Method and apparatus for encoding and decoding image

By using a candidate list and sub-block motion vectors to reconstruct the current block during image encoding and decoding, the problems of inaccurate block motion information reconstruction and high computational complexity are solved, achieving more efficient image processing.

CN118741102APending Publication Date: 2024-10-01SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410926297.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-12-21
Filing Date
2019-07-29
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing image encoding and decoding technologies suffer from inaccurate reconstruction and high computational complexity when processing block motion information.

Method used

By identifying a reference block from the candidate list as the motion vector of the current block, the current block is reconstructed using the sample values ​​indicated by the motion vectors of the sub-blocks, and deblocking filtering is performed as necessary to limit the size of the block and reduce computational complexity.

Benefits of technology

It improves the accuracy of image block motion information reconstruction and reduces the complexity of image encoding and decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118741102A_ABST
    Figure CN118741102A_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method and apparatus for encoding and decoding an image. Disclosed according to an embodiment is a method for decoding an image, comprising the steps of: determining, if a size of a current block in the image is at least a preset size, a candidate list including a first reference block indicated by a temporal motion vector as a candidate; if a first reference block is selected from candidates included in the candidate list, determining a motion vector of a sub-block in the current block by using a motion vector obtained from the first reference block; and restoring the current block based on a sample value of the second reference block indicated by the motion vector of the sub-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 July 29, 2019, application number 201980059236.3, and titled “Method and device for encoding an image based on sub-blocks and method and device for decoding an image”. Technical Field

[0002] The present disclosure relates to the field of image encoding and decoding. More specifically, the present disclosure relates to a method and device for encoding an image based on sub-blocks in a block and a method and device for decoding an image based on sub-blocks in a block. Background Art

[0003] In image encoding and decoding, one image may be divided into blocks, and each block may be prediction-encoded and prediction-decoded by using inter-prediction or intra-prediction.

[0004] Inter-frame prediction refers to a method of compressing an image by removing temporal redundancy between images, wherein a representative example of the method is motion estimation coding. In motion estimation coding, a block of a current image is predicted by using at least one reference image. A reference block most similar to the current block can be searched within a specific search range by using a specific evaluation function. The current block is predicted based on the reference block, and a residual block generated by subtracting a prediction block generated as a prediction result from the current block is encoded. In this case, in order to perform prediction more accurately, interpolation may be performed on the reference image to generate pixels in sub-pixel units smaller than integer pixel units, and inter-frame prediction may be performed on the generated pixels in sub-pixel units.

[0005] In codecs such as H.264 Advanced Video Coding (AVC) and High Efficiency Video Coding (HEVC), in order to predict the motion vector of a current block, a motion vector of a previously encoded block adjacent to the current block or a motion vector of a block included in a previously encoded image is used as a predicted motion vector of the current block. A differential motion vector, which is a difference between the predicted motion vector and the motion vector of the current block, is signaled to a decoder using a specific method. Summary of the invention

[0006] Technical issues

[0007] According to an embodiment, there are provided an apparatus and method for decoding an image and an apparatus and method for encoding an image, wherein the apparatus and method can accurately reconstruct motion information of a block in the image.

[0008] According to an embodiment, there are also provided an apparatus and method for decoding an image and an apparatus and method for encoding an image, wherein the apparatus and method can reduce the complexity of image encoding and decoding by limiting the size of a block.

[0009] Solution to the problem

[0010] A method for decoding an image according to an embodiment includes: when a size of a current block in the image is equal to or greater than a specific size, determining a candidate list including a first reference block indicated by a temporal motion vector as a candidate; when a first reference block is selected from candidates included in the candidate list, determining a motion vector of a subblock in the current block by using a motion vector obtained from the first reference block; and reconstructing the current block based on a sample value of a second reference block indicated by the motion vector of the subblock.

[0011] Disclosure of beneficial effects

[0012] The apparatus and method for decoding an image and the apparatus and method for encoding an image according to the embodiments may accurately reconstruct motion information of a block in the image.

[0013] In addition, the apparatus and method for decoding an image and the apparatus and method for encoding an image according to the embodiments can reduce the complexity of image encoding and decoding by limiting the size of a block.

[0014] However, the effects that can be achieved by the apparatus and method for decoding an image and the apparatus and method for encoding an image according to the embodiments are not limited thereto, and other unmentioned effects will be apparent to those of ordinary skill in the art from the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] A brief description of each figure is provided to provide a better understanding of the drawings referenced herein.

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

[0017] Figure 2 is a block diagram of an image encoding apparatus according to an embodiment.

[0018] Figure 3 A process in which the image decoding apparatus according to an embodiment determines at least one coding unit by splitting a current coding unit is illustrated.

[0019] Figure 4 A process in which the image decoding apparatus according to an embodiment determines at least one coding unit by dividing a non-square coding unit is illustrated.

[0020] Figure 5A process in which the image decoding apparatus according to an embodiment divides a coding unit based on at least one of block shape information and division shape pattern information is illustrated.

[0021] Figure 6 A method in which the image decoding apparatus according to an embodiment determines a specific coding unit from among odd-numbered coding units is illustrated.

[0022] 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.

[0023] Figure 8 A process in which an image decoding apparatus determines that a current coding unit is split into an odd number of coding units when coding units cannot be processed in a specific order according to an embodiment is illustrated.

[0024] Fig. 9 A process in which the image decoding apparatus according to an embodiment determines at least one coding unit by splitting a first coding unit is illustrated.

[0025] Fig.10 It is shown that shapes into which the image decoding apparatus may split the second coding unit when the second coding unit determined by splitting the first coding unit satisfies a specific condition according to an embodiment are restricted.

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

[0027] 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.

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

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

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

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

[0032] Fig.17 Illustrations of coding units that may be determined for each picture when a combination of shapes into which a coding unit may be divided is different for each picture according to an embodiment.

[0033] Fig.18 Various shapes of coding units that may be determined based on division shape pattern information that may be represented as a binary code according to an embodiment are illustrated.

[0034] Fig.19 Other shapes of coding units that may be determined based on division shape pattern information that may be represented as a binary code according to an embodiment are illustrated.

[0035] Fig. 20 is a block diagram of an image encoding and decoding system for performing loop filtering.

[0036] Fig.21 is a block diagram showing the configuration of an image decoding device according to an embodiment.

[0037] Fig. 22 is a diagram illustrating a candidate list according to an embodiment.

[0038] Fig.23 is a diagram illustrating a first reference block indicated by a temporal motion vector.

[0039] Fig.24 is a diagram for describing a method of determining a motion vector of a subblock in a current block.

[0040] Fig.25 is a diagram for describing a process of reconstructing a current block.

[0041] Fig.26 is a diagram showing the positions of neighboring blocks adjacent to the current block.

[0042] Fig. 27 is a diagram illustrating positions of neighboring blocks according to the shape of a current block.

[0043] Fig.28 is a diagram for describing a deblocking process according to an embodiment.

[0044] Fig.29 is a flowchart for describing a method of decoding an image according to an embodiment.

[0045] Fig.30 is a block diagram showing the configuration of an image encoding device according to an embodiment.

[0046] Fig.31 is a flowchart for describing a method of encoding an image according to an embodiment.

[0047] Best Mode

[0048] A method for decoding an image according to an embodiment includes: when a size of a current block in the image is equal to or greater than a specific size, determining a candidate list including a first reference block indicated by a temporal motion vector as a candidate; when a first reference block is selected from the candidates included in the candidate list, determining a motion vector of a subblock in the current block by using a motion vector obtained from the first reference block; and reconstructing the current block based on a sample value of a second reference block indicated by the motion vector of the subblock.

[0049] The method may further include obtaining a filtered current block by performing deblocking filtering on sample values ​​of the subblocks based on boundaries between the subblocks in the reconstructed current block.

[0050] The determining of the candidate list may include determining the candidate list when the prediction mode of the current block is a mode in which the motion vector of the current block is determined by using the motion vectors of the candidates included in the candidate list.

[0051] The method may further include determining a motion vector of a neighboring block spatially adjacent to the current block as the temporal motion vector.

[0052] The determining of the temporal motion vector may include determining a predetermined motion vector as the temporal motion vector when the neighboring blocks are unavailable.

[0053] The determining of the temporal motion vector may include determining a predetermined motion vector instead of the motion vector of the neighboring block as the temporal motion vector when the image indicated by the motion vector of the neighboring block is different from a predetermined co-located image.

[0054] The method may further include determining a predetermined motion vector as a temporal motion vector when the current block is a specific block unit.

[0055] When the size of the current block is smaller than the specific size, the method may further include determining the candidate list including blocks other than the first reference block as candidates.

[0056] An index having a minimum value is assigned to a first reference block among candidates included in the candidate list.

[0057] The method may further include determining a motion vector corresponding to a center sample among the samples of the first reference block as the representative motion vector.

[0058] The method may further include: determining a sub-region corresponding to the sub-block in the first reference block; and determining the representative motion vector as a motion vector of a sub-region for which a motion vector cannot be obtained among the sub-regions.

[0059] The determining of the candidate list may include determining the candidate list including blocks other than the first reference block as candidates when there is no motion vector corresponding to a center sample among samples of the first reference block.

[0060] A device for decoding an image according to an embodiment includes: a motion information determiner configured to, when a size of a current block in the image is equal to or larger than a specific size, determine a candidate list including a first reference block indicated by a temporal motion vector as a candidate, and when the first reference block is selected from the candidates included in the candidate list, determine a motion vector of a subblock in the current block by using a motion vector obtained from the first reference block; and a reconstructor configured to reconstruct the current block based on a sample value of a second candidate list, wherein the motion vector of the subblock in the current block is determined by using the motion vector obtained from the first reference block, and the current block is reconstructed based on a sample value of the second reference block indicated by the motion vector of the subblock.

[0061] A method for encoding an image according to an embodiment includes: when a size of a current block in the image is equal to or greater than a specific size, determining a candidate list including a first reference block indicated by a temporal motion vector as a candidate; selecting a candidate for determining a motion vector of the current block from the candidates included in the candidate list; and generating a bitstream including information indicating the selected candidate, wherein the motion vector obtained from the first reference block is used to determine the motion vector of a sub-block in the current block. DETAILED DESCRIPTION

[0062] Since the present disclosure allows various changes and multiple embodiments, specific embodiments will be shown in the drawings and described in detail in the written description. However, this is not intended to limit the present disclosure to a specific mode of practice, and it will be understood that all changes, equivalents and substitutions that do not depart from the spirit and technical scope of the present disclosure are included in the present disclosure.

[0063] In the description of the embodiments, when it is considered that the specific detailed description of the related art may unnecessarily obscure the essence of the present disclosure, the specific detailed description of the related art is omitted. In addition, the numbers (e.g., first and second) used in the description of the specification are only intended to distinguish one component from another component.

[0064] Furthermore, in this specification, when a component is referred to as being “connected” or “coupled” to another component or being “connected” or “coupled” by another component, it should be understood that the component may be directly connected or coupled to the other component, but may be connected or coupled to the other component using an intermediate component between the component and the other component, unless otherwise specified.

[0065] In addition, in this specification, with respect to an element having a suffix such as "unit" or "module", two or more elements may be combined into one element, or one element may be divided into two or more elements according to function. In addition, in addition to its own main function, each element described below may also additionally perform some or all of the functions performed by another element, and some of the main functions of each element may be completely performed by another component.

[0066] Furthermore, the term "image" or "picture" used herein may refer to a still image or a moving image of a video, that is, the video itself.

[0067] In addition, the term "sample" used herein refers to the data assigned to the sampling position of the image and to be processed. For example, the pixel value in the image in the spatial domain and the transform coefficient in the transform domain can be a sample. A unit including one or more samples can be defined as a block.

[0068] Will refer to Figures 1 to 20 An image encoding method and apparatus based on a transformation unit and a coding unit having a tree structure and an image decoding method and apparatus according to an embodiment are described. Figures 1 to 20 The image encoding device 200 and the image decoding device 100 described may respectively include a reference Figures 21 to 31 An image encoding apparatus 2900 and an image decoding apparatus 2100 are described.

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

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

[0071] The bitstream obtainer 110 may receive a bitstream. The bitstream includes information obtained when the image encoding device 200 encodes an image as described below. In addition, the bitstream may be sent from the image encoding device 200. The image encoding device 200 and the image decoding device 100 may be connected to each other by wire or wirelessly, and the bitstream obtainer 110 may receive the bitstream by wire or wirelessly. The bitstream obtainer 110 may receive the bitstream from a storage medium such as an optical medium or a hard disk. 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.

[0072] The operation of the image decoding apparatus 100 will be described in detail. The bitstream obtainer 110 may receive a bitstream.

[0073] The image decoding device 100 may perform an operation of obtaining a binary bit string corresponding to a division shape pattern of a coding unit from a bitstream. The image decoding device 100 may perform an operation of determining a division rule of a coding unit. In addition, the image decoding device 100 may perform an operation 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. The image decoding device 100 may determine an allowable first range of the size of the coding unit according to the aspect ratio of the coding unit in order to determine the division rule. The image decoding device 100 may determine an allowable second range of the size of the coding unit according to the division shape pattern of the coding unit in order to determine the division rule.

[0074] The division of coding units according to an embodiment of the present disclosure will be described in detail.

[0075] First, a picture may be divided into one or more slices or one or more tiles. A slice or tile may be a sequence of maximum coding units (coding tree units (CTUs)). There is a maximum coding block (coding tree block (CTB)) conceptually comparable to the maximum coding unit (CTU).

[0076] A maximum coding block (CTB) refers to an N×N block including N×N samples (N is an integer). Each color component can be divided into one or more maximum coding blocks.

[0077] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), the maximum coding unit (CTU) includes a maximum coding block of luma samples, two corresponding maximum coding blocks of chroma samples, and a syntax structure for encoding luma samples and chroma samples. When the picture is a monochrome picture, the maximum coding unit includes a maximum coding block of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture with color planes separated according to color components, the maximum coding unit includes a syntax structure for encoding the picture and the samples of the picture.

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

[0079] When the picture has sample arrays for Y, Cr, and Cb components, the coding unit (CU) includes a coding block of luma samples, two corresponding coding blocks of chroma samples, and a syntax structure for encoding the luma samples and the chroma samples. When the picture is a monochrome picture, the coding unit includes a coding block of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture with color planes separated according to color components, the coding unit includes a syntax structure for encoding the picture and the samples of the picture.

