Encoding method and apparatus therefor, and decoding method and apparatus therefor

By optimizing the video coding method and utilizing the decoding status of adjacent blocks and predicted motion vector information, the motion vector resolution of the current block is determined, thus solving the problem of data rate limitation in video coding and improving coding efficiency and image quality.

CN119031131APending Publication Date: 2024-11-26SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411414457.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2017-09-28
Filing Date
2018-09-28
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

Existing video coding technologies face the problem of limited data rates when transmitting high-quality video, making it difficult to find a balance between compression ratio and image quality.

Method used

By determining the motion vector resolution of the current block, and utilizing the decoding status of adjacent blocks and predicted motion vector information, the video encoding and decoding process can be optimized, reducing redundancy in encoded information.

Benefits of technology

It improves the compression ratio of motion vector resolution, optimizes encoding efficiency, reduces data transmission requirements, and maintains image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031131A_ABST
    Figure CN119031131A_ABST
Patent Text Reader

Abstract

Disclosed are an encoding method and an apparatus therefor, and a decoding method and an apparatus therefor. Provided is a video decoding method comprising the steps of: acquiring, from a bitstream, predicted motion vector information indicating a predicted motion vector of a current block and differential motion vector information indicating a differential motion vector of the current block; determining a predicted motion vector of the current block according to whether a block adjacent to the current block has been decoded and the predicted motion vector information; determining a motion vector resolution of the current block according to whether the block adjacent to the current block has been decoded; determining a differential motion vector of the current block according to the differential motion vector information; determining a motion vector of the current block according to the predicted motion vector, the motion vector resolution and the differential motion vector; and reconstructing the current block according to the motion vector of the current block, in which the block adjacent to the current block includes a block on the right side of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a patent application with an application date of September 28, 2018, application number 201880063025.2, and invention name “Encoding method and device thereof, decoding method and device thereof”. Technical Field

[0002] The present disclosure relates to a video encoding method and a video decoding method, and more particularly, to an encoding / decoding method and apparatus for optimizing encoding / decoding efficiency by determining an encoding / decoding order of images. Background Art

[0003] Videos with high image quality require a large amount of data for encoding. However, the bandwidth allowed for transmitting video data is limited, so the data rate applied when transmitting video data may be limited. Therefore, in order to effectively transmit video data, a method for encoding and decoding video data is needed, thereby minimizing the degradation of image quality while improving the compression rate.

[0004] Video data can be compressed by removing spatial and temporal redundancy between pixels. Pixels adjacent to each other generally have common characteristics, and therefore, in order to remove redundancy between adjacent pixels, encoding information is transmitted in data units including pixels.

[0005] Instead of directly transmitting the pixel value of the pixel included in the data unit, the method required to obtain the pixel value is transmitted. A prediction method for predicting a pixel value similar to the original value is determined for each data unit, and encoding information for the prediction method is transmitted from the encoder to the decoder. In addition, because the predicted value is not exactly the same as the original value, residual data about the difference between the original value and the predicted value is transmitted from the encoder to the decoder.

[0006] As prediction becomes more accurate, the coding information required to specify the prediction method increases, but the size of the residual data decreases. Therefore, the prediction method is determined by considering the size of the coding information and the residual data. In particular, the data units divided from the picture have various sizes, and as the size of the data unit increases, the accuracy of the prediction is likely to decrease, but the coding information decreases. Therefore, the block size is determined corresponding to the characteristics of the picture.

[0007] In addition, prediction methods are divided into intra prediction and inter prediction. Intra prediction is a method of predicting pixels of a block from peripheral pixels of the block. Inter prediction is a method of predicting pixels by referring to pixels of another picture referenced by a picture including the block. Therefore, intra prediction removes spatial redundancy and inter prediction removes temporal redundancy.

[0008] As the number of prediction methods increases, the amount of encoding information indicating the prediction method increases. Therefore, the encoding information can be reduced by predicting the encoding information applied to a block from another block.

[0009] Video data loss is allowed within a limit that does not allow human vision to perceive, and therefore the amount of residual data can be reduced by performing lossy compression on the residual data in the transform and quantization processes. Summary of the invention

[0010] Technical issues

[0011] A video encoding method for determining a motion vector resolution of a current block according to an encoding order of the current block, whether an adjacent block is decoded, etc. is provided. In addition, a video decoding method for determining a motion vector resolution of a current block according to an encoding order of the current block, whether an adjacent block is decoded, etc. is provided. In addition, according to an embodiment of the present disclosure, a computer-readable recording medium is provided, wherein a program for executing the video encoding method and the video decoding method in a computer is recorded on the computer-readable recording medium.

[0012] Technical Solution

[0013] A video decoding method is provided, the video decoding method comprising: obtaining predicted motion vector information indicating a predicted motion vector of a current block and differential motion vector information indicating a differential motion vector of the current block from a bit stream; determining a predicted motion vector of the current block according to whether adjacent blocks of the current block are decoded and the predicted motion vector information; determining a motion vector resolution of the current block according to whether the adjacent blocks of the current block are decoded; determining the differential motion vector of the current block according to the differential motion vector information; determining a motion vector of the current block according to the predicted motion vector, the motion vector resolution and the differential motion vector; and reconstructing the current block according to the motion vector of the current block, wherein the adjacent blocks of the current block include right blocks of the current block.

[0014] A video decoding device is provided, comprising: a processor configured to: obtain predicted motion vector information indicating a predicted motion vector of a current block and differential motion vector information indicating a differential motion vector of the current block from a bit stream; determine the predicted motion vector of the current block according to whether adjacent blocks of the current block are decoded and the predicted motion vector information; determine the motion vector resolution of the current block according to whether the adjacent blocks of the current block are decoded; determine the differential motion vector of the current block according to the differential motion vector information; determine the motion vector of the current block according to the predicted motion vector, the motion vector resolution and the differential motion vector; and reconstruct the current block according to the motion vector of the current block, wherein the adjacent blocks of the current block include right blocks of the current block.

[0015] A video encoding method is provided, the video encoding method comprising: determining a motion vector of a current block; determining a predicted motion vector of the current block from neighboring blocks of the current block; determining a motion vector resolution of the current block according to whether the neighboring blocks of the current block are encoded; determining a differential motion vector of the current block according to a difference between the motion vector of the current block and the predicted motion vector of the current block and the motion vector resolution of the current block; and outputting a bit stream including predicted motion vector information indicating the predicted motion vector of the current block and differential motion vector information indicating the differential motion vector of the current block, wherein the neighboring blocks of the current block include right blocks of the current block.

[0016] A video encoding device is provided, comprising: a processor configured to: determine a motion vector of a current block; determine a predicted motion vector of the current block from neighboring blocks of the current block; determine a motion vector resolution of the current block according to whether the neighboring blocks of the current block are encoded; determine a differential motion vector of the current block according to a difference between the motion vector of the current block and the predicted motion vector of the current block and the motion vector resolution of the current block; and output a bit stream including predicted motion vector information indicating the predicted motion vector of the current block and differential motion vector information indicating the differential motion vector of the current block, wherein the neighboring blocks of the current block include right blocks of the current block.

[0017] A non-transitory recording medium is provided on which a program for executing a video encoding method and a video decoding method in a computer is recorded.

[0018] The technical objectives of the present embodiment are not limited to the above-mentioned technical objectives, and other technical objectives can be derived from the embodiments described below.

[0019] Beneficial Effects

[0020] The compression rate of information about the motion vector resolution of the current block may be improved by determining the motion vector resolution of the current block according to whether blocks adjacent to the current block are decoded. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 is a schematic block diagram of an image decoding apparatus according to an embodiment.

[0022] Figure 2 is a flowchart of an image decoding method according to an embodiment.

[0023] Figure 3 A process of determining at least one coding unit by splitting a current coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0024] Figure 4A process of determining at least one coding unit by splitting a non-square coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0025] Figure 5 A process of splitting a coding unit based on at least one of block shape information and division shape pattern information, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0026] Figure 6 A method of determining a predetermined coding unit from among odd-numbered coding units, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0027] Figure 7 An order in which a plurality of coding units are processed when an image decoding apparatus determines a plurality of coding units by splitting a current coding unit according to an embodiment is illustrated.

[0028] Figure 8 A process of determining that a current coding unit is to be split into an odd number of coding units when coding units cannot be processed in a predetermined order, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0029] Fig. 9 A process of determining at least one coding unit by splitting a first coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0030] Fig.10 It is shown that according to an embodiment, when a second coding unit having a non-square shape determined by an image decoding apparatus by splitting a first coding unit satisfies a predetermined condition, shapes into which the second coding unit may be split are limited.

[0031] Fig.11 A process of splitting a square coding unit when division shape pattern information indicates that the square coding unit is not to be split into four square coding units, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0032] Fig.12 It is shown that a processing order among a plurality of coding units may be changed according to a process of dividing the coding units according to an embodiment.

[0033] Fig.13 A process of determining a depth of a coding unit as a shape and a size of a coding unit change when a coding unit is recursively split to determine a plurality of coding units according to an embodiment is illustrated.

[0034] Fig.14 Depth that may be determined based on a shape and a size of a coding unit, and a partial index (PID) for distinguishing coding units, according to an exemplary embodiment, are illustrated.

[0035] Fig.15It is illustrated that a plurality of coding units are determined based on a plurality of predetermined data units included in a picture according to an embodiment.

[0036] Fig.16 A processing block serving as a unit for determining an order of reference coding units included in a picture according to an embodiment is illustrated.

[0037] Fig.17 A video decoding apparatus for splitting a current block and determining an encoding order of deeper split blocks according to an embodiment is illustrated.

[0038] Figures 18a to 18c A basic encoding sequence according to an embodiment is shown.

[0039] Fig.19a and Fig.19b The case where the coding unit is encoded in the forward direction and the case where the coding unit is encoded in the reverse direction are respectively shown.

[0040] Fig. 20 A coding tree unit and a tree structure of the coding tree unit for describing an encoding order of coding units included in the coding tree unit are shown.

[0041] Fig.21a and Figure 21b Describes how to change the encoding order of three or more blocks arranged in the vertical direction or the horizontal direction according to the encoding order flag.

[0042] Fig. 22 Shows the motion vector resolution in adaptive motion vector resolution (AMVR) mode.

[0043] Fig.23 A method of determining a motion vector resolution of a current block according to positions of blocks adjacent to the current block referenced by the current block is shown.

[0044] Fig.24 A method of determining motion vector resolution according to the encoding order is shown.

[0045] Fig.25 A method of determining a motion vector resolution according to a method of dividing blocks is described.

[0046] Fig.26 A video decoding method for splitting a current block and decoding a deeper split block according to an embodiment is illustrated.

[0047] Fig. 27 A video encoding apparatus for splitting a current block and encoding a deeper split block according to an embodiment is illustrated.

[0048] Fig.28A video encoding method for splitting a current block and encoding a deeper split block according to an embodiment is illustrated.

[0049] Best Practices

[0050] A video decoding method is provided, the video decoding method comprising: obtaining predicted motion vector information indicating a predicted motion vector of a current block and differential motion vector information indicating a differential motion vector of the current block from a bit stream; determining a predicted motion vector of the current block according to whether an adjacent block of the current block is decoded and the predicted motion vector information; determining a motion vector resolution of the current block according to whether the adjacent block of the current block is decoded; determining the differential motion vector of the current block according to the differential motion vector information; determining a motion vector of the current block according to the predicted motion vector, the motion vector resolution and the differential motion vector; and reconstructing the current block according to the motion vector of the current block, wherein the adjacent blocks of the current block include right blocks of the current block. DETAILED DESCRIPTION

[0051] The advantages and features of the present disclosure and the methods for achieving the advantages and features will become more apparent by referring to the embodiments described below with reference to the accompanying drawings. However, the present disclosure can be implemented in many different forms and should not be construed as being limited to the embodiments set forth herein; rather, these embodiments are provided so that the present disclosure will be thorough and complete and will fully convey the concepts of the present disclosure to those of ordinary skill in the art.

[0052] Terms used in the specification will be briefly described, and the present disclosure will be described in detail.

[0053] Considering the functions of the terms used in the present disclosure in the present disclosure, the terms used in the present disclosure are selected as common terms widely used today as much as possible. However, the terms can be changed according to the intention of those skilled in the relevant art, precedents or the emergence of new technologies. In addition, some of the terms used in this article can be selected arbitrarily by the applicant. In this case, these terms are defined in detail in the detailed description below. Therefore, the terms used in this article should be understood based on their unique meaning and the entire context of the present disclosure.

[0054] As used herein, singular forms are intended to include plural forms as well, unless the context clearly indicates otherwise.

[0055] Throughout the specification, it will be further understood that when a component “includes” or “comprises” an element, unless otherwise defined, the component may further include other elements without excluding the other elements.

[0056] In addition, the term "unit" used in the specification may represent software or hardware components (such as FPGA or ASIC), and may perform specific functions. However, "unit" is not limited to software or hardware. "Unit" may be configured to be included in a storage medium that can perform addressing, or may be configured to reproduce one or more processors. Therefore, for example, "unit" may include software components, object-oriented software components, class components and task components, processors, functions, attributes, programs, subroutines, program code fragments, drivers, firmware, microcodes, circuits, data, databases, data structures, tables, arrays and variables. The functions provided by components and "units" may be integrated into a smaller number of components and "units", or may also be separated into other components and "units".

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

[0058] The term "memory" should be interpreted broadly to include electronic components capable of storing electronic information. The term "memory" may refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), 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, registers, etc. When a processor is able to read information from or record information in a memory, the memory is said to be in electronic communication with the processor. Memory that is integrated into a processor is in electronic communication with the processor.

[0059] Hereinafter, “image” may indicate a static image such as a still image of a video, or a dynamic image (ie, an animated moving image) such as a video.

[0060] Hereinafter, a "sample" is data assigned to an image sampling position and may represent data to be processed. For example, a pixel value in an image in a spatial domain and a transform coefficient on a transform domain may be a sample. A unit including at least one sample among a plurality of samples may be defined as a block.

[0061] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily perform the embodiments. In addition, parts irrelevant to the specification will be omitted to clearly describe the present disclosure.

[0062] In the following, by reference Figures 1 to 16 , an image encoding device, an image decoding device, an image encoding method, and an image decoding method will be described in detail according to the embodiments. Figures 3 to 16 , a method for determining a data unit of an image is described according to an embodiment.

[0063] In the following, by reference Figure 1 and Figure 2 According to an embodiment of the present disclosure, a method and apparatus for adaptively selecting a context model based on coding units having various shapes are described in detail.

[0064] Figure 1 is a schematic block diagram of an image decoding apparatus 100 according to an embodiment.

[0065] The image decoding apparatus 100 may include a receiver 110 and a decoder 120. The receiver 110 and the decoder 120 may include at least one processor. In addition, the receiver 110 and the decoder 120 may include a memory storing instructions to be executed by at least one processor.

[0066] The receiver 110 may receive a bitstream. The bitstream includes information indicating that the image encoding device 2700 described below encodes the image. In addition, the bitstream may be sent from the image encoding device 2700. The image encoding device 2700 and the image decoding device 100 may be connected to each other in a wired or wireless manner, and the receiver 110 may receive the bitstream in a wired or wireless manner. The receiver 110 may receive the bitstream from a storage medium such as an optical medium, a hard disk, etc. The decoder 120 may reconstruct the image based on the information obtained from the received bitstream. The decoder 120 may obtain syntax elements for reconstructing the image from the bitstream. The decoder 120 may reconstruct the image based on the syntax elements.

[0067] Reference Figure 2 The operation of the image decoding apparatus 100 is described in more detail.

[0068] Figure 2 is a flowchart of an image decoding method according to an embodiment.

[0069] According to an embodiment of the present disclosure, the receiver 110 may receive a bit stream.

[0070] The image decoding apparatus 100 may perform an operation 210 of obtaining a binary bit string corresponding to a division shape pattern of a coding unit from a bitstream. The image decoding apparatus 100 may perform an operation 220 of determining a division rule of a coding unit. In addition, the image decoding apparatus 100 may perform an operation 230 of dividing a coding unit into a plurality of coding units based on at least one of a binary bit string corresponding to the division shape pattern and a division rule. In order to determine the division rule, the image decoding apparatus 100 may determine a first allowable range of a size of the coding unit according to an aspect ratio of the coding unit. In order to determine the division rule, the image decoding apparatus 100 may determine a second allowable range of a size of the coding unit according to a division shape pattern of the coding unit.

[0071] Hereinafter, division of coding units according to an embodiment of the present disclosure is described in detail.

[0072] First, a picture may be divided into one or more slices. A slice may be a sequence of at least one coding tree unit (CTU). Compared with CTU, there is a concept of coding tree block (CTB).

[0073] A CTB represents an N×N block (N is an integer) including N×N samples. Each color element may be divided into one or more CTBs.

[0074] When a picture has three sample arrays (Y, Cr, and Cb component sample arrays), CTU is a unit including one CTB of luma samples, two CTBs of chroma samples, two CTBs corresponding to the CTB of luma samples, and a syntax structure for encoding luma samples and chroma samples. When the picture is a monochrome picture, CTU is a unit including CTBs of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture encoded in a color plane separated into each color component, CTU is a unit including a syntax structure for encoding the corresponding picture and samples of the picture.

[0075] One CTB may be divided into M×N coding blocks (M and N are integers) including M×N samples.

[0076] When a picture has arrays of Y, Cr, and Cb component samples, a coding unit is a unit including one coding block of luma samples, two coding blocks of chroma samples, two coding blocks corresponding to the coding block of luma samples, and a syntax structure for encoding luma samples and chroma samples. When a picture is a monochrome picture, a coding unit is a unit including a coding block of monochrome samples and a syntax structure for encoding monochrome samples. When a picture is a picture encoded in a color plane separated into color components, a coding unit is a unit including a syntax structure for encoding the corresponding picture and samples of the picture.

[0077] As described above, CTB and CTU are different concepts from each other, and coding blocks and coding units are different concepts from each other. That is, a coding unit (CTU) represents a data structure including a coding block (CTB), which includes corresponding samples and a syntax structure corresponding thereto. However, it can be understood by a person skilled in the art that a coding unit (CTU) or a coding block (CTB) refers to a block having a predetermined size and including a predetermined number of samples, and therefore, in this specification, unless there is a special reason, CTB and CTU or coding blocks and coding units are mentioned without distinction.

[0078] The image may be divided into CTUs. The size of the CTU may be determined based on information obtained from the bitstream. The shape of the CTU may be a square of the same size. However, it is not limited thereto.

[0079] For example, information about the maximum size of the luma coding block may be obtained from the bitstream. For example, the maximum size of the luma coding block indicated by the information about the maximum size of the luma coding block may be one of 4×4, 8×8, 16×16, 32×32, 64×64, 128×128, and 256×256.

[0080] For example, information about the maximum size of a luma coding block that can be divided into two and information about the luma block size difference can be obtained from the bitstream. The information about the luma block size difference may indicate the size difference between a luma CTU that can be divided into two and a luma CTB. Therefore, when the information about the maximum size of a luma coding block that can be divided into two is combined with the information about the luma block size difference, the size of the luma CTU can be determined, wherein the information about the maximum size of a luma coding block that can be divided into two and the information about the luma block size difference are obtained from the bitstream. The size of the chroma CTU can also be determined by using the size of the luma CTU. For example, when the ratio of Y:Cb:Cr according to the color format is 4:2:0, the size of the chroma block can be half the size of the luma block, and similarly, the size of the chroma CTU can be half the size of the luma CTU.

[0081] According to an embodiment, since information about the maximum size of a brightness coding block that can be divided into two is obtained from a bitstream, the maximum size of a brightness coding block that can be divided into two may be determined differently. Different from this, the maximum size of a brightness coding block that can be divided into three may be fixed. For example, the maximum size of a brightness coding block that can be divided into three in slice I may be 32×32, and the maximum size of a brightness coding block that can be divided into three in slice P or B may be 64×64.

[0082] In addition, the CTU may be hierarchically divided into coding units based on the division shape pattern information obtained from the bitstream. At least one of information indicating whether to perform four divisions, information indicating whether to perform multiple divisions, division direction information, and division type information may be obtained from the bitstream as the division shape pattern information.

[0083] For example, the information indicating whether to perform four-split may indicate whether to perform four-split on the current coding unit (QUAD_SPLIT).

[0084] When the current coding unit is not divided into four parts, the information indicating whether to perform multi-split may indicate whether the current coding unit is no longer split (NO_SPLIT) or is divided into two parts / three parts.

[0085] When the current coding unit is two-partitioned or three-partitioned, the split direction information indicates that the current coding unit will be split in one of a horizontal direction and a vertical direction.

[0086] When the current coding unit is split in the horizontal direction or the vertical direction, the split type information indicates whether the current coding unit will be split into two or three.

[0087] According to the split direction information and the split type information, the split mode of the current coding unit may be determined. The split mode when the current coding unit is split into two in the horizontal direction may be determined as horizontal two-split (SPLIT_BT_HOR), the split mode when the current coding unit is split into three in the horizontal direction may be determined as horizontal three-split (SPLIT_TT_HOR), the split mode when the current coding unit is split into two in the vertical direction may be determined as vertical two-split (SPLIT_BT_VER), and the split mode when the current coding unit is split into three in the vertical direction may be determined as vertical three-split (SPLIT_TT_VER).

[0088] The image decoding device 100 may obtain the division shape pattern information from a binary bit string. The shape of the bit stream received by the image decoding device 100 may include a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The binary bit string is information indicated as a binary digital bit string. The binary bit string may include at least one bit. The image decoding device 100 may obtain the division shape pattern information corresponding to the binary bit string based on the division rule. The image decoding device 100 may determine whether to divide the coding unit into four, whether to divide the coding unit, or the division direction and division type based on a binary bit string.

[0089] A coding unit may be smaller than or equal to a CTU. For example, a CTU is a coding unit having a maximum size, and therefore, a CTU is also a coding unit. When the division shape mode information about a CTU indicates that division is not performed, a coding unit determined from a CTU has the same size as the CTU. When the division shape mode information about a CTU indicates that division is performed, the CTU may be divided into coding units. In addition, when the division shape mode information about a coding unit indicates that division is performed, the coding unit may be divided into coding units of a smaller size. However, division of an image is not limited thereto, and a CTU and a coding unit may not be separated from each other. Reference Figures 3 to 16 The division of coding units is described in more detail.

[0090] In addition, one or more prediction blocks for prediction may be determined from the coding unit. The prediction block may be the same as or smaller than the coding unit. In addition, one or more transform blocks for transformation may be determined from the coding unit. The transform block may be the same as or smaller than the coding unit.

[0091] The shapes and sizes of the transform block and the prediction block may be unrelated to each other.

[0092] According to another embodiment, prediction may be performed by using a coding unit as a prediction block. In addition, transformation may be performed by using a coding unit as a transformation block.

[0093] Reference Figures 3 to 16 The division of the coding unit is described in more detail. The current block and the peripheral block of the present disclosure may indicate one of a CTU, a coding unit, a prediction block, and a transform block. In addition, the current block or the current coding unit is a block currently being decoded or encoded or a block currently being divided. The peripheral block may be a block reconstructed before the current block. The peripheral block may be adjacent to the current block in space or time. The peripheral block may be located in one of the lower left, left, upper left, upper, upper right, right, and lower right of the current block.

[0094] Figure 3 A process of determining at least one coding unit by splitting a current coding unit, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.

[0095] The block shape may include 4N×4N, 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N. Here, N may be a positive integer. The block shape information may be information indicating at least one of a shape, a direction, an aspect ratio, or a size of a coding unit.

[0096] The shape of the coding unit may include a square and a non-square. When the width and height of the coding unit are the same as each other (ie, when the block shape of the coding unit is 4N×4N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a square. The image decoding apparatus 100 may determine the shape of the coding unit as a non-square.

[0097] When the width and height of the coding unit are different from each other (that is, the block shape of the coding unit is 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a non-square. When the shape of the coding unit is a non-square, the image decoding apparatus 100 may determine the aspect ratio in the block shape information of the coding unit as 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. In addition, the image decoding apparatus 100 may determine whether the coding unit is in a horizontal direction or a vertical direction based on the width and height of the coding unit. In addition, the image decoding apparatus 100 may determine the size of the coding unit based on at least one of the width, height, or area of ​​the coding unit.

[0098] According to an embodiment, the image decoding apparatus 100 may determine the shape of the coding unit by using the block shape information, and may determine the division method of the coding unit by using the division shape pattern information. That is, the coding unit division method indicated by the division shape pattern information may be determined based on the block shape indicated by the block shape information used by the image decoding apparatus 100.

[0099] The image decoding device 100 may obtain the division shape pattern information from the bitstream. However, it is not limited thereto, and the image decoding device 100 and the image encoding device 2800 may determine the predetermined division shape pattern information based on the block shape information. The image decoding device 100 may determine the predetermined division shape pattern information for the CTU or the minimum coding unit. For example, the image decoding device 100 may determine the division shape pattern information for the CTU as four divisions. In addition, the image decoding device 100 may determine the division shape pattern information for the minimum coding unit as "no division". In detail, the image decoding device 100 may determine the size of the CTU to be 256×256. The image decoding device may determine the predetermined division shape pattern information to be four divisions. Four divisions are division shape patterns for dividing both the width and height of the coding unit into two. The image decoding device 100 may obtain a coding unit of 128×128 size from a CTU of 256×256 size based on the division shape pattern information. In addition, the image decoding device 100 may determine the size of the minimum coding unit to be 4×4. The image decoding apparatus 100 may obtain division shape pattern information indicating “no division” for a minimum coding unit.

[0100] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a square shape. For example, the image decoding apparatus 100 may determine whether to divide a square coding unit, whether to divide a square coding unit vertically, whether to divide a square coding unit horizontally, or whether to divide a square coding unit into four coding units based on the division shape mode information. Figure 3 When the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may determine that the coding unit 310a having the same size as the current coding unit 300 is not divided based on the division shape pattern information indicating that division is not performed, or may determine the coding unit 310b, 310c, 310d, 310e or 310f divided based on the division shape pattern information indicating a predetermined division method.

[0101] Reference Figure 3 According to an embodiment, the image decoding apparatus 100 may determine two coding units 310b obtained by dividing the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that division is performed in the vertical direction. The image decoding apparatus 100 may determine two coding units 310c obtained by dividing the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that division is performed in the horizontal direction. The image decoding apparatus 100 may determine four coding units 310d obtained by dividing the current coding unit 300 in the vertical and horizontal directions based on the division shape pattern information indicating that division is performed in the vertical and horizontal directions. According to an embodiment, the image decoding apparatus 100 may determine three coding units 310e obtained by dividing the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that three divisions are performed in the vertical direction. The image decoding apparatus 100 may determine three coding units 310f obtained by dividing the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that three divisions are performed in the horizontal direction. However, the division method of the square coding unit is not limited to the above method, and the division shape pattern information may indicate various methods. A predetermined division method for dividing the square coding unit will be described in detail below with respect to various embodiments.

[0102] Figure 4 A process of determining at least one coding unit by splitting a non-square coding unit, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.

[0103] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a non-square shape. The image decoding apparatus 100 may determine whether to split the non-square current coding unit or whether to split the non-square current coding unit by using a predetermined splitting method based on the splitting shape mode information. Figure 4 , when the block shape information of the current coding unit 400 or 450 indicates a non-square shape, the image decoding apparatus 100 may determine that the coding unit 410 or 460 having the same size as the current coding unit 400 or 450 is not to be split, or determine the coding units 420a and 420b, the coding units 430a to 430c, the coding units 470a and 470b, or the coding units 480a to 480c divided based on the division shape pattern information indicating the predetermined division method. The predetermined division method for dividing the non-square coding unit will be described in detail with respect to various embodiments below.

[0104] According to an embodiment, the image decoding apparatus 100 may determine a splitting method of a coding unit by using splitting shape pattern information, and in this case, the splitting shape pattern information may indicate the number of one or more coding units generated by splitting the coding unit. Figure 4 When the division shape pattern information indicates that the current coding unit 400 or 450 is divided into two coding units, the image decoding device 100 can determine the two coding units 420a and 420b, or the coding units 470a and 470b included in the current coding unit 400 or 450 by dividing the current coding unit 400 or 450 based on the division shape pattern information.

[0105] According to an embodiment, when the image decoding apparatus 100 divides the non-square current coding unit 400 or 450 based on the division shape pattern information, the position of the long side of the non-square current coding unit 400 or 450 may be considered. For example, the image decoding apparatus 100 may determine a plurality of coding units by dividing the long side of the current coding unit 400 or 450, considering the shape of the current coding unit 400 or 450.

[0106] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided (three-divided) into an odd number of blocks, the image decoding apparatus 100 may determine the odd number of coding units included in the current coding unit 400 or 450. For example, when the division shape pattern information indicates that the current coding unit 400 or 450 is divided into three coding units, the image decoding apparatus 100 may divide the current coding unit 400 or 450 into three coding units 430a, 430b, and 430c or coding units 480a, 480b, and 480c.

[0107] According to an embodiment, the aspect ratio of the current coding unit 400 or 450 may be 4:1 or 1:4. When the aspect ratio is 4:1, the width is greater than the height, and therefore, the block shape information may be in a horizontal direction. When the aspect ratio is 1:4, the width is less than the height, and therefore, the block shape information may be in a vertical direction. The image decoding apparatus 100 may determine that the current coding unit is divided into an odd number of blocks based on the division shape mode information. In addition, the image decoding apparatus 100 may determine the division direction of the current coding unit 400 or 450 based on the block shape information of the current coding unit 400 or 450. For example, when the current coding unit 400 is in a vertical direction, the image decoding apparatus 100 may determine the coding units 430a, 430b, and 430c by dividing the current coding unit 400 in a horizontal direction. In addition, when the current coding unit 450 is in a horizontal direction, the image decoding apparatus 100 may determine the coding units 480a, 480b, and 480c by dividing the current coding unit 450 in a vertical direction.

[0108] According to an embodiment, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and not all determined coding units may have the same size. For example, a predetermined coding unit 430b or a predetermined coding unit 480b among the determined odd number of coding units 430a, 430b, and 430c or coding units 480a, 480b, and 480c may have a size different from that of other coding units 430a and 430c or other coding units 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, all coding units among the odd number of coding units 430a, 430b, and 430c or coding units 480a, 480b, and 480c may have different sizes.

[0109] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of blocks, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and may apply a predetermined restriction to at least one of the odd number of coding units generated by dividing the current coding unit 400 or 450. Figure 4, the image decoding apparatus 100 may allow a decoding method of a coding unit 430b or a coding unit 480b to be different from a decoding method of other coding units 430a and 430c or other coding units 480a and 480c, wherein the coding unit 430b or the coding unit 480b is located at a center position among the three coding units 430a, 430b, and 430c or the coding units 480a, 480b, and 480c generated by dividing the current coding unit 400 or 450. For example, unlike the other coding units 430a and 430c or the other coding units 480a and 480c, the image decoding apparatus 100 may limit the coding unit 430b or the coding unit 480b at the center position to not be divided any more or to be divided only a predetermined number of times.

[0110] Figure 5 A process of splitting a coding unit based on at least one of block shape information and division shape pattern information, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.

[0111] According to an embodiment, the image decoding apparatus 100 may determine whether to divide the square first coding unit 500 into coding units or not to divide the square first coding unit 500 based on at least one of the block shape information and the division shape mode information. According to an embodiment, when the division shape mode information indicates that the first coding unit 500 is divided in the horizontal direction, the image decoding apparatus 100 may determine the second coding unit 510 by dividing the first coding unit 500 in the horizontal direction. The first coding unit, the second coding unit, and the third coding unit used according to the embodiment are terms for understanding the relationship before and after dividing the coding unit. For example, the second coding unit may be determined by dividing the first coding unit, and the third coding unit may be determined by dividing the second coding unit. It will be understood that the structures of the first coding unit, the second coding unit, and the third coding unit follow the above description.

[0112] According to an embodiment, the image decoding apparatus 100 may determine whether to split the determined second coding unit 510 into coding units or not to split the determined second coding unit 510 based on the division shape pattern information. Figure 5, the image decoding apparatus 100 may split the non-square second coding unit 510 determined by splitting the first coding unit 500 into one or more third coding units 520a or third coding units 520b, 520c, and 520d based on the split shape pattern information, or may not split the non-square second coding unit 510. The image decoding apparatus may obtain the split shape pattern information, and determine a plurality of second coding units (e.g., 510) of various shapes by splitting the first coding unit 500 based on the obtained split shape pattern information, and may split the second coding unit 510 by using the split method of the first coding unit 500 based on the split shape pattern information. According to an embodiment, when the first coding unit 500 is split into the second coding unit 510 based on the split shape pattern information of the first coding unit 500, the second coding unit 510 may also be split into the third coding unit 520a or third coding units 520b, 520c, and 520d based on the split shape pattern information of the second coding unit 510. That is, the coding unit may be recursively split based on the split shape pattern information of each coding unit. Thus, a square coding unit may be determined by splitting a non-square coding unit, and a non-square coding unit may be determined by recursively splitting a square coding unit.

[0113] Reference Figure 5 , a predetermined coding unit (e.g., a coding unit at a center position or a square coding unit) among the odd number of third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510 may be recursively divided. According to an embodiment, a square third coding unit 520b among the odd number of third coding units 520b, 520c, and 520d may be divided into a plurality of fourth coding units in the horizontal direction. A non-square fourth coding unit 530b or 530d among a plurality of fourth coding units 530a, 530b, 530c, and 530d may be divided into a plurality of coding units. For example, a non-square fourth coding unit 530b or 530d may be divided into an odd number of coding units. A method for recursively dividing coding units will be described below with respect to various embodiments.

[0114] According to an embodiment, the image decoding apparatus 100 may determine whether to divide the third coding unit 520a or each of the third coding units 520b, 520c, and 520d into coding units, or not to divide the second coding unit 510 based on the division shape pattern information. In addition, the image decoding apparatus 100 may determine not to divide the second coding unit 510 based on the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The image decoding apparatus 100 may impose a predetermined restriction on a predetermined third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding apparatus 100 may limit the third coding unit 520c located at the center position among the odd number of third coding units 520b, 520c, and 520d to no longer be divided or to be divided a settable number of times.

[0115] Reference Figure 5 , the image decoding device 100 may limit the third coding unit 520c at the center position among the odd third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to no longer be divided, to be divided by using a predetermined division method (for example, only divided into four coding units or divided by using the division method of the second coding unit 510), or to be divided only a predetermined number of times (for example, only divided n times (where n>0)). However, the limitation on the third coding unit 520c at the center position is not limited to the above example, and may include various limitations on decoding the third coding unit 520c at the center position differently from the other third coding units 520b and 520d.

[0116] According to an embodiment, the image decoding apparatus 100 may obtain split shape pattern information for splitting the current coding unit from a predetermined position in the current coding unit.

[0117] Figure 6 A method of determining a predetermined coding unit from among odd-numbered coding units, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.

[0118] Reference Figure 6 , the division shape mode information of the current coding unit 600 or 650 may be obtained from a sample at a predetermined position (e.g., a sample 640 or 690 at a center position) among a plurality of samples included in the current coding unit 600 or 650. However, the predetermined position in the current coding unit 600 where at least one piece of division shape mode information may be obtained is not limited to Figure 6, and may include various positions (e.g., top, bottom, left, right, top left, bottom left, top right, and bottom right positions) included in the current coding unit 600. The image decoding apparatus 100 may obtain the division shape pattern information from the predetermined position, and determine whether to divide the current coding unit into coding units of various shapes and sizes or not to divide the current coding unit.

[0119] According to an embodiment, when the current coding unit is divided into a predetermined number of coding units, the image decoding apparatus 100 may select one of the coding units. As will be described below with respect to various embodiments, various methods may be used to select one of the plurality of coding units.

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

[0121] According to an embodiment, the image decoding apparatus 100 may use information indicating the positions of odd-numbered coding units to determine a coding unit at a center position among the odd-numbered coding units. Figure 6 , the image decoding apparatus 100 may determine the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c by dividing the current coding unit 600 or 650. The image decoding apparatus 100 may determine the coding unit 620b at the center position or the coding unit 660b at the center position by using information about the positions of the odd number of coding units 620a to 620c or the odd number of coding units 660a to 660c. For example, the image decoding apparatus 100 may determine the coding unit 620b at the center position by determining 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. In detail, the image decoding apparatus 100 may determine the coding unit 620b at the center position by determining 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.

[0122] According to an embodiment, the information indicating the positions of the upper left sample points 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture. According to an embodiment, the information indicating the positions of the upper left sample points 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information indicating the width or height of the coding units 620a, 620b, and 620c included in the current coding unit 600, and the width or height may correspond to the information indicating the difference between the coordinates of the coding units 620a, 620b, and 620c in the picture. That is, the image decoding apparatus 100 may determine the coding unit 620b at the center position by directly using the information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture, or by using the information about the width or height of the coding unit corresponding to the difference between the coordinates.

[0123] According to an embodiment, information indicating the position of the upper left sample point 630a of the upper coding unit 620a may include coordinates (xa, ya), information indicating the position of the upper left sample point 630b of the middle coding unit 620b may include coordinates (xb, yb), and information indicating the position of the upper left sample point 630c of the lower coding unit 620c may include coordinates (xc, yc). The image decoding apparatus 100 may determine the middle coding unit 620b by using the coordinates of the upper left sample points 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c. For example, when the coordinates of the upper left sample points 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b including the coordinates (xb, yb) of the sample point 630b at the center position may be determined as the coding unit at the center position among the coding units 620a, 620b, and 620 determined by dividing the current coding unit 600. However, the coordinates indicating the positions of the upper left sample points 630a, 630b, and 630c may include coordinates indicating absolute positions in the picture, or coordinates (dxb, dyb) indicating the relative position of the upper left sample point 630b of the middle coding unit 620b relative to the position of the upper left sample point 630a of the upper coding unit 620a and coordinates (dxc, dyc) indicating the relative position of the upper left sample point 630c of the lower coding unit 620c relative to the position of the upper left sample point 630a of the upper coding unit 620a may be used. The method of determining the coding unit at a predetermined position by using the coordinates of the sample points included in the coding unit as information indicating the positions of the sample points is not limited to the above method, and may include various arithmetic methods capable of using the coordinates of the sample points.

[0124] According to an embodiment, the image decoding apparatus 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c, and may select one of the coding units 620a, 620b, and 620c based on a predetermined criterion. For example, the image decoding apparatus 100 may select a coding unit 620b having a size different from that of other coding units from among the coding units 620a, 620b, and 620c.

[0125] According to an embodiment, the image decoding apparatus 100 may determine the width or height of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya) indicating the position of the upper left sample point 630a of the upper coding unit 620a, the coordinates (xb, yb) indicating the position of the upper left sample point 630b of the middle coding unit 620b, and the coordinates (xc, yc) indicating the position of the upper left sample point 630c of the lower coding unit 620c. The image decoding apparatus 100 may determine the respective sizes of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 620a, 620b, and 620c. According to an embodiment, the image decoding apparatus 100 may determine the width of the upper coding unit 620a as the width of the current coding unit 600. The image decoding apparatus 100 may determine the height of the upper coding unit 620a as yb-ya. According to an embodiment, the image decoding apparatus 100 may determine the width of the intermediate coding unit 620b as the width of the current coding unit 600. According to an embodiment, the image decoding apparatus 100 may determine the height of the intermediate coding unit 620b as yc-yb. According to an embodiment, the image decoding apparatus 100 may determine the width or height of the lower coding unit by using the width or height of the current coding unit 600 or the width or height of the upper coding unit 620a and the intermediate coding unit 620b. The image decoding apparatus 100 may determine a coding unit having a size different from that of other coding units based on the determined width and height of the coding units 620a to 620c. Referring to Figure 6 , the image decoding apparatus 100 may determine the middle coding unit 620b having a size different from the sizes of the upper coding unit 620a and the lower coding unit 620c as the coding unit at the predetermined position. However, the above-mentioned method of determining the coding unit having a size different from the sizes of other coding units performed by the image decoding apparatus 100 corresponds only to an example of determining the coding unit at the predetermined position by using the size of the coding unit determined based on the coordinates of the sample points, and thus various methods of determining the coding unit at the predetermined position by comparing the size of the coding unit determined based on the coordinates of the predetermined sample points may be used.

[0126] The image decoding apparatus 100 may determine the width or height of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd) indicating the position of the upper left sample point 670a of the left coding unit 660a, the coordinates (xe, ye) indicating the position of the upper left sample point 670b of the middle coding unit 660b, and the coordinates (xf, yf) indicating the position of the upper left sample point 670c of the right coding unit 660c. The image decoding apparatus 100 may determine the respective sizes of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.