[0080] As described above, the maximum coding block and the maximum coding unit are conceptually distinguished from each other, and the coding block and the coding unit are conceptually distinguished from each other. That is, the (maximum) coding unit refers to a data structure including a (maximum) coding block containing corresponding samples and a syntax structure corresponding to the (maximum) coding block. However, because a person of ordinary skill in the art understands that a (maximum) coding unit or a (maximum) coding block refers to a block of a specific size including a specific number of samples, unless otherwise described, the maximum coding block and the maximum coding unit or the coding block and the coding unit are mentioned in the following description without distinction.

[0081] The image may be divided into maximum coding units (CTUs). The size of each maximum coding unit may be determined based on information obtained from the bitstream. The shape of each maximum coding unit may be a square shape of the same size. However, the present disclosure is not limited thereto.

[0082] 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.

[0083] For example, information about the luminance block size difference and the maximum size of the luminance coding block that can be divided into two may be obtained from the bitstream. The information about the luminance block size difference may refer to the size difference between the luminance maximum coding unit and the maximum luminance coding block that can be divided into two. Therefore, when the information about the maximum size of the luminance coding block that can be divided into two obtained from the bitstream and the information about the luminance block size difference are combined with each other, the size of the luminance maximum coding unit may be determined. The size of the chrominance maximum coding unit may be determined by using the size of the luminance maximum coding unit. For example, when the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chrominance block may be half the size of the luminance block, and the size of the chrominance maximum coding unit may be half the size of the luminance maximum coding unit.

[0084] 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 can be variably determined. In contrast, the maximum size of a brightness coding block that can be divided into three can be fixed. For example, the maximum size of a brightness coding block that can be divided into three in an I picture can be 32×32, and the maximum size of a brightness coding block that can be divided into three in a P picture or a B picture can be 64×64.

[0085] In addition, the maximum coding unit may be hierarchically split into coding units based on the split shape pattern information obtained from the bitstream. At least one of information indicating whether to perform four-partitioning, information indicating whether to perform multi-partitioning, split direction information, and split type information may be obtained from the bitstream as the split shape pattern information.

[0086] For example, the information indicating whether to perform four-split may indicate whether the current coding unit is divided into four (QUAD_SPLIT).

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

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

[0089] 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 is split into two or three.

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

[0091] The image decoding device 100 may obtain the division shape pattern information from the bit stream from one binary bit string. 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 a binary sequence of information. 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 perform four divisions on the coding unit, the division direction, and the division type based on one binary bit string.

[0092] The coding unit may be equal to or smaller than the maximum coding unit. For example, since the maximum coding unit is a coding unit having the maximum size, the maximum coding unit is one of the coding units. When the division shape pattern information about the maximum coding unit indicates that division is not performed, the coding unit determined in the maximum coding unit has the same size as the maximum coding unit. When the division shape pattern information about the maximum coding unit indicates that division is performed, the maximum coding unit may be divided into coding units. In addition, when the division shape pattern information about the coding unit indicates that division is performed, the coding unit may be divided into smaller coding units. However, the division of the image is not limited thereto, and the maximum coding unit and the coding unit may not be distinguished from each other. Reference will be made to Figures 3 to 16 The division of coding units is described in more detail.

[0093] In addition, one or more prediction blocks for prediction may be determined from the coding unit. The prediction block may be equal to 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 equal to or smaller than the coding unit.

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

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

[0096] Will refer to Figures 3 to 16 The division of the coding unit is described in more detail. Each of the current block and the neighboring blocks of the present disclosure may indicate one of the maximum coding unit, the coding unit, the prediction block, and the transform block. In addition, the current block or the current coding unit is a block currently performing decoding or encoding or a block currently performing division. The neighboring block may be a block reconstructed before the current block. The neighboring block may be adjacent to the current block in space or time. The neighboring block may be located at one of the lower left, left side, upper left, upper, upper right, right side, and lower right side of the current block.

[0097] Figure 3A process in which the image decoding apparatus 100 according to an embodiment determines at least one coding unit by splitting a current coding unit is illustrated.

[0098] 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. N may be a positive integer. The block shape information is information indicating at least one of a shape, a direction, an aspect ratio, and a size of a coding unit.

[0099] The shape of the coding unit may include a square shape and a non-square shape. When the width and height of the coding unit are the same (that is, 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 shape. The image decoding apparatus 100 may determine the shape of the coding unit as a non-square shape.

[0100] When the width and height of the coding unit are different from each other (that is, when 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 shape. When the shape of the coding unit is a non-square shape, 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 the horizontal direction or in the vertical direction based on the width length and height length 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 length, height length, and area of ​​the coding unit.

[0101] 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 according to the block shape indicated by the block shape information used by the image decoding apparatus 100.

[0102] The image decoding device 100 may obtain the division shape pattern information from the bitstream. However, the present disclosure is not limited thereto, and the image decoding device 100 and the image encoding device 200 may determine the division shape pattern information pre-agreed based on the block shape information. The image decoding device 100 may determine the division shape pattern information pre-agreed for the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine that the pre-agreed division shape pattern information for the maximum coding unit indicates four divisions. In addition, the image decoding device 100 may determine that the pre-agreed division shape pattern information for the minimum coding unit indicates "no division is performed". For example, the image decoding device 100 may determine that the size of the maximum coding unit is 256×256. The image decoding device 100 may determine that the pre-agreed division shape pattern information indicates four divisions. Four divisions are division shape patterns in which the width and height of the coding unit are halved. The image decoding device 100 may obtain a coding unit of size 128×128 from a maximum coding unit of size 256×256 based on the division shape pattern information. Also, the image decoding apparatus 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 “do not perform division” with respect to the minimum coding unit.

[0103] 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 not split the square coding unit, whether to vertically split the square coding unit, whether to horizontally split the square coding unit, or whether to split the square coding unit into four coding units based on the split 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 not to divide the coding unit 310a having the same size as the current coding unit 300 based on the division shape pattern information indicating that division is not performed, or may determine the coding units 310b, 310c, 310d, 310e and 310f divided based on the division shape pattern information indicating a specific division method.

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

[0105] Figure 4 A process in which the image decoding apparatus 100 according to an embodiment determines at least one coding unit by splitting a non-square coding unit is illustrated.

[0106] 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 not split the non-square current coding unit or whether to split the non-square current coding unit by using a specific method according to the split 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 a coding unit 410 or 460 having the same size as the current coding unit 400 or 450 based on the division shape pattern information indicating that division is not performed, or may determine coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c divided based on the division shape pattern information indicating a specific division method. A specific division method for dividing a non-square coding unit will be described in detail below through various embodiments.

[0107] 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 4When 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 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.

[0108] According to an embodiment, when the image decoding apparatus 100 splits the non-square current coding unit 400 or 450 based on the split 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 splitting the long side of the current coding unit 400 or 450 in consideration of the shape of the current coding unit 400 or 450.

[0109] 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 480a, 480b, and 480c.

[0110] 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 length is greater than the height length, and thus the block shape information may be horizontal. When the aspect ratio is 1:4, the width length is less than the height length, and thus the block shape information may be vertical. The image decoding apparatus 100 may determine to divide the current coding unit 400 or 450 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 the vertical direction, the image decoding apparatus 100 may determine the coding units 430a, 430b, and 430c by horizontally dividing the current coding unit 400. In addition, when the current coding unit 450 is in the horizontal direction, the image decoding apparatus 100 may determine the coding units 480a, 480b, and 480c by vertically dividing the current coding unit 450.

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

[0112] 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 impose a specific restriction on 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 process of a coding unit 430b or 480b to be different from a decoding process of other coding units 430a and 430c or 480a and 480c, wherein the coding unit 430b or 480b is at a center position among three coding units 430a, 430b, and 430c or 480a, 480b, and 480c generated by dividing the current coding unit 400 or 450. For example, unlike other coding units 430a and 430c or 480a and 480c, the image decoding apparatus 100 may restrict the coding unit 430b or 480b at the center position from being further divided or being divided only a specific number of times.

[0113] Figure 5 A process in which the image decoding apparatus 100 according to an embodiment divides a coding unit based on at least one of block shape information and division shape pattern information is illustrated.

[0114] 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 the coding unit is divided. 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 relationship between the first coding unit, the second coding unit, and the third coding unit is applicable to the following description.

[0115] 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 520b, 520c, and 520d based on the split shape pattern information, or may not split the non-square second coding unit 510 determined by splitting the first coding unit 500. The image decoding apparatus 100 may obtain the split shape pattern information, and may split a plurality of second coding units (for example, 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 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.

[0116] Reference Figure 5, a specific coding unit (e.g., a coding unit at a center position or a square coding unit) among the odd-numbered 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 520c among the odd-numbered 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 the plurality of fourth coding units 530a, 530b, 530c, and 530d may be divided into a plurality of coding units again. For example, a non-square fourth coding unit 530b or 530d may be divided into an odd-numbered coding unit again. A method for recursively dividing coding units will be described below through various embodiments.

[0117] According to an embodiment, the image decoding device 100 may divide each of the third coding unit 520a, or 520b, 520c, and 520d into coding units based on the division shape pattern information. In addition, the image decoding device 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 device 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 device 100 may impose specific restrictions on a specific third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding device 100 may limit the third coding unit 520c at the center position of the odd number of third coding units 520b, 520c, and 520d to no longer be divided or divided a set number of times.

[0118] 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 specific 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 specific 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 for decoding the third coding unit 520c at the center position differently from the other third coding units 520b and 520d.

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

[0120] Figure 6 A method in which the image decoding apparatus 100 according to an embodiment determines a specific coding unit from among odd-numbered coding units is illustrated.

[0121] Reference Figure 6 , the division shape mode information of the current coding unit 600 or 650 may be obtained from a sample at a specific 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 specific position in the current coding unit 600 where the division shape mode information can be obtained is not limited to Figure 6 , and may include various positions (e.g., upper, lower, left, right, upper left, lower left, upper right, and lower right positions) included in the current coding unit 600. The image decoding apparatus 100 may obtain the division shape pattern information from a specific position, and may determine whether to divide the current coding unit into coding units of various shapes and sizes or not to divide the current coding unit.

[0122] According to an embodiment, when the current coding unit is split into a specific number of coding units, the image decoding apparatus 100 may select one of the coding units. Various methods that may be used to select one of a plurality of coding units will be described below through various embodiments.

[0123] 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 specific position.

[0124] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a center position among the odd-numbered coding units using information indicating the positions of 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 the current coding unit 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, 620b, and 620c or the odd number of coding units 660a, 660b, and 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 specific 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.

[0125] 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.

[0126] 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 620c 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. In addition, a method of determining a coding unit at a specific 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.

[0127] 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 specific 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.

[0128] 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 size of each 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. 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 620c by using the width or height of the current coding unit 600 and the widths or heights 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 widths and heights of the coding units 620a to 620c. Referring to Figure 6 , the image decoding apparatus 100 may determine the intermediate 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 a specific position. However, the above-described process in which the image decoding apparatus 100 determines the coding unit having a size different from the sizes of other coding units corresponds only to an example of determining the coding unit at a specific position by using the size of the coding unit determined based on the coordinates of the sample points, and therefore, various processes of determining the coding unit at a specific position by comparing the size of the coding unit determined based on the coordinates of the specific sample points may be used.

[0129] The image decoding apparatus 100 may determine the width or height of each of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd) as information indicating the position of the upper left sample point 670a of the left coding unit 660a, the coordinates (xe, ye) as information indicating the position of the upper left sample point 670b of the middle coding unit 660b, and the coordinates (xf, yf) as information indicating the position of the upper left sample point 670c of the right coding unit 660c. The image decoding apparatus 100 may determine the 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.

[0130] According to an embodiment, the image decoding apparatus 100 may determine the width of the left coding unit 660a as xe-xd. 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 widths and heights 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 widths and heights 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 specific position. However, the above-mentioned process in which the image decoding apparatus 100 determines the coding unit having a size different from the sizes of other coding units corresponds only to an example of determining the coding unit at the specific position by using the size of the coding unit determined based on the coordinates of the sample points, and therefore, various processes of determining the coding unit at the specific position by comparing the size of the coding unit determined based on the coordinates of the specific sample points may be used.

[0131] However, the position of the sample considered in determining 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.

[0132] According to an embodiment, the image decoding apparatus 100 may select a coding unit at a specific 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 specific position along the horizontal direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions along the horizontal direction and may 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 specific position along the vertical direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions along the vertical direction and may impose restrictions on the coding unit.

[0133] 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 specific 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 specific position by using information about the positions of the even-numbered coding units. Operations related thereto may be similar to those already described above with reference to Figure 6 The operation of determining a coding unit at a specific position (eg, a center position) among odd-numbered coding units corresponds to the operation described in detail, and thus a detailed description thereof will be omitted.

[0134] According to an embodiment, when a non-square current coding unit is split into a plurality of coding units, specific information about a coding unit at a specific position may be used in a split operation to determine a coding unit at a specific position among the plurality of coding units. For example, the image decoding apparatus 100 may determine a coding unit at a center position among the plurality of coding units determined by splitting the current coding unit using at least one of block shape information and split shape pattern information stored in samples included in a coding unit at a center position in a split operation.

[0135] 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 where 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 the coding unit at the center position may be determined using various types of information.

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

[0137] According to an embodiment, the position of the sample at which specific 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 specific information can be obtained may be determined based on the shape. For example, the image decoding apparatus 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 specific information can be obtained by using at least one of information about the width of the current coding unit and 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 apparatus 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 specific information can be obtained.

[0138] According to an embodiment, when a current coding unit is divided into a plurality of coding units, the image decoding device 100 may use division shape pattern information to determine a coding unit at a specific position in the plurality of coding units. According to an embodiment, the image decoding device 100 may obtain division shape pattern information from a sample at a specific position in the coding unit, and may divide a plurality of coding units generated by dividing the current coding unit by using the division shape pattern information, wherein the division shape pattern information is obtained from a sample at a specific 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, wherein the division shape pattern information is obtained from a sample at a specific position in each coding unit. Reference has been made to the above. Figure 5 An operation of recursively splitting the coding unit is described, and thus a detailed description thereof will be omitted here.

[0139] 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 specific block (for example, the current coding unit).

[0140] 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.

[0141] According to an embodiment, based on the division shape pattern information, 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, may determine the second coding units 730a and 730b by dividing the first coding unit 700 in a horizontal direction, or may determine the second coding units 750a to 750d by dividing the first coding unit 700 in vertical and horizontal directions.

[0142] 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 and horizontal directions in a specific order (for example, in a raster scan order or a zigzag scan order 750e), wherein the specific order is used to process the coding units in one row and then process the coding units in the next row.

[0143] 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 second 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 second coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. The division method of the plurality of second coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d may correspond to the division method of the first coding unit 700. In this way, each of the plurality of second 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.

[0144] 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.

[0145] 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 coding units after the division may be determined based on the processing order of the coding units immediately before the division. 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 splitting is not limited to the above example, and coding units split and determined to be various shapes may be independently processed in a specific order using various methods.

[0146] Figure 8 A process in which the image decoding apparatus 100 determines that a current coding unit is split into an odd number of coding units when coding units cannot be processed in a specific order according to an embodiment is illustrated.

[0147] According to an embodiment, the image decoding apparatus 100 may determine whether to split the current coding unit 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 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.

[0148] According to an embodiment, the image decoding apparatus 100 may determine whether any coding unit is split into an odd number of coding units by determining whether the third coding units 820a and 820b and 820c to 820e can be processed in a specific order. Figure 8, the image decoding apparatus 100 may determine the third coding units 820a, 820b, and 820c to 820e by recursively dividing the first coding unit 800. The image decoding apparatus 100 may determine whether any one of the following coding units 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: the first coding unit 800, the second coding units 810a and 810b, and the third coding units 820a and 820b and 820c, 820d, and 820e. For example, the right second coding unit 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 specific 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 a specific order.

[0149] According to an embodiment, the image decoding apparatus 100 may determine whether the third coding units 820a and 820b and 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition for processing in a specific 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 820c, 820d, and 820e. For example, the third coding units 820a and 820b determined by dividing the height of the non-square left second coding unit 810a in half may satisfy the condition. However, since 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 may 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 may determine that the right second coding unit 810b is divided into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a specific restriction on the coding unit at a specific position in the divided coding units, and the restriction or the specific position has been described above through various embodiments, and therefore a detailed description thereof will be omitted.

[0150] Fig. 9 A process in which the image decoding apparatus 100 according to an embodiment determines at least one coding unit by splitting the first coding unit 900 is illustrated.

[0151] 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 bitstream obtainer 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).

[0152] 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 processing in a specific 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 width of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not satisfy the condition for processing in a specific 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 height of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not satisfy the condition for processing in a specific order. When the condition is not satisfied 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 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 specific restriction on the coding unit at a specific position in the divided coding unit, and the restriction or the specific position has been described above through various embodiments, so its detailed description will be omitted.

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

[0154] 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.

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

[0156] According to an embodiment, the image decoding apparatus 100 may determine to divide 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 bitstream obtainer 110. The second coding units 1010a, 1010b, 1020a, and 1020b may be independently divided. Therefore, the image decoding apparatus 100 may determine to divide each of the second coding units 1010a, 1010b, 1020a, and 1020b into a plurality of coding units or not to divide each of the second coding units 1010a, 1010b, 1020a, and 1020b 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 splitting the non-square left second coding unit 1010a determined by splitting the first coding unit 1000 in the vertical direction in the horizontal direction. However, when the left second coding unit 1010a is split in the horizontal direction, the image decoding apparatus 100 may limit the right second coding unit 1010b to not be split in the horizontal direction in which the left second coding unit 1010a is split. When the third coding units 1014a and 1014b are determined by splitting 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 split in the horizontal direction, the third coding units 1012a, 1012b, 1014a, and 1014b may be determined. However, this case has the same effect as the case where 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 terms of image decoding.

[0157] 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 units 1020a and / 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, for the above-mentioned reason, the image decoding apparatus 100 may limit another second coding unit (e.g., the lower second coding unit 1020b) to not be split in the vertical direction in which the upper second coding unit 1020a is split.

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

[0159] 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 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.

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

[0161] 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.

[0162] As another example, the image decoding apparatus 100 may determine the third coding units 1122a and 1122b of the square shape by dividing the upper second coding unit 1120a in the vertical direction, and may determine the third coding units 1124a and 1124b of the square shape 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 the square shape 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.

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

[0164] 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 shape 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, 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 based on the division shape pattern information of each coding unit. 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 mentioned 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 be omitted.

[0165] According to an embodiment, the image decoding apparatus 100 may process the coding units in a specific order. Figure 7 The operation of processing the coding units in a specific order is described, and thus a detailed description thereof will be omitted. Fig.12 , the image decoding apparatus 100 may determine four square third coding units 1216a, 1216b, 1216c, 1216d and 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 1226a, 1226b, 1226c and 1226d based on a division method of the first coding unit 1200.

[0166] According to an embodiment, the image decoding device 100 can 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 can process the third coding units 1216a, 1216b, 1216c and 1216d in the following processing order 1217: first, the third coding units 1216a and 1216c included in the left second coding unit 1210a are processed in the vertical direction, and then the third coding units 1216b and 1216d included in the right second coding unit 1210b are processed in the vertical direction.

[0167] 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 the following processing order 1227: 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.

[0168] Reference Fig.12 , square third coding units 1216a, 1216b, 1216c and 1216d and 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 splitting the first coding unit 1200 in the vertical direction are different from the second coding units 1220a and 1220b determined by splitting 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 split from the second coding units 1210a and 1210b and the second coding units 1220a and 1220b ultimately show the same shape of coding units split from the first coding unit 1200. Therefore, by recursively splitting the coding units in different ways based on the split shape pattern information, even if the coding units are ultimately determined to be the same shape, the image decoding apparatus 100 may process a plurality of coding units in different orders.

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

[0170] According to an embodiment, the image decoding device 100 may determine the depth of the coding unit based on a specific criterion. For example, the specific 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 (n>0) times 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 compared to the depth of the coding unit before being divided. In the following description, the coding unit with the increased depth is represented as a coding unit of a deeper depth.

[0171] Reference Fig.13 According to an embodiment, the image decoding apparatus 100 may determine a second coding unit 1302 and a third coding unit 1304 of a deeper depth, etc., 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 by 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 by 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 of 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 of the width and height of the first coding unit 1300 may be D+2.

[0172] According to an embodiment, the image decoding device 100 can determine a second coding unit 1312 or 1322, a third coding unit 1314 or 1324, and the like of 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 longer than the width, or may be represented as "2: NS_HOR" indicating a non-square shape in which the width is longer than the height).