[0127] According to an embodiment, the image decoding apparatus 100 may determine the width of the left coding unit 660a as xe-xd. According to an embodiment, the image decoding apparatus 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 image decoding apparatus 100 may determine the width of the middle coding unit 660b as xf-xe. The image decoding apparatus 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 image decoding apparatus 100 may determine the width or height of the right coding unit 660c by using the width or height of the current coding unit 650 and the width or height of the left coding unit 660a and the middle coding unit 660b. The image decoding apparatus 100 may determine a coding unit having a size different from that of other coding units based on the determined width and height of the coding units 660a, 660b, and 660c. Referring to Figure 6 , the image decoding apparatus 100 may determine the middle coding unit 660b having a size different from the sizes of the left coding unit 660a and the right coding unit 660c as the coding unit at the predetermined position. However, the above-mentioned method of determining the coding unit having a size different from the sizes of other coding units performed by the image decoding apparatus 100 corresponds only to an example of determining the coding unit at the predetermined position by using the size of the coding unit determined based on the coordinates of the sample points, and thus various methods of determining the coding unit at the predetermined position by comparing the size of the coding unit determined based on the coordinates of the predetermined sample points may be used.

[0128] However, the position of the sample considered to determine the position of the coding unit is not limited to the above-mentioned upper left position, and information on arbitrary positions of the samples included in the coding unit may be used.

[0129] According to an embodiment, the image decoding apparatus 100 may select a coding unit at a predetermined position from an odd number of coding units determined by dividing the current coding unit, taking into account the shape of the current coding unit. For example, when the current coding unit has a non-square shape in which the width is greater than the height, the image decoding apparatus 100 may determine a coding unit at a predetermined position in the horizontal direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions in the horizontal direction and impose restrictions on the coding unit. When the current coding unit has a non-square shape in which the height is greater than the width, the image decoding apparatus 100 may determine a coding unit at a predetermined position in the vertical direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions in the vertical direction and may impose restrictions on the coding unit.

[0130] According to an embodiment, the image decoding apparatus 100 may use information indicating respective positions of even-numbered coding units to determine a coding unit at a predetermined position among the even-numbered coding units. The image decoding apparatus 100 may determine the even-numbered coding units by dividing (dividing) the current coding unit, and may determine the coding unit at the predetermined position by using information about the positions of the even-numbered coding units. The operations related thereto may be similar to those described above with respect to Figure 6 The operation of determining a coding unit at a predetermined position (eg, a center position) among odd-numbered coding units has been described in detail, and thus a detailed description thereof is not provided here.

[0131] According to an embodiment, when a non-square current coding unit is divided into a plurality of coding units, predetermined information about a coding unit at a predetermined position may be used in a division operation to determine a coding unit at a predetermined position among the plurality of coding units. For example, the image decoding apparatus 100 may use at least one of block shape information and division shape pattern information stored in a sample included in a coding unit at a center position to determine a coding unit at a center position among a plurality of coding units determined by dividing the current coding unit in a division operation.

[0132] Reference Figure 6, the image decoding apparatus 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on the division shape pattern information, and may determine the coding unit 620b at the center position among the plurality of coding units 620a, 620b, and 620c. In addition, the image decoding apparatus 100 may determine the coding unit 620b at the center position in consideration of the position at which the division shape pattern information is obtained. That is, the division shape pattern information of the current coding unit 600 may be obtained from the sample point 640 at the center position of the current coding unit 600, and when the current coding unit 600 is divided into a plurality of coding units 620a, 620b, and 620c based on the division shape pattern information, the coding unit 620b including the sample point 640 may be determined as the coding unit at the center position. However, information for determining the coding unit at the center position is not limited to the division shape pattern information, and various types of information may be used to determine the coding unit at the center position.

[0133] According to an embodiment, predetermined information for identifying a coding unit at a predetermined position may be obtained from predetermined samples included in a coding unit to be determined. Figure 6 , the image decoding apparatus 100 may determine a coding unit at a predetermined position (e.g., a coding unit at a center position of the plurality of divided coding units) among the plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, using division shape pattern information obtained from a sample at a predetermined position in the current coding unit 600 (e.g., a sample at a center position of the current coding unit 600). That is, the image decoding apparatus 100 may determine the sample at the predetermined position by considering the block shape of the current coding unit 600, determine the coding unit 620b including the sample for which the predetermined information (e.g., division shape pattern information) may be obtained among the plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may impose a predetermined restriction on the coding unit 620b. Referring to Figure 6 According to an embodiment, the image decoding apparatus 100 may determine a sample 640 at a center position of the current coding unit 600 as a sample from which predetermined information may be obtained, and may impose a predetermined restriction on a coding unit 620b including the sample 640 in a decoding operation. However, the position of the sample from which the predetermined information may be obtained is not limited to the above-mentioned position, and may include any position of the sample included in the coding unit 620b to be determined as being restricted.

[0134] According to an embodiment, the position of the sample at which the predetermined information can be obtained may be determined based on the shape of the current coding unit 600. According to an embodiment, the block shape information may indicate whether the current coding unit has a square shape or a non-square shape, and the position of the sample at which the predetermined information can be obtained may be determined based on the shape. For example, the image decoding device 100 may determine a sample located on a boundary for dividing at least one of the width and the height of the current coding unit in half as a sample at which the predetermined information can be obtained by using at least one of the information about the width of the current coding unit and the information about the height of the current coding unit. As another example, when the block shape information of the current coding unit indicates a non-square shape, the image decoding device 100 may determine one of the samples adjacent to the boundary for dividing the long side of the current coding unit in half as a sample at which the predetermined information can be obtained.

[0135] According to an embodiment, when the current coding unit is divided into a plurality of coding units, the image decoding device 100 may use the division shape pattern information to determine the coding unit at a predetermined position in the plurality of coding units. According to an embodiment, the image decoding device 100 may obtain the division shape pattern information from the sample at the predetermined position in the coding unit, and divide the plurality of coding units generated by dividing the current coding unit by using the division shape pattern information obtained from the sample at the predetermined position in each of the plurality of coding units. That is, the coding unit may be recursively divided based on the division shape pattern information obtained from the sample at the predetermined position in each coding unit. As has been described above, Figure 5 An operation of recursively splitting the coding unit is described, and thus a detailed description thereof will not be provided here.

[0136] According to an embodiment, the image decoding apparatus 100 may determine one or more coding units by splitting a current coding unit, and may determine an order in which to decode the one or more coding units based on a predetermined block (for example, the current coding unit).

[0137] Figure 7 An order in which a plurality of coding units are processed when the image decoding apparatus 100 determines a plurality of coding units by splitting a current coding unit according to an embodiment is illustrated.

[0138] According to an embodiment, the image decoding device 100 may determine the second coding units 710a and 710b by dividing the first coding unit 700 in a vertical direction, determine the second coding units 730a and 730b by dividing the first coding unit 700 in a horizontal direction, or determine the second coding units 750a to 750d by dividing the first coding unit 700 in vertical and horizontal directions based on the division shape pattern information.

[0139] Reference Figure 7, the image decoding apparatus 100 may determine to process the second coding units 710a and 710b determined by dividing the first coding unit 700 in the vertical direction in a horizontal direction order 710c. The image decoding apparatus 100 may determine to process the second coding units 730a and 730b determined by dividing the first coding unit 700 in the horizontal direction in a vertical direction order 730c. The image decoding apparatus 100 may determine to process the second coding units 750a to 750d determined by dividing the first coding unit 700 in the vertical direction and the horizontal direction in a predetermined order (e.g., a raster scan order or a zigzag scan order 750e), wherein the predetermined order is to process the coding units in one row and then process the coding units in the next row.

[0140] According to an embodiment, the image decoding apparatus 100 may recursively divide the coding unit. Figure 7 , the image decoding apparatus 100 may determine a plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d by dividing the first coding unit 700, and may recursively divide each of the determined plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. A division method of the plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d may correspond to a division method of the first coding unit 700. In this way, each of the plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d may be independently divided into a plurality of coding units. Referring to Figure 7 , the image decoding apparatus 100 may determine the second coding units 710a and 710b by splitting the first coding unit 700 in a vertical direction, and may determine whether to independently split or not split each of the second coding units 710a and 710b.

[0141] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 720a and 720b by splitting the left second coding unit 710a in a horizontal direction, and may not split the right second coding unit 710b.