[0173] 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 N×2N. 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.

[0174] According to an embodiment, the image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by dividing 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 dividing 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 dividing the first coding unit 1320 in horizontal and vertical directions.

[0175] 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 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 dividing the second coding unit 1302 in the vertical direction and the horizontal direction.

[0176] 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.

[0177] 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.

[0178] 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 having a size of 2N×2N 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.

[0179] 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 of 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.

[0180] 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.

[0181] 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, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information of the first coding unit 1400.

[0182] 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 lengths 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 1404a and 1404b, the first coding unit 1400 and the non-square second coding units 1402a and 1402b and 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 of 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.

[0183] According to an embodiment, the image decoding apparatus 100 may determine a plurality of second coding units 1412a and 1412b and 1414a, 1414b, and 1414c by dividing the first coding unit 1410 whose height is longer than the width in the 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 1424a, 1424b, and 1424c by dividing the first coding unit 1420 whose width is longer than the height in the vertical direction based on the division shape pattern information.

[0184] According to an embodiment, the depths of the second coding units 1412a and 1412b, the second coding units 1414a, 1414b and 1414c, the second coding units 1422a and 1422b, and the second coding units 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 lengths of their long sides. For example, since the lengths of the sides of the square second coding units 1412a and 1412b are 1 / 2 of the lengths of the long sides of the first coding unit 1410 of the non-square shape having a height longer than a width, the depths of the square second coding units 1412a and 1412b are D+1 which is 1 deeper than the depth D of the non-square first coding unit 1410.

[0185] 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 longer than a height by using the above-described method of determining the depths of the coding units split from the first coding unit 1410 .

[0186] According to an embodiment, when the odd-numbered divided 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 width of the coding unit 1414b at the center position among the odd-numbered divided coding units 1414a, 1414b, and 1414c may be equal to the width of the other coding units 1414a and 1414c and its height may be 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 is 1 based on the scanning order, the PID of the coding unit 1414c located at a position adjacent to the coding unit 1414b may increase by 2 and may thus 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 odd-numbered divided coding units do not have equal sizes based on whether there is discontinuity in the PID for identifying the divided coding units.

[0187] 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 even-numbered coding units 1412a and 1412b or odd-numbered coding units 1414a, 1414b, and 1414c by dividing the first coding unit 1410 having a rectangular shape having a height longer than a 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 specific position of each coding unit (e.g., an upper left sample point).

[0188] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a specific 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 longer 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 odd-numbered divided coding units. The image decoding apparatus 100 may determine the coding unit 1414b having a PID corresponding to an intermediate 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 thereof 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 at the adjacent position to the coding unit 1414b may be increased by 2 and thus may be 3. When the PID is not uniformly increased as described above, the image decoding apparatus 100 may determine that the coding unit is divided into a plurality of coding units, wherein the plurality of coding units include coding units having sizes different from sizes of 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 specific position (e.g., a coding unit at a center position) among the odd number of coding units has a size different from sizes of 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 position of the coding unit of a specific position to be determined are not limited to the above-mentioned examples, and various PIDs and various positions and sizes of the coding unit may be used.

[0189] According to an embodiment, the image decoding apparatus 100 may use a specific data unit in which recursive splitting of a coding unit starts.

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

[0191] According to an embodiment, a specific data unit may be defined as a data unit for recursively dividing a coding unit starting by using division shape pattern information. That is, the specific 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 specific data unit is referred to as a reference data unit.

[0192] According to an embodiment, the reference data unit may have a specific size and a specific shape. According to an embodiment, the reference data unit may include M×N samples. Here, M and N may be equal to each other and may be an integer represented 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.

[0193] 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 shape pattern information for each reference data unit. The operation of dividing the reference data unit may correspond to a division operation using a quadtree structure.

[0194] According to an embodiment, the image decoding apparatus 100 may predetermine a minimum size allowed for a 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 with reference to the determined reference data unit.

[0195] 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 tile, a tile group, or a maximum coding unit) that can include one or more reference coding units.

[0196] According to an embodiment, the bitstream obtainer 110 of the image decoding apparatus 100 may obtain at least one of reference coding unit shape information and reference coding unit size information for each of various data units from the bitstream. Figure 3 The operation of dividing the current coding unit 300 by describing the operation of determining one or more coding units included in the reference coding unit 1500 of the square, and the above has been described with respect to Figure 4 The operation of splitting the current coding unit 400 or 450 describes an operation of determining one or more coding units included in the non-square reference coding unit 1502, and thus a detailed description thereof will be omitted.

[0197] According to an embodiment, the image decoding apparatus 100 may determine the size and shape of the reference coding unit using a PID for identifying the size and shape of the reference coding unit according to some data units predetermined based on a specific condition. That is, the bitstream obtainer 110 may obtain only the PID for identifying the size and shape of the reference coding unit for each slice, slice segment, tile, tile group, or maximum coding unit from the bitstream, wherein the slice, slice segment, tile, tile group, or maximum coding unit 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 tile, a tile group, or a maximum coding unit) that satisfies a specific condition. The image decoding apparatus 100 may determine the size and shape of the reference coding unit for each data unit that satisfies the specific condition by using the PID. When the reference coding unit shape information and the reference coding unit size information are obtained and used from the bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high, and therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the sizes and shapes of the reference coding units corresponding to the PID for identifying the sizes and shapes of the reference coding units may be predetermined. That is, the image decoding apparatus 100 may determine at least one of the sizes and shapes of the reference coding units included in the data unit serving as the unit for obtaining the PID by selecting at least one of the sizes and shapes of the reference coding units predetermined based on the PID.

[0198] According to an embodiment, the image decoding device 100 may use one or more reference coding units included in the maximum coding unit. That is, the maximum coding unit 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 maximum coding unit may be an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be obtained by dividing the maximum coding unit n times based on a quadtree structure. That is, according to various embodiments, the image decoding device 100 may determine the reference coding unit by dividing the maximum coding unit n times based on a quadtree structure, and the reference coding unit may be divided based on at least one of the block shape information and the division shape mode information.

[0199] 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.

[0200] 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 an image, and one or more reference coding units included in the processing block may be determined according to a specific order. That is, the determination order of one or more reference coding units determined in each processing block may correspond to one of various types of orders for determining reference coding units, and may vary according to the processing block. The determination order of the reference coding units determined for each processing block may be one of various orders (e.g., raster scanning, zigzag scanning, N-shaped scanning, upper right diagonal scanning, horizontal scanning, and vertical scanning), but is not limited to the scanning order mentioned above.

[0201] 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 the image. 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 the image. The size of the processing block may be a specific size of a data unit indicated by the processing block size information.

[0202] According to an embodiment, the bitstream obtainer 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 data units such as an image, a sequence, a picture, a slice, a slice segment, a parallel block, or a parallel block group. That is, the bitstream obtainer 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, and the size of the processing block may be an integer multiple of the size of the reference coding unit.

[0203] 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 the width of the processing blocks 1602 and 1612 to be four times the width of the reference coding unit, and may determine the height of the processing blocks 1602 and 1612 to be 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.

[0204] 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 included in the processing blocks 1602 and 1612. According to an embodiment, the determination of the reference coding unit may include determining the size of the reference coding unit.

[0205] 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 the one or more reference coding units based on the obtained determination order information. The determination order information may be defined as an order or direction for determining the reference coding units in the processing block. That is, the determination order of the reference coding units may be determined independently for each processing block.

[0206] 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 bitstream obtainer 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, a tile, a tile group, or a processing block). Because the determination order information of the reference coding unit indicates the order of the reference coding unit in the processing block, the determination order information may be obtained for each specific data unit including an integer number of processing blocks.

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

[0208] According to an embodiment, the bitstream obtainer 110 may obtain determination order information of reference coding units from the bitstream as 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 may 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 reverse raster scan order, the reference coding units included in the processing block 1612 may be determined according to the reverse raster scan order.

[0209] 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.

[0210] 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 associated with 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, a slice segment header, a parallel block header, or a parallel block group header. In addition, the image decoding device 100 may obtain a syntax element corresponding to the block shape information or the division shape pattern information from the bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and may use the obtained syntax element.

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

[0212] 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 200. 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, a slice segment header, a parallel block header, and a parallel block group header. The image decoding apparatus 100 may determine a division rule differently according to a frame, a slice, a parallel block, a temporal layer, a maximum coding unit, or a coding unit.

[0213] 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 200 and the image decoding device 100 may predetermine the division rule based on the block shape of the coding unit. However, the present disclosure 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 200.

[0214] The shape of the coding unit may include a square shape and a non-square shape. When the width and height of the coding unit are the same, the image decoding apparatus 100 may determine that the shape of the coding unit is a square shape. In addition, when the width and height of the coding unit are different, the image decoding apparatus 100 may determine that the shape of the coding unit is a non-square shape.

[0215] The size of the coding unit may include various sizes such as 4×4, 8×4, 4×8, 8×8, 16×4, 16×8, ... and 256×256. The size of the coding unit may be classified 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 belonging to the same group. For example, the image decoding apparatus 100 may classify the coding units whose long sides have the same length as coding units having the same size. In addition, the image decoding apparatus 100 may apply the same division rule to the coding units whose long sides have the same length.

[0216] 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 length of the coding unit is greater than the height length of the coding unit. The vertical direction may indicate a case where the width length of the coding unit is less than the height length of the coding unit.

[0217] 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.

[0218] The division rule determined based on the size of the coding unit may be a division rule predetermined between the image encoding apparatus 200 and the image decoding apparatus 100. Also, the image decoding apparatus 100 may determine the division rule based on information obtained from a bitstream.

[0219] 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 of a coding unit in an image.

[0220] In addition, the image decoding apparatus 100 may determine a division rule so that the coding units generated using different division paths do not have the same block shape. However, the present disclosure is not limited thereto, and the coding units generated using different division paths may have the same block shape. The coding units generated using different division paths may have different decoding process orders. Fig.12 The decoding process order has been described, so its detailed description will be omitted.

[0221] Fig.17 Illustrations of coding units that may be determined for each picture when a combination of shapes into which a coding unit may be divided is different for each picture according to an embodiment.

[0222] Reference Fig.17 , the image decoding apparatus 100 may determine that the combination of shapes into which the coding unit may be divided is different for each picture. For example, the image decoding apparatus 100 may decode the image by using a picture 1700 that may be divided into 4 coding units, a picture 1710 that may be divided into 2 or 4 coding units, and a picture 1720 that may be divided into 2, 3, or 4 coding units among one or more pictures included in the image. In order to divide the picture 1700 into a plurality of coding units, the image decoding apparatus 100 may use only the division shape information indicating division into 4 square coding units. In order to divide the picture 1710, the image decoding apparatus 100 may use only the division shape information indicating division into 2 or 4 coding units. In order to divide the picture 1720, the image decoding apparatus 100 may use only the division shape information indicating division into 2, 3, or 4 coding units. Because such a combination of division shapes is merely an example for describing the operation of the image decoding apparatus 100, the combination of division shapes should not be interpreted as being limited thereto, and various combinations of division shapes may be used according to each specific data unit.

[0223] According to an embodiment, the bitstream obtainer 110 of the image decoding apparatus 100 may obtain a bitstream including an index indicating a combination of division shape information according to each specific data unit (e.g., a sequence, a picture, a slice, a slice segment, a tile, or a tile group). For example, the bitstream obtainer 110 may obtain an index indicating a combination of division shape information from a sequence parameter set, a picture parameter set, a slice header, a tile header, or a tile group header. The image decoding apparatus 100 may determine a combination of division shapes into which a coding unit may be divided according to each specific data unit by using the obtained index, and thus may use different combinations of division shapes according to specific data units.

[0224] Fig.18 Various shapes of coding units that may be determined based on division shape pattern information that may be represented as a binary code according to an embodiment are illustrated.

[0225] According to an embodiment, the image decoding apparatus 100 may divide the coding unit into various shapes by using the block shape information and the division shape pattern information obtained by the bitstream obtainer 110. The shapes into which the coding unit may be divided may correspond to various shapes including the shapes described with reference to the above embodiments.

[0226] Reference Fig.18 , the image decoding apparatus 100 may divide the square coding unit in at least one of the horizontal direction and the vertical direction based on the division shape pattern information, and may divide the non-square coding unit in the horizontal direction or the vertical direction.

[0227] According to an embodiment, when the image decoding device 100 is capable of dividing a square coding unit into 4 square coding units in the horizontal direction and the vertical direction, the number of division shapes that can be indicated by the division shape pattern information of the square coding unit can be 4. According to an embodiment, the division shape pattern information can be represented as a 2-bit binary code, and the binary code can be assigned to each division shape. For example, when the coding unit is not divided, the division shape pattern information can be represented as (00)b; when the coding unit is divided in the horizontal direction and the vertical direction, the division shape pattern information can be represented as (01)b; when the coding unit is divided in the horizontal direction, the division shape pattern information can be represented as (10)b; and when the coding unit is divided in the vertical direction, the division shape pattern information can be represented as (11)b.

[0228] According to an embodiment, when the image decoding apparatus 100 splits a non-square coding unit in a horizontal direction or a vertical direction, the type of a split shape that may be indicated by the split shape pattern information may be determined according to the number of coding units into which the coding unit is split. Fig.18 , according to an embodiment, the image decoding device 100 may divide the non-square coding unit into up to 3 coding units. The image decoding device 100 may divide the coding unit into two coding units, and in this case, the division shape pattern information may be represented as (10)b. The image decoding device 100 may divide the coding unit into three coding units, and in this case, the division shape pattern information may be represented as (11)b. The image decoding device 100 may determine not to divide the coding unit, and in this case, the division shape pattern information may be represented as (0)b. That is, in order to use a binary code indicating the division shape pattern information, the image decoding device 100 may use variable length coding (VLC) instead of fixed length coding (FLC).

[0229] According to the embodiment, referring to Fig.18 , the binary code of the division shape mode information indicating that the coding unit is not divided can be represented as (0)b. When the binary code of the division shape mode information indicating that the coding unit is not divided is set to (00)b, even if there is no division shape mode information set to (01)b, all 2 bits of the binary code of the division shape mode information must be used. However, if Fig.18 As shown in , when three division shapes are used for non-square coding units, the image decoding apparatus 100 can determine not to divide the coding unit even by using a 1-bit binary code (0)b as the division shape pattern information, thereby efficiently using a bit stream. However, the division shape of the non-square coding unit indicated by the division shape pattern information should not be interpreted as being limited to Fig.18 The three shapes shown in FIG. 1 should be interpreted as including various shapes of the above-mentioned embodiments.

[0230] Fig.19 Other shapes of coding units that may be determined based on division shape pattern information that may be represented as a binary code according to an embodiment are illustrated.

[0231] Reference Fig.19 , the image decoding device 100 may divide the square coding unit in the horizontal direction or the vertical direction based on the division shape pattern information, and may divide the non-square coding unit in the horizontal direction or the vertical direction. That is, the division shape pattern information may indicate that the square coding unit is divided in one direction. In this case, the binary code of the division shape pattern information indicating that the square coding unit is not divided may be represented as (0)b. When the binary code of the division shape pattern information indicating that the coding unit is not divided is set to (00)b, even if there is no division shape pattern information set to (01)b, the entire 2-bit binary code of the division shape pattern information must be used. However, as Fig.19 As shown in , when three division shapes are used for square coding units, the image decoding apparatus 100 can determine not to divide the coding unit even by using a 1-bit binary code (0)b as the division shape pattern information, thereby efficiently using the bit stream. However, the division shape of the square coding unit indicated by the division shape pattern information should not be interpreted as being limited to Fig.19 The three shapes shown in FIG. 1 should be interpreted as including various shapes of the above-mentioned embodiments.

[0232] According to an embodiment, the block shape information or the division shape mode information may be represented by using a binary code, and such information may be instantly generated as a bitstream. Alternatively, the block shape information or the division shape mode information that may be represented as a binary code may be used as a binary code input during context adaptive binary arithmetic coding (CABAC) without being instantly generated as a bitstream.

[0233] According to an embodiment, a process in which the image decoding device 100 obtains syntax about block shape information or division shape mode information through CABAC will be described. A bitstream including a binary code for the syntax may be obtained by the bitstream obtainer 110. The image decoding device 100 may detect a syntax element indicating block shape information or division shape mode information by debinarizing a binary bit string included in the obtained bitstream. According to an embodiment, the image decoding device 100 may obtain a set of binary bit strings corresponding to syntax elements to be decoded, and may decode each binary bit by using probability information, and the image decoding device 100 may repeatedly perform such a process until a binary bit string including such decoded binary bits is identical to one of the binary bit strings obtained in advance. The image decoding device 100 may determine the syntax element by debinarizing the binary bit string.

[0234] According to an embodiment, the image decoding apparatus 100 may determine the syntax about the binary bit string by performing a decoding process of adaptive binary arithmetic coding, and may update the probability model for the binary bit obtained by the bitstream obtainer 110. Fig.18 According to an embodiment, the bitstream obtainer 110 of the image decoding device 100 may obtain a bitstream indicating a binary code, wherein the binary code indicates the division shape mode information. The image decoding device 100 may determine the syntax about the division shape mode information by using the obtained binary code of 1 bit or 2 bits. In order to determine the syntax about the division shape mode information, the image decoding device 100 may update the probability of each bit in the 2-bit binary code. That is, the image decoding device 100 may update the probability that the value of the next binary bit during encoding is 0 or 1 according to whether the value of the first binary bit in the 2-bit binary code is 0 or 1.

[0235] According to an embodiment, when determining syntax, the image decoding device 100 may update the probability of binary bits used in the process of decoding binary bits of a binary bit string used for syntax, and the image decoding device 100 may determine that specific bits in the binary bit string have the same probability without updating the probability.

[0236] Reference Fig.18, when determining the syntax by using a binary bit string indicating the division shape pattern information about the non-square coding unit, the image decoding apparatus 100 may determine the syntax about the division shape pattern information by using one binary bit having a value of 0 when the non-square coding unit is not divided. That is, when the block shape information indicates that the current coding unit has a non-square shape, the first binary bit of the binary bit string for the division shape information may be 0 when the non-square coding unit is not divided, and the first binary bit of the binary bit string for the division shape information may be 1 when the non-square coding unit is divided into two or three coding units. Therefore, the probability that the first binary bit of the binary bit string for the division shape pattern information about the non-square coding unit is 0 may be 1 / 3, and the probability that the first binary bit of the binary bit string for the division shape pattern information about the non-square coding unit is 1 may be 2 / 3. As described above, since the division shape pattern information indicating that the non-square coding unit is not divided may represent only a 1-bit binary bit string having a value of 0, the image decoding apparatus 100 may determine the syntax about the division shape pattern information by determining whether the second binary bit is 0 or 1 only when the first binary bit of the division shape pattern information is 1. According to an embodiment, when the first binary bit for the division shape pattern information is 1, the image decoding apparatus 100 may decode the binary bit by considering that the probability that the second binary bit is 0 and 1 is the same.

[0237] According to an embodiment, the image decoding apparatus 100 may use various probabilities for each binary bit when determining the binary bit string for the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may determine the probability of the binary bit for the division shape pattern information differently according to the direction of the non-square block. According to an embodiment, the image decoding apparatus 100 may determine the probability of the binary bit for the division shape pattern information differently according to the area of ​​the current coding unit or the length of the long side. According to an embodiment, the image decoding apparatus 100 may determine the probability of the binary bit for the division shape pattern information differently according to at least one of the shape of the current coding unit and the length of the long side.

[0238] According to an embodiment, the image decoding apparatus 100 may determine that the probability of the binary bits for the division shape pattern information is the same for coding units having a specific size or larger. For example, the image decoding apparatus 100 may determine that the probability of the binary bits for the division shape pattern information is the same for coding units having a size equal to or larger than 64 samples based on the length of the long side of each coding unit.

[0239] According to an embodiment, the image decoding apparatus 100 may determine initial probabilities of bins constituting a bin string of division shape pattern information based on a slice type (eg, I slice, P slice, or B slice).

[0240] Fig. 20 is a block diagram of an image encoding and decoding system for performing loop filtering.

[0241] The encoding end 2010 of the image encoding and decoding system 2000 transmits a bit stream of an encoded image, and the decoding end 2050 receives and decodes the bit stream and outputs a reconstructed image. The encoding end 2010 may have a configuration similar to that of the image encoding device 200 to be described below, and the decoding end 2050 may have a configuration similar to that of the image decoding device 100.

[0242] In the encoding end 2010, the prediction encoder 2015 outputs prediction data through inter-frame prediction and intra-frame prediction, and the transformer and quantizer 2020 outputs the quantized transformation coefficients of the residual data between the prediction data and the current input image. The entropy encoder 2025 encodes the quantized transformation coefficients and outputs the encoded quantized transformation coefficients as a bit stream. The quantized transformation coefficients are reconstructed into data in the spatial domain through the inverse quantizer and inverse transformer 2030, and the reconstructed data in the spatial domain is output as a reconstructed image through the deblocking filter 2035 and the loop filter 2040. The reconstructed image can be used as a reference image of the next input image through the prediction encoder 2015.

[0243] The encoded image data in the bit stream received by the decoding end 2050 is reconstructed into residual data in the spatial domain through the entropy decoder 2055 and the inverse quantizer and inverse transformer 2060. When the residual data and the prediction data output from the prediction decoder 2075 are combined, the image data in the spatial domain is formed, and the deblocking filter 2065 and the loop filter 2070 can filter the image data in the spatial domain and output a reconstructed image for the current original image. The reconstructed image can be used by the prediction decoder 2075 as a reference image for the next original image.

[0244] The loop filter 2040 of the encoding end 2010 performs loop filtering by using filter information input according to user input or system setting. The filter information used by the loop filter 2040 is output to the entropy encoder 205 and is sent to the decoding end 2050 together with the encoded image data. The loop filter 2070 of the decoding end 2050 can perform loop filtering based on the filter information input from the decoding end 2050.

[0245] The above-described various embodiments are used to describe operations related to the image decoding method performed by the image decoding apparatus 100. Operations of the image encoding apparatus 200 for performing an image encoding method corresponding to the reverse order process of the image decoding method will be described with reference to various embodiments.

[0246] Figure 2 is a block diagram of an image encoding apparatus 200 for encoding an image based on at least one of block shape information and division shape pattern information according to an embodiment.

[0247] The image encoding apparatus 200 may include an encoder 220 and a bitstream generator 210. The encoder 220 may receive an input image and may encode the input image. The encoder 220 may encode the input image and may obtain at least one syntax element. The syntax element may include at least one of a skip flag, a prediction mode, a motion vector difference, a motion vector prediction method (or index), a transform quantization coefficient, a coding block pattern, a coding block flag, an intra prediction mode, a direct flag, a merge flag, a differential QP, a reference index, a prediction direction, and a transform index. The encoder 220 may determine a context model based on block shape information including at least one of a shape, a direction, an aspect ratio, and a size of a coding unit.

[0248] The bitstream generator 210 may generate a bitstream based on the encoded input image. For example, the bitstream generator 210 may generate a bitstream by entropy encoding syntax elements based on a context model. In addition, the image encoding apparatus 200 may transmit the bitstream to the image decoding apparatus 100.