[0142] According to an embodiment, the processing order of the coding units may be determined based on the operation of dividing the coding units. In other words, the processing order of the divided coding units may be determined based on the processing order of the coding units immediately before being divided. The image decoding apparatus 100 may determine the processing order of the third coding units 720a and 720b determined by dividing the left second coding unit 710a independently of the right second coding unit 710b. Since the third coding units 720a and 720b are determined by dividing the left second coding unit 710a in the horizontal direction, the third coding units 720a and 720b may be processed in a vertical direction order 720c. Since the left second coding unit 710a and the right second coding unit 710b are processed in a horizontal direction order 710c, the right second coding unit 710b may be processed after the third coding units 720a and 720b included in the left second coding unit 710a are processed in a vertical direction order 720c. The operation of determining the processing order of coding units based on the coding units before being split is not limited to the above example, and coding units split and determined into various shapes may be independently processed in a predetermined order using various methods.

[0143] Figure 8 A process of determining that a current coding unit is to be split into an odd number of coding units when coding units cannot be processed in a predetermined order, performed by the image decoding apparatus 100 according to an embodiment is illustrated.

[0144] According to an embodiment, the image decoding apparatus 100 may determine whether the current coding unit is split into an odd number of coding units based on the obtained division shape pattern information. Figure 8 , the square first coding unit 800 may be divided into non-square second coding units 810a and 810b, and the second coding units 810a and 810b may be independently divided into third coding units 820a and 820b and third coding units 820c to 820e. According to an embodiment, the image decoding apparatus 100 may determine a plurality of third coding units 820a and 820b by dividing the left second coding unit 810a in the horizontal direction, and may divide the right second coding unit 810b into an odd number of third coding units 820c to 820e.

[0145] According to an embodiment, the image decoding apparatus 100 may determine whether to split any coding unit into an odd number of coding units by determining whether the third coding units 820a and 820b and the third coding units 820c to 820e can be processed in a predetermined order. Figure 8, the image decoding apparatus 100 may determine the third coding units 820a and 820b and the third coding units 820c to 820e by recursively dividing the first coding unit 800. The image decoding apparatus 100 may determine whether any one of the first coding unit 800, the second coding units 810a and 810b, the third coding units 820a and 820b, and the third coding units 820c, 820d, and 820e is divided into an odd number of coding units based on at least one of the block shape information and the division shape mode information. For example, the second coding unit located on the right side of the second coding units 810a and 810b may be divided into an odd number of third coding units 820c, 820d, and 820e. The processing order of the multiple coding units included in the first coding unit 800 can be a predetermined order (for example, a zigzag scanning order 830), and the image decoding device 100 can 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 meet the conditions for processing in the predetermined order.

[0146] According to an embodiment, the image decoding apparatus 100 may determine whether the third coding units 820a and 820b and the third coding units 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition for processing in a predetermined order, and the condition is related to whether at least one of the width and height of the second coding units 810a and 810b is divided in half along the boundary of the third coding units 820a and 820b and the third coding units 820c, 820d, and 820e. For example, the third coding units 820a and 820b determined by dividing the height of the non-square left second coding unit 810a in half satisfy the condition. Because the boundary of the third coding units 820c, 820d, and 820e determined by dividing the right second coding unit 810b into three coding units does not divide the width or height of the right second coding unit 810b in half, it can be determined that the third coding units 820c, 820d, and 820e do not satisfy the condition. When the condition is not satisfied as described above, the image decoding apparatus 100 may determine that the scanning order is discontinuous, and determine that the right second coding unit 810b is to be divided into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a predetermined restriction on the coding unit at a predetermined position in the divided coding unit. The restriction or the predetermined position has been described above with respect to various embodiments, so a detailed description thereof will not be provided here.

[0147] Fig. 9 A process of determining at least one coding unit by splitting the first coding unit 900 , performed by the image decoding apparatus 100 according to an embodiment, is illustrated.

[0148] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 900 based on the division shape pattern information obtained by the receiver 110. The square first coding unit 900 may be divided into four square coding units, or may be divided into a plurality of non-square coding units. Fig. 9 , when the first coding unit 900 has a square shape and the division shape pattern information indicates that the first coding unit 900 is divided into non-square coding units, the image decoding apparatus 100 may divide the first coding unit 900 into a plurality of non-square coding units. In detail, when the division shape pattern information indicates that an odd number of coding units is determined by dividing the first coding unit 900 in a horizontal direction or a vertical direction, the image decoding apparatus 100 may divide the square first coding unit 900 into an odd number of coding units (for example, second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in a vertical direction, or second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in a horizontal direction).

[0149] According to an embodiment, the image 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, and the condition is related to whether at least one of the width and height of the first coding unit 900 is divided in half along a boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Fig. 9 , because the boundaries of the second coding units 910a, 910b, and 910c determined by dividing the first coding unit 900 in the vertical direction do not divide the height of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not meet the condition of being processed in a predetermined order. In addition, because the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the first coding unit 900 in the horizontal direction do not divide the width of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not meet the condition of being processed in a predetermined order. When the condition is not met as described above, the image decoding apparatus 100 may determine that the scanning order is not continuous, and may determine that the first coding unit 900 is divided into an odd number of coding units based on the result of the determination. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a predetermined restriction on the coding unit at a predetermined position in the divided coding unit. The restriction or the predetermined position has been described above with respect to various embodiments, and thus a detailed description thereof will not be provided here.

[0150] According to an embodiment, the image decoding apparatus 100 may determine coding units of various shapes by splitting the first coding unit.

[0151] Reference Fig. 9 , the image decoding apparatus 100 may divide the square first coding unit 900 or the non-square first coding unit 930 or 950 into coding units of various shapes.

[0152] Fig.10 It is shown that according to an embodiment, when a second coding unit having a non-square shape determined by splitting the first coding unit 1000 satisfies a predetermined condition, shapes into which the second coding unit may be split by the image decoding apparatus 100 are limited.

[0153] According to an embodiment, the image decoding apparatus 100 may determine to split the square first coding unit 1000 into non-square second coding units 1010a, 1010b, 1020a, and 1020b based on the division shape pattern information obtained by the receiver 110. The second coding units 1010a, 1010b, 1020a, and 1020b may be independently divided. In this way, the image decoding apparatus 100 may determine to split the first coding unit 1000 into a plurality of coding units or not to split the first coding unit 1000 based on the division shape pattern information of each of the second coding units 1010a, 1010b, 1020a, and 1020b. According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1012a and 1012b by horizontally splitting the non-square left second coding unit 1010a determined by splitting the first coding unit 1000 in the vertical direction. However, when the left second coding unit 1010a is divided in the horizontal direction, the image decoding apparatus 100 may restrict the right second coding unit 1010b from being divided in the horizontal direction in which the left second coding unit 1010a is divided. When the third coding units 1014a and 1014b are determined by dividing the right second coding unit 1010b in the same direction, since the left second coding unit 1010a and the right second coding unit 1010b are independently divided in the horizontal direction, the third coding units 1012a, 1012b, 1014a, and 1014b may be determined. However, this case is equivalent to the case in which the image decoding apparatus 100 divides the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the division shape pattern information, and may be inefficient in image decoding.

[0154] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1022a, 1022b, 1024a, and 1024b by vertically splitting the non-square second coding unit 1020a or 1020b determined by splitting the first coding unit 1000 in the horizontal direction. However, when the second coding unit (e.g., the upper second coding unit 1020a) is split in the vertical direction, the image decoding apparatus 100 may restrict another second coding unit (e.g., the lower second coding unit 1020b) from being split in the vertical direction in which the upper second coding unit 1020a is split for the above-mentioned reason.

[0155] Fig.11 A process of splitting a square coding unit when division shape pattern information indicates that the square coding unit is not to be split into four square coding units, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.

[0156] According to an embodiment, the image decoding apparatus 100 may determine second coding units 1110a, 1110b, 1120a, 1120b, etc. by dividing the first coding unit 1100 based on the division shape pattern information. The division shape pattern information may include information about various methods of dividing the coding unit, but the information about the various division methods may not include information for dividing the coding unit into four square coding units. According to such division shape pattern information, the image decoding apparatus 100 may not divide the square first coding unit 1100 into four square second coding units 1130a, 1130b, 1130c, and 1130d. The image decoding apparatus 100 may determine non-square second coding units 1110a, 1110b, 1120a, 1120b, etc. based on the division shape pattern information.

[0157] According to an embodiment, the image decoding apparatus 100 may independently divide the non-square second coding units 1110a, 1110b, 1120a, 1120b, etc. Based on the division shape pattern information, each of the second coding units 1110a, 1110b, 1120a, 1120b, etc. may be recursively divided in a predetermined order, and the division method may correspond to the method of dividing the first coding unit 1100.

[0158] For example, the image decoding apparatus 100 may determine square third coding units 1112a and 1112b by dividing the left second coding unit 1110a in the horizontal direction, and may determine square third coding units 1114a and 1114b by dividing the right second coding unit 1110b in the horizontal direction. In addition, the image decoding apparatus 100 may determine square third coding units 1116a, 1116b, 1116c, and 1116d by dividing both the left second coding unit 1110a and the right second coding unit 1110b in the horizontal direction. In this case, coding units having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 may be determined.

[0159] As another example, the image decoding apparatus 100 may determine the third coding units 1122a and 1122b of a square by dividing the upper second coding unit 1120a in the vertical direction, and may determine the third coding units 1124a and 1124b of a square by dividing the lower second coding unit 1120b in the vertical direction. In addition, the image decoding apparatus 100 may determine the third coding units 1126a, 1126b, 1126c, and 1126d of a square by dividing both the upper second coding unit 1120a and the lower second coding unit 1120b in the vertical direction. In this case, a coding unit having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 may be determined.

[0160] Fig.12 It is shown that a processing order among a plurality of coding units may be changed according to a process of dividing the coding units according to an embodiment.

[0161] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 1200 based on the division shape pattern information. When the block shape is a square and the division shape pattern information indicates that the first coding unit 1200 is divided in at least one of the horizontal direction and the vertical direction, the image decoding apparatus 100 may determine the second coding units 1210a, 1210b, 1220a, 1220b, etc. by dividing the first coding unit 1200. Fig.12, based on the division shape pattern information of each coding unit, the non-square second coding units 1210a, 1210b, 1220a, and 1220b determined by dividing the first coding unit 1200 only in the horizontal direction or the vertical direction may be independently divided. For example, the image decoding device 100 may determine the third coding units 1216a, 1216b, 1216c, and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in the vertical direction in the horizontal direction, and may determine the third coding units 1226a, 1226b, 1226c, and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 in the horizontal direction in the vertical direction. As has been described above, Fig.11 An operation of dividing the second coding units 1210a, 1210b, 1220a, and 1220b is described, and thus a detailed description thereof will not be provided here.

[0162] According to an embodiment, the image decoding apparatus 100 may process the coding units in a predetermined order. Figure 7 The operation of processing the encoding units in a predetermined order is described, and thus a detailed description thereof will not be provided here. Fig.12 , the image decoding apparatus 100 may determine four square third coding units 1216a, 1216b, 1216c, and 1216d and third coding units 1226a, 1226b, 1226c, and 1226d by dividing the square first coding unit 1200. According to an embodiment, the image decoding apparatus 100 may determine a processing order of the third coding units 1216a, 1216b, 1216c, and 1216d and the third coding units 1226a, 1226b, 1226c, and 1226d based on a division method of the first coding unit 1200.

[0163] According to an embodiment, the image decoding device 100 may determine third coding units 1216a, 1216b, 1216c, and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in a vertical direction in a horizontal direction, and may process the third coding units 1216a, 1216b, 1216c, and 1216d in a processing order 1217, wherein the processing order 1217 is: first, the third coding units 1216a and 1216c included in the left second coding unit 1210a are processed in a vertical direction, and then the third coding units 1216b and 1216d included in the right second coding unit 1210b are processed in a vertical direction.

[0164] According to an embodiment, the image decoding device 100 can determine the third coding units 1226a, 1226b, 1226c and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 in the horizontal direction in the vertical direction, and can process the third coding units 1226a, 1226b, 1226c and 1226d in a processing order 1227, wherein the processing order 1227 is: first, the third coding units 1226a and 1226b included in the upper second coding unit 1220a are processed in the horizontal direction, and then the third coding units 1226c and 1226d included in the lower second coding unit 1220b are processed in the horizontal direction.

[0165] Reference Fig.12 , square third coding units 1216a, 1216b, 1216c, and 1216d and third coding units 1226a, 1226b, 1226c, and 1226d can be determined by dividing the second coding units 1210a, 1210b, 1220a, and 1220b, respectively. Although the second coding units 1210a and 1210b determined by dividing the first coding unit 1200 in the vertical direction are different from the second coding units 1220a and 1220b determined by dividing the first coding unit 1200 in the horizontal direction, the third coding units 1216a, 1216b, 1216c, and 1216d and the third coding units 1226a, 1226b, 1226c, and 1226d divided from the second coding unit ultimately show the same shaped coding units divided from the first coding unit 1200. In this way, by recursively splitting the coding units in different manners based on the division shape pattern information, even if the coding units are finally determined to be the same shape, the image decoding apparatus 100 may process a plurality of coding units in different orders.

[0166] Fig.13 A process of determining a depth of a coding unit as a shape and a size of a coding unit change when a coding unit is recursively split to determine a plurality of coding units according to an embodiment is illustrated.

[0167] According to an embodiment, the image decoding device 100 may determine the depth of the coding unit based on a predetermined criterion. For example, the predetermined criterion may be the length of the long side of the coding unit. When the length of the long side of the coding unit before being divided is 2n times (n>0) the length of the long side of the current coding unit after being divided, the image decoding device 100 may determine that the depth of the current coding unit is increased by n from the depth of the coding unit before being divided. In the following description, a coding unit with an increased depth is represented as a coding unit with a deeper depth.

[0168] Reference Fig.13According to an embodiment, the image decoding apparatus 100 may determine a second coding unit 1302 and a third coding unit 1304 having a deeper depth by dividing a square first coding unit 1300 based on block shape information indicating a square shape (for example, the block shape information may be represented as "0: SQUARE"). Assuming that the size of the square first coding unit 1300 is 2N×2N, the second coding unit 1302 determined by dividing the width and height of the first coding unit 1300 into 1 / 2 may have a size of N×N. In addition, the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 into 1 / 2 may have a size of N / 2×N / 2. In this case, the width and height of the third coding unit 1304 are 1 / 4 of the width and height of the first coding unit 1300. When the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302 whose width and height are 1 / 2 times the width and height of the first coding unit 1300 may be D+1, and the depth of the third coding unit 1304 whose width and height are 1 / 4 the width and height of the first coding unit 1300 may be D+2.

[0169] According to an embodiment, the image decoding device 100 can determine a second coding unit 1312 or 1322 and a third coding unit 1314 or 1324 having a deeper depth by dividing the non-square first coding unit 1310 or 1320 based on block shape information indicating a non-square shape (for example, the block shape information may be represented as "1:NS_VER" indicating a non-square shape in which the height is greater than the width, or as "2:NS_HOR" indicating a non-square shape in which the width is greater than the height).

[0170] The image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by splitting at least one of the width and the height of the first coding unit 1310 having a size of 2N×N. That is, the image decoding apparatus 100 may determine the second coding unit 1302 having a size of N×N or the second coding unit 1322 having a size of N×N / 2 by splitting the first coding unit 1310 in a horizontal direction, or may determine the second coding unit 1312 having a size of N / 2×N by splitting the first coding unit 1310 in horizontal and vertical directions.

[0171] According to an embodiment, the image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by splitting at least one of the width and the height of the first coding unit 1320 having a size of 2N×N. That is, the image decoding apparatus 100 may determine the second coding unit 1302 having a size of N×N or the second coding unit 1312 having a size of N / 2×N by splitting the first coding unit 1320 in a vertical direction, or may determine the second coding unit 1322 having a size of N×N / 2 by splitting the first coding unit 1320 in horizontal and vertical directions.

[0172] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by splitting at least one of the width and the height of the second coding unit 1302 having a size of N×N. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2, the third coding unit 1314 having a size of N / 4×N / 2, or the third coding unit 1324 having a size of N / 2×N / 4 by splitting the second coding unit 1302 in the vertical direction and the horizontal direction.

[0173] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1312 having a size of N / 2×N. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1312 in a horizontal direction, or may determine the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1312 in a vertical direction and a horizontal direction.

[0174] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1322 having a size of N×N / 2. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1322 in a vertical direction, or may determine the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1322 in a vertical direction and a horizontal direction.

[0175] According to an embodiment, the image decoding apparatus 100 may split the square coding unit 1300, 1302, or 1304 in a horizontal direction or a vertical direction. For example, the image decoding apparatus 100 may determine the first coding unit 1310 having a size of N×2N by splitting the first coding unit 1300 having a size of 2N×2N in a vertical direction, or may determine the first coding unit 1320 having a size of 2N×N by splitting the first coding unit 1300 in a horizontal direction. According to an embodiment, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by splitting the first coding unit 1300 having a size of 2N×2N in a horizontal direction or a vertical direction may be the same as the depth of the first coding unit 1300.