[0249] According to an embodiment, the encoder 220 of the image encoding apparatus 200 may determine the shape of the coding unit. For example, the coding unit may have a square shape or a non-square shape, and information indicating the shape may be included in the block shape information.

[0250] According to an embodiment, the encoder 220 may determine a shape into which the coding unit is to be divided. The encoder 220 may determine the shape of at least one coding unit included in the coding unit, and the bitstream generator 210 may generate a bitstream including division shape pattern information including information about the shape of the coding unit.

[0251] According to an embodiment, the encoder 220 may determine whether the coding unit is divided or not divided. When the encoder 220 determines that only one coding unit is included in the coding unit or the coding unit is not divided, the bitstream generator 210 may generate a bitstream including division shape pattern information indicating that the coding unit is not divided. In addition, the encoder 220 may divide the coding unit into a plurality of coding units, and the bitstream generator 210 may generate a bitstream including division shape pattern information indicating that the coding unit is divided into a plurality of coding units.

[0252] According to an embodiment, information indicating the number of coding units into which the coding unit will be divided or the direction in which the coding unit will be divided may be included in the division shape pattern information. For example, the division shape pattern information may indicate whether the coding unit is divided or not divided in at least one of the vertical direction and the horizontal direction.

[0253] The image encoding apparatus 200 determines the division shape pattern information based on the division shape pattern of the coding unit. The image encoding apparatus 200 determines the context model based on at least one of the shape, direction, aspect ratio, and size of the coding unit. The image encoding apparatus 200 generates the division shape pattern information for dividing the coding unit as a bitstream based on the context model.

[0254] In order to determine the context model, the image encoding apparatus 200 may obtain an array for mapping at least one of the shape, direction, aspect ratio, and size of the coding unit to an index for the context model. The image encoding apparatus 200 may obtain the index for the context model from the array based on at least one of the shape, direction, aspect ratio, and size of the coding unit. The image encoding apparatus 200 may determine the context model based on the index for the context model.

[0255] In order to determine the context model, the image encoding apparatus 200 may further determine the context model based on block shape information including at least one of a shape, a direction, an aspect ratio, and a size of the unit output from the prediction decoder 2075. In addition, the neighboring coding unit may include at least one of coding units located below the left, on the left, above the left, above, above the right, on the right, and below the right of the coding unit.

[0256] In addition, in order to determine the context model, the image encoding apparatus 200 may compare the width length of the upper adjacent coding unit with the width length of the coding unit. In addition, the image encoding apparatus 200 may compare the height lengths of the left adjacent coding unit and the right adjacent coding unit with the height length of the coding unit. In addition, the image encoding apparatus 200 may determine the context model based on the comparison result.

[0257] Operation and reference of the image encoding device 200 Figures 3 to 20 The operation of the described image decoding device 100 is similar, so its detailed description will be omitted.

[0258] Fig.21 is a block diagram showing the configuration of an image decoding apparatus 2100 according to an embodiment.

[0259] Reference Fig.21 , the image decoding apparatus 2100 includes an obtainer 2110 , a motion information determiner 2130 , a reconstructor 2150 , and a deblocker 2170 . Fig.21 The obtainer 2110 may correspond to Figure 1 The bitstream obtainer 110 of the embodiment of the present invention may correspond to the motion information determiner 2130, the reconstructor 2150 and the deblocker 2170. Figure 1 Decoder 120.

[0260] The obtainer 2110, the motion information determiner 2130, the reconstructor 2150, and the deblocker 2170 according to an embodiment may be implemented as at least one processor. The image decoding apparatus 2100 may include one or more data memories (not shown) storing input / output data of the obtainer 2110, the motion information determiner 2130, the reconstructor 2150, and the deblocker 2170. In addition, the image decoding apparatus 2100 may include a memory controller (not shown) for controlling data input to / output from the data memory (not shown).

[0261] The obtainer 2110 receives a bitstream generated as a result of encoding an image. The bitstream may include information for determining a motion vector for inter prediction of a current block. The current block, which is a block generated by dividing an image according to a tree structure, may correspond to a block unit such as a maximum coding unit, a coding unit, or a transformation unit.

[0262] The motion information determiner 2130 may determine the current block based on the block shape information and / or the partition shape mode information included in at least one of the sequence parameter set, the picture parameter set, the video parameter set, the slice header, and the slice segment header. In addition, the obtainer 2110 may obtain a syntax element corresponding to the block shape information or the partition shape mode information from the bitstream for each maximum coding unit, the reference coding unit, or the processing block, and the motion information determiner 2130 may use the syntax element to determine the current block.

[0263] The bitstream may include information indicating a prediction mode of the current block, and examples of the prediction mode of the current block may include intra mode, inter mode, merge mode, advanced motion vector prediction (AMVP) mode, direct mode, and skip mode.

[0264] In an embodiment, when the size of the current block is equal to or greater than a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, or 128×128), the motion information determiner 2130 may determine a candidate list including the first reference block indicated by the temporal motion vector as a candidate. The candidate list may include a predetermined number of candidates. Each candidate may indicate a block at a specific position. Alternatively, each candidate may indicate a motion vector of a block at a specific position. That is, when a specific block is included in the candidate list as a candidate, this may mean that the motion vector of the specific block is included as a candidate.

[0265] In the present disclosure, the first reference block refers to a block used to extract a motion vector for determining a motion vector of a current block. When comparing the size of the current block with a specific size, the motion information determiner 2130 may compare one of the width and height of the current block (e.g., a smaller size) with the specific size. For example, when the size of the current block is 4×16 and the specific size is 8×8, 4, which is the width of the current block, is smaller than 8, which indicates the size of one side in the specific size, and thus it may be determined that the size of the current block is smaller than the specific size.

[0266] In an embodiment, when the size of the current block is smaller than the specific size, the motion information determiner 2130 may determine a candidate list including blocks other than the first reference block as candidates. Based on the size of the current block, the first reference block may or may not be included in the candidate list.

[0267] In an embodiment, when the size of the current block is equal to or greater than the specific size, the motion information determiner 2130 may determine a first candidate list including the first reference block as a candidate, and when the size of the current block is smaller than the specific size, the motion information determiner 2130 may determine a second candidate list including blocks other than the first reference block as candidates.

[0268] When the prediction mode of the current block is a mode in which the motion vector of the current block is determined by using the motion vectors of the candidates included in the candidate list, the motion information determiner 2130 may determine the candidate list. Information (e.g., a flag or an index) indicating the prediction mode of the current block may be obtained from the bitstream. When the flag indicates whether the prediction mode of the current block is a mode in which the motion vector of the current block is determined by using the motion vectors of the candidates included in the candidate list, the motion information determiner 2130 may determine the candidate list.

[0269] Examples of a mode for determining a motion vector of a current block by using motion vectors of candidates included in a candidate list may include, for example, a skip mode, a merge mode, and an AMVP mode. In the skip mode and the merge mode, motion vectors of candidates included in the candidate list are determined as motion vectors of the current block, and in the AMVP mode, a value obtained by applying a differential motion vector to motion vectors of candidates included in the candidate list is determined as the motion vector of the current block. Information indicating a differential motion vector is obtained from a bitstream.

[0270] Fig. 22 is a diagram illustrating a candidate list according to an embodiment.

[0271] Reference Fig. 22, the candidate list may include a first reference block, a first spatial neighboring block, a second spatial neighboring block, a third spatial neighboring block, and a temporal neighboring block as candidates. An index may be assigned to each candidate, and in an embodiment, an index having a minimum value may be assigned to the first reference block.

[0272] exist Fig. 22 In the present invention, the spatial neighboring block refers to a neighboring block that is spatially adjacent to the current block in the current image, and the temporal neighboring block may include a block located at the same point as the current block in the same-position image or a block located to the lower right of the block located at the same point as the current block.

[0273] Fig. 22 It is shown that both the first reference block and the temporally adjacent block are included in the candidate list as candidates. When the first reference block is included in the candidate list, the temporally adjacent block may not be included in the candidate list. Conversely, when the temporally adjacent block is included in the candidate list, the first reference block may not be included in the candidate list.

[0274] In an embodiment, a minimum number of spatially neighboring blocks to be included as candidates in the candidate list and a minimum number of temporally neighboring blocks (including the first reference block) to be included as candidates in the candidate list may be predetermined.

[0275] The motion information determiner 2130 may determine the availability of a predetermined block (including the first reference block) before the candidate list is configured, and may then include the block having availability in the candidate list. When the number of candidates included in the candidate list is less than a predetermined number, the motion information determiner 2130 may include a default motion vector in the candidate list. When a block is inter-predicted, it may be determined that the block has availability.

[0276] The default motion vector may include, for example, a zero vector, a temporal motion vector indicating the first reference block, a representative motion vector of the first reference block, or a combination of motion vectors of blocks already included in the candidate list.

[0277] The order of the blocks included in the candidate list may be predetermined. For example, the blocks may be sorted according to availability. Fig. 22 The blocks may be included in the candidate list in the order of the first reference block → spatial neighboring block → temporal neighboring block shown in , or the blocks may be included in the candidate list in the order of spatial neighboring block → first reference block → temporal neighboring block according to availability. Alternatively, the blocks may be included in the candidate list in the order of the first spatial neighboring block → first reference block → second spatial neighboring block → third spatial neighboring block → temporal neighboring block according to availability. Alternatively, the blocks may be included in the candidate list in the order of spatial neighboring blocks with first availability → first reference block → remaining spatial neighboring blocks in the spatial neighboring blocks → temporal neighboring blocks.

[0278] However, Fig. 22 The candidate list is only an example, and the number and type of candidates included in the candidate list may vary according to the implementation. For example, the candidate list may include at least one of a zero vector, a temporal motion vector indicating a first reference block, a representative motion vector of the first reference block, and a combination of motion vectors of blocks already included in the candidate list as a candidate.

[0279] The motion information determiner 2130 obtains information (eg, a flag or an index) indicating one of the candidates included in the candidate list from the bitstream, and determines a motion vector of the current block by using a motion vector of the candidate indicated by the obtained information.

[0280] According to an embodiment of the present disclosure, when a first reference block is selected from the candidates included in the candidate list, Fig.23 and Fig.24 The described sub-block based prediction process determines the motion vector of a sub-block in the current block.

[0281] Fig.23 is a diagram illustrating a first reference block 2330 indicated by a temporal motion vector 2320 . Fig.24 is a diagram for describing a method of determining motion vectors of a first subblock 2312 , a second subblock 2314 , a third subblock 2316 , and a fourth subblock 2318 in a current block 2310 .

[0282] The motion information determiner 2130 determines a temporal motion vector 2320 to determine a first reference block 2330. A detailed method of determining the temporal motion vector 2320 will be described below.

[0283] Once the temporal motion vector 2320 is determined, a first reference block 2330 indicated by the temporal motion vector 2320 is determined based on the current block 2310 in the first reference picture. The size of the first reference block 2330 may be determined to be the same as that of the current block 2310.

[0284] When the motion vector of the current block 2310 is determined based on the first reference block 2330, in an embodiment of the present disclosure, sub-blocks in the current block 2310 are determined, and a motion vector is determined for each sub-block.

[0285] Reference Fig.24 , the current block 2310 may be divided into a first sub-block 2312, a second sub-block 2314, a third sub-block 2316, and a fourth sub-block 2318. Each of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316, and the fourth sub-block 2318 may have a specific size. For example, the size of each sub-block may be 4×4, 8×8, 16×16, 32×32, or 64×64.

[0286] The size of the subblock may be determined for each group of pictures (GOP), each picture, each tile, each maximum coding unit, or each coding unit.

[0287] The subblock may have a size predetermined according to the value of the temporal layer of the picture constituting the GOP. In detail, in an image whose value of the temporal layer is in the range from 0 to n (n is an integer), the subblock may have a size of 4×4; in an image whose value of the temporal layer is in the range from n+1 to m (m is an integer), the subblock may have a size of 8×8; and in an image whose value of the temporal layer is in the range from m+1 to I (I is an integer), the subblock may have a size of 16×16. That is, as the value of the temporal layer increases, the size of the subblock may also increase.

[0288] In an embodiment, the size of the sub-block may be determined based on the size of the current block. In detail, when the size of the current block is M×N, the sub-block may have a size of M / 4×N / 4. In this case, when the size of the sub-block is smaller than a predetermined minimum size of the sub-block, the size of the sub-block in the current block may be determined as the minimum size of the sub-block.

[0289] Alternatively, when the size of the current block is M×N and a larger value between M and N is K, the sub-block may have a size of K / 4×K / 4.

[0290] Although in Fig.24 Four sub-blocks (ie, a first sub-block 2312, a second sub-block 2314, a third sub-block 2316, and a fourth sub-block 2318) in the current block 2310 are determined, but the number of sub-blocks may vary according to the size of the sub-blocks and the size of the current block.

[0291] It can be determined that the first sub-region 2332, the second sub-region 2334, the third sub-region 2336 and the fourth sub-region 2338 in the first reference block 2330 correspond to the first sub-block 2312, the second sub-block 2314, the third sub-block 2316 and the fourth sub-block 2318, respectively, and the motion vectors mv1', mv2', mv3' and mv4' of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316 and the fourth sub-block 2318 can be determined based on the motion vectors mv1, mv2, mv3 and mv4 extracted from the first sub-region 2332, the second sub-region 2334, the third sub-region 2336 and the fourth sub-block 2338.

[0292] For example, the motion vector mv1' of the first sub-block 2312 in the current block 2310 can be determined based on the motion vector mv1 extracted from the first sub-region 2332 in the first reference block 2330, the motion vector mv2' of the second sub-block 2314 can be determined based on the motion vector mv2 extracted from the second sub-region 2334, the motion vector mv3' of the third sub-block 2316 in the current block 2310 can be determined from the motion vector mv3 extracted from the third sub-region 2336, and the motion vector mv4' of the fourth sub-block 2318 in the current block 2310 can be determined based on the motion vector mv4 extracted from the fourth sub-region 2338.

[0293] Motion vectors mv1, mv2, mv3, and mv4 of the first subregion 2332, the second subregion 2334, the third subregion 2336, and the fourth subregion 2338 may be extracted based on central pixels of the first subregion 2332, the second subregion 2334, the third subregion 2336, and the fourth subregion 2338.

[0294] The motion vector used in the process of decoding the image is stored based on a block of a specific size (for example, a 16×16 block in the High Efficiency Video Coding (HEVC) codec, hereinafter referred to as a storage block). In an embodiment of the present disclosure, the size of the storage block may be, but is not limited to, 4×4, 8×8, 16×16, or 32×32.

[0295] The motion information determiner 2130 may determine a motion vector of a storage block including a central pixel of each of the first sub-region 2332, the second sub-region 2334, the third sub-region 2336, and the fourth sub-region 2338 in the first reference block 2330 as a motion vector of each of the first sub-region 2332, the second sub-region 2334, the third sub-region 2336, and the fourth sub-region 2338. The motion vector of the storage block including the central pixel of the first sub-region 2332 may be determined as the motion vector of the first sub-region 2332, and the motion vector of the storage block including the central pixel of the second sub-region 2334 may be determined as the motion vector of the second sub-region 2334.

[0296] When the position of pixels in a specific area is in the range from (0,0) to (n-1,n-1), the position of the center pixel may be (n / 2,n / 2), ((n-2) / 2), (n-2) / 2)), (n / 2, (n-2) / 2)) or ((n-2) / 2),n / 2).

[0297] When the motion vector of each of the first sub-region 2332, the second sub-region 2334, the third sub-region 2336, and the fourth sub-region 2338 is determined, the motion vector may not exist in the storage block including the central pixel of any one of the first sub-region 2332, the second sub-region 2334, the third sub-region 2336, and the fourth sub-region 2338. For example, when the samples of the storage block including the central pixel of the sub-region are all intra-predicted, the motion vector may not exist in the storage block. In this case, the motion information determiner 2130 may determine that the motion vector of the storage block including the central pixel of the first reference block 2330 is a representative motion vector, and may determine that the motion vector of the sub-block for which the motion vector may not be determined is a representative motion vector. As described below, there may be no motion vector corresponding to the central pixel of the first reference block 2330. In this case, it may be determined that the first reference block 2330 has no availability, and the first reference block 2330 may not be included in the candidate list.

[0298] In an embodiment, when the size of the storage block (e.g., 8×8) is larger than the size of the sub-block (e.g., 4×4), the motion information determiner 2130 may determine that the motion vector of at least one of the first sub-region 2332, the second sub-region 2334, the third sub-region 2336, and the fourth sub-region 2338 corresponding to the first sub-block 2312, the second sub-block 2314, the third sub-block 2316, and the fourth sub-block 2318 is a value obtained by combining the motion vectors of the adjacent sub-regions (e.g., an average value). This is to prevent the following problem: the center pixels of a plurality of sub-regions are all included in one storage block and the motion vectors of the sub-regions are determined to be the same value. For example, when the center pixels of a predetermined number of sub-regions among all the sub-regions in the current block are all included in one storage block, the motion vectors of some of the predetermined number of sub-regions may be determined as the average value of the motion vectors of the adjacent sub-regions.

[0299] When the motion vectors of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316, and the fourth sub-block 2318 in the current block 2310 are determined, the reconstructor 2150 reconstructs the first sub-block 2312, the second sub-block 2314, the third sub-block 2316, and the fourth sub-block 2318 based on the sample value of the second reference block indicated by the motion vectors of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316, and the fourth sub-block 2318. Therefore, as a result, the current block 2310 is reconstructed. In the present embodiment, the second reference block refers to a block used for motion compensation of the current block.

[0300] Fig.252314, the third sub-block 2316, and the fourth sub-block 2318 as the sample values ​​of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316, and the fourth sub-block 2318.

[0301] In an embodiment, the reconstructor 2150 may determine the sample values ​​of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316 and the fourth sub-block 2318 by applying the residual data obtained from the bitstream according to the prediction mode of the current block 2310 to the sample values ​​of the second reference blocks 2512, 2514, 2516 and 2518 indicated by the motion vectors mv1', mv2', mv3' and mv4' of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316 and the fourth sub-block 2318.

[0302] In an embodiment, when the current block 2310 is a reference block of a subsequent block, the motion vector of the subsequent block may be determined based on the representative motion vector of the first reference block 2330. In another embodiment, when the current block 2310 is a reference block of a subsequent block, the motion vector of the subsequent block may be determined based on the motion vector of any one of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316, and the fourth sub-block 2318 in the current block 2310.

[0303] In an embodiment, when decoding of the current image is completed and a motion vector determined in the current image is subsequently stored, the reconstructor 2150 may store motion vectors of all sub-blocks in the current block. However, the motion vectors of the sub-blocks may be converted into predetermined precision and stored according to the temporal layer value of the current image in the GOP. The precision may be represented by using pixel units. For example, 1 pixel precision indicates that the motion vector is represented by using an integer pixel unit, and 1 / 4 pixel precision indicates that the motion vector is represented by using 1 / 4 pixel unit (i.e., sub-pixel unit). Compared with 1 pixel precision, the motion vector can be represented more accurately with 1 / 4 pixel precision.

[0304] As the temporal layer value of the current image decreases, the reconstructor 2150 may store the motion vector of the sub-block as lower precision. When the motion vector of the sub-block is determined to be 1 / 4 pixel precision and the temporal layer value of the current image is the same as the predetermined value, the reconstructor 2150 may convert the motion vector of the sub-block to, for example, 1 pixel precision and may store the converted motion vector. When the motion vector of a sub-block is (16,16) of 1 / 4 pixel precision, the motion vector may be stored as (4,4) of 1 pixel precision. This is to increase the data processing speed because images with lower temporal layer values ​​are more frequently referenced from other images.

[0305] When the reconstructor 2150 stores the motion vector of the sub-block as low precision, the reconstructor 2150 may store the motion vector as an integer value by applying rounding. For example, when the motion vector of one sub-block is (17,17) of 1 / 4 pixel precision, the motion vector may be stored as (4,4) of 1 pixel precision (i.e., an integer value obtained by rounding 17 / 4).

[0306] In an embodiment of the present disclosure, when a first reference block is selected from candidates included in a candidate list, image decoding may be accurately performed based on subblocks by performing a motion vector determination process and a sample value reconstruction process based on subblocks.

[0307] According to an embodiment of the present disclosure, when a candidate other than the first reference block is selected from the candidates included in the candidate list, Figure 23 to Figure 25 The motion information determiner 2130 may reconstruct the current block by using a different process from the process described above. For example, when a specific spatial neighboring block is selected from the candidates included in the candidate list, the motion information determiner 2130 may determine the motion vector of the current block by using the motion vector of the spatial neighboring block, and may reconstruct the current block by using the sample value of the reference block indicated by the motion vector of the current block. That is, when the spatial neighboring block is selected, the motion vector determination process and the reconstruction process may be performed based on the current block.

[0308] The first reference block may be included in the candidate list, or may not be included in the candidate list. Whether the first reference block is included in the candidate list may be determined based on various conditions.

[0309] For example, when the size of the current block is smaller than a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, or 128×128), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include temporally adjacent blocks in a predetermined co-located image as candidates. Conversely, when the size of the current block is equal to or larger than the specific size, the first reference block may be included in the candidate list, and the temporally adjacent blocks in the co-located image may not be included in the candidate list. The specific size may be the size of a sub-block.

[0310] In addition, for example, when the size of the current block is smaller than a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, or 128×128) and the temporal motion vector obtained by the temporal motion vector determination process described below is a predetermined motion vector (e.g., a zero vector), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include temporal neighboring blocks in a predetermined co-located image as candidates. Conversely, when the size of the current block is equal to or larger than the specific size or the temporal motion vector is not the predetermined motion vector, the first reference block may be included in the candidate list, and the temporal neighboring blocks in the co-located image may not be included in the candidate list. The specific size may be the size of a sub-block.

[0311] In addition, for example, when the size of the current block is larger than a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, 128×128), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporally adjacent block in a predetermined co-located image as a candidate. Conversely, when the size of the current block is equal to or smaller than the specific size, the first reference block may be included in the candidate list, and the temporally adjacent block in the co-located image may not be included in the candidate list. The specific size may be the size of a sub-block.

[0312] In addition, for example, when the size of the current block is the same as a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, or 128×128), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporally adjacent block in a predetermined co-located image as a candidate. Conversely, when the size of the current block is not the same as the specific size, the first reference block may be included in the candidate list, and the temporally adjacent block in the co-located image may not be included in the candidate list. The specific size may be the size of a sub-block.

[0313] In addition, for example, when the size of the current block is different from a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, or 128×128), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporally adjacent block in a predetermined co-located image as a candidate. Conversely, when the size of the current block is the same as the specific size, the first reference block may be included in the candidate list, and the temporally adjacent block in the co-located image may not be included in the candidate list. The specific size may be the size of a sub-block.

[0314] In addition, for example, when the current block is a specific block unit (e.g., a maximum coding unit), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporally adjacent block in a predetermined co-located image as a candidate. Conversely, when the current block is not the specific block unit, the first reference block may be included in the candidate list, and the temporally adjacent block in the co-located image may not be included in the candidate list.

[0315] In addition, for example, when the size of the current block is k times the size of the sub-block (k is a predetermined integer), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporally adjacent block in a predetermined co-located image as a candidate. Conversely, when the size of the current block is not k times the size of the specific block, the first reference block may be included in the candidate list, and the temporally adjacent block in the co-located image may not be included in the candidate list.

[0316] In addition, for example, when the candidates of the candidate list are sequentially determined according to the availability of a plurality of blocks including the first reference block and the first reference block is determined as the first candidate of the candidate list, the first reference block may be excluded from the candidate list. For example, in the case where the blocks are included in the candidate list in the order of the first spatially neighboring block, the first reference block, and the second spatially neighboring block according to their availability, when the first spatially neighboring block has no availability and the first reference block is included in the candidate list as the first candidate, the first reference block may be excluded from the candidate list.

[0317] Also, for example, when a temporal layer value of a current picture in a GOP including the current picture is identical to a predetermined value (eg, a maximum value), a candidate list including blocks other than the first reference block as candidates may be determined.

[0318] In addition, for example, when the temporal motion vector obtained by the temporal motion vector determination process to be described below is a predetermined motion vector (e.g., a zero vector), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporal neighboring block in a predetermined co-located image as a candidate. Conversely, when the temporal motion vector obtained by the temporal motion vector determination process is different from the predetermined motion vector, the first reference block may be included in the candidate list, and the temporal neighboring block in the co-located image may not be included in the candidate list.

[0319] In addition, for example, when the temporal motion vector obtained by the temporal motion vector determination process to be described below is different from a predetermined motion vector (e.g., a zero vector), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporal neighboring block in a predetermined co-located image as a candidate. Conversely, when the temporal motion vector obtained by the temporal motion vector determination process is the same as the predetermined motion vector, the first reference block may be included in the candidate list, and the temporal neighboring block in the co-located image may not be included in the candidate list.

[0320] In addition, for example, when there is no motion vector corresponding to the central pixel of the first reference block, a candidate list including blocks other than the first reference block as candidates may be determined. Conversely, when there is a motion vector corresponding to the central pixel of the first reference block, the first reference block may be included in the candidate list.

[0321] A method in which the motion information determiner 2130 determines a temporal motion vector indicating a first reference block will be described.

[0322] When the motion information determiner 2130 determines that the prediction mode of the current block is a mode in which the motion vector of the current block is determined by using the motion vector of the candidate included in the candidate list (for example, sub-block_merge_flag is 1), the temporal motion vector may be determined before the candidate list is determined. Alternatively, the motion information determiner 2130 may determine the temporal motion vector to determine the availability of the first reference block when determining the candidate list. When the first reference block has no availability (for example, when there is no representative motion vector), a candidate list including blocks other than the first reference block as candidates may be determined.

[0323] The motion information determiner 2130 may determine the motion vector of the neighboring block having the first availability as the temporal motion vector by scanning at least one neighboring block determined in advance in a predetermined order. Fig.26 , the neighboring blocks of the current block 2310 may include spatial neighboring blocks A0, A1, B0, B1, and B2 that are spatially adjacent to the current block 2310 and temporal neighboring blocks Co1 and Br that are temporally adjacent to the current block 2310. In detail, the neighboring blocks may include a lower left outer block A0 of the current block 2310, a lower left block A1 of the current block 2310, an upper right outer block B0 of the current block 2310, an upper right block B1 of the current block 2310, an upper left outer block B2 of the current block 2310, a block Co1 located at the same point as the current block 2310 in the co-located image, and a lower right outer block Br of the block Co1 at the same point.

[0324] Assume that the position of the leftmost pixel above the current block 2310 is (xCb, yCb), and the horizontal length and vertical length of the current block 2310 are cbWidth and cbHeight in pixels, respectively. Block A1 is a block including a pixel at a position of (xCb-1, yCb+cbHeight-1), and block A0 is a block including a pixel at a position of (xCb-1, yCb+cbHeight). In addition, block B1 is a block including a pixel at a position of (xCb+cbWidth-1, yCb-1), and block B0 is a block including a pixel at a position of (xCb+cbWidth, yCb-1). In addition, block B2 is a block including a pixel at a position of (xCb-1, yCb-1). However, Fig.26 The positions of the neighboring blocks are merely examples and may vary depending on the implementation.

[0325] When the predetermined at least one neighboring block has no availability, the motion information determiner 2130 may determine a predetermined motion vector (eg, a zero vector) as the temporal motion vector.

[0326] When the neighboring block to be scanned is intra-predicted, the motion information determiner 2130 may determine that the block does not have availability. When the image indicated by the neighboring block to be scanned is different from the predetermined co-located image, the motion information determiner 2130 may determine that the block does not have availability, and when the image indicated by the neighboring block to be scanned is the same as the predetermined co-located image, the motion information determiner 2130 may determine that the block has availability. In addition, the motion information determiner 2130 may determine the availability of the neighboring block in consideration of the size of the storage block. For example, when the size of the storage block is M×M and the X component value or the Y component value of the motion vector of the neighboring block to be scanned is less than M, the motion information determiner 2130 may determine that the block does not have availability. Alternatively, when the size of the storage block is M×M and the X component value or the Y component value of the motion vector of the neighboring block to be scanned is less than M / 2, the motion information determiner 2130 may determine that the block does not have availability.

[0327] In an embodiment, the motion information determiner 2130 may scan the blocks in the order of the left neighboring block A0 or A1 of the current block→the upper neighboring block B0, B1 or B2 of the current block, and may determine the motion vector of the neighboring block with availability as the temporal motion vector. When the left neighboring block and the upper neighboring block do not have availability, the motion vector determiner may determine a predetermined motion vector (e.g., a zero vector) as the temporal motion vector.

[0328] In an embodiment, the motion information determiner 2130 may scan the left neighboring block A0 or A1 of the current block, and when the left neighboring block has availability, the motion information determiner 2130 may determine the motion vector of the left neighboring block as the temporal motion vector. When the left neighboring block does not have availability, the motion vector determiner may determine a predetermined motion vector (e.g., a zero vector) as the temporal motion vector. In addition, in an embodiment, the motion vector determiner may scan the blocks in the order of the left neighboring block A0 or A1 of the current block → the upper neighboring block B0, B1, or B1 → the temporal neighboring block Co1 or Br, and may determine the motion vector of the neighboring block with availability as the temporal motion vector.