[0176] According to an embodiment, the width and height of the third coding unit 1314 or 1324 may be 1 / 4 of the width and height of the first coding unit 1310 or 1320. When the depth of the first coding unit 1310 or 1320 is D, the depth of the second coding unit 1312 or 1322 whose width and height are 1 / 2 times the width and height of the first coding unit 1310 or 1320 may be D+1, and the depth of the third coding unit 1314 or 1324 whose width and height are 1 / 4 of the width and height of the first coding unit 1310 or 1320 may be D+2.

[0177] Fig.14 Depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.

[0178] According to an embodiment, the image decoding apparatus 100 may determine second coding units of various shapes by dividing the square first coding unit 1400. Fig.14 , the image decoding apparatus 100 may determine the second coding units 1402a and 1402b, the second coding units 1404a and 1404b, and the second coding units 1406a, 1406b, 1406c, and 1406d by dividing the first coding unit 1400 in at least one of the vertical direction and the horizontal direction based on the division shape pattern information. That is, the image decoding apparatus 100 may determine the second coding units 1402a and 1402b, the second coding units 1404a and 1404b, and the second coding units 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information of the first coding unit 1400.

[0179] According to an embodiment, the depths of the second coding units 1402a and 1402b, the second coding units 1404a and 1404b, and the second coding units 1406a, 1406b, 1406c, and 1406d determined based on the division shape pattern information of the square first coding unit 1400 may be determined based on the length of their long sides. For example, since the length of the side of the square first coding unit 1400 is equal to the length of the long side of the non-square second coding units 1402a and 1402b and the second coding units 1404a and 1404b, the first coding unit 1400 and the non-square second coding units 1402a and 1402b and the second coding units 1404a and 1404b may have the same depth, for example, D. However, when the image decoding device 100 divides the first coding unit 1400 into four square second coding units 1406a, 1406b, 1406c and 1406d based on the division shape pattern information, because the length of the side of the square second coding units 1406a, 1406b, 1406c and 1406d is 1 / 2 times the length of the side of the first coding unit 1400, the depth of the second coding units 1406a, 1406b, 1406c and 1406d can be D+1 which is 1 deeper than the depth D of the first coding unit 1400.

[0180] According to an embodiment, the image decoding apparatus 100 may determine a plurality of second coding units 1412a and 1412b and second coding units 1414a, 1414b, and 1414c by dividing the first coding unit 1410 having a height greater than a width in a horizontal direction based on the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may determine a plurality of second coding units 1422a and 1422b and second coding units 1424a, 1424b, and 1424c by dividing the first coding unit 1420 having a width greater than a height in a vertical direction based on the division shape pattern information.

[0181] According to an embodiment, the depths of the second coding units 1412a and 1412b, 1414a, 1414b and 1414c, 1422a and 1422b, and 1424a, 1424b and 1424c determined based on the division shape pattern information of the non-square first coding unit 1410 or 1420 may be determined based on the length of the long side thereof. For example, since the length of the side of the square second coding units 1412a and 1412b is 1 / 2 of the length of the long side of the first coding unit 1410 having a non-square shape having a height greater than a width, the depth of the square second coding units 1412a and 1412b is D+1 which is 1 deeper than the depth D of the non-square first coding unit 1410.

[0182] In addition, the image decoding apparatus 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 shape pattern 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, since the length of the long side of the non-square second coding units 1414a and 1414c and the length of the side of the square second coding unit 1414b are 1 / 2 of the length of the long side of the first coding unit 1410, the depth of the second coding units 1414a, 1414b, and 1414c may be D+1 which is 1 deeper than the depth D of the non-square first coding unit 1410. The image decoding apparatus 100 may determine the depths of the coding units split from the first coding unit 1420 having a non-square shape having a width greater than a height by using the above-described method of determining the depths of the coding units split from the first coding unit 1410 .

[0183] According to an embodiment, when the divided odd-numbered coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for identifying the divided coding units based on a size ratio between the coding units. Fig.14 , the coding unit 1414b at the center position among the divided odd-numbered coding units 1414a, 1414b, and 1414c may have a width equal to that of the other coding units 1414a and 1414c and a height twice the height of the other coding units 1414a and 1414c. That is, in this case, the coding unit 1414b at the center position may include two other coding units 1414a or 1414c. Therefore, when the PID of the coding unit 1414b at the center position based on the scanning order is 1, the PID of the coding unit 1414c located next to the coding unit 1414b may increase by 2 and thus may be 3. That is, there may be discontinuity in the PID value. According to an embodiment, the image decoding apparatus 100 may determine whether the divided odd-numbered coding units do not have equal sizes based on whether there is discontinuity in the PID for identifying the divided coding units.

[0184] According to an embodiment, the image decoding apparatus 100 may determine whether to use a specific splitting method based on a PID value for identifying a plurality of coding units determined by splitting a current coding unit. Fig.14, the image decoding apparatus 100 may determine an even number of coding units 1412a and 1412b or an odd number of coding units 1414a, 1414b, and 1414c by dividing the first coding unit 1410 having a rectangular shape whose height is greater than its width. The image decoding apparatus 100 may use the PID to identify each coding unit. According to an embodiment, the PID may be obtained from a sample point at a predetermined position of each coding unit (e.g., an upper left sample point).

[0185] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a predetermined position among the divided coding units by using a PID for distinguishing coding units. According to an embodiment, when the division shape pattern information of the first coding unit 1410 having a rectangular shape having a height greater than a width indicates that the coding unit is divided into three coding units, the image decoding apparatus 100 may divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The image decoding apparatus 100 may assign a PID to each of the three coding units 1414a, 1414b, and 1414c. The image decoding apparatus 100 may compare the PIDs of the odd-numbered divided coding units to determine a coding unit at a center position among the coding units. The image decoding apparatus 100 may determine the coding unit 1414b having a PID corresponding to a middle value among the PIDs of the coding units as a coding unit at a center position among the coding units determined by dividing the first coding unit 1410. According to an embodiment, when the divided coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for distinguishing the divided coding units based on a size ratio between the coding units. Fig.14, the width of the coding unit 1414b generated by dividing the first coding unit 1410 may be equal to the width of the other coding units 1414a and 1414c, and the height may be twice the height of the other coding units 1414a and 1414c. In this case, when the PID of the coding unit 1414b at the center position is 1, the PID of the coding unit 1414c located next to the coding unit 1414b may increase by 2 and thus may be 3. When the PID does not increase uniformly as described above, the image decoding apparatus 100 may determine that the coding unit is divided into a plurality of coding units, and the plurality of coding units include coding units having sizes different from those of the other coding units. According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may divide the current coding unit in such a manner that a coding unit at a predetermined position among the odd number of coding units (for example, a coding unit at the center position) has a size different from that of the other coding units. In this case, the image decoding apparatus 100 may determine the coding units at the center position having different sizes by using the PIDs of the coding units. However, the PID and the size or the position of the coding unit at the predetermined position are not limited to the above-mentioned examples, and various PIDs and various positions and sizes of the coding unit may be used.

[0186] According to an embodiment, the image decoding apparatus 100 may use a predetermined data unit in which a coding unit starts to be recursively split.

[0187] Fig.15 It is illustrated that a plurality of coding units are determined based on a plurality of predetermined data units included in a picture according to an embodiment.

[0188] According to an embodiment, a predetermined data unit may be defined as a data unit for recursively dividing a coding unit by starting to use at least one of block shape information and division shape mode information. That is, the predetermined data unit may correspond to a coding unit for determining a highest depth of a plurality of coding units divided from a current picture. In the following description, for ease of explanation, the predetermined data unit is referred to as a reference data unit.

[0189] According to an embodiment, the reference data unit may have a predetermined size and a predetermined size shape. According to an embodiment, the reference coding unit may include M×N samples. Here, M and N may be equal to each other and may be an integer expressed as a power of 2. That is, the reference data unit may have a square shape or a non-square shape and may be divided into an integer number of coding units.

[0190] According to an embodiment, the image decoding apparatus 100 may divide the current picture into a plurality of reference data units. According to an embodiment, the image decoding apparatus 100 may divide the plurality of reference data units divided from the current picture by using division information about each reference data unit. The operation of dividing the reference data unit may correspond to a division operation using a quadtree structure.

[0191] According to an embodiment, the image decoding apparatus 100 may predetermine the minimum size allowed for the reference data unit included in the current picture. Therefore, the image decoding apparatus 100 may determine various reference data units having a size equal to or larger than the minimum size, and may determine one or more coding units by using the division shape pattern information about the determined reference data unit.

[0192] Reference Fig.15 , the image decoding apparatus 100 may use a square reference coding unit 1500 or a non-square 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 CTU, etc.) that can include one or more reference coding units.

[0193] According to an embodiment, the receiver 110 of the image decoding apparatus 100 may obtain at least one of reference coding unit shape information and reference coding unit size information about each of various data units from a bitstream. Figure 3 The operation of dividing the current coding unit 300 describes the operation of dividing the square reference coding unit 1500 into one or more coding units, and the above has been about Figure 4 The operation of splitting the current coding unit 400 or 450 describes an operation of splitting the non-square reference coding unit 1502 into one or more coding units. Therefore, a detailed description thereof will not be provided here.

[0194] According to an embodiment, the image decoding apparatus 100 may use a PID for identifying the size and shape of a reference coding unit to determine the size and shape of the reference coding unit according to some data units previously determined based on a predetermined condition. That is, the receiver 110 may obtain only a PID for identifying the size and shape of a reference coding unit for each slice, slice segment, or CTU from a bitstream, wherein each slice, slice segment, or CTU is a data unit (e.g., a data unit having a size equal to or smaller than a slice) among various data units (e.g., a sequence, a picture, a slice, a slice segment, a CTU, etc.) that satisfies a predetermined condition. The image decoding apparatus 100 may determine the size and shape of a reference data unit for each data unit that satisfies a predetermined condition by using a PID. When the reference coding unit shape information and the reference coding unit size information are obtained and used from a bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high, so only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the size and shape of the reference coding unit corresponding to the PID for identifying the size and shape of the reference coding unit may be predetermined. That is, the image decoding apparatus 100 may determine at least one of the size and shape of a reference coding unit included in a data unit serving as a unit for obtaining a PID by selecting at least one of the size and shape of a predetermined reference coding unit based on the PID.

[0195] According to an embodiment, the image decoding apparatus 100 may use one or more reference coding units included in the CTU. That is, the CTU divided from the picture may include one or more reference coding units, and the coding unit may be determined by recursively dividing each reference coding unit. According to an embodiment, at least one of the width and height of the CTU may be an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be obtained by dividing the CTU n times based on a quadtree structure. That is, according to various embodiments, the image decoding apparatus 100 may determine the reference coding unit by dividing the CTU n times based on the quadtree structure, and may divide the reference coding unit based on at least one of the block shape information and the division shape mode information.

[0196] Fig.16 A processing block serving as a unit for determining an order of reference coding units included in the picture 1600 according to an embodiment is illustrated.

[0197] According to an embodiment, the image decoding device 100 may determine one or more processing blocks divided from a picture. A processing block is a data unit including one or more reference coding units divided from a picture, and the one or more reference coding units included in the processing block may be determined according to a specific order. That is, the determination order of the one or more reference coding units determined in each processing block may correspond to one of the various types of orders for determining the reference coding units, and may vary according to the processing block. The determination order of the reference coding units determined for each processing block may be one of various orders (e.g., a raster scanning order, a zigzag scan, an N-shaped scan, an upper right diagonal scan, a horizontal scan, and a vertical scan), but is not limited to the above-mentioned scanning order.

[0198] According to an embodiment, the image decoding apparatus 100 may obtain processing block size information and may determine the size of one or more processing blocks included in a picture. The image decoding apparatus 100 may obtain processing block size information from a bitstream and may determine the size of one or more processing blocks included in a picture. The size of the processing block may be a predetermined size of a data unit indicated by the processing block size information.

[0199] According to an embodiment, the receiver 110 of the image decoding device 100 may obtain processing block size information from the bitstream according to each specific data unit. For example, the processing block size information may be obtained from the bitstream according to a data unit such as an image, a sequence, a picture, a slice, or a slice segment. That is, the receiver 110 may obtain processing block size information from the bitstream according to each of the various data units, and the image decoding device 100 may determine the size of one or more processing blocks divided from the picture by using the obtained processing block size information. The size of the processing block may be an integer multiple of the size of the reference coding unit.

[0200] According to an embodiment, the image decoding apparatus 100 may determine the size of the processing blocks 1602 and 1612 included in the picture 1600. For example, the image decoding apparatus 100 may determine the size of the processing block based on the processing block size information obtained from the bitstream. Fig.16 According to an embodiment, the image decoding apparatus 100 may determine that the width of the processing blocks 1602 and 1612 is four times the width of the reference coding unit, and may determine that the height of the processing blocks 1602 and 1612 is four times the height of the reference coding unit. The image decoding apparatus 100 may determine the determination order of one or more reference coding units in one or more processing blocks.

[0201] According to an embodiment, the image decoding apparatus 100 may determine the processing blocks 1602 and 1612 included in the picture 1600 based on the size of the processing blocks, and may determine a determination order of one or more reference coding units in the processing blocks 1602 and 1612. According to an embodiment, determining the reference coding unit may include determining the size of the reference coding unit.

[0202] According to an embodiment, the image decoding apparatus 100 may obtain determination order information of one or more reference coding units included in one or more processing blocks from a bitstream, and may determine a determination order for one or more reference coding units based on the obtained determination order information. The determination order information may be defined as an order or direction for determining the reference coding units in the processing block. That is, the determination order of the reference coding units may be determined independently for each processing block.

[0203] According to an embodiment, the image decoding apparatus 100 may obtain the determination order information of the reference coding unit from the bitstream according to each specific data unit. For example, the receiver 110 may obtain the determination order information of the reference coding unit from the bitstream according to each data unit (such as an image, a sequence, a picture, a slice, a slice segment, or a processing block). Because the determination order information of the reference coding unit indicates the order in which the reference coding unit is determined in the processing block, the determination order information may be obtained for each specific data unit including an integer number of processing blocks.

[0204] According to an embodiment, the image decoding apparatus 100 may determine one or more reference coding units based on the determined order.

[0205] According to an embodiment, the receiver 110 may obtain the determination order information of the reference coding unit from the bitstream as the information related to the processing blocks 1602 and 1612, and the image decoding apparatus 100 may determine the determination order of one or more reference coding units included in the processing blocks 1602 and 1612, and determine one or more reference coding units included in the picture 1600 based on the determination order. Fig.16 , the image decoding apparatus 100 may respectively determine determination orders 1604 and 1614 of one or more reference coding units in the processing blocks 1602 and 1612. For example, when determination order information of the reference coding units is obtained for each processing block, different types of determination order information of the reference coding units may be obtained for the processing blocks 1602 and 1612. When the determination order 1604 of the reference coding units in the processing block 1602 is a raster scan order, the reference coding units included in the processing block 1602 may be determined according to the raster scan order. On the contrary, when the determination order 1614 of the reference coding units in another processing block 1612 is a backward raster scan order, the reference coding units included in the processing block 1612 may be determined according to the backward raster scan order.

[0206] According to an embodiment, the image decoding apparatus 100 may decode the determined one or more reference coding units. The image decoding apparatus 100 may decode the image based on the reference coding units determined as described above. The method of decoding the reference coding units may include various image decoding methods.

[0207] According to an embodiment, the image decoding device 100 may obtain block shape information indicating the shape of the current coding unit or division shape pattern information indicating the division method of the current coding unit from the bitstream, and may use the obtained information. The division shape pattern information may be included in the bitstream related to various data units. For example, the image decoding device 100 may use the division shape pattern information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, or a slice segment header. In addition, the image decoding device 100 may obtain a syntax corresponding to the block shape information or the division shape pattern information from the bitstream according to each CTU, each reference coding unit, or each processing block, and may use the obtained syntax.

[0208] Hereinafter, a method for determining a division rule according to an embodiment of the present disclosure is described in detail.

[0209] The image decoding apparatus 100 may determine a division rule of an image. The division rule may be predetermined between the image decoding apparatus 100 and the image encoding apparatus 2800. The image decoding apparatus 100 may determine a division rule of an image based on information obtained from a bitstream. The image decoding apparatus 100 may determine a division rule based on information obtained from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. The image decoding apparatus 100 may determine a division rule differently according to a frame, a slice, a temporal layer, a CTU, or a coding unit.