[0329] In an embodiment, the motion information determiner 2130 may determine the positions and scanning order of the neighboring blocks to be scanned based on the shape of the current block 2310, which will refer to Fig. 27 (a) Fig. 27 (b) and Fig. 27 (c) is described. Fig. 27 (a) shows that the current block 2310 has a square shape, and Fig. 27 B shows that the horizontal length of the current block 2310 is greater than the vertical length. In addition, Fig. 27 (c) shows that the vertical length of the current block 2310 is greater than the horizontal length.

[0330] First, we will describe Fig. 27 (a) Fig. 27 (b) and Fig. 27 (c) The position of the neighboring block. Assume that the position of the leftmost pixel above the current block 2310 is (xCb, yCb), and the horizontal length and vertical length of the current block 2310 are cbWidth and cbHeight in pixels, respectively. Block A1 is a block including a pixel at a position of (xCb-1, yCb+cbHeight-1), and block A0 is a block including a pixel at a position of (xCb-1, yCb+cbHeight). In addition, block B1 is a block including a pixel at a position of (xCb+cbWidth-1, yCb-1), and block B0 is a block including a pixel at a position of (xCb+cbWidth, yCb-1). Furthermore, block A2 is a block including a pixel at a position of (xCb-1, yCb+cbHeight / 2-1), and block B3 is a block including a pixel at a position of (xCb+cbWidth / 2-1, yCb-1). However, Fig. 27 (a) Fig. 27 (b) and Fig. 27 The positions of the neighboring blocks of (c) are merely examples and may vary depending on the implementation.

[0331] For example, when the current block 2310 has a square shape, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the left neighboring block A0 or A1 of the current block 2310. When the horizontal length of the current block 2310 is greater than the vertical length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the upper neighboring block B0 or ​​B1 of the current block 2310, and when the vertical length of the current block 2310 is greater than the horizontal length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the left neighboring block A0 or A1 of the current block 2310.

[0332] Alternatively, when the current block 2310 has a square shape, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the left neighboring block A0 or A1 of the current block 2310. Furthermore, when the horizontal length of the current block 2310 is greater than the vertical length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the left neighboring block A0 or A1 of the current block 2310, and when the vertical length of the current block 2310 is greater than the horizontal length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the upper neighboring block B0 or ​​B1 of the current block 2310.

[0333] Alternatively, when the current block 2310 has a square shape or the vertical length of the current block 2310 is greater than the horizontal length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability in the order of block A1→block B1→block B0→block A0. When the horizontal length of the current block 2310 is greater than the vertical length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability in the order of block B1→block A1→block B0→block A0.

[0334] Alternatively, when the current block 2310 has a square shape, the motion information determiner 2130 may determine the temporal motion vector by determining availability in the order of block A1→block B1→block B0→block A0. When the vertical length of the current block 2310 is greater than the horizontal length or the horizontal length of the current block 2310 is greater than the vertical length, the motion information determiner 2130 may determine the temporal motion vector by determining availability in the order of block B1→block B0→block A1→block A0.

[0335] Alternatively, when the current block 2310 has a square shape, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the left neighboring block A0 or A1 and the upper neighboring block B0 or ​​B1 of the current block 2310. When the horizontal length of the current block 2310 is greater than the vertical length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the upper neighboring block B0 or ​​B1 of the current block 2310. In addition, when the vertical length of the current block 2310 is greater than the horizontal length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the left neighboring block A0 or A1 of the current block 2310.

[0336] Alternatively, when the current block 2310 has a square shape, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the left neighboring block A0 or A1 and the upper neighboring block B0 or ​​B1. When the horizontal length of the current block 2310 is greater than the vertical length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the left neighboring block A0 or A1 and the upper neighboring block B3. Block B3 is a block on the upper right side of the left block determined by vertically dividing the current block 2310 into two. In addition, when the vertical length of the current block 2310 is greater than the horizontal length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the upper neighboring block B0 or ​​B1 and the left neighboring block A2 of the current block 2310. Block A2 is a block located at the lower left of the upper block determined by horizontally dividing the current block 2310 into two blocks.

[0337] Alternatively, when the current block 2310 has a square shape, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of blocks A1, B1, A0, and B0. When the horizontal length of the current block 2310 is greater than the vertical length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of blocks A1, B3, A0, and B0. In addition, when the vertical length of the current block 2310 is greater than the horizontal length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of blocks A2, B1, A0, and B0. Regardless of the shape of the current block 2310, blocks A0 and B0 may be excluded from the scanning target.

[0338] Alternatively, when the current block 2310 has a square shape, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of blocks A1, B1, A0, and B0. When the horizontal length of the current block 2310 is greater than the vertical length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of blocks A1, B3, B1, and A0. In addition, when the vertical length of the current block 2310 is greater than the horizontal length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of blocks B1, A1, A2, and B0.

[0339] Alternatively, when the current block 2310 has a square shape, the motion information determiner 2130 may determine the temporal motion vector by determining availability in the order of block A1→block B1→block B0→block A0. When the horizontal length of the current block 2310 is greater than the vertical length, the motion information determiner 2130 may determine the temporal motion vector by determining availability in the order of block B1→block B0→block B3→block A1. In addition, when the vertical length of the current block 2310 is greater than the horizontal length, the motion information determiner 2130 may determine the temporal motion vector by determining availability in the order of block A1→block A2→block A0→block B1.

[0340] Alternatively, when the current block 2310 has a square shape, the motion information determiner 2130 may determine the temporal motion vector by determining availability in the order of block A1→block B1→block B0→block A0. When the horizontal length of the current block 2310 is greater than the vertical length, the motion information determiner 2130 may determine the temporal motion vector by determining availability in the order of block B1→block B0. In addition, when the vertical length of the current block 2310 is greater than the horizontal length, the motion information determiner 2130 may determine the temporal motion vector by determining availability in the order of block A1→block A0.

[0341] Alternatively, when the current block 2310 has a square shape, the motion information determiner 2130 may determine the temporal motion vector by determining the availability in the order of the left neighboring block A1 or A0→the upper neighboring block B1 or B0. When the horizontal length of the current block 2310 is greater than the vertical length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the upper neighboring block B0 or ​​B1. In addition, when the vertical length of the current block 2310 is greater than the horizontal length, the motion information determiner 2130 may determine the temporal motion vector by determining the availability of the left neighboring block A1 or A0.

[0342] When the motion information determiner 2130 determines the temporal motion vector through a scanning process, and the precision of the motion vector of a neighboring block with availability is A pixel precision (A is a rational number), the motion information determiner 2130 may determine the temporal motion vector by converting the motion vector of the neighboring block into B pixel precision (B is a rational number) different from the A pixel precision.

[0343] The motion information determiner 2130 may determine the accuracy of the temporal motion vector based on at least one of the size of the storage block as a unit for storing the motion vector and the size of the sub-block in the current block. For example, when the size of the storage block is M×M, the motion information determiner 2130 may determine the temporal motion vector by converting the motion vector of the neighboring block into M / 2 pixel accuracy or M pixel accuracy. In this case, in order to convert the motion vector of the neighboring block of high accuracy into low accuracy, the motion information determiner 2130 may divide the motion vector of the neighboring block by a specific value, determine the low-precision motion vector of integer pixel accuracy by rounding, rounding up, or rounding down the result value, and may determine the determined low-precision motion vector as the temporal motion vector. When the size of the storage block is M×M, the motion information determiner 2130 may convert the motion vector of the neighboring block into M / 2 pixel accuracy or M pixel accuracy, thereby omitting the process of calculating the position of the pixel unit for extracting the motion vector of the sub-region in the first reference region.

[0344] Alternatively, when the size of the sub-block is M×M, the motion information determiner 2130 may determine the temporal motion vector by converting the motion vector of the neighboring block into M / 2 pixel precision or M pixel precision. In this case, in order to convert the motion vector of the neighboring block of high precision into low precision, the motion information determiner 2130 may divide the motion vector of the neighboring block by a specific value, determine a low-precision motion vector of integer pixel precision by rounding, rounding up, or rounding down the result value, and may determine the determined low-precision motion vector as the temporal motion vector.

[0345] Alternatively, the motion information determiner 2130 may determine the temporal motion vector by converting the motion vector of the neighboring block into pixel precision pre-mapped to the size of the storage block and the size of the sub-block.

[0346] In an embodiment, the motion information determiner 2130 may determine the temporal motion vector based on the history of the motion vector. The motion information determiner 2130 may store a specific number of motion vectors used in the decoding process of the previous block, and may determine at least one motion vector used in the decoding process of the previous block as the temporal motion vector during decoding of the current block. For example, the motion information determiner 2130 may determine the motion vector used in the decoding process of the block just before the current block as the temporal motion vector. Alternatively, the motion information determiner 2130 may determine the motion vector indicated by the information included in the bitstream among the motion vectors stored as the history as the temporal motion vector. The motion information determiner 2130 may store a specific number of motion vectors of the previous block for each maximum coding unit, each slice unit, or each picture unit.

[0347] In another embodiment, the motion information determiner 2130 may determine a global motion vector obtained from a bitstream as a temporal motion vector. In this case, the global motion vector may be included in the bitstream with a specific pixel precision. The global motion vector may be used to decode a picture including the current block, a slice including the current block, or a block in a maximum coding unit including the current block.

[0348] In another embodiment, the motion information determiner 2130 may determine a predetermined motion vector (eg, a zero vector) as the temporal motion vector.

[0349] In another embodiment, the motion information determiner 2130 may determine the temporal motion vector based on at least one of the size of the storage block and the size of the sub-block. For example, when the size of the storage block is M×M, the motion information determiner 2130 may determine (M, M) or (M / 2, M / 2) with 1 pixel precision as the temporal motion vector. In addition, for example, when the size of the sub-block is M×M, the motion information determiner 2130 may determine (M, M) or (M / 2, M / 2) with 1 pixel precision as the temporal motion vector. Alternatively, when the size of the storage block is M×M and the size of the sub-block is M×M, the motion information determiner 2130 may determine (M, M) or (M / 2, M / 2) with 1 pixel precision as the temporal motion vector. Alternatively, the motion information determiner 2130 may determine a motion vector pre-mapped to the size of the storage block and the size of the sub-block as the temporal motion vector.

[0350] Optionally, when the motion vector determined based on at least one of the size of the storage block and the size of the sub-block is (I, J), the motion information determiner 2130 may determine not only (I, J) as a candidate, but also a motion vector that is a modification of (I, J) (for example, at least one of (-I, J), (I, -J), (-I, -J), (I, 0), (-I, 0), (0, J), (0, -J) and (0, 0)) as a candidate, and may determine any motion vector among the motion vectors determined as candidates as a temporal motion vector.

[0351] In another embodiment, when the current block is a specific block unit (e.g., a maximum coding unit), the motion information determiner 2130 may determine a predetermined motion vector (e.g., a zero vector) as the temporal motion vector. When the current block is not the specific block unit (e.g., a maximum coding unit), the temporal motion vector may be determined by a scanning process of a predetermined block.

[0352] When the reconstructor 2150 completes reconstruction of the current block, the deblocker 2170 may perform deblocking filtering on sample values ​​of the block based on a boundary between blocks to remove artifacts in the image.

[0353] Fig.28 is a diagram for describing a deblocking process according to an embodiment.

[0354] Reference Fig.28 , the current image 2700 includes a current block 2310 and neighboring blocks 2730 and 2750. In an embodiment, the deblocker 2170 deblocks sample values ​​adjacent to the boundaries 2735 and 2755 between the current block 2310 and the neighboring blocks 2730 and 2750. In detail, based on the boundary 2735 between the current block 2310 and the right block 2730, deblocking filtering of change values ​​of samples in the current block 2310 and the right block 2730 adjacent to the boundary 2735 may be performed. In addition, based on the boundary 2755 between the current block 2310 and the lower block 2750, deblocking filtering of change values ​​of samples in the current block 2310 and the lower block 2750 adjacent to the boundary 2755 may be performed.

[0355] In addition, in an embodiment, the deblocker 2170 may perform deblocking on the first subblock 2312, the second subblock 2314, the third subblock 2316, and the fourth subblock 2318 in the current block 2310. In detail, the deblocker 2170 may determine the filtered current block by performing deblocking filtering on the sample values ​​of the first subblock 2312, the second subblock 2314, the third subblock 2316, and the fourth subblock 2318 based on the boundaries 2311, 2313, 2315, and 2317 between the first subblock 2312, the second subblock 2314, the third subblock 2316, and the fourth subblock 2318. Therefore, based on the boundary 2311 between the first subblock 2312 and the second subblock 2314, deblocking filtering of the changed values ​​of the samples in the first subblock 2312 and the samples in the second subblock 2314 adjacent to the boundary 2311 may be performed. In addition, based on the boundary 2313 between the first sub-block 2312 and the third sub-block 2316, deblocking filtering of the changed values ​​of the samples in the first sub-block 2312 and the samples in the third sub-block 2316 adjacent to the boundary 2313 may be performed. Similarly, deblocking filtering may be performed based on the boundary 2317 between the second sub-block 2314 and the fourth sub-block 2318 and the boundary 2315 between the third sub-block 2316 and the fourth sub-block 2318.

[0356] In an embodiment, when the size of each of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316 and the fourth sub-block 2318 in the current block 2310 is equal to or less than a predetermined size (e.g., 8×8 or 16×16), the deblocker 2170 may perform deblocking filtering on the first sub-block 2312, the second sub-block 2314, the third sub-block 2316 and the fourth sub-block 2318, and when the size of each of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316 and the fourth sub-block 2318 is greater than the predetermined size, the deblocker 2170 may not perform deblocking filtering.

[0357] In addition, in an embodiment, when the size of each of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316 and the fourth sub-block 2318 in the current block 2310 is equal to or greater than a predetermined size (e.g., 8×8 or 16×16), the deblocker 2170 may perform deblocking filtering on the first sub-block 2312, the second sub-block 2314, the third sub-block 2316 and the fourth sub-block 2318, and when the size of each of the first sub-block 2312, the second sub-block 2314, the third sub-block 2316 and the fourth sub-block 2318 is less than the predetermined size, the deblocker 2170 may not perform deblocking filtering.

[0358] Fig.29 is a flowchart for describing a method of decoding an image according to an embodiment.