[0210] The image decoding device 100 may determine the division rule based on the block shape of the coding unit. The block shape may include the size, shape, aspect ratio, and direction of the coding unit. The image encoding device 2800 and the image decoding device 100 may determine the division rule based on the block shape of the coding unit. However, it is not limited to this. The image decoding device 100 may determine the division rule based on information obtained from the bit stream received from the image encoding device 2800.

[0211] The shape of the coding unit may include a square and a non-square. When the width and height of the coding unit are the same as each other, the image decoding apparatus 100 may determine the shape of the coding unit as a square. In addition, when the width and height of the coding unit are different from each other, the image decoding apparatus 100 may determine the shape of the coding unit as a non-square.

[0212] The size of the coding unit may include various sizes, including 4×4, 8×4, 4×8, 16×4, 16×8, ..., and 256×256. The size of the coding unit may be divided according to the length of the long side, the length of the short side, or the area of ​​the coding unit. The image decoding apparatus 100 may apply the same division rule to the coding units divided into the same group. For example, the image decoding apparatus 100 may divide the coding units having the same length of long sides into the same size. In addition, the image decoding apparatus 100 may apply the same division rule to the coding units having the same length of long sides.

[0213] The aspect ratio of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, or 1:32. In addition, the direction of the coding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate a case where the width of the coding unit is greater than the height of the coding unit. The vertical direction may indicate a case where the width of the coding unit is less than the height of the coding unit.

[0214] The image decoding apparatus 100 may adaptively determine the division rule based on the size of the coding unit. The image decoding apparatus 100 may determine the allowable division shape mode differently based on the size of the coding unit. For example, the image decoding apparatus 100 may determine whether to allow division based on the size of the coding unit. The image decoding apparatus 100 may determine the division direction according to the size of the coding unit. The image decoding apparatus 100 may determine the allowable division type according to the size of the coding unit.

[0215] Determining the division rule based on the size of the coding unit may be a division rule predetermined between the image encoding apparatus 2800 and the image decoding apparatus 100. In addition, the image decoding apparatus 100 may determine the division rule based on information obtained from a bitstream.

[0216] The image decoding apparatus 100 may adaptively determine a split rule based on a location of a coding unit. The image decoding apparatus 100 may adaptively determine a split rule based on a location in an image where a coding unit is located.

[0217] In addition, the image decoding apparatus 100 may determine a division rule so that the coding units generated by using different division methods do not have the same block shape. However, it is not limited thereto, and the coding units generated by using different division methods may have the same block shape. The coding units generated by using different division methods may have different decoding process orders. Fig.12 The decoding process order is described, and therefore, a detailed description thereof is omitted.

[0218] Reference Figures 17 to 28 A method of determining a coding order of a current block and a method of applying an AMVR mode according to the coding order are described.

[0219] Fig.17 A video decoding apparatus 1700 for dividing a current block and decoding the divided lower layer blocks according to an embodiment is shown.

[0220] The video decoding apparatus 1700 may include a processor 1710 and a memory 1720. Fig.17 , the processor 1710 and the memory 1720 are shown as components located in one device. However, the processor 1710 and the memory 1720 do not necessarily have to be physically adjacent to each other. Therefore, according to an embodiment, the processor 1710 and the memory 1720 may be separated from each other. Fig.17 The processor 1710 is shown to be a single component. However, according to an embodiment, a plurality of processors may be included in the video decoding apparatus 1700.

[0221] Depend on Fig.17 The functions performed by the processor 1710 in Figure 1 The decoder 120 in is executed.

[0222] The processor 1710 may obtain partition information indicating whether to partition the current block. The partition information indicates whether to partition the current block into two or more smaller blocks. In addition, when the partition information indicates to partition the current block, the processor 1710 partitions the current block into two or more lower layer blocks.

[0223] The current block may be divided into various shapes according to the shape of the current block. For example, when the current block has a square shape, the current block may be divided into four deeper square blocks according to the division information.

[0224] When the shape of the current block allows two or more division methods, the processor 1710 may select a division method according to the division shape information. Therefore, when the division information indicates that the current block is to be divided, the processor 1710 may obtain the division shape information indicating the division method of the current block. In addition, the processor 1710 may divide the current block according to the division method indicated by the division shape information.

[0225] For example, when the current block has a square shape and a size of 2N×2N, the partition shape information may indicate a partition method applied to the current block among N×N partition, N×2N partition, 2N×N partition, vertical non-uniform three-partition, and horizontal non-uniform three-partition. N×N partition is a method of partitioning the current block into four N×N-sized blocks. N×2N partition is a method of partitioning the current block into N×2N-sized blocks. 2N×N partition is a method of partitioning the current block into 2N×N-sized blocks. Vertical non-uniform three-partition refers to a method of partitioning a 2N×2N-sized block into three blocks having the same width and a height ratio of 1:2:1. Horizontal non-uniform three-partition refers to a method of partitioning a 2N×2N-sized block into three blocks having the same height and a width ratio of 1:2:1. In addition, the current block may be partitioned by one of various horizontal partitioning methods or vertical partitioning methods.

[0226] When the current block size is N×2N and is a rectangle with a longer length in the vertical direction, the partition shape information may indicate a partition method applied to the current block from among N×N partition and vertical non-uniform three-partition. N×N partition is a method of partitioning the current block into two N×N-sized blocks. Vertical non-uniform three-partition refers to a method of partitioning a N×2N-sized block into three blocks with the same width and a height ratio of 1:2:1. In addition, the current block may be partitioned by one of various horizontal partitioning methods or vertical partitioning methods.

[0227] When the current block size is 2N×N and is a rectangle with a long length in the horizontal direction, the partition shape information may indicate a partition method applied to the current block from among N×N partition and horizontal non-uniform three-partition. N×N partition is a method of partitioning the current block into two N×N-sized blocks. Horizontal non-uniform three-partition refers to a method of partitioning a 2N×N-sized block into three blocks with the same height and a width ratio of 1:2:1. In addition, the current block may be partitioned by one of various horizontal partitioning methods or vertical partitioning methods.

[0228] In addition to the above-mentioned division methods, a method of dividing the current block by using an asymmetric ratio, a method of dividing the current block into triangles, a method of dividing the current block into other geometric shapes, etc. can also be used as a method of dividing the current block having a size of a square and a rectangle.

[0229] When the partition information does not indicate partitioning of the current block, the processor 1710 does not partition the current block. In addition, the processor 1710 decodes the current block.

[0230] When the current block is a coding unit, the processor 1710 determines the current block as a final coding unit. The final coding unit is not further divided into deeper coding units. According to an embodiment, the processor 1710 may divide the current block as the final coding unit into data units other than the coding unit.

[0231] According to an embodiment, the processor 1710 may divide the current block into one or more prediction units according to the hierarchical tree structure. Similarly, the processor 1710 may divide the current block into one or more transformation units according to the hierarchical tree structure. In addition, the processor 1710 may reconstruct the current block according to the prediction result for the prediction unit and the transformation result for the transformation unit.

[0232] When the current block is a prediction unit, the processor 1710 may perform prediction on the current block. In addition, when the current block is a transform unit, the processor 1710 may obtain residual data by dequantizing and inverse transforming quantized transform coefficients for the current block.

[0233] The processor 1710 obtains coding order information indicating a coding order of the lower layer blocks. In addition, the processor 1710 may determine a decoding order of the lower layer blocks according to the obtained coding order information.

[0234] The coding order information indicates a coding order of two or more lower layer blocks included in the current block. The data amount of the coding order information is determined according to the number of lower layer blocks and a method of determining the coding order.

[0235] For example, when there are two lower layer blocks, the encoding order information may be determined to indicate a lower layer block that is encoded earlier of the two lower layer blocks. Therefore, the encoding order information may have a form of a flag of a 1-bit data amount.

[0236] However, when there are four lower-layer blocks, the number of cases of the coding order of the lower-layer blocks is 4! = 24. Therefore, in order to indicate 24 coding orders, a 5-bit data amount is required. That is, as the number of lower-layer blocks increases, the number of cases of the coding order increases. Therefore, in order to reduce the data amount of the coding order information, a coding order determination method can be used to determine the coding order by determining whether to swap the coding order of some lower-layer block pairs for a predetermined basic coding order. The coding order information indicating whether the coding order of the lower-layer block pairs is swapped indicates whether the coding order is in the positive direction or the reverse direction relative to the basic coding order.

[0237] The current picture including the current block is encoded and decoded according to the basic coding order. All blocks and pixels encoded and decoded in the current picture are encoded and decoded at the same level according to the basic coding order. Therefore, the lower layer blocks of the same level divided from the current block are also encoded and decoded according to the basic coding order. An embodiment of the basic coding order will be described below. Figures 18a to 18cis shown in .

[0238] Therefore, when the lower layer block pair is encoded according to the basic coding order, the lower layer block pair is said to be encoded in the forward direction. Conversely, when the lower layer block pair is encoded in the reverse order of the basic coding order, the lower layer block pair is said to be encoded in the reverse direction.

[0239] For example, when two lower layer blocks are adjacent to each other in the horizontal direction and are encoded in the forward direction, the coding order information may be determined so that the left lower layer block is decoded earlier. Conversely, when two lower layer blocks adjacent to each other in the horizontal direction are encoded in the reverse direction, the coding order information may be determined so that the right lower layer block is decoded earlier.

[0240] Likewise, when two lower layer blocks are adjacent to each other in the vertical direction and are encoded in the forward direction, the coding order information may be determined so that the upper lower layer block is decoded earlier. Conversely, when two lower layer blocks adjacent to each other in the vertical direction are encoded in the reverse direction, the coding order information may be determined so that the lower lower layer block is decoded earlier.

[0241] When the coding order information indicates only the coding order of the lower layer block pair, the coding order information has a data amount of 1 bit. The coding order information having a data amount of 1 bit may be defined as a coding order flag.

[0242] The processor 1710 may obtain the coding order information from the bitstream. In the bitstream, the coding order information may be located after the partition information.

[0243] The processor 1710 may determine the coding order information based on the surrounding environment of the current block. The coding order information may be determined based on whether the surrounding blocks adjacent to the current block are encoded. For example, the processor 1710 may determine a lower layer block that has more adjacent surrounding blocks than other lower layer blocks that will be decoded earlier.

[0244] For processor 1710, Figures 18a to 18c A basic encoding sequence according to an embodiment is described. Figures 18a to 18c The basic encoding order is a zigzag encoding order. According to the zigzag encoding order, data units are encoded from the left direction to the right direction, and after all data units in the current row are encoded, data units included in the row below the current row are encoded from the left direction to the right direction. The above zigzag encoding order is called a raster scanning order.

[0245] Fig.18aThe coding order of CTUs included in the current picture 1800 according to the zigzag coding order is shown. Indexes 0 to 15 are set for the CTUs according to the zigzag coding order. The CTUs in the first row are first encoded from the left direction to the right direction, and then the CTUs in the second row are encoded from the left direction to the right direction, wherein the indexes of the CTUs in the first row are set to 0 to 3 according to the zigzag coding order, and the indexes of the CTUs in the second row are set to 4 to 7. The CTUs are also intra-encoded according to the zigzag coding order.

[0246] Fig.18b The coding order of the CTU 1810 of the sixth index in the CTU included in the current picture 1800 is shown. For the coding unit with the final depth for which the division has been completed, indexes 0 to 15 are set according to the zigzag coding order. The zigzag coding order is applied to data units of the same depth. In addition, the coding unit of the next order with a depth of n is not encoded until all deeper coding units of the coding unit with a depth of n are encoded. For example, the coding unit with an index of 15 is not encoded until all coding units with indexes of 5 to 14 are encoded. The coding units are also internally encoded according to the zigzag coding order.

[0247] Fig.18c Reference samples referenced by the sixth-indexed coding unit 1824 in the coding units included in the CTU 1810 are shown. Around the coding unit 1824 with the sixth index currently being encoded, only the coding unit 1812 with the zeroth index and the coding unit 1822 with the fifth index are reconstructed, respectively. Therefore, only the pixel 1850 of the coding unit 1812 and the pixel 1860 of the coding unit 1822 can be used as reference samples for the coding unit 1824.

[0248] Figures 18a to 18c The zigzag coding order can be applied in different directions according to the data unit. For example, the zigzag coding order can be changed to encode the data units in the same row from the right direction to the left direction. In addition, the zigzag coding order can be changed so that the data units in the previous row for the current row are encoded after all the data units in the current row are encoded. In addition, the zigzag coding order can be changed so that the data units in the same column are encoded from the top direction to the bottom direction, and the data units in the right column for the current column are encoded after all the data units in the current column are encoded.

[0249] For processor 1710, Fig.19a and Fig.19b The case 1900 in which the coding unit 1910 is encoded in the forward direction and the case 1902 in which the coding unit 1920 is encoded in the reverse direction are respectively shown. Fig.19a and Fig.19b Advantages gained by changing the encoding order.

[0250] Fig.19a The coding unit 1910 and Fig.19b The coding unit 1920 is predicted in the upper right direction according to the intra mode. Fig.19a and Fig.19b The solid line 1930 is a pixel arranged in a straight line form in the original image and having a constant value. Therefore, when the current coding unit is predicted along the direction of the solid line 1930, the prediction accuracy of the coding units 1910 and 1920 can be improved.

[0251] In the case 1900 where the coding unit 1910 is encoded in the forward direction, the left coding unit, the upper coding unit, and the upper right coding unit for the current coding unit 1910 are reconstructed earlier than the current coding unit 1910. Therefore, the current coding unit 1910 refers to the pixels or encoding information of the left coding unit, the upper coding unit, and the upper right coding unit. For example, a pixel 1916 located at the lower edge of the upper right coding unit is used to predict the current coding unit 1910. The pixel 1916 is spatially separated from the current coding unit 1910, so the prediction accuracy of a portion 1914 of the current coding unit 1910 may be low.

[0252] However, in case 1902 that the current coding unit 1910 is encoded in the reverse direction, the right coding unit, the upper coding unit, and the upper left coding unit for the current coding unit 1910 are reconstructed earlier than the current coding unit 1920, and therefore, in intra prediction, a pixel 1926 located at the left edge of the right coding unit may be used to predict the current coding unit 1920. The pixel 1926 is adjacent to the current coding unit 1920, and therefore the prediction accuracy for a portion 1924 of the current coding unit 1920 may be higher than the prediction accuracy for a portion 1914 of the current coding unit 1910.

[0253] If targeted Fig.19a and Fig.19b As described in the embodiment of intra-frame prediction, for inter-frame prediction, there are many cases where the prediction accuracy can be improved by obtaining encoding information from blocks located in the opposite direction. When the current coding unit and the right coding unit of the current coding unit are coding units for the same object, the current coding unit and the right coding unit may have similar motion information. Therefore, the motion information of the current coding unit can be derived from the motion information of the right coding unit to improve the encoding efficiency.

[0254] Therefore, the encoding order may be determined by comparing the encoding efficiency of a case where the current coding unit is encoded in a forward direction with the encoding efficiency of a case where the current coding unit is encoded in a reverse direction, thereby improving the encoding efficiency of the image.

[0255] The coding order information may be set to be the same as the coding order information of the upper layer block applied to the current block. For example, when the current block is a prediction unit or a transformation unit, the processor 1710 may apply the coding order information applied to the coding unit including the current block to the current block. As another example, when the current block is a coding unit, the processor 1710 may apply the coding order information applied to the coding unit having a depth lower than the current block to the current block.

[0256] When there are two or more coding order flags for the current block, the processor 1710 may obtain only one coding order flag from the bitstream and determine the remaining coding order flags to be synchronized with the coding order flag obtained from the bitstream.

[0257] Regarding determining the encoding order via processor 1710, Fig. 20 A CTU and a tree structure of the CTU are shown, wherein the tree structure of the CTU is used to describe the encoding order of coding units included in the CTU.

[0258] The CTU 2050 is divided into a plurality of coding units 2056, 2058, 2060, 2062, 2068, 2070, 2072, 2074, 2080, 2082, 2084, and 2086. The CTU 2050 corresponds to the highest node 2000 of the tree structure. In addition, the plurality of coding units 2056, 2058, 2060, 2062, 2068, 2070, 2072, 2074, 2080, 2082, 2084, and 2086 correspond to the plurality of nodes 2006, 2008, 2010, 2012, 2018, 2020, 2022, 2024, 2030, 2032, 2034, and 2036, respectively. The upper coding order flags 2002 , 2014 , and 2026 indicating the coding order of the tree structure correspond to arrows 2052 , 2064 , and 2076 , and the lower coding order flags 2004 , 2016 , and 2028 correspond to arrows 2054 , 2066 , and 2078 .

[0259] The upper coding order flag indicates the coding order of the two coding units located at the top of the four coding units with the same depth. When the upper coding order flag is 0, encoding is performed in the forward direction. On the contrary, when the upper coding order flag is 1, encoding is performed in the reverse direction.

[0260] Similarly, the lower coding order flag indicates the coding order of the two coding units located at the bottom of the four coding units with the same depth. When the lower coding order flag is 0, encoding is performed in the forward direction. On the contrary, when the lower coding order flag is 1, encoding is performed in the reverse direction.

[0261] For example, because the upper coding order flag 2014 is 0, the coding order between coding units 2068 and 2070 is determined to be in the positive direction, that is, from the left position to the right position. In addition, because the lower coding order flag 2016 is 1, the coding order between coding units 2072 and 2074 is determined to be in the reverse direction, that is, from the right position to the left position.

[0262] According to an embodiment, the upper coding order flag and the lower coding order flag may be set to have the same value. For example, when the upper coding order flag 2002 is determined to be 1, the lower coding order flag 2004 corresponding to the upper coding order flag 2002 may also be determined to be 1. Since the upper coding order flag and the lower coding order flag are determined to have a value of 1 bit, the data amount of the coding order information is reduced.

[0263] According to an embodiment, the upper coding order flag and the lower coding order flag of the current coding unit may be determined by referring to at least one of the upper coding order flag and the lower coding order flag applied to the coding unit having a depth lower than the depth of the current coding unit. For example, the upper coding order flag 2026 and the lower coding order flag 2028 applied to the coding units 2080, 2082, 2084, and 2086 may be determined based on the lower coding order flag 2016 applied to the coding units 2072 and 2074. Therefore, the upper coding order flag 2026 and the lower coding order flag 2028 may be determined to have the same value as the lower coding order flag 2016. Since the values ​​of the upper coding order flag and the lower coding order flag are determined based on the upper coding unit of the current coding unit, the coding order information is not obtained from the bitstream. Therefore, the amount of data of the coding order information is reduced.

[0264] Regarding determining the encoding order via processor 1710, Fig.21a and Figure 21b It is described how to change the encoding order of three or more blocks arranged in the vertical direction or the horizontal direction according to the encoding order flag.

[0265] Fig.21a An embodiment of the present invention relates to a method of exchanging a coding order based on a coding order flag only when the coding orders of coding units that are spatially adjacent to each other are adjacent.

[0266] The coding unit 2100 is divided into three coding units 2110, 2120, and 2130. When the basic coding order is from the left position to the right position, encoding is performed in the order of the coding unit 2110, the coding unit 2120, and the coding unit 2130. However, the coding order may be changed according to the coding order flag 2140 or 2150.

[0267] The coding order flag 2140 indicates the coding order of the coding unit 2110 and the coding unit 2120. When the coding order flag 2140 is 0, the coding order of the coding unit 2110 and the coding unit 2120 is determined to be in the forward direction. Therefore, the coding unit 2110 is encoded earlier than the coding unit 2120. However, when the coding order flag 2140 is 1, the coding order of the coding unit 2110 and the coding unit 2120 is determined to be in the reverse direction, and therefore, the coding unit 2120 is encoded earlier than the coding unit 2110.

[0268] The coding order flag 2150 indicates the coding order of the coding unit 2120 and the coding unit 2130. When the coding order flag 2140 indicates the forward direction, the coding order flag 2150 is obtained. When the coding order flag 2140 indicates the reverse direction, the coding order of the coding unit 2120 and the coding unit 2130 is not adjacent, and therefore, the coding order flag 2150 is not obtained. When the coding order flag 2150 is 0, the coding order of the coding unit 2120 and the coding unit 2130 is determined to be the forward direction. Therefore, the coding unit 2120 is encoded earlier than the coding unit 2130. However, when the coding order flag 2150 is 1, the coding order of the coding unit 2120 and the coding unit 2130 is determined to be the reverse direction, and therefore, the coding unit 2130 is encoded earlier than the coding unit 2120.

[0269] according to Fig.21a In the embodiment of the present invention, there are three cases of the coding order of the three coding units. Therefore, in order to determine the coding order, one or two coding order flags are used.

[0270] Figure 21b An embodiment of the invention relates to a method for determining a coding order based on a coding order flag 2160, which indicates the direction of the coding order applied to three coding units.

[0271] The coding order flag 2160 indicates whether the coding order is in the forward direction or the reverse direction. For example, when the coding order flag 2160 is 0, the coding order of the coding units 2110, 2120, and 2130 may be determined as the forward direction. Therefore, when the coding order flag 2160 is 0, the coding may be performed in the order of the coding units 2110, 2120, and 2130.

[0272] On the contrary, when the coding order flag 2160 is 1, the coding order of the coding units 2110, 2120, and 2130 may be determined as the reverse direction. Therefore, when the coding order flag 2160 is 1, encoding may be performed in the order of the coding unit 2130, the coding unit 2120, and the coding unit 2110.

[0273] according to Figure 21b In the embodiment of the present invention, there are two cases of the coding order of the three coding units. Therefore, in order to determine the coding order, a coding order flag is used.

[0274] exist Fig.21a and Figure 21b The method for determining the encoding order used in the embodiment of the present invention can be applied to four or more encoding units.

[0275] The processor 1710 may identify the coding order change permission information for the upper layer data unit of the current block. The coding order change permission information indicates whether the coding order for the blocks included in the upper layer data unit of the current block is allowed to be changed. When the coding order change permission information does not allow the coding order to be changed, all blocks of the upper layer data unit are encoded according to the basic coding order. When the coding order change permission information indicates that the coding order information for the current block is encoded, the processor 1710 may obtain the coding order information.

[0276] The coding order change enable information may be included in a video parameter set, a sequence parameter set, a picture parameter set, a slice segment header, a CTU header, etc. In addition, when there are two or more types of coding order information, the coding order change enable information for the two or more types of coding order information may be divided and stored in different headers.

[0277] The coding order change permission information may indicate a depth or a block size to which the coding order information is provided. For example, the processor 1710 may obtain the coding order information only when the depth of the current block is included in the depth indicated by the coding order change permission information. As another example, the processor 1710 may obtain the coding order information only when the block size of the current block corresponds to the block size indicated by the coding order change permission information.

[0278] When the split information indicates that the current block is not split, the processor 1710 may determine a method of predicting the current block according to encoding information of the current block and whether peripheral blocks of the current block are decoded.

[0279] The encoding information of the current block may indicate how to predict the current block. In detail, the encoding information may indicate a prediction method among a plurality of intra prediction modes and a plurality of inter prediction modes. In detail, the AMVR mode may be included in the current block. Therefore, the processor 1710 may determine the prediction mode applied to the current block according to the encoding information of the current block.

[0280] The AMVR mode is a coding mode that determines the motion vector resolution (MVR) of the current block based on the relevant information of the current block. The MVR indicates the minimum unit of the motion vector. The differential motion vector is compressed according to the MVR, so the coding efficiency of the differential motion vector information indicating the differential motion vector can be improved.

[0281] The MVR can be determined regardless of the relevant information of the current block. However, when the MVR is determined according to the relevant information of the current block according to the AMVR mode, the encoding and decoding of the information about the MVR are omitted, and thus the encoding efficiency and decoding efficiency of the image can be improved. In addition, in the AMVR mode, when it is possible to change the encoding order of the current block, the MVR can be determined according to the encoding order of the current block and whether the neighboring blocks of the current block are encoded.

[0282] The processor 1710 may determine the prediction mode of the current block as an inter mode or an intra mode. In addition, when the prediction mode of the current block is an inter mode, the processor 1710 may obtain information about a motion vector of the current block. In addition, the processor 1710 may determine whether to apply the AMVR mode to the current block. Whether to apply the AMVR mode to the current block may be determined according to an AMVR mode flag obtained from a bitstream.

[0283] The processor 1710 may obtain predicted motion vector information indicating a predicted motion vector of the current block and differential motion vector information indicating a differential motion vector of the current block from a bitstream. When the AMVR mode is applied to the current block, the processor 1710 may additionally determine an MVR of the current block.

[0284] The processor 1710 may determine a predicted motion vector of the current block and an MVR of the current block according to whether a neighboring block of the current block is decoded and predicted motion vector information.

[0285] The processor 1710 may determine the predicted motion vector of the current block according to the coding order information of the current block, whether the neighboring blocks of the current block are decoded, and the predicted motion vector information of the current block. In addition, the processor 1710 may determine the MVR of the current block according to the coding order information of the current block and whether the neighboring blocks of the current block are decoded. The predicted motion vector information may indicate the type of predicted motion vector candidates, the number of predicted motion vector candidates, and the priority order of the predicted motion vectors.

[0286] The processor 1710 may obtain MVR information indicating the MVR of the current block. The MVR information may indicate the type of MVR, the number of MVRs, and the priority order of the MVRs. The processor 1710 may determine the MVR of the current block according to whether the neighboring blocks of the current block are decoded and the MVR information.

[0287] The processor 1710 may entropy decode the MVR information according to a context determined based on at least one of the size of the current block, the encoding order of the current block, the encoding mode of the current block, the size of the peripheral blocks, the encoding order of the peripheral blocks, and the encoding mode of the peripheral blocks.

[0288] The processor 1710 may determine MVR candidates available for the current block according to whether neighboring blocks of the current block are decoded. The processor 1710 may determine the MVR of the current block from the MVR candidates according to the MVR information.

[0289] The processor 1710 may determine a prediction motion vector candidate of the current block according to whether a neighboring block of the current block is decoded. In addition, the processor 1710 may determine a prediction motion vector of the current block from prediction motion vector candidates according to prediction motion vector information.

[0290] In addition, the processor 1710 may determine a predicted motion vector candidate and an MVR candidate corresponding to the predicted motion vector candidate according to whether a neighboring block of the current block is decoded. In addition, the processor 1710 may determine an MVR candidate corresponding to the predicted motion vector candidate indicated by the predicted motion vector information as the MVR of the current block.

[0291] The processor 1710 may determine the predicted motion vector of the current block according to the size of the current block, whether the neighboring blocks of the current block are decoded, and the predicted motion vector information. The processor 1710 may determine the MVR of the current block according to the size of the current block and whether the neighboring blocks of the current block are decoded.

[0292] The processor 1710 determines the differential motion vector of the current block according to the differential motion vector information. The processor 1710 may determine the motion vector of the current block according to the predicted motion vector, the MVR, and the differential motion vector.

[0293] The processor 1710 may correct the predicted motion vector and the differential motion vector according to the MVR. In detail, the processor 1710 may determine a scaling constant based on the difference between the MVR and the minimum resolution available for the current block. In addition, the processor 1710 may correct the predicted motion vector and the differential motion vector according to the scaling constant.

[0294] The scaling constant may be determined as a binary logarithm of a value obtained by dividing the MVR by the minimum resolution. For example, when the MVR is 1 pixel unit and the minimum resolution is 1 / 4 pixel unit, the MVR may be four times the minimum resolution. Therefore, the scaling constant may be determined as 2.

[0295] According to the following equations 1 and 2, a method of correcting a predicted motion vector (MVP) is described. >> indicates a right shift calculation, and << indicates a left shift calculation. In addition, k indicates a scaling constant, wherein the scaling constant indicates a difference between an MVR and a minimum resolution. According to equation 1, the MVP may be rounded down according to the scaling constant. In addition, according to equation 2, the MVP may be rounded up according to the scaling constant.

[0296] [Equation 1]

[0297] MVP=(MVP>>k)< <k

[0298] [Equation 2]

[0299] MVP=((MVP+(1<<(k-1)))>>k)

[0300] According to the following equations 3 and 4, a method of encoding a differential motion vector (MVD) via an encoding end is described. According to equation 3, the MVD is shifted to the right according to a scaling constant. In addition, according to equation 4, the MVD is rounded according to the scaling constant and then shifted to the right.

[0301] [Equation 3]

[0302] MVD=MVD>>k

[0303] [Equation 4]

[0304] MVD=(MVD+(1<<(k-1)))>>k

[0305] A method of decoding the MVD performed by the decoding end is described according to the following Equation 5. According to Equation 5, the MVD transmitted by the encoding end is shifted to the left according to a scaling constant.

[0306] [Equation 5]

[0307] MVD=MVD< <k

[0308] Based on Equations 3 to 5, the encoder compresses the MVD according to the MVR, and the decoder reconstructs the compressed MVD according to the MVR.

[0309] The processor 1710 may determine a motion vector of the current block based on the corrected MVP and MVD. In addition, the processor 1710 may reconstruct the current block according to the motion vector of the current block.

[0310] The processor 1710 may obtain MVR determination method information indicating a method for determining an MVR applied to a block in an upper layer data unit included in the current block. For example, the processor 1710 may determine whether to obtain MVR information according to the MVR determination method information, whether to determine MVR according to MVP information, whether to determine MVR according to a coding order and a block size of the current block, whether to determine MVR according to whether neighboring blocks of the current block are coded, etc. In addition, the processor 1710 may determine the MVR of the current block according to the MVR determination method indicated by the MVR determination method information.

[0311] In the following, Fig. 22 Shown is the MVR in AMVR mode.

[0312] The motion vector according to the first MVR 2210 is determined as a 1 / 4 pixel unit. The current block can be accurately predicted using the 1 / 4 pixel unit according to the motion vector according to the first MVR 2210. However, according to the first MVR 2210, since the MVD is encoded as a 1 / 4 pixel unit, the amount of MVD information indicating the MVD increases. Therefore, according to the first MVR 2210, although the prediction accuracy of the current block is high, the encoding efficiency is low.

[0313] The motion vector according to the second MVR 2220 is determined as a 1 / 2 pixel unit. In addition, the motion vector according to the third MVR 2230 is determined as a 1 pixel unit. Therefore, the second MVR 2220 has a lower prediction accuracy of the current block than the first MVR 2210, but has a higher encoding efficiency than the first MVR 2210. Likewise, the third MVR 2230 has a lower prediction accuracy of the current block than the first MVR 2210 and the second MVR 2220, but has a higher encoding efficiency than the first MVR 2210 and the second MVR 2220.

[0314] The motion vector according to the fourth MVR 2240 is determined as a 2-pixel unit. According to the fourth MVR 2240, the prediction accuracy of the current block is lower than the prediction accuracy of the current block of the first MVR 2210 to the third MVR 2230. However, the encoding efficiency of the current block is higher than the encoding efficiency of the current block of the first MVR 2210 to the third MVR 2230.

[0315] Despite Fig. 22 Although not shown in the figure, an MVR of 1 / 16 units, an MVR of 1 / 8 units, an MVR of 4 units, an MVR of 8 units, etc. may be used in the AMVR mode. The accuracy of the motion vector required according to the characteristics of the current block and the surrounding environment in the AMVR mode may be determined. Fig. 22 One of the multiple MVRs described in .

[0316] Fig.23 A method of determining an MVR of a current block according to positions of neighboring blocks of the current block, the neighboring blocks being referenced by the current block, is described.

[0317] The processor 1710 may determine an MVR candidate corresponding to the MVP candidate according to whether a neighboring block of the current block is decoded. According to an embodiment, when determining the MVP from the MVP candidates, the MVR corresponding to the MVP may be applied to the current block according to the MVP information.

[0318] When the left neighboring block and the right neighboring block of the current block 2300 are not decoded, the processor 1710 may refer to only the upper left block, the upper block, and the upper right block for the current block 2300. Here, the neighboring blocks located at the second position 2306, the fifth position 2312, the third position 2308, the fourth position 2310, and the twelfth position 2326 may be sequentially determined as reference blocks of the current block 2300. Each reference block corresponds to each MVR candidate. For example, the MVR candidate corresponding to the reference block at the second position 2306 may be determined as a 1 / 4 pixel unit. In addition, the MVR candidate corresponding to the reference block at the fifth position 2312 may be determined as a 1 / 2 pixel unit. The MVR candidate corresponding to the reference block at the third position 2308 may be determined as a 1 pixel unit. The MVR candidate corresponding to the reference block at the fourth position 2310 may be determined as a 2 pixel unit. The MVR candidate corresponding to the reference block at the twelfth position 2326 may be determined as a 4 pixel unit.