[0359] In operation S2810, the image decoding apparatus 2100 determines a temporal motion vector, and in operation S2820, the image decoding apparatus 2100 determines a candidate list including a first reference block indicated by the temporal motion vector as a candidate.

[0360] When the size of the current block is equal to or greater than a specific size and the prediction mode of the current block is a mode of determining the motion vector of the current block by using motion vectors of candidates included in the candidate list, the image decoding apparatus 2100 may determine the temporal motion vector and the candidate list.

[0361] The process of determining the temporal motion vector and the candidate list has been described above in detail, so its detailed description will be omitted.

[0362] In operation S2830, when a first reference block is selected from candidates included in the candidate list, the image decoding apparatus 2100 determines a motion vector of a subblock in a current block by using a motion vector obtained from the first reference block.

[0363] In operation S2840, the image decoding apparatus 2100 may reconstruct the current block based on a sample value of the second reference block indicated by the motion vector of the subblock.

[0364] When the current block is reconstructed, the image decoding apparatus 2100 may obtain a filtered current block by performing deblocking filtering on sample values ​​of subblocks based on boundaries between subblocks in the reconstructed current block. The filtered current block may be used as a reference block for a next block.

[0365] Fig.30 29 is a block diagram showing the configuration of an image encoding device 2900 according to an embodiment.

[0366] The image encoding device 2900 includes an encoder 2910 and a generator 2930. The encoder 2910 and the generator 2930 according to an embodiment may be implemented as at least one processor. The image encoding device 2900 may include one or more data memories (not shown) storing input / output data of the encoder 2910 and the generator 2930. In addition, the image encoding device 2900 may include a memory controller (not shown) for controlling data input to / output from the data memory (not shown).

[0367] The encoder 2910 encodes an image, and the generator 2930 generates a bit stream including information generated as a result of the image encoding. Fig.30 The encoder 2910 and the generator 2930 may correspond to Figure 2 encoder 220 and bitstream generator 210.

[0368] The encoder 2910 may determine a prediction mode of a current block determined in a current image. Examples of the prediction mode of the current block may include an intra mode, an inter mode, a merge mode, an AMVP mode, a direct mode, and a skip mode.

[0369] When the size of the current block is equal to or greater than a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, or 128×128), the encoder 2910 may determine a candidate list including the first reference block indicated by the temporal motion vector as a candidate. The candidate list may include a predetermined number of candidates.

[0370] The first reference block refers to a block used to extract a motion vector used to determine a motion vector of the current block.

[0371] When comparing the size of the current block with the specific size, the encoder 2910 may compare one of the width and height of the current block (e.g., the smaller size) with the specific size. For example, when the size of the current block is 4×16 and the specific size is 8×8, 4, which is the width of the current block, is smaller than 8, which indicates the size of one side in the specific size, and thus it may be determined that the size of the current block is smaller than the specific size.

[0372] In an embodiment, when the size of the current block is smaller than a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, or 128×128), a candidate list including blocks other than the first reference block as candidates may be determined. That is, based on the size of the current block, the first reference block may be included or may not be included in the candidate list.

[0373] In an embodiment, when the size of the current block is equal to or greater than the specific size, the encoder 2910 may determine a first candidate list including the first reference block as a candidate, and when the size of the current block is smaller than the specific size, the motion information determiner 2130 may determine a second candidate list including blocks other than the first reference block as candidates.

[0374] In addition, in an embodiment, when the size of the current block is smaller than a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, or 128×128) and the temporal motion vector is a predetermined motion vector (e.g., a zero vector), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include temporal neighboring blocks in a predetermined co-located image as candidates. Conversely, when the size of the current block is equal to or larger than the specific size or the temporal motion vector is not a predetermined motion vector, the first reference block may be included in the candidate list, and the temporal neighboring blocks in the co-located image may not be included in the candidate list. The specific size may be the size of a sub-block.

[0375] In addition, in an embodiment, when the size of the current block is greater than a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, 128×128), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporally adjacent block in a predetermined co-located image as a candidate. Conversely, when the size of the current block is equal to or less than the specific size, the first reference block may be included in the candidate list, and the temporally adjacent block in the co-located image may not be included in the candidate list. The specific size may be the size of a sub-block.

[0376] In addition, in an embodiment, when the size of the current block is the same as a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, or 128×128), a candidate list including blocks other than the first reference block as candidates may be determined. Conversely, when the size of the current block is not the same as the specific size, the first reference block may be included in the candidate list. In this case, a temporally adjacent block in a co-located image may not be included in the candidate list. The specific size may be the size of a sub-block.

[0377] In addition, in an embodiment, when the size of the current block is different from a specific size (e.g., 4×4, 8×8, 16×16, 32×32, 64×64, or 128×128), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporally adjacent block in a predetermined co-located image as a candidate. Conversely, when the size of the current block is the same as the specific size, the first reference block may be included in the candidate list, and the temporally adjacent block in the co-located image may not be included in the candidate list. The specific size may be the size of a sub-block.

[0378] In addition, in an embodiment, when the current block is a specific block unit (e.g., a maximum coding unit), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporally adjacent block in a predetermined co-located image as a candidate. Conversely, when the current block is not the specific block unit, the first reference block may be included in the candidate list, and the temporally adjacent block in the co-located image may not be included in the candidate list.

[0379] In addition, in an embodiment, when the size of the current block is k times the size of the sub-block (k is a predetermined integer), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporally adjacent block in a predetermined co-located image as a candidate. Conversely, when the size of the current block is not k times the size of the specific block, the first reference block may be included in the candidate list, and the temporally adjacent block in the co-located image may not be included in the candidate list.

[0380] In addition, in an embodiment, when the candidates of the candidate list are sequentially determined according to the availability of a plurality of blocks including the first reference block and the first reference block is determined as the first candidate of the candidate list, the first reference block may be excluded from the candidate list. For example, in a case where the blocks are included in the candidate list in the order of the first spatially adjacent block, the first reference block, and the second spatially adjacent block according to their availability, when the first spatially adjacent block has no availability and the first reference block is included in the candidate list as the first candidate, the first reference block may be excluded from the candidate list.

[0381] Also, in an embodiment, when a temporal layer value of a current picture in a GOP including the current picture is identical to a predetermined value (eg, a maximum value), a candidate list including blocks other than the first reference block as candidates may be determined.

[0382] In addition, in an embodiment, when the temporal motion vector is a predetermined motion vector (e.g., a zero vector), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporal neighboring block in a predetermined co-located image as a candidate. Conversely, when the temporal motion vector is different from the predetermined motion vector, the first reference block may be included in the candidate list, and the temporal neighboring block in the co-located image may not be included in the candidate list.

[0383] In addition, in an embodiment, when the temporal motion vector is different from a predetermined motion vector (e.g., a zero vector), a candidate list including blocks other than the first reference block as candidates may be determined. In this case, the candidate list may include a temporal neighboring block in a predetermined co-located image as a candidate. Conversely, when the temporal motion vector is the same as the predetermined motion vector, the first reference block may be included in the candidate list, and the temporal neighboring block in the co-located image may not be included in the candidate list.

[0384] In addition, in an embodiment, when there is no motion vector corresponding to the central pixel of the first reference block, a candidate list including blocks other than the first reference block as candidates may be determined. Conversely, when there is a motion vector corresponding to the central pixel of the first reference block, the first reference block may be included in the candidate list.

[0385] When the prediction mode of the current block is a mode of determining the motion vector of the current block by using motion vectors of candidates included in the candidate list, the encoder 2910 may determine the candidate list.

[0386] The method in which the encoder 2910 determines the candidate list is the same as the method in which the motion information determiner 2130 determines the candidate list, and thus a detailed description thereof will be omitted.

[0387] In an embodiment, the encoder 2910 determines a temporal motion vector indicating the first reference block. The method of determining the temporal motion vector is the same as the method in which the motion information determiner 2130 determines the temporal motion vector, and thus a detailed description thereof will be omitted.

[0388] The encoder 2910 may assign an index to a candidate included in the candidate list. For example, an index having a minimum value may be assigned to the first reference block. The encoder 2910 may determine a motion vector of a current block and a motion vector of a sub-block in the current block, and in order to encode the motion vector of the current block, the encoder 2910 selects one of the candidates included in the candidate list. When the first reference block is selected, the first reference block may be used to determine the motion vector of the sub-block in the current block. For example, when the first reference block is selected, the motion vector of a sub-region in the first reference block may be determined as the motion vector of the sub-block in the current block. The method of determining the motion vector of the sub-region in the first reference block has been described above, and thus a detailed description thereof will be omitted.

[0389] The generator 2930 generates a bitstream including information generated as a result of image encoding. The bitstream may include at least one of the following items: information indicating a prediction mode of a current block, information indicating one of the candidates included in the candidate list, information indicating a temporal motion vector, a differential motion vector between a motion vector of the current block and a motion vector of a candidate included in the candidate list, and residual data between a sample value of a second reference block and a sample value of the current block.

[0390] The encoder 2910 may perform the functions of the motion information determiner 2130, the reconstructor 2150, and the deblocker 2170 of the image decoding apparatus 2100. Therefore, the encoder 2910 may determine the motion vector of the current block by using the motion vector of the candidate selected in the candidate list, and may reconstruct the current block by motion compensation of the current block.

[0391] The encoder 2910 may apply deblocking filtering to the current image including the reconstructed current block. The encoder 2910 may perform deblocking filtering on the current block and the adjacent blocks based on the boundary between the current block and the adjacent blocks. In addition, the encoder 2910 may perform deblocking filtering on the sub-blocks based on the boundary between the sub-blocks in the current block. The deblocked current block may be used to encode the next block. When the current block is a reference block of a subsequent block, the motion vector of the subsequent block may be determined based on the representative motion vector of the first reference block. In another embodiment, when the current block is a reference block of a subsequent block, the motion vector of the subsequent block may be determined based on the motion vector of any sub-block in the sub-block in the current block.

[0392] Fig.31 is a flowchart for describing a method of encoding an image according to an embodiment.

[0393] In operation S3010, the image encoding apparatus 2900 determines a temporal motion vector, and in operation S3020, the image encoding apparatus 2900 determines a candidate list including a first reference block indicated by the temporal motion vector as a candidate.

[0394] When the size of the current block is equal to or greater than a specific size and the prediction mode of the current block is a mode of determining a motion vector of the current block by using motion vectors of candidates included in the candidate list, the image encoding apparatus 2900 may determine a temporal motion vector and a candidate list.

[0395] The process of determining the temporal motion vector and the candidate list has been described above in detail, so its detailed description will be omitted.

[0396] In operation S3030, the image encoding apparatus 2900 determines a motion vector of the current block and selects a candidate in the candidate list to be used to determine the motion vector of the current block. The image encoding apparatus 2900 may determine a candidate based on a cost corresponding to each candidate in the candidate list. A rate-distortion cost may be used to calculate the cost.

[0397] In operation S3040, the image encoding apparatus 2900 generates a bitstream including information indicating a candidate selected in the candidate list. When a first reference block is selected in the candidate list, a motion vector obtained from the first reference block may be used to determine a motion vector of a subblock in a current block.

[0398] As described above, in addition to information indicating the candidate selected in the candidate list, the bitstream may also include at least one of the following: information indicating a prediction mode of the current block (e.g., sub-block_merge_flag), information indicating a temporal motion vector, a differential motion vector between the motion vector of the current block and the motion vectors of the candidates included in the candidate list, and residual data between a sample value of a second reference block indicated by the motion vector of the current block and a sample value of the current block.

[0399] In addition, the embodiments of the present disclosure may be written as a computer-executable program or instruction, and the computer-executable program may be stored in a medium or a computer program product.

[0400] The medium may store computer executable programs continuously, or may temporarily store computer executable programs for execution or downloading. In addition, the medium may be any of a variety of recording media or storage media combined with single or multiple pieces of hardware, and the medium is not limited to media directly connected to the computer system, but may be distributed on a network. Examples of media include magnetic media (such as hard disks, floppy disks, and tapes) configured to store program instructions, optical recording media (such as compact disk read-only memories (CD-ROMs) and digital versatile disks (DVDs)), magneto-optical media (such as floppy disks and ROMs, random access memories (RAMs), and flash memory). In addition, other examples of media may include recording media and storage media managed by application stores that distribute applications or by websites, servers, etc. that provide or distribute various other types of software.

[0401] Although one or more embodiments of the present disclosure have been described with reference to the drawings, it will be understood by those skilled in the art that various changes in form and details may be made in the present disclosure without departing from the spirit and scope defined by the claims.

Claims

1. A method for decoding a picture, the method include: When the size of the current block is equal to or greater than a predetermined size, determining that the temporal candidate is available; Determine whether a neighboring block spatially adjacent to the current block in the current picture is available; When the one neighboring block is available, obtaining a temporal motion vector by using a motion vector of the one neighboring block, wherein when the one neighboring block is not available, the temporal motion vector is determined to be a zero vector; When the temporal candidate is available, generating a candidate list including the temporal candidate; and When the time candidate is selected from among the candidates included in the candidate list: Determining a motion vector of a first subblock in the current block, wherein the motion vector of the first subblock in the current block is determined based on a motion vector of a first subblock in a predetermined picture; determining a motion vector of a second subblock in the current block, wherein the motion vector of the second subblock in the current block is determined based on the motion vector of the second subblock in the predetermined picture; and reconstructing the current block by using a motion vector of a first subblock in the current block and a motion vector of a second subblock in the current block, wherein the first sub-block in the predetermined picture and the second sub-block in the predetermined picture are determined based on the temporal motion vector, The one neighboring block is located at the lower left side of the current block.

2. A method for encoding a picture, the method include: When the size of the current block is equal to or greater than a predetermined size, determining that the temporal candidate is available; Determine whether a neighboring block spatially adjacent to the current block in the current picture is available; When the one neighboring block is available, obtaining a temporal motion vector by using a motion vector of the one neighboring block, wherein when the one neighboring block is not available, the temporal motion vector is determined to be a zero vector; When the time candidate is available, generating a candidate list including the time candidate; Selecting a candidate for encoding the current block from among the candidates included in the candidate list; and generating a bitstream, wherein the bitstream includes information indicating the selected candidate, wherein, when selecting the temporal candidate from the candidate list, a motion vector of a first subblock in the current block is determined based on a motion vector of a first subblock in a predetermined picture, and a motion vector of a second subblock in the current block is determined based on a motion vector of a second subblock in the predetermined picture, wherein the first sub-block in the predetermined picture and the second sub-block in the predetermined picture are determined based on the temporal motion vector, The one neighboring block is located at the lower left side of the current block.

3. A method for transmitting a bit stream, in, The bit stream is generated by the method according to claim 2.