[0319] When the left neighboring block of the current block 2300 is decoded and the right neighboring block of the current block 2300 is not decoded, the processor 1710 may refer to the lower left block, the left block, the upper left block, the upper block, and the upper right block for the current block 2300. Here, the neighboring blocks located at the zeroth position 2302, the second position 2306, the fifth position 2312, the fourth position 2310, and the sixth position 2314 may be sequentially determined as reference blocks of the current block 2300. Each reference block corresponds to each MVR candidate. For example, the MVR candidate corresponding to the reference block at the zeroth position 2302 may be determined as a 1 / 4 pixel unit. In addition, the MVR candidate corresponding to the reference block at the second position 2306 may be determined as a 1 / 2 pixel unit. The MVR candidate corresponding to the reference block at the fifth position 2312 may be determined as a 1 pixel unit. The MVR candidate corresponding to the reference block at the fourth position 2310 may be determined as a 2 pixel unit. The MVR candidate corresponding to the reference block at the sixth position 2314 may be determined as a 4 pixel unit.

[0320] When the right neighboring block of the current block 2300 is decoded and the left neighboring block of the current block 2300 is not decoded, the processor 1710 may refer to the lower right block, the right block, the upper left block, the upper block, and the upper right block for the current block 2300. Here, the neighboring blocks located at the first position 2304, the third position 2308, the fourth position 2310, the fifth position 2312, and the seventh position 2316 may be sequentially determined as reference blocks of the current block 2300. Each reference block corresponds to each MVR candidate. For example, the MVR candidate corresponding to the reference block at the first position 2304 may be determined as a 1 / 4 pixel unit. In addition, the MVR candidate corresponding to the reference block at the third position 2308 may be determined as a 1 / 2 pixel unit. The MVR candidate corresponding to the reference block at the fourth position 2310 may be determined as a 1 pixel unit. The MVR candidate corresponding to the reference block at the fifth position 2312 may be determined as a 2 pixel unit. The MVR candidate corresponding to the reference block at the seventh position 2316 may be determined as a 4 pixel unit.

[0321] When both the left neighboring block and the right neighboring block of the current block 2300 are decoded, the processor 1710 may refer to the lower left block, the left block, the lower right block, the right block, the upper left block, the upper block, and the upper right block for the current block 2300. Here, the neighboring blocks located at the zeroth position 2302, the first position 2304, the second position 2306, the fifth position 2312, and the fourth position 2308 may be sequentially determined as reference blocks of the current block 2300. Each reference block corresponds to each MVR candidate. For example, the MVR candidate corresponding to the reference block at the zeroth position 2302 may be determined as a 1 / 4 pixel unit. In addition, the MVR candidate corresponding to the reference block at the first position 2304 may be determined as a 1 / 2 pixel unit. The MVR candidate corresponding to the reference block at the second position 2306 may be determined as a 1 pixel unit. The MVR candidate corresponding to the reference block at the fifth position 2312 may be determined as a 2 pixel unit. The MVR candidate corresponding to the reference block at the fourth position 2308 may be determined as a 4 pixel unit.

[0322] According to an embodiment, the position of the description referred to may be changed. In addition, according to an embodiment, the number of positions referred to and the order of the positions referred to may be changed. In addition, the order of the positions referred to may be changed by comparing the width and height of the current block. For example, when the width of the current block is greater than the height of the current block, the twelfth position 2326 may be before the tenth position 2322 and the eleventh position 2324. On the contrary, when the height of the current block is greater than the width of the current block, the tenth position 2322 and the eleventh position 2324 may be before the twelfth position 2326.

[0323] In addition, the same MVR candidate may be assigned to multiple reference blocks. Conversely, two or more MVR candidates may be assigned to one reference block. Here, the MVR of the current block may be selected based on the MVR information. Alternatively, the MVR of the current block may be selected based on the size or coding order of the current block.

[0324] According to the described embodiment, when the block at the referenced position is intra-predicted or there is no block at the referenced position, the processor 1710 may determine a predetermined motion vector as a motion vector candidate for the current block. In addition, when one or more motion vector candidates of the current block are repeated, the processor 1710 may remove one or more repeated motion vector candidates, and may determine a motion vector generated by combining previous motion vector candidates as a new motion vector candidate or determine a predetermined motion vector as a new motion vector candidate.

[0325] Fig.24 A method for determining the MVR based on the encoding order is described.

[0326] The MVR may be determined according to the coding order. For example, the MVR when the coding order is determined from the left position to the right position and the MVR when the coding order is determined from the right position to the left position may be determined to be different from each other.

[0327] In the first embodiment 2400, a plurality of blocks are decoded from a left position to a right position. According to the encoding order of the first embodiment 2400, only a specific MVR may be applied to determine a motion vector of a current block. For example, in the first embodiment 2400, the MVR may be determined as one of a 1 / 4 pixel unit and a 1 pixel unit. According to an embodiment, in the first embodiment 2400, at least one of a 1 / 8 pixel unit to an 8 pixel unit may be used as an MVR candidate of the current block.

[0328] In the second embodiment 2410, a plurality of blocks are decoded from a right position to a left position. According to the encoding order of the second embodiment 2410, only a specific MVR may be applied to determine a motion vector of a current block. For example, in the second embodiment 2410, the MVR may be determined as one of a 1 / 2 pixel unit and a 2 pixel unit. According to an embodiment, in the second embodiment 2410, at least one of a 1 / 8 pixel unit to an 8 pixel unit may be used as an MVR candidate of the current block.

[0329] Fig.25 A method of determining the MVR according to a method of dividing blocks is described.

[0330] After the processor 1710 divides the current block, the processor 1710 may determine the MVP candidate and the MVR candidate used in the AMVR mode according to the width and height of the block. For example, the lower layer block 2502 and the lower layer block 2504 generated by vertically dividing the current block 2500 and the lower layer block 2512 and the lower layer block 2514 generated by horizontally dividing the current block 2510 may have different methods of determining MVP candidates and different methods of determining MVR candidates.

[0331] After the processor 1710 divides the current block 2500 or the current block 2510, the processor 1710 may determine: a method of determining an MVP candidate and a method of determining an MVR candidate by comparing the width and height of the lower layer blocks. Therefore, the method of determining an MVP candidate and a method of determining an MVR candidate may be determined in consideration of the substantial shapes of the lower layer blocks 2502, 2504, 2512, and 2514.

[0332] After the processor 1710 vertically divides the current block 2500, the processor 1710 determines: a method of determining an MVP candidate and a method of determining an MVR candidate according to the coding order of the lower layer block 2502 and the lower layer block 2504. According to an embodiment, the method of determining the MVP candidate and the method of determining the MVR candidate may be determined so that the lower layer block 2502 and the lower layer block 2504 do not refer to each other.

[0333] The processor 1710 may determine reference positions of the lower layer blocks 2502 , 2504 , 2512 , and 2514 and MVRs according to the reference positions according to a method of dividing the current block 2500 and the current block 2510 .

[0334] Fig.26 A video decoding method 2600 according to an embodiment is shown, which includes dividing a current block and decoding the divided lower layer blocks.

[0335] In operation 2610, MVP information indicating an MVP of a current block and MVD information indicating an MVD of the current block are obtained from a bitstream.

[0336] In addition, coding order information indicating a coding order of lower layer blocks in an upper layer block including the current block may be obtained. According to the coding order indicated by the coding order information, the lower layer blocks in the upper layer block including the current block may be decoded.

[0337] In addition, MVR determination method information indicating a method of determining an MVR of a block included in an upper layer data unit applied to the current block may be obtained. The MVR of the current block may be determined according to the method of determining the MVR indicated by the MVR determination method information.

[0338] In operation 2620, the MVP of the current block and the MVR of the current block are determined according to whether the neighboring blocks of the current block are decoded and the MVP information. The neighboring blocks of the current block may include right blocks of the current block.

[0339] In addition, the MVP of the current block and the MVR of the current block may be determined according to the encoding order information, whether the neighboring blocks of the current block are decoded, and the MVP information.

[0340] The MVP candidate of the current block may be determined according to whether the neighboring blocks of the current block are decoded. The MVP of the current block may be determined from the MVP candidates according to the MVP information. In addition, the MVR candidate corresponding to the MVP candidate may be determined according to whether the neighboring blocks of the current block are decoded. The MVR candidate corresponding to the MVP candidate indicated by the MVP information may be determined as the MVR of the current block.

[0341] According to an embodiment, MVP information indicating the MVR of the current block may be obtained. In addition, the MVR of the current block may be determined according to whether the neighboring blocks of the current block are decoded and the MVR information. The MVR information may be entropy decoded according to a context determined based on at least one of the size of the current block, the encoding order of the current block, the encoding mode of the current block, the size of the peripheral blocks, the encoding order of the peripheral blocks, and the encoding mode of the peripheral blocks.

[0342] The MVR candidates available for the current block may be determined according to whether the neighboring blocks of the current block are decoded. The MVR of the current block may be determined from the MVR candidates according to the MVR information.

[0343] The MVP of the current block and the MVR of the current block may be determined according to the size of the current block, whether neighboring blocks of the current block are decoded, and the MVP information.

[0344] In operation 2630, an MVD of the current block is determined according to the MVD information.

[0345] In operation 2640, a motion vector of the current block is determined according to the MVP, the MVR, and the MVD.

[0346] According to an embodiment, MVP and MVD are corrected according to MVR, and a motion vector of a current block may be determined based on the corrected MVP and the corrected MVD. In detail, a scaling constant is determined based on a difference between MVR and a minimum resolution available for the current block, and MVP and MVD may be corrected according to the scaling constant.

[0347] In operation 2650, the current block is reconstructed according to the motion vector of the current block.

[0348] The video decoding method 2600 may include Fig.17 The functions of the video decoding device 1700 described in .

[0349] Fig. 27 A video encoding apparatus 2700 for dividing a current block and encoding the divided lower layer blocks according to an embodiment is illustrated.

[0350] The video encoding device 2700 includes a processor 2710 and a memory 2720. Fig. 27 In the embodiment, the processor 2710 and the memory 2720 are shown as components located in one device. However, the processor 2710 and the memory 2720 do not necessarily have to be physically adjacent to each other. Therefore, according to an embodiment, the processor 2710 and the memory 2720 may be separated from each other. Fig. 27 , the processor 2710 is illustrated as a single component. However, according to an embodiment, a plurality of processors may be included in the video encoding apparatus 2700.

[0351] The processor 2710 may divide the current block into two or more lower layer blocks, and may determine whether to divide the current block according to the result of dividing the current block. For example, when the encoding efficiency is good in the case of dividing the current block, the processor 2710 may determine to divide the current block. When the encoding efficiency is good in the case of not dividing the current block, the processor 2710 may determine not to divide the current block.

[0352] The processor 2710 may generate split information indicating whether to split the current block. In addition, the processor 2710 may determine a method of splitting the current block according to encoding efficiency, and generate split shape information indicating a method of splitting the current block.

[0353] The processor 2710 may determine the coding order of the lower layer blocks included in the current block according to the coding efficiency based on the coding order, and may generate coding order information indicating the coding order of the lower layer blocks. The processor 2710 may determine the coding order by comparing the coding efficiency when the current coding unit is encoded in the forward direction and the coding efficiency when the current coding unit is encoded in the reverse direction, thereby improving the coding efficiency of the image.

[0354] When the partitioning of the current block is completed, the processor 2710 may determine a prediction mode for a lower layer block of the current block. The processor 2710 may determine a prediction mode for the lower layer block according to the encoding efficiency of the prediction mode applicable to the lower layer block. The prediction mode applicable to the lower layer block may include an AMVR mode.

[0355] When the current block is not divided, the processor 2710 may determine the best motion vector of the current block. In addition, the processor 2710 may determine the MVP of the current block from the neighboring blocks of the current block. In addition, the processor 2710 may determine the MVR of the current block according to whether the neighboring blocks of the current block are decoded.

[0356] The processor 2710 may determine the MVD of the current block according to the difference between the motion vector of the current block and the MVP and the MVR of the current block.

[0357] The processor 2710 outputs a bitstream including information about encoding of the current block. Therefore, the processor 2710 may output a bitstream including MVP information indicating the MVP of the current block and MVD information indicating the MVD of the current block.

[0358] Fig. 27 The video encoding device 2700 may execute the same Fig.17 The video decoding method performed by the video decoding device 1700 corresponds to the video encoding method.

[0359] Fig.28 A video encoding method 2800 according to an embodiment is shown, which includes dividing a current block and encoding the divided lower layer blocks.

[0360] In operation 2810, a motion vector of a current block is determined.

[0361] In operation 2820, an MVP of the current block is determined from neighboring blocks of the current block.

[0362] In operation 2830, an MVR of the current block is determined according to whether a neighboring block of the current block is encoded.

[0363] In operation 2840, an MVD of the current block is determined according to a difference between the motion vector of the current block and the MVP and an MVR of the current block.

[0364] In operation 2850, a bitstream including MVP information indicating the MVP of the current block and MVD information indicating the MVD of the current block is output.

[0365] The video encoding method 2800 may include Fig. 27 The functions of the video encoding device 2700 described in.

[0366] As above Figures 1 to 28 According to the video encoding method based on the coding unit of the tree structure, the spatial domain image data is encoded for each coding unit having the tree structure, and according to the video decoding method based on the coding unit of the tree structure, each CTU is decoded, so that the spatial domain image data can be reconstructed and the picture and the video as the picture sequence can be reconstructed. The reconstructed video can be reproduced by the reproduction device, can be stored in the storage medium or can be transmitted via the network.

[0367] The embodiments of the present disclosure described in detail can be realized as a program to be executed in a computer, and can be implemented in a general-purpose digital computer for executing the program by using a computer-readable recording medium.

[0368] Although the present disclosure has been described in terms of specific best embodiments, substitutions, modifications, and corrections to the present disclosure will be apparent to those skilled in the art based on the above description. That is, the scope of the claims should be interpreted as including all such substitutions, modifications, and corrections. Therefore, the descriptions in this specification and the accompanying drawings should be interpreted as non-limiting examples.

Claims

1. A video decoding method, include: obtaining, from a bitstream, first coding order information indicating a first coding order between first lower layer coding blocks included in first coding blocks among coding blocks hierarchically divided from an upper layer block; decoding the first lower layer coding block according to the first coding order indicated by the first coding order information, obtaining, from the bitstream, second coding order information indicating a second coding order between second lower layer coding blocks included in second coding blocks among coding blocks hierarchically divided from the upper layer block; and decoding the second lower layer coding block according to the second coding order indicated by the second coding order information, wherein a first coding order between first lower-layer coding blocks included in the first coding block and a second coding order between second lower-layer coding blocks included in the second coding block are determined separately, and the first coding block and the second coding block are included in the same upper-layer block, wherein one of the first coding order and the second coding order is one of a forward direction and a reverse direction, the forward direction is a direction from a left block to a right block in the first lower layer coding block or the second lower layer coding block, and the reverse direction is a direction from a right block to a left block in the first lower layer coding block or the second lower layer coding block, and The decoding of the first lower-layer coding block includes: Obtaining information about a resolution of a motion vector of a current coding block in a first lower layer coding block from a bitstream; Determine a predicted motion vector of the current coding block using a motion vector of a neighboring block among neighboring blocks that can be used for inter-frame prediction of the current coding block based on information about a resolution of the motion vector of the current coding block; and The current coding block is reconstructed by using the predicted motion vector of the current coding block.

2. A video encoding method, include: encoding a first lower layer coding block included in a first coding block among coding blocks hierarchically divided from an upper layer block, and encoding a second lower layer coding block included in a second coding block among coding blocks hierarchically divided from an upper layer block; as well as encoding first coding order information indicating a first coding order between first lower layer coding blocks included in the upper layer block and second coding order information indicating a second coding order between second lower layer coding blocks included in the upper layer block, wherein a first coding order between first lower-layer coding blocks included in the first coding block and a second coding order between second lower-layer coding blocks included in the second coding block are determined separately, and the first coding block and the second coding block are included in the same upper-layer block, One of the first coding order and the second coding order is one of a forward direction and a reverse direction, the forward direction is a direction from a left block to a right block in the first lower layer coding block or the second lower layer coding block, and the reverse direction is a direction from a right block to a left block in the first lower layer coding block or the second lower layer coding block, The step of encoding the first lower-layer coding block includes: Determining a motion vector of a current coding block in a first lower layer coding block; Determine a motion vector of a neighboring block among neighboring blocks that can be used to perform inter-frame prediction on the current coding block; Determine a predicted motion vector of the current coding block using the motion vector of the neighboring block; encoding information about a resolution of a motion vector of the current coding block according to neighboring blocks among neighboring blocks that can be used to perform inter-frame prediction on the current coding block; and A bitstream including information about the resolution of the motion vector of the current coding block is output.

3. A method for storing a bit stream in a computer-readable storage medium, wherein the bit stream is generated by the video encoding method according to claim 2.