Apparatus and method for encoding and decoding motion information by using neighboring motion information

By changing the neighboring motion information and using the change information in the bit stream to identify the number of reference pictures and offset operations, the problem of low efficiency in motion information encoding and decoding is solved, and efficient motion information encoding and decoding is achieved.

CN113994667BActive Publication Date: 2025-09-05SAMSUNG ELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202080044983.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-09-27
Filing Date
2020-06-19
Publication Date
2025-09-05
Estimated Expiration
2040-06-19

AI Technical Summary

Technical Problem

In the prior art, in image encoding and decoding, the encoding and decoding efficiency of motion information is low, especially when using neighboring motion information, more bits are required.

Method used

By changing the neighboring motion information, the change information in the bit stream is used to identify the number of reference pictures of the neighboring blocks, and the motion vector of the current block is obtained through offset or scaling operations, reducing the number of bits for encoding and decoding.

Benefits of technology

Efficient encoding and decoding of motion information with a small amount of bits is achieved, thereby improving coding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113994667B_ABST
    Figure CN113994667B_ABST
Patent Text Reader

Abstract

A method for decoding motion information is disclosed, wherein the method includes the following steps: obtaining change information indicating whether motion information of a neighboring block is changed from a bitstream; when the change information indicates that the motion information is changed and a superior block can use one reference picture list, checking the number of pictures included in a reference picture list of a current block; selecting a reference picture of the neighboring block or a picture different from the reference picture of the neighboring block as a reference picture of the current block, considering the number of pictures; when the reference picture of the neighboring block is selected as the reference picture of the current block, obtaining a motion vector of the current block by applying an offset to at least one of an x ​​component or a y component of a motion vector of the neighboring block; and reconstructing the current block by using a reference block indicated by the motion vector of the current block in the reference picture of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image encoding and decoding, and in particular to a device and method for encoding and decoding current motion information by using neighboring motion information. Background Art

[0002] In encoding and decoding of an image, the image may be divided into blocks, and each block may be prediction-encoded and prediction-decoded via inter-prediction or intra-prediction.

[0003] A representative example of inter-frame prediction is motion estimation coding, which uses a method for compressing images by removing temporal redundancy between them. In motion estimation coding, a block of the current image is predicted using at least one reference image. A specific evaluation function is used to search for a reference block most similar to the current block within a specific search range. The current block is predicted based on the reference block, and a residual block is generated by subtracting the predicted block from the current block, which is then encoded. To further accurately predict the image, interpolation is performed on the at least one reference image to generate pixels in sub-pixel units smaller than integer pixel units, and inter-frame prediction is performed based on the pixels in the sub-pixel units.

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

[0005] Technical issues

[0006] According to an embodiment, an apparatus and method for encoding motion information and an apparatus and method for decoding motion information are provided, wherein the method and apparatus respectively encode and decode current motion information with a small number of bits by changing neighboring motion information.

[0007] Solution to the problem

[0008] According to an embodiment, a method for decoding motion information performed by a decoding device includes: obtaining change information indicating whether motion information of a neighboring block temporally or spatially related to a current block is changed from a bitstream; when the change information indicates that the motion information is changed and an upper block of the current block can use one reference picture list, identifying the number of pictures included in the reference picture list of the current block; considering the number of identified pictures, selecting a reference picture of the neighboring block or a picture different from the reference picture of the neighboring block as a reference picture of the current block; when the reference picture of the neighboring block is selected as the reference picture of the current block, obtaining a motion vector of the current block by applying an offset to at least one of an x ​​component or a y component of a motion vector of the neighboring block; and reconstructing the current block by using a reference block indicated by the motion vector of the current block in the reference picture of the current block.

[0009] Best Mode

[0010] According to an embodiment, a method for decoding motion information performed by a decoding device includes: obtaining change information indicating whether motion information of a neighboring block temporally or spatially related to a current block is changed from a bitstream; when the change information indicates that the motion information is changed and an upper block of the current block can use one reference picture list, identifying the number of pictures included in the reference picture list of the current block; considering the number of identified pictures, selecting a reference picture of the neighboring block or a picture different from the reference picture of the neighboring block as a reference picture of the current block; when the reference picture of the neighboring block is selected as the reference picture of the current block, obtaining a motion vector of the current block by applying an offset to at least one of an x ​​component or a y component of a motion vector of the neighboring block; and reconstructing the current block by using a reference block indicated by the motion vector of the current block in the reference picture of the current block.

[0011] The selecting step may include: when the number of identified pictures is 1, selecting a reference picture of the neighboring block as a reference picture of the current block.

[0012] When the change information indicates a first type change, the offset may have a + sign, and when the change information indicates a second type change, the offset may have a - sign.

[0013] When the number of identified pictures is 2 and the change information indicates a first type change, the selecting step may include selecting a picture different from the reference picture of the neighboring block as the reference picture of the current block, and the obtaining the motion vector of the current block may include obtaining the motion vector of the current block by scaling the motion vector of the neighboring block according to a ratio of a distance between the current picture and the reference picture of the neighboring block and a distance between the current picture and the reference picture of the current block.

[0014] When the number of identified pictures is 2 and the change information indicates a second type change, the selecting step may include selecting a reference picture of the neighboring block as a reference picture of the current block, and the obtaining the motion vector of the current block may include obtaining the motion vector of the current block by applying the offset to at least one of an x ​​component or a y component of the motion vector of the neighboring block.

[0015] When the number of identified pictures is 3 or more, the selecting step may include selecting a picture different from the reference picture of the neighboring block as the reference picture of the current block, and the obtaining the motion vector of the current block may include obtaining the motion vector of the current block by scaling the motion vector of the neighboring block according to a ratio of a distance between the current picture and the reference picture of the neighboring block and a distance between the current picture and the reference picture of the current block.

[0016] When the number of identified pictures is 3 or more and the change information indicates a first type change, the selecting step may include selecting a picture different from a reference picture of the neighboring block as a reference picture of the current block from among pictures included in the reference picture list.

[0017] When the number of identified pictures is 3 or more and the change information indicates a second type change, the selecting step may include: when the index of the reference picture indicating the neighboring block is less than 2, selecting a picture with an index of 2 from among the pictures included in the reference picture list as the reference picture of the current block, and when the index of the reference picture indicating the neighboring block is equal to or greater than 2, selecting a picture with an index of 1 from among the pictures included in the reference picture list as the reference picture of the current block.

[0018] The obtaining of the motion vector of the current block may include obtaining the motion vector of the current block by adding a differential motion vector obtained from a bitstream and a motion vector of the neighboring block to which the offset is applied.

[0019] The differential motion vector may be calculated according to change distance information and change direction information included in the bitstream.

[0020] The change distance information may indicate a change distance 2 n , where n may be an integer equal to or greater than 0, and the offset may be an odd number.

[0021] When the change information indicates that the motion information is not changed, the selecting step may include: selecting a reference picture of the neighboring block as a reference picture of the current block, and the obtaining the motion vector of the current block may include: obtaining the motion vector of the current block by applying a differential motion vector obtained from a bitstream to the motion vector of the neighboring block.

[0022] When the size of the current block is less than or equal to a preset size, the step of obtaining the change information is not performed, the selecting step may include: selecting a reference picture of the neighboring block as a reference picture of the current block, and the step of obtaining the motion vector of the current block may include: obtaining the motion vector of the current block by applying a differential motion vector obtained from a bitstream to the motion vector of the neighboring block.

[0023] According to another embodiment, a device for decoding motion information includes: a bitstream obtainer configured to obtain change information indicating whether motion information of a neighboring block temporally or spatially related to a current block is changed from a bitstream; a motion information obtainer configured to, when the change information indicates that the motion information is changed and a superior block including the current block can use one reference picture list, identify the number of pictures included in the reference picture list of the current block, select a reference picture of the neighboring block or a picture different from the reference picture of the neighboring block as a reference picture of the current block according to the number of pictures identified, and when the reference picture of the neighboring block is selected as the reference picture of the current block, obtain a motion vector of the current block by applying an offset to at least one of an x ​​component or a y component of a motion vector of the neighboring block; and a prediction decoder configured to reconstruct the current block by using a reference block indicated by the motion vector of the current block in the reference picture of the current block.

[0024] According to another embodiment, a method for encoding motion information includes: determining whether to change motion information of a neighboring block temporally or spatially related to a current block; and generating a bitstream, wherein the bitstream includes information indicating the neighboring block, change information indicating whether to change the motion information, and information indicating a differential motion vector, wherein when an upper block including the current block uses a reference picture list and a reference picture of the neighboring block is selected as a reference picture of the current block, the differential motion vector corresponds to a difference between a motion vector of the current block and a result obtained by applying an offset to at least one of an x ​​component or a y component of the motion vector of the neighboring block.

[0025] Disclosed beneficial effects

[0026] According to an embodiment, an apparatus and method for encoding motion information and an apparatus and method for decoding motion information may respectively encode and decode current motion information with a small number of bits by changing neighboring motion information.

[0027] However, the effects that can be achieved by the apparatus and method for encoding motion information and the apparatus and method for decoding motion information are not limited to those described above, and other effects not mentioned can be clearly understood by a person of ordinary skill in the art from the following description. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

[0031] Figure 3 1. A process of determining at least one coding unit by splitting a current coding unit according to an embodiment is shown;

[0032] Figure 4 1. A process of determining at least one coding unit by dividing a non-square coding unit according to an embodiment is shown;

[0033] Figure 5 1. A process of dividing a coding unit based on at least one of block shape information or division shape mode information according to an embodiment is shown;

[0034] Figure 6 A method of determining a specific coding unit from an odd number of coding units according to an embodiment is shown;

[0035] Figure 7 illustrates an order in which a plurality of coding units are processed when a plurality of coding units are determined by splitting a current coding unit according to an embodiment;

[0036] Figure 8 1. A process of determining that a current coding unit is to be split into an odd number of coding units when coding units cannot be processed in a specific order according to an embodiment is shown;

[0037] Figure 9 1. A process of determining at least one coding unit by dividing a first coding unit according to an embodiment is shown;

[0038] Figure 10 shows that shapes into which a non-square second coding unit may be divided are restricted when a second coding unit determined by dividing a first coding unit satisfies a specific condition according to an embodiment;

[0039] Figure 11 illustrates a process of splitting a square coding unit when division shape pattern information indicates that the square coding unit is not to be split into four square coding units according to an embodiment;

[0040] Figure 12 It is shown that a processing order among a plurality of coding units can be changed according to a process of dividing the coding units according to an embodiment;

[0041] Figure 13 illustrating a process of determining a depth of a coding unit when a shape and size of a coding unit are changed when the coding unit is recursively split so that a plurality of coding units are determined according to an embodiment;

[0042] Figure 14 illustrating a depth that may be determined based on a shape and size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment;

[0043] Figure 15 Detailed description of the embodiment of the present invention showing how to determine a plurality of coding units based on a plurality of specific data units included in a picture.

[0044] Figure 16 illustrates 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;

[0045] Figure 17 illustrates various shapes of coding units that may be determined based on division shape pattern information represented as a binary code according to an embodiment;

[0046] Figure 18 illustrating other shapes of coding units that may be determined based on division shape pattern information represented as a binary code according to an embodiment;

[0047] Figure 19 is a block diagram of an image encoding and decoding system that performs loop filtering;

[0048] Figure 20 is a block diagram of a configuration of an image decoding device according to an embodiment;

[0049] Figure 21 is an exemplary diagram showing positions of neighboring blocks temporally or spatially relative to a current block;

[0050] Figure 22is an exemplary table showing in which direction the prediction direction of the neighboring blocks is changed according to the value indicated by the change information;

[0051] Figure 23 is an exemplary table showing pictures included in reference picture list 0 and reference picture list 1;

[0052] Figure 24 is a diagram showing a positional relationship between a reference picture of a neighboring block, a current picture, and a reference picture of the current block;

[0053] Figure 25 is a diagram showing a positional relationship between a reference picture of a neighboring block, a current picture, and a reference picture of the current block;

[0054] Figure 26 is a diagram showing differential motion vectors displayed on a coordinate plane;

[0055] Figure 27 is an exemplary table showing change distances corresponding to values ​​of change distance information;

[0056] Figure 28 is an exemplary table showing change directions corresponding to values ​​of change direction information;

[0057] Figure 29 is a table for describing a method of selecting a reference picture of a current block according to the number of pictures included in the reference picture list and a value indicated by the change information;

[0058] Figure 30 is a diagram for describing a method of changing a motion vector of a neighboring block when a reference picture of the neighboring block and a reference picture of a current block are the same;

[0059] Figure 31 is a flowchart of a method for decoding motion information according to an embodiment;

[0060] Figure 32 is a block diagram of a configuration of an image encoding device according to an embodiment; and

[0061] Figure 33 is a flowchart of a method of encoding motion information according to an embodiment. DETAILED DESCRIPTION

[0062] Since the present disclosure allows for various changes and numerous examples, specific embodiments will be described in detail in the accompanying drawings and 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 are included in the present disclosure.

[0063] In the description of the embodiment, when it is believed that the specific detailed explanation of the related art may unnecessarily obscure the essence, the specific detailed explanation of the related art is omitted. In addition, the numbering (e.g., first, second, etc.) used in the description of the specification is merely an identifier code for distinguishing one element from another element.

[0064] Furthermore, in this specification, it will be understood that when elements are “connected” or “coupled” to each other, the elements can be directly connected or coupled to each other, but may alternatively be connected or coupled to each other through intervening elements between the elements, unless otherwise specified.

[0065] In this specification, regarding an element represented as a "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 subdivided functions. In addition, each element described below may perform some or all of the functions performed by another element in addition to its own main function, and some of the main functions of each element may be completely performed by another component.

[0066] In addition, in this specification, "image" or "screen" may refer to a still image or a moving image of a video, that is, the video itself.

[0067] In this specification, "sample" or "signal" refers to data assigned to a sampling location of an image, that is, data to be processed. For example, pixel values ​​of an image in the spatial domain and transform coefficients in the transform domain can be samples. A unit including at least one such sample can be defined as a block.

[0068] In the following, reference will be made to Figures 1 to 19 An image encoding method and apparatus and an image decoding method and apparatus based on tree-structured coding units and transformation units according to an embodiment 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 can receive a bitstream. The bitstream includes information about an image encoded by the image encoding device 200 described later. In addition, the bitstream can be transmitted from the image encoding device 200. The image encoding device 200 and the image decoding device 100 can be connected via a wired or wireless method, and the bitstream obtainer 110 can receive the bitstream via a wired or wireless method. The bitstream obtainer 110 can receive the bitstream from a storage medium such as an optical medium or a hard disk. The decoder 120 can reconstruct the image based on the information obtained from the received bitstream. The decoder 120 can obtain syntax elements for reconstructing the image from the bitstream. The decoder 120 can reconstruct the image based on the syntax elements.

[0072] Regarding a detailed operation of the image decoding apparatus 100 , the bitstream obtainer 110 may receive a bitstream.

[0073] The image decoding apparatus 100 may perform an operation of obtaining a binary bit string corresponding to a division shape pattern of a coding unit from a bitstream. Then, the image decoding apparatus 100 may perform an operation of determining a division rule for the coding unit. Furthermore, the image decoding apparatus 100 may perform an operation of dividing the coding unit into a plurality of coding units based on at least one of the binary bit string corresponding to the division shape pattern or the division rule. The image decoding apparatus 100 may determine a first allowable range of the size of the coding unit based on the aspect ratio of the coding unit in order to determine the division rule. The image decoding apparatus 100 may determine a second allowable range of the size of the coding unit based on the division shape pattern of the coding unit in order to determine the division rule.

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

[0075] First, a picture may be divided into one or more slices or one or more tiles. A slice or a tile may be a sequence of one or more maximum coding units (coding tree units (CTUs)). Depending on the embodiment, a slice may include one or more tiles or one or more maximum coding units. A slice including one or more tiles may be determined in a picture.

[0076] There is a maximum coding block (coding tree block (CTB)) that is conceptually comparable to a maximum coding unit (CTU). A maximum coding unit (CTU) represents 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 includes three sample arrays (sample arrays for the Y component, the Cr component, and the Cb component), 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 the luma samples and the 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 coded in color planes separated by color components, the maximum coding unit includes a syntax structure for encoding the picture and the samples of the picture.

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

[0079] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) includes a coding block of luma samples, two corresponding coding blocks of chroma samples, and syntax structures for encoding the luma and chroma samples. When the picture is a monochrome picture, a coding unit includes a coding block of monochrome samples and syntax structures for encoding monochrome samples. When the picture is coded in color planes separated by color components, a coding unit includes syntax structures for encoding the picture and 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, a (maximum) coding unit refers to a data structure including a (maximum) coding block containing corresponding samples and a syntax element corresponding to the (maximum) coding block. However, since a person skilled 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 following description refers to the maximum coding block and the maximum coding unit or the coding block and the coding unit without making a 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 embodiment 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 can 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 can be determined. The size of the chrominance maximum coding unit can 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 binary-dividable luma coding block is obtained from a bitstream, the maximum size of a binary-dividable luma coding block can be variably determined. In contrast, the maximum size of a ternary-dividable luma coding block can be fixed. For example, the maximum size of a ternary-dividable luma coding block in an I-picture can be 32×32, and the maximum size of a ternary-dividable luma coding block 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 split shape pattern information obtained from a bitstream. At least one of information indicating whether quad splitting is performed, information indicating whether multi-split is performed, split direction information, or split type information may be obtained from the bitstream as the split shape pattern information.

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

[0087] When the current coding unit is not quadruplicated, the information indicating whether multi-split is performed may indicate whether the current coding unit is no longer split (NO_SPLIT) or is binary / ternary split.

[0088] When the current coding unit is binary-split or ternary-split, the split direction information indicates that the current coding unit is split in one 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 binary-split or ternary-split.

[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 binary-split in the horizontal direction may be determined as a binary horizontal split mode (SPLIT_BT_HOR), the split mode when the current coding unit is ternary-split in the horizontal direction may be determined as a ternary horizontal split mode (SPLIT_TT_HOR), the split mode when the current coding unit is binary-split in the vertical direction may be determined as a binary vertical split mode (SPLIT_BT_VER), and the split mode when the current coding unit is ternary-split in the vertical direction may be determined as a ternary vertical split mode SPLIT_TT_VER.

[0091] The image decoding device 100 may obtain division shape pattern information from a binary bit string from a bitstream. The bitstream received by the image decoding device 100 may be in the form of a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, or the like. A binary bit string is information about a binary number. A binary bit string may include at least one bit. The image decoding device 100 may obtain division shape pattern information corresponding to the binary bit string based on a division rule. Based on the binary bit string, the image decoding device 100 may determine whether to perform quaternary division on a coding unit, whether to perform non-division on the coding unit, the division direction, and the division type.

[0092] The coding unit may be smaller than or equal to the maximum coding unit. For example, since the maximum coding unit is a coding unit having the largest 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. Reference will be made to Figures 3 to 16 The division of coding units is described in detail.

[0093] In addition, one or more prediction blocks for prediction may be determined from a coding unit. A prediction block may be equal to or smaller than a coding unit. In addition, one or more transform blocks for transformation may be determined from a coding unit. A transform block may be equal to or smaller than a 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 coding units is described in detail. The current block and the neighboring block may indicate one of a maximum coding unit, a coding unit, a prediction block, and a transform block. Furthermore, the current block of the current coding unit is the block currently being decoded or encoded, or the block currently being divided. The neighboring block may be a block reconstructed before the current block. The neighboring block may be spatially or temporally adjacent to the current block. The neighboring block may be located at one of the following: the lower left, left, upper left, above, upper right, right, or lower right of the current block.

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

[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. Here, N may be a positive integer. The block shape information is information indicating at least one of the shape, orientation, aspect ratio, or size of the coding unit.

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

[0100] When the width and height of a coding unit differ from each other (i.e., 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 non-square, the image decoding apparatus 100 may determine the aspect ratio in the block shape information of the coding unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, or 32:1. In addition, the image decoding apparatus 100 may determine whether the coding unit is horizontally or vertically oriented based on the width and height of the coding unit. In addition, the image decoding apparatus 100 may determine the size of the coding unit based on at least one of the width, height, or area of ​​the coding unit.

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

[0102] The image decoding device 100 may obtain the division shape pattern information from the bitstream. However, the embodiment is not limited thereto, and the image decoding device 100 and the image encoding device 200 may determine the pre-agreed division shape pattern information based on the block shape information. The image decoding device 100 may determine the pre-agreed division shape pattern information for the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine the division shape pattern information for the maximum coding unit as quadruple division. In addition, the image decoding device 100 may determine the division shape pattern information for the minimum coding unit as "no division". Specifically, the image decoding device 100 may determine the size of the maximum coding unit to be 256×256. The image decoding device 100 may determine the pre-agreed division shape pattern information as quadruple division. Quaternary division is a division shape pattern in which the width and height of the coding unit are both divided into two equal parts. The image decoding device 100 may obtain a coding unit of 128×128 size from a maximum coding unit of 256×256 size 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 division shape mode information. Figure 3 , when the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may determine not to split 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 unit 310b, 310c, 310d, 310e or 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 splitting the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that division is performed in the vertical direction. The image decoding apparatus 100 may determine two coding units 310c obtained by splitting the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that division is performed in the horizontal direction. The image decoding apparatus 100 may determine four coding units 310d obtained by splitting the current coding unit 300 in the vertical and horizontal directions based on the division shape pattern information indicating that division is performed in the vertical and horizontal directions. According to an embodiment, the image decoding apparatus 100 may determine three coding units 310e obtained by splitting the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that ternary division is performed in the vertical direction. The image decoding apparatus 100 may determine three coding units 310f obtained by splitting the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that ternary division is performed in the horizontal direction. However, the division method of the square coding unit is not limited to the above method, and the division shape pattern information may indicate various methods. A specific division method for dividing the square coding unit will be described in detail below with respect to various embodiments.

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

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

[0107] According to an embodiment, the image decoding apparatus 100 may determine a division method of a coding unit by using division shape pattern information, and in this case, the division shape pattern information may indicate the number of one or more coding units generated by dividing the coding unit. Figure 4 When the division shape pattern information indicates that the current coding unit 400 or 450 is divided into two coding units, the image decoding device 100 can determine the two coding units 420a and 420b or 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 image decoding apparatus 100 may split the current coding unit considering the position of the long side of the non-square current coding unit 400 or 450. 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 considering 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 (ternary division) 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. 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] Depending on the embodiment, the ratio of the width to the height of the current coding unit 400 or 450 may be 4:1 or 1:4. When the ratio of the width to the height is 4:1, the block shape information may be horizontal because the width is longer than the height. When the ratio of the width to the height is 1:4, the block shape information may be vertical because the width is shorter than the height. The image decoding device 100 may determine whether to split the current coding unit into an odd number of blocks based on the division shape pattern information. Furthermore, the image decoding device 100 may determine the direction in which to split 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 vertical, the image decoding device 100 may determine coding units 430a to 430c by splitting the current coding unit 400 horizontally. Furthermore, when the current coding unit 450 is horizontal, the image decoding device 100 may determine coding units 480a to 480c by splitting the current coding unit 450 vertically.

[0111] According to an embodiment, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and not all of the determined coding units may have the same size. 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 the other coding units 430a and 430c or 480a and 480c. That is, the coding units determined by dividing the current coding unit 400 or 450 may have a plurality of sizes, and in some cases, all of 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 further, 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 set a decoding process for a coding unit 430b or 480b to be different from a decoding process of other coding units 430a and 430c or 480a or 480c, wherein the coding unit 430b or 480b is located at the center of the three coding units 430a, 430b, and 430c or 480a, 480b, and 480c generated by dividing the current coding unit 400 or 450. For example, the image decoding apparatus 100 may limit the coding unit 430b or 480b at the center position from being further divided or from being divided only a specific number of times, unlike the other coding units 430a and 430c or 480a and 480c.

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

[0114] According to an embodiment, the image decoding device 100 may determine whether to split the square first coding unit 500 into coding units or not based on at least one of the block shape information or the division shape pattern information. According to an embodiment, when the division shape pattern information indicates that the first coding unit 500 is to be divided in the horizontal direction, the image decoding device 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 in the embodiment are terms used to understand the relationship between before and after the division of the coding unit. For example, the second coding unit may be determined by dividing the first coding unit, and the third coding unit may be determined by dividing the second coding unit. It will be understood that the structures of the first coding unit, the second coding unit, and the third coding unit follow the above description.

[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. The image decoding apparatus 100 may obtain the split shape pattern information, and may obtain a plurality of second coding units of various shapes (e.g., the second coding unit 510) 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 (for example, a coding unit located 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, the non-square third coding unit 520b 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. The non-square fourth coding unit 530b or 530d among the plurality of fourth coding units 530a, 530b, 530c, and 530d may be further divided into a plurality of coding units. For example, the non-square fourth coding unit 530b or 530d may be further divided into an odd-numbered coding unit. A method for recursively dividing coding units will be described below with respect to 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. Furthermore, 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 specific third coding units 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 of the odd number of third coding units 520b, 520c, and 520d to no longer being divided or to being divided a set number of times.

[0118] Reference Figure 5 , the image decoding apparatus 100 may limit the third coding unit 520c at the center position among the odd-numbered 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 of determining a specific coding unit from among odd-numbered coding units, performed by the image decoding apparatus 100 , according to an embodiment is illustrated.

[0121] Reference Figure 6 , the division shape pattern information of the current coding unit 600 or 650 can be obtained from a sample at a specific position (for example, 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 pattern information can be obtained is not limited to Figure 6 , and may include various positions (for example, above, below, 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 divided into a specific number of coding units, the image decoding apparatus 100 may select one coding unit from among the coding units. As will be described below with respect to various embodiments, various methods may be used to select one coding unit from among the plurality of coding units.

[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 odd-numbered coding units using information indicating positions of odd-numbered coding units. Figure 6, the image decoding apparatus 100 may determine the odd-numbered coding units 620a, 620b, and 620c or the odd-numbered 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 intermediate coding unit 620b or the intermediate coding unit 660b by using information about the positions of the odd-numbered coding units 620a, 620b, and 620c or the odd-numbered coding units 660a, 660b, and 660c. For example, the image decoding apparatus 100 may determine the central position coding unit 620b 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 samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, 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 samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, may include information indicating the width or height of the coding units 620a, 620b, and 620c included in the current coding unit 600, and the width or height may correspond to 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 can 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 information about the width or height of the coding units corresponding to the difference between the coordinates.

[0126] According to an embodiment, the information indicating the position of the upper left sample point 630a of the upper coding unit 620a may include coordinates (xa, ya), the information indicating the position of the upper left sample point 630b of the middle coding unit 620b may include coordinates (xb, yb), and the 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 can determine the middle coding unit 620b by using the coordinates of the upper left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively. For example, when the coordinates of the upper left samples 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 can be determined as the coding unit at the center position among the coding units 620a, 620b, and 620c determined by splitting 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 intermediate coding unit 620b relative to the position of the upper left sample point 630a of the upper coding unit 620a and coordinates (dxc, dyc) indicating the relative position of the upper left sample point 630c of the lower coding unit 620c relative to the position of the upper left sample point 630a of the upper coding unit 620a may be used. The method of determining 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 the 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 each of the coding units 620a, 620b, and 620c 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 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 or the width or height of the upper coding unit 620a and the intermediate coding unit 620b. The image decoding apparatus 100 may determine a coding unit having a size different from that of other coding units based on the determined width and height of the coding units 620a to 620c. Referring to Figure 6 , the image decoding apparatus 100 may determine the 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 method of determining a coding unit having a size different from the sizes of other coding units, performed by the image decoding apparatus 100, corresponds only to an example of determining a 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 methods of determining a coding unit at a specific position by comparing the sizes of the coding units 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 size of each 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 or the width or height of the left coding unit 660a and the middle coding unit 660b. The image decoding apparatus 100 may determine a coding unit having a size different from that of other coding units based on the determined width and height of the coding units 660a to 660c. With reference 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 a specific position. However, the above-described method of determining a coding unit having a size different from the sizes of other coding units, performed by the image decoding apparatus 100, corresponds only to an example of determining a 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 methods of determining a coding unit at a specific position by comparing the sizes of the coding units determined based on the coordinates of the specific sample points may be used.

[0131] However, the positions of samples considered for determining the position of a coding unit are not limited to the above-mentioned upper left position, and information on arbitrary positions of 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 longer 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 impose restrictions on the coding unit. When the current coding unit has a non-square shape in which the height is longer 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 (binary division) the current coding unit, and may determine the coding unit at a 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 respect 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 is not provided here.

[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 splitting operation to determine a coding unit at a specific position among the plurality of coding units. For example, the image decoding apparatus 100 may use at least one of block shape information or split shape pattern information stored in samples included in an intermediate coding unit in the splitting operation to determine a coding unit at a center position among the plurality of coding units determined by splitting the current coding unit.

[0135] Reference Figure 6, the image decoding apparatus 100 may split the current coding unit 600 into multiple 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 multiple coding units 620a, 620b, and 620c. Furthermore, the image decoding apparatus 100 may determine the coding unit 620b at the center position by considering the position where the division shape pattern information was obtained. That is, the division shape pattern information of the current coding unit 600 may be obtained from the sample 640 at the center position of the current coding unit 600, and when the current coding unit 600 is split into the multiple coding units 620a, 620b, and 620c based on the division shape pattern information, the coding unit 620b including the sample 640 may be determined as the coding unit at the center position. However, the information used to determine the coding unit at the center position is not limited to the division shape pattern information, and various types of information may be used to determine the coding unit at the center position.

[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 a specific position in the current coding unit 600 (for example, the sample at the center position of the current coding unit 600) to determine a coding unit at a specific position (for example, the coding unit at the center position of the divided 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, determine the coding unit 620b including the sample for which specific information (for example, the division shape pattern information) can 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. With reference 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 specific restrictions 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 of the sample included in the coding unit 620b to be determined as subject to 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, by using at least one of the information about the width of the current coding unit or the information about the height of the current coding unit, a sample located on a boundary for dividing at least one of the width or height of the current coding unit in half as a sample at which specific information can be obtained. 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, as a sample at which specific information can be obtained, one of the samples adjacent to the boundary for dividing the long side of the current coding unit in half.

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

[0141] According to an embodiment, based on the division shape pattern information, the image decoding device 100 can determine the second coding units 710a and 710b by dividing the first coding unit 700 in the vertical direction, determine the second coding units 730a and 730b by dividing the first coding unit 700 in the horizontal direction, or determine the second coding units 750a to 750d by dividing the first coding unit 700 in the 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) according to which the coding units in one row are processed and then the coding units in the next row are processed.

[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 coding units 710a and 710b, 730a and 730b, or 750a to 750d by dividing the first coding unit 700, and may recursively divide each of the determined plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d. A division method of the plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d may correspond to a division method of the first coding unit 700. In this manner, each of the plurality of coding units 710a and 710b, 730a and 730b, or 750a to 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 coding units may be determined based on the operation of splitting the coding units. In other words, the processing order of the split coding units may be determined based on the processing order of the coding units immediately before the split. The image decoding device 100 may determine the processing order of the third coding units 720a and 720b determined by splitting the left second coding unit 710a independently of the right second coding unit 710b. Because the third coding units 720a and 720b are determined by splitting the left second coding unit 710a horizontally, the third coding units 720a and 720b may be processed in a vertical order 720c. Because the left second coding unit 710a and the right second coding unit 710b are processed in a horizontal 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 order 720c. Determining the processing order of coding units based on coding units before splitting is not limited to the above example, and coding units split and determined into various shapes may be independently processed in a specific order using various methods.

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

[0147] According to an embodiment, the image decoding apparatus 100 may determine that the current coding unit is to be split into an odd number of coding units based on the obtained division shape pattern information. Figure 8 , the square first coding unit 800 may be divided into non-square second coding units 810a and 810b, and the second coding units 810a and 810b may be independently divided into third coding units 820a and 820b and 820c to 820e. According to an embodiment, the image decoding apparatus 100 may determine a plurality of third coding units 820a and 820b by horizontally dividing the left second coding unit 810a, 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 and 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 or the division shape pattern information: the first coding unit 800, the second coding units 810a and 810b, or the third coding units 820a and 820b and 820c to 820e. For example, the second coding unit located on the right side of the second coding units 810a and 810b may be divided into an odd number of third coding units 820c, 820d, and 820e. The processing order of the multiple coding units included in the first coding unit 800 can be a 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 to 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 or 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 to 820e. For example, the third coding units 820a and 820b determined when the height of the non-square left second coding unit 810a is divided in half may satisfy the condition. Because the boundary of the third coding units 820c to 820e determined when the right second coding unit 810b is divided into three coding units fails to divide the width or height of the right second coding unit 810b in half, it may be determined that the third coding units 820c to 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, based on the determination result, that the second coding unit on the right 810b is to be divided into an odd number of coding units. According to an embodiment, when a coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose specific restrictions on coding units at specific positions in the divided coding units. The restrictions or specific positions have been described above with respect to various embodiments, and thus a detailed description thereof will not be provided again.

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

[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. Figure 9 When 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. Specifically, 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 or height of the first coding unit 900 will be divided in half along the boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Figure 9 Because the boundaries of the second coding units 910a, 910b, and 910c determined by vertically dividing the first coding unit 900 into a square do not divide the width of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not meet the conditions for processing in a specific order. Furthermore, because the boundaries of the second coding units 920a, 920b, and 920c determined by horizontally dividing the first coding unit 900 into a square do not divide the height of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not meet the conditions for processing in a specific order. When the conditions are not met as described above, the image decoding apparatus 100 may determine that the scanning order is discontinuous and, based on the determination result, determine that the first coding unit 900 is to be divided into an odd number of coding units. According to an embodiment, when a coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose specific restrictions on coding units at specific positions within the divided coding units. These restrictions or specific positions have been described above with respect to various embodiments, and therefore a detailed description thereof will not be provided.

[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 Figure 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] Figure 10 It is shown that according to an embodiment, when a second coding unit having a non-square shape determined by the image decoding apparatus 100 splitting the first coding unit 1000 satisfies a specific condition, shapes into which the second coding unit may be split are restricted.

[0156] According to an embodiment, the image decoding apparatus 100 may determine whether to split a square first coding unit 1000 into non-square second coding units 1010a and 1010b, or 1020a and 1020b, based on the division shape pattern information obtained by the bitstream obtainer 110. The second coding units 1010a and 1010b, or 1020a and 1020b, may be independently split. In this way, the image decoding apparatus 100 may determine whether to split each of the second coding units 1010a and 1010b, or 1020a and 1020b, into multiple coding units or not to split each of the second coding units 1010a and 1010b, or 1020a and 1020b, based on the division shape pattern information of each of the second coding units 1010a and 1010b, or 1020a and 1020b. According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1012a and 1012b by horizontally splitting the non-square left-side second coding unit 1010a determined by vertically splitting the first coding unit 1000. However, when the left-side second coding unit 1010a is split horizontally, the image decoding apparatus 100 may restrict the right-side second coding unit 1010b from being split in the horizontal direction in which the left-side second coding unit 1010a is split. When the third coding units 1014a and 1014b are determined by splitting the right-side second coding unit 1010b in the same direction, since the left-side second coding unit 1010a and the right-side second coding unit 1010b are independently split horizontally, the third coding units 1012a and 1012b, or 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 and 1022b, or 1024a and 1024b, by vertically splitting the non-square second coding unit 1020a or 1020b determined by horizontally splitting the first coding unit 1000. 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] Figure 11 A process of splitting a square coding unit, performed by the image decoding apparatus 100 , when the division shape pattern information cannot indicate that the square coding unit is 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 and 1110b, or 1120a and 1120b, etc., by dividing the first coding unit 1100 based on the division shape pattern information. The division shape pattern information may include information regarding various methods for dividing the coding unit, but the information regarding the various division methods may not include information for dividing the coding unit into four square coding units. Based on such division shape pattern information, the image decoding apparatus 100 may not divide the square first coding unit 1100 into the four square coding units 1130a, 1130b, 1130c, and 1130d. The image decoding apparatus 100 may determine non-square second coding units 1110a and 1110b, or 1120a and 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 and 1110b, or 1120a and 1120b, etc. Each of the second coding units 1110a and 1110b, or 1120a and 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 horizontally splitting the left second coding unit 1110a, and square third coding units 1114a and 1114b by horizontally splitting the right second coding unit 1110b. Furthermore, the image decoding apparatus 100 may determine square third coding units 1116a, 1116b, 1116c, and 1116d by horizontally splitting both the left second coding unit 1110a and the right second coding unit 1110b. In this case, coding units having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d split from the first coding unit 1100 may be determined.

[0162] As another example, the image decoding apparatus 100 may determine square third coding units 1122a and 1122b by vertically dividing the upper second coding unit 1120a, and may determine square third coding units 1124a and 1124b by vertically dividing the lower second coding unit 1120b. Furthermore, the image decoding apparatus 100 may determine square third coding units 1126a, 1126b, 1126c, and 1126d by vertically dividing both the upper second coding unit 1120a and the lower second coding unit 1120b. 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.

[0163] Figure 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 the coding units.

[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 indicates a square shape and the division shape pattern information indicates that the first coding unit 1200 is divided in at least one of a horizontal direction or a vertical direction, the image decoding apparatus 100 may determine the second coding units 1210a and 1210b, or 1220a and 1220b, etc. by dividing the first coding unit 1200. Figure 12, the non-square second coding units 1210a and 1210b, or 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 described above with respect to Figure 11 An operation of dividing the second coding units 1210a and 1210b, or 1220a and 1220b is described, and thus a detailed description thereof will not be provided here.

[0165] According to an embodiment, the image decoding apparatus 100 may process 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 is not provided again. Figure 12 , the image decoding apparatus 100 may determine four square third coding units 1216a, 1216b, 1216c, and 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 the processing order of the third coding units 1216a, 1216b, 1216c, and 1216d, and 1226a, 1226b, 1226c, and 1226d based on the 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 Figure 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 and 1210b, and 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. In this way, 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 have the same shape, the image decoding apparatus 100 can process a plurality of coding units in different orders.

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

[0170] According to an embodiment, the image decoding apparatus 100 may determine the depth of a 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 split is 2n (n>0) times the length of the long side of the current coding unit after being split, the image decoding apparatus 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 split. In the following description, a coding unit with an increased depth is referred to as a coding unit of a deeper depth.

[0171] Reference Figure 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 by dividing the square first coding unit 1300 based on block shape information indicating a square shape (for example, the block shape information may be represented as "0: SQUARE"). Assuming that the size of the square first coding unit 1300 is 2N×2N, the second coding unit 1302 determined by dividing the width and height of the first coding unit 1300 into 1 / 2 may have a size of N×N. In addition, the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 into 1 / 2 may have a size of N / 2×N / 2. In this case, the width and height of the third coding unit 1304 are 1 / 4 of the width and height of the first coding unit 1300. When the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302 whose width and height are 1 / 2 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 the second coding unit 1312 or 1322 of a deeper depth, and the third coding unit 1314 or 1324 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 can be expressed as "1: NS_VER" indicating a non-square shape in which the height is longer than the width, or can be expressed 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 dividing at least one of the width or 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 dividing 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 dividing 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 or 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 or 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 vertical and horizontal directions.

[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 or 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 vertical and horizontal directions.

[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 or 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 vertical and horizontal directions.

[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 a 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 a first coding unit 1320 having a size of 2N×N by splitting the first coding unit 1300 in a horizontal direction. According to an embodiment, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by splitting the first coding unit 1300 having a size of 2N×2N in a horizontal direction or a vertical direction may be the same as the depth of the first coding unit 1300.

[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] Figure 14 Depths that may be determined based on shapes and sizes of coding units and partial indices (PIDs) 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. Figure 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 and horizontal directions 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 length of their long sides. For example, since the length of the side of the square first coding unit 1400 is equal to the length of the long side of the non-square second coding units 1402a and 1402b and 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 horizontally dividing the first coding unit 1410 in which the height is longer than the width 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 vertically dividing the first coding unit 1420 in which the width is longer than the height based on the division shape pattern information.

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

[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 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 coding units split from the first coding unit 1410 .

[0186] According to an embodiment, when the odd-numbered split coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for identifying the split coding units based on a size ratio between the coding units. Figure 14 , the width of the center coding unit 1414b among the odd-numbered divided coding units 1414a, 1414b, and 1414c may be equal to the widths of the other coding units 1414a and 1414c, and its height may be twice the heights of the other coding units 1414a and 1414c. That is, in this case, the center coding unit 1414b may include two other coding units 1414a or 1414c. Therefore, when the PID of the center coding unit 1414b is 1 based on the scanning order, the PID of the coding unit 1414c located adjacent to the coding unit 1414b may increase by 2 and thus may be 3. That is, there may be discontinuity in the PID values. According to an embodiment, the image decoding apparatus 100 may determine whether the odd-numbered divided coding units are not of equal size based on whether there is discontinuity in the PIDs used to identify 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. Figure 14, the image decoding apparatus 100 may determine an even number of coding units 1412a and 1412b or an odd number of coding units 1414a, 1414b, and 1414c by dividing the first coding unit 1410 into a rectangular shape having a height longer than a width. The image decoding apparatus 100 may use a PID indicating a corresponding coding unit to identify the corresponding coding unit. According to an embodiment, the PID may be obtained from a sample at a specific position of each coding unit (e.g., an upper left sample).

[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 whose height is longer than its 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 the coding unit at the center position among the coding units. The image decoding apparatus 100 may determine the coding unit 1414b having a PID that is an intermediate value among the PIDs of the coding units as the coding unit at the 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. Figure 14, the width of coding unit 1414b generated by splitting the first coding unit 1410 may be equal to the widths of the other coding units 1414a and 1414c, and its height may be twice the height of the other coding units 1414a and 1414c. In this case, when the PID of coding unit 1414b at the center position is 1, the PID of coding unit 1414c located adjacent to coding unit 1414b may increase by 2 and thus may be 3. When the PIDs do not increase uniformly as described above, the image decoding apparatus 100 may determine that the coding unit is split into a plurality of coding units, wherein the plurality of coding units includes coding units with sizes different from those of the other coding units. According to an embodiment, when the division shape pattern information indicates that the coding unit is split into an odd number of coding units, the image decoding apparatus 100 may split the current coding unit such that a coding unit at a specific position (e.g., a coding unit at the center position) among the odd number of coding units has a size different from that of the other coding units. In this case, the image decoding apparatus 100 may determine the coding units at the center position with different sizes by using the PIDs of the coding units. However, the PID and the size or position of the coding unit at a specific position are not limited to the above 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] Figure 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 splitting a coding unit starting by using division shape pattern information. That is, the specific data unit may correspond to a coding unit for determining the highest depth of a plurality of coding units split from the current picture. In the following description, for ease of explanation, the specific data unit is referred to as a reference data unit.

[0192] Depending on the embodiment, the reference data unit may have a specific size and a specific size shape. Depending on the embodiment, the reference data unit may include M×N samples. Here, M and N may be equal to each other and may be integers expressed as powers 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 a 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 of each reference data unit. The operation of dividing the reference data units 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 a 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 units.

[0195] Reference Figure 15 , the image decoding apparatus 100 may use a square reference coding unit 1500 or a non-square reference coding unit 1502. Depending on an embodiment, the shape and size of the reference coding unit may be determined based on various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, a maximum coding unit, etc.) that can include one or more reference coding units.

[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 or 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 describes the operation of dividing the square reference coding unit 1500 into one or more coding units, and the above has been described about Figure 4 The operation of splitting the current coding unit 400 or 450 describes an operation of splitting the non-square reference coding unit 1502 into one or more coding units. Therefore, a detailed description thereof is not provided again.

[0197] According to an embodiment, the image decoding apparatus 100 may determine the size and shape of a reference coding unit using a PID for identifying the size and shape of a reference coding unit based on certain data units predetermined based on specific conditions. That is, the bitstream obtainer 110 may obtain from the bitstream only a PID for identifying the size and shape of a reference coding unit for each slice, slice segment, tile, tile group, or maximum coding unit (a slice, slice segment, tile, tile group, or maximum coding unit, for example, a data unit that satisfies a specific condition (e.g., a data unit with a size equal to or smaller than a slice) among various data units (e.g., a sequence, picture, slice, slice segment, tile, tile group, maximum coding unit, etc.). The image decoding apparatus 100 may determine the size and shape of a reference coding unit for each data unit that satisfies the specific condition using the PID. When obtaining and using reference coding unit shape information and reference coding unit size information from a bitstream based on each relatively small data unit, using the bitstream may be inefficient. Therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and reference coding unit size information. In this case, at least one of the sizes or shapes of the reference coding units corresponding to the PID for identifying the size or shape of the reference coding units may be predetermined. That is, the image decoding apparatus 100 may determine at least one of the sizes or 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 or shapes of the reference coding units predetermined based on the PID.

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

[0199] 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 a division method of the current coding unit from a bitstream, and may use the obtained information. The division shape pattern information may be included in a 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 a bitstream according to each maximum coding unit or each reference coding unit, and may use the obtained syntax element.

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

[0201] The image decoding apparatus 100 may determine a division rule for 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 the division rule for an image based on information obtained from a bitstream. The image decoding apparatus 100 may determine the 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 tile header, or a tile group header. The image decoding apparatus 100 may determine the division rule differently depending on the frame, slice, tile, temporal layer, maximum coding unit, or coding unit.

[0202] The image decoding apparatus 100 may determine a division rule based on the block shape of the coding unit. The block shape may include the size, shape, aspect ratio, and orientation of the coding unit. The image encoding apparatus 200 and the image decoding apparatus 100 may predetermine the division rule based on the block shape information of the coding unit. However, the embodiment is not limited thereto. The image decoding apparatus 100 may determine the division rule based on information obtained from the bitstream received from the image encoding apparatus 200.

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

[0204] 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 up to 256×256. The size of the coding unit may be classified based on 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 classified into the same group. For example, the image decoding apparatus 100 may classify coding units having the same long side length as having the same size. In addition, the image decoding apparatus 100 may apply the same division rule to coding units having the same long side length.

[0205] 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, 1:32, etc. In addition, the direction of the coding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate that the width of the coding unit is longer than the height of the coding unit. The vertical direction may indicate that the width of the coding unit is shorter than the height of the coding unit.

[0206] The image decoding apparatus 100 may adaptively determine a division rule based on the size of a coding unit. The image decoding apparatus 100 may determine different allowable division shape patterns based on the size of a coding unit. For example, the image decoding apparatus 100 may determine whether division is allowed based on the size of a coding unit. The image decoding apparatus 100 may determine a division direction based on the size of a coding unit. The image decoding apparatus 100 may determine allowable division types based on the size of a coding unit.

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

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

[0209] In addition, the image decoding apparatus 100 may determine a division rule so that the coding units generated via different division paths do not have the same block shape. However, the embodiment is not limited thereto, and the coding units generated via different division paths have the same block shape. The coding units generated via different division paths may have different decoding processing orders. As has been mentioned above, Figure 12 The decoding process order is described, so its details are not provided again.

[0210] Figure 16Illustrated are 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.

[0211] Reference Figure 16 , the image decoding apparatus 100 may determine that the combination of division shapes into which each picture coding unit can be divided is different. For example, the image decoding apparatus 100 may decode the image by using, among at least one picture included in the image, a picture 1600 that can be divided into four coding units, a picture 1610 that can be divided into two or four coding units, and a picture 1620 that can be divided into two, three, or four coding units. The image decoding apparatus 100 may use only the division shape information indicating division into four square coding units to divide the picture 1600 into a plurality of coding units. The image decoding apparatus 100 may use only the division shape information indicating division into two or four coding units to divide the picture 1610. The image decoding apparatus 100 may use only the division shape information indicating division into two, three, or four coding units to divide the picture 1620. Because the above-mentioned combination of division shapes is merely an embodiment for describing the operation of the image decoding device 100, the combination of division shapes should not be interpreted as being limited to the embodiment, but should be interpreted as various types of combinations of division shapes that can be used for each specific data unit.

[0212] 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 for 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 bitstream obtainer 110 of the image decoding apparatus 100 may determine a combination of division shapes of coding units into which a specific data unit may be divided by using the obtained index, and thus, may use a different combination of division shapes for each specific data unit.

[0213] Figure 17 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.

[0214] According to an embodiment, the image decoding apparatus 100 may split the coding unit into various shapes by using block shape information and division shape pattern information obtained through the bitstream obtainer 110. The division shape of the coding unit may correspond to various shapes including the shapes described in the above embodiments.

[0215] Reference Figure 17, the image decoding apparatus 100 may divide the square coding unit in at least one of 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.

[0216] 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, 4 division shapes may be indicated by the division shape pattern information for the square coding unit. According to an embodiment, the division shape pattern information may be represented as a 2-bit binary code, and a binary code may be assigned to each division shape. For example, when the coding unit is not divided, the division shape pattern information may be represented as (00)b, when the coding unit is divided in the horizontal direction and the vertical direction, the division shape pattern information may be represented as (01)b, when the coding unit is divided in the horizontal direction, the division shape pattern information may be represented as (10)b, and when the coding unit is divided in the vertical direction, the division shape pattern information may be represented as (11)b.

[0217] According to an embodiment of the image decoding apparatus 100, when a non-square coding unit is divided in a horizontal direction or a vertical direction, the type of the division shape indicated by the division shape pattern information may be determined based on the number of divisions of the coding unit. Figure 17 , according to an embodiment, the image decoding device 100 may divide the non-square coding unit into at most three 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. In other words, the image decoding device 100 may use variable length coding (VLC) instead of fixed length coding (FLC) in order to use a binary code indicating the division shape pattern information.

[0218] According to the embodiment, referring to Figure 17 , the binary code of the division shape pattern information indicating that the coding unit is not divided can 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, although there is no division shape pattern information set to (01)b, the binary code of the division shape pattern information of 2 bits is used. However, as Figure 17As shown in , when three types of division shapes are used for non-square coding units, the image decoding apparatus 100 can determine that the coding unit is not divided even by using a one-bit binary code (0)b as the division shape pattern information, and thus can effectively use the bitstream. However, the division shape of the non-square coding unit indicated by the division shape pattern information should not be restrictively interpreted as referring to Figure 17 The three shapes described herein should be interpreted as including various shapes of the above-mentioned embodiments.

[0219] Figure 18 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.

[0220] Reference Figure 18 , the image decoding device 100 may divide the square coding unit in the horizontal direction or the vertical direction, and divide the non-square coding unit in the horizontal direction or the vertical direction based on the division shape pattern information. In other words, 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, although there is no division shape pattern information set to (01)b, the binary code of the 2-bit division shape pattern information is used. However, as Figure 18 As shown in , when three types of division shapes are used for square coding units, the image decoding apparatus 100 can determine that the coding unit is not divided even by using a one-bit binary code (0)b as the division shape pattern information, and thus can effectively use the bit stream. However, the division shape of the square coding unit indicated by the division shape pattern information should not be restrictively interpreted as referring to Figure 18 Three shapes are described and should be interpreted as including various shapes of the above-mentioned embodiments.

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

[0222] According to an embodiment, the image decoding device 100 will describe a process for obtaining syntax related to block shape information or partition shape mode information via CABAC. A bitstream including a binary code of the syntax may be obtained via the bitstream obtainer 110. The image decoding device 100 may detect syntax elements indicating block shape information or partition shape mode information by debinarizing the binary bit string included in the obtained bitstream. According to an embodiment, the image decoding device 100 may obtain a set of binary binary bit strings corresponding to the syntax elements to be decoded, and decode each binary bit using probability information. This operation may be repeated until the binary bit string including the decoded binary bit becomes the same as one of the previously obtained binary bit strings. The image decoding device 100 may determine the syntax elements by debinarizing the binary bit string.

[0223] According to an embodiment, the image decoding apparatus 100 may determine a syntax for a binary bit string by performing a decoding process of adaptive binary arithmetic coding, and update a probability model for the binary bits obtained via the bitstream obtainer 110. Figure 17 According to an embodiment, the bitstream obtainer 110 of the image decoding apparatus 100 may obtain a bitstream indicating a binary code representing the division shape pattern information. The image decoding apparatus 100 may determine the syntax for the division shape pattern information by using a binary code having a size of 1 bit or 2 bits. The image decoding apparatus 100 may update the probability for each bit in the 2-bit binary code in order to determine the syntax for the division shape pattern information. In other words, the image decoding apparatus 100 may update the probability of the next binary bit having a value of 0 or 1 when decoding the next binary bit based on whether the value of the first binary bit in the 2-bit binary code is 0 or 1.

[0224] According to an embodiment, the image decoding apparatus 100 may update the probability for bins used when decoding bins of a bin string for syntax when determining syntax, and may determine that specific bits of a bin string have the same probability without updating the probability.

[0225] Reference Figure 17When determining syntax using a binary bit string indicating division shape pattern information for a non-square coding unit, the image decoding apparatus 100 may determine the syntax for the division shape pattern information using a single bit having a value of 0 when the non-square coding unit is not divided. In other words, when the block shape information indicates that the current coding unit has a non-square shape, the first bit of the binary bit string for the division shape pattern information may be 0 when the non-square coding unit is not divided, and may be 1 when the non-square coding unit is divided into two or three coding units. Therefore, the probability that the first bit of the binary bit string for the division shape pattern information for a non-square coding unit is 0 is 1 / 3, and the probability that the first bit of the binary bit string for the division shape pattern information for a non-square coding unit is 1 is 2 / 3. As described above, because the division shape pattern information indicating that the non-square coding unit is not divided represents only a single-bit binary bit string having a value of 0, the image decoding apparatus 100 may determine the syntax for the division shape pattern information by determining whether the second bit is 0 only when the first bit of the division shape pattern information is 1. According to an embodiment, when the first binary bit of the division shape pattern information is 1, the image decoding apparatus 100 may decode the binary bit while considering that the probability that the second binary bit is 0 and 1 is the same.

[0226] According to an embodiment, the image decoding apparatus 100 may use various probabilities for each bin when determining the bins of the bin string for the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may determine the probabilities of the bins for the division shape pattern information differently based on the direction of the non-square block. According to an embodiment, the image decoding apparatus 100 may determine the probabilities of the bins for the division shape pattern information differently based on the area or the length of the long side of the current coding unit. According to an embodiment, the image decoding apparatus 100 may determine the probabilities of the bins for the division shape pattern information differently based on at least one of the area or the length of the long side of the current coding unit.

[0227] According to an embodiment, the image decoding apparatus 100 may determine whether the probability of the binary bits of the partition shape pattern information is the same for coding units of a specific size or larger. For example, based on the length of the long side of the coding unit, it may be determined that the probability of the binary bits of the partition shape pattern information is the same for coding units of 64 samples or larger.

[0228] According to an embodiment, the image decoding apparatus 100 may determine the initial probability of bins included in a bin string of the division shape pattern information based on a slice type (for example, I slice, P slice, or B slice).

[0229] Figure 19is a block diagram of an image encoding and decoding system 1900 that performs loop filtering.

[0230] The encoding end 1910 of the image encoding and decoding system 1900 transmits an encoded bitstream of an image, and the decoding end 1950 receives the bitstream and decodes the bitstream to output a reconstructed image. Here, the encoding end 1910 may have a similar configuration to the image encoding apparatus 200 described later, and the decoding end 1950 may have a similar configuration to the image decoding apparatus 100.

[0231] At the encoding end 1910, the prediction encoder 1915 outputs prediction data via inter-frame prediction and intra-frame prediction, and the transformer and quantizer 1920 outputs quantized transform coefficients of the residual data between the prediction data and the current input image. The entropy encoder 1925 transforms the quantized transform coefficients by encoding the quantized transform coefficients and outputs the transformed quantized transform coefficients as a bitstream. The quantized transform coefficients are reconstructed into spatial domain data via the inverse quantizer and inverse transformer 1930, and the spatial domain data is output as a reconstructed image via the deblocking filter 1935 and the loop filter 1940. The reconstructed image can be used as a reference image for the next input image via the prediction encoder 1915.

[0232] The encoded image data in the bitstream received by the decoding end 1950 is reconstructed into residual data in the spatial domain via the entropy decoder 1955 and the inverse quantizer and inverse transformer 1960. When the prediction data and residual data output from the prediction decoder 1975 are combined, the spatial domain image data is configured, and the deblocking filter 1965 and the loop filter 1970 can output a reconstructed image for the current original image by filtering the spatial domain image data. The reconstructed image can be used by the prediction decoder 1975 as a reference image for the next original image.

[0233] The loop filter 1940 of the encoding end 1910 performs loop filtering by using filter information input according to user input or system settings. The filter information used by the loop filter 1940 is output to the entropy encoder 1925 and transmitted to the decoding end 1950 together with the encoded image data. The loop filter 1970 of the decoding end 1950 can perform loop filtering based on the filter information input from the decoding end 1950.

[0234] The above-mentioned various embodiments describe operations related to the image decoding method performed by the image decoding apparatus 100. Hereinafter, operations of the image encoding apparatus 200 that performs an image encoding method corresponding to an inverse process of the image decoding method will be described through various embodiments.

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

[0236] The image encoding apparatus 200 may include an encoder 220 and a bitstream generator 210. The encoder 220 may receive an input image and encode the input image. The encoder 220 may obtain at least one syntax element by encoding the input image. 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, or 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, or a size of a coding unit.

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

[0238] 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 such a shape may be included in the block shape information.

[0239] According to an embodiment, the encoder 220 may determine which shape the coding unit is to be divided into. 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 such a shape of the coding unit.

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

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

[0242] The image encoding apparatus 200 determines information about a division shape pattern based on the division shape pattern of the coding unit. The image encoding apparatus 200 may determine a context model based on at least one of a shape, direction, aspect ratio, or size of the coding unit. In addition, the image encoding apparatus 200 generates a bitstream including information about a division shape pattern used to divide the coding unit based on the context model.

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

[0244] 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, or a size of a neighboring coding unit adjacent to the coding unit to determine the context model. Here, the neighboring coding unit may include at least one of coding units located below the left, to the left, above the left, above, to the right, above the right, or below the right of the coding unit.

[0245] In addition, the image encoding apparatus 200 may compare the width length of the upper adjacent coding unit with the width length of the coding unit to determine the context model. 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.

[0246] Since the operation of the image encoding device 200 includes reference Figures 3 to 19 The operations of the image decoding apparatus 100 described are similar, so a detailed description thereof will not be provided.

[0247] Figure 20 is a block diagram showing a configuration of an image decoding apparatus 2000 according to an embodiment.

[0248] Reference Figure 20 , the image decoding apparatus 2000 includes a bitstream obtainer 2010 , a motion information obtainer 2030 , and a prediction decoder 2050 .

[0249] Figure 20 The bitstream obtainer 2010 may correspond to Figure 1 The bit stream obtainer 110, and Figure 20 The motion information obtainer 2030 and the prediction decoder 2050 may correspond to Figure 1 decoder 120.

[0250] According to an embodiment, the bitstream obtainer 2010, the motion information obtainer 2030, and the prediction decoder 2050 may be implemented as at least one processor. The image decoding apparatus 2000 may include at least one memory (not shown) that stores input / output data of the bitstream obtainer 2010, the motion information obtainer 2030, and the prediction decoder 2050. The image decoding apparatus 2000 may include a memory controller (not shown) for controlling data input and output of the memory.

[0251] The bitstream obtainer 2010 obtains a bitstream generated as a result of encoding an image. The bitstream obtainer 2010 obtains syntax elements for decoding the image from the bitstream. Binary values ​​corresponding to the syntax elements may be included in the bitstream according to the hierarchical structure of the image. The bitstream obtainer 2010 may obtain the syntax elements by performing entropy encoding on the binary values ​​included in the bitstream.

[0252] The bitstream may include information about a prediction mode of a current block in a current picture. The current block may refer to a block of a maximum coding unit, a coding unit, or a transformation unit divided from the current picture to be encoded or decoded.

[0253] The prediction mode of the current block may include intra prediction mode or inter prediction mode. As described above, inter prediction mode is a mode for reconstructing the current block from a reference block in a reference picture indicated by the motion information of the current block. The motion information may include a prediction direction, a reference picture index, and a motion vector.

[0254] The prediction direction may be one of list 0, list 1, and bidirectional. When the prediction direction is list 0, the picture included in reference picture list 0 is used as a reference picture in the list 0 direction, and when the prediction direction is list 1, the picture included in reference picture list 1 is used as a reference picture in the list 1 direction. Furthermore, when the prediction direction is bidirectional, the picture included in reference picture list 0 is used as a reference picture in the list 0 direction, and the picture included in reference picture list 1 is used as a reference picture in the list 1 direction.

[0255] The reference picture index indicates a picture used as a reference picture for the current block from among the pictures included in reference picture list 0 and / or reference picture list 1. Based on the reference picture index in the list 0 direction, the picture used as the reference picture in the list 0 direction is specified from among the pictures included in reference picture list 0. Furthermore, based on the reference picture index in the list 1 direction, the picture used as the reference picture in the list 1 direction is specified from among the pictures included in reference picture list 1.

[0256] The motion vector specifies the position of the reference block in the reference picture. The motion vector in the list 0 direction indicates the motion vector of the reference block in the reference picture in the list 0 direction, and the motion vector in the list 1 direction indicates the motion vector of the reference block in the reference picture in the list 1 direction.

[0257] When the prediction direction of the current block is the list 0 direction, the motion information of the current block includes at least one of information indicating that the prediction direction of the current block is the list 0 direction, a reference picture index in the list 0 direction, or a motion vector in the list 0 direction. When the prediction direction of the current block is the list 1 direction, the motion information of the current block includes at least one of information indicating that the prediction direction of the current block is the list 1 direction, a reference picture index in the list 1 direction, or a motion vector in the list 1 direction. When the prediction direction of the current block is bidirectional, the motion information of the current block includes at least one of information indicating that the prediction direction of the current block is bidirectional, a reference picture index in the list 0 direction, a reference picture index in the list 1 direction, a motion vector in the list 0 direction, or a motion vector in the list 1 direction.

[0258] Merge mode (or direct mode), one of the inter-frame prediction modes, uses the motion information of a previous block decoded before the current block as the motion information of the current block. This can reduce the bit rate by including only information indicating the previous block in the bitstream without directly including the motion information of the current block in the bitstream.

[0259] Typically, in a candidate list that includes multiple pieces of motion information of neighboring blocks as candidates, the number of candidates is limited in advance, and the similarity between the multiple pieces of motion information of the neighboring blocks and the motion information of the current block may not be high. Therefore, even when the best candidate is selected from the candidate list, if the motion information of the selected candidate is different from the motion information of the current block, the quality of the reconstructed block is inevitably degraded.

[0260] According to an embodiment of the present disclosure, after constructing a candidate list including multiple pieces of motion information of neighboring blocks as candidates, the motion information of the neighboring blocks may be modified according to a specific standard to be used as the motion information of the current block. In other words, according to the present disclosure, instead of using the motion information included in the candidate list as is, the motion information in the candidate list may be modified according to a specific standard so that the difference between the reconstructed block and the original block is reduced.

[0261] When the prediction mode of the current block is a mode for deriving the motion information of the current block by using the motion information of the neighboring blocks, the bitstream obtainer 2010 obtains change information indicating whether to change the motion information of the neighboring blocks from the bitstream. The change information may indicate whether the motion information of the neighboring blocks needs to be changed, and when the change is necessary, the change information may indicate how the motion information will be changed.

[0262] According to an embodiment, when information obtained from a higher level of the current block (e.g., 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 of a bitstream) indicates that the change mode is not applied, the bitstream obtainer 2010 may not obtain change information of the current block from the bitstream, and when the information indicates that the change mode is applied, the bitstream obtainer 2010 may obtain change information of the current block from the bitstream.

[0263] According to an embodiment, even when information obtained from a higher level of the current block indicates that a change mode is applied, the bitstream obtainer 2010 may not obtain change information from the bitstream when the size of the current block is equal to or smaller than a preset size. When the size of the current block is small, the degree of quality improvement may be low compared to the complexity of obtaining motion information of the current block by changing motion information of adjacent blocks. The size of the current block may be calculated by multiplying the width and height of the current block or by adding the width and height of the current block.

[0264] When the change information indicates a change in the motion information of a neighboring block, the motion information obtainer 2030 obtains the motion information of the current block by changing the motion information of the neighboring block. On the other hand, when the change information indicates no change in the motion information of the neighboring block, the motion information obtainer 2030 may obtain the motion information of the current block without changing the motion information of the neighboring block. As described below, even when the change information indicates a change, the motion information of the neighboring block, particularly at least one of the prediction direction, reference picture, or motion information, may not be changed. Furthermore, even when the change information indicates no change, the motion information of the neighboring block, particularly the motion vector, may be changed based on the differential motion vector obtained from the bitstream.

[0265] Before describing a method of changing motion information of a neighboring block, neighboring blocks spatially or temporally related to a current block will be described.

[0266] Figure 21 2100 is an exemplary diagram illustrating positions of neighboring blocks temporally or spatially related to the current block 2100 .

[0267] Reference Figure 21 , the neighboring blocks of the current block 2100 may include a spatial block spatially related to the current block 2100 and a temporal block temporally related to the current block 2100 .

[0268] The spatial block may include at least one of the lower left corner block A0, the lower left block A1, the upper right corner block B0, the upper right block B1, or the upper left corner block B2. Figure 21 As shown in , the lower left block A1 may be located above the lower left corner block A0, and the upper right block B1 may be located to the left of the upper right corner block B0.

[0269] The temporal block may include at least one of a block Co1 located at the same point as the current block 2100 in a co-located picture having a picture order count (POC) different from a picture order count (POC) of a current picture including the current block 2100, and a block Br spatially adjacent to the block Co1 located at the same point. The block Br may be located to the lower right of the block Col located at the same point as the current block 2100. The block Co1 located at the same point as the current block 2100 may be a block including a pixel corresponding to a center pixel in the current block 2100 among pixels included in the co-located picture.

[0270] Figure 22 The positions of the time blocks and space blocks in are only examples, and the positions and numbers of the time blocks and space blocks may vary according to embodiments.

[0271] The motion information obtainer 2030 may determine the availability of neighboring blocks according to a specific order and sequentially include the motion information of the neighboring blocks into the candidate list according to the determination result. The motion information obtainer 2030 may determine that the neighboring blocks subjected to intra prediction do not have availability.

[0272] When the prediction mode of the current block is a mode for deriving motion information of the current block by using motion information of a neighboring block, the motion information obtainer 2030 may obtain motion information of a neighboring block from the candidate list and determine whether to change the motion information of the neighboring block and how to change the motion information based on the change information.

[0273] When the change information indicates a change, the motion information of the neighboring block may be changed differently depending on the type of the upper block (e.g., picture, tile, slice, or maximum coding unit) including the current block. For example, when the upper block is a block capable of using both reference picture list 0 and reference picture list 1 (e.g., bi-predicted B slice), the change information may indicate in which direction the prediction direction of the neighboring block will be changed. As another example, when the upper block is a block capable of using only reference picture list 0 (e.g., predicted P slice), a prediction direction of the current block that is different from the prediction direction of the neighboring block cannot be selected, and therefore the change information may indicate how to change the reference picture and / or motion vector of the neighboring block.

[0274] Hereinafter, a method of obtaining motion information of a current block based on change information when an upper block is a block capable of using both reference picture list 0 and reference picture list 1 will be described.

[0275] I. When the upper block is a block capable of using both reference picture list 0 and reference picture list 1

[0276] Figure 22 is an exemplary table showing in which direction the prediction direction of the neighboring block is changed according to the value indicated by the change information when the upper block is a block capable of using both the reference picture list 0 and the reference picture list 1.

[0277] Reference Figure 22 , when the change information mmvd_group_idx has a value of 0, the motion information of the neighboring block is not changed. In other words, the prediction direction and reference picture of the neighboring block are determined as the prediction direction and reference picture of the current block. Then, the motion vector of the current block is obtained by applying the differential motion vector described below to the motion vector of the neighboring block. Even when the change information mmvd_group_idx is not included in the bitstream, the motion information of the neighboring block is not changed. In other words, the prediction direction and reference picture of the neighboring block are determined as the prediction direction and reference picture of the current block. Then, the motion vector of the current block is obtained by applying the differential motion vector to the motion vector of the neighboring block.

[0278] When the change information mmvd_group_idx has a value of 1 or 2, motion information of the neighboring block is changed.

[0279] Specifically, when the prediction direction of the neighboring block is the list 0 direction and the change information mmvd_group_idx has a value of 1, the prediction direction of the current block may be determined as bidirectional, and when the change information mmvd_group_idx has a value of 2, the prediction direction of the current block may be determined as the list 1 direction.

[0280] Also, when the prediction direction of the neighboring block is a list 1 direction and the change information mmvd_group_idx has a value of 1, the prediction direction of the current block may be determined as bidirectional, and when the change information mmvd_group_idx has a value of 2, the prediction direction of the current block may be determined as a list 0 direction.

[0281] Also, when the prediction direction of the neighboring block is bidirectional and the change information mmvd_group_idx has a value of 1, the prediction direction of the current block may be determined as the list 0 direction, and when the change information mmvd_group_idx has a value of 2, the prediction direction of the current block may be determined as the list 1 direction.

[0282] Can be determined differently based on Figure 22The change information mmvd_group_idx indicates the direction of change of the prediction direction of the neighboring block.

[0283] Hereinafter, a method of selecting a reference picture of a current block when a prediction direction of a neighboring block is changed will be described.

[0284] 1. When the prediction direction of the neighboring block is bidirectional and the prediction direction of the current block is unidirectional

[0285] When the prediction direction of the neighboring block is bidirectional and the prediction direction of the current block is in list 0, the reference picture of the neighboring block in list 0 is selected as the reference picture of the current block. The reference picture of the neighboring block in list 1 is not used for the current block.

[0286] When the prediction direction of the neighboring block is bidirectional and the prediction direction of the current block is list 1, the reference picture of the neighboring block in list 1 is selected as the reference picture of the current block. The reference picture of the neighboring block in list 0 is not used for the current block.

[0287] 2. When the prediction direction of the neighboring block is list 0 and the prediction direction of the current block is list 1

[0288] Based on the distance between the current picture and the reference picture of the neighboring block in the direction of List 0, one of the pictures included in Reference Picture List 1 is selected as the reference picture of the current block in the direction of List 1. Here, the distance between the pictures may be the difference in Point of View (POC) between the two pictures. The POC is a value inherent to the picture that indicates the output order of each picture.

[0289] According to an embodiment, the motion information obtainer 2030 may select a picture in the reference picture list 1 that is spaced apart from the current picture by the distance between the current picture and the reference picture of the neighboring block in the list 0 direction as the reference picture of the current block in the list 1 direction. When the distance between the current picture and the reference picture of the neighboring block in the list 0 direction and the distance between the current picture and the reference picture of the current block in the list 1 direction are the same, the scaling process of the motion vector described later may be omitted.

[0290] Reference Figure 23 , when the POC of the current picture is 5 and the POC of the reference picture of the neighboring block in the list 0 direction is 3, a picture with a POC of 7 among the pictures included in the reference picture list 1 may be selected as the reference picture of the current block in the list 1 direction. When a picture spaced apart from the current picture by the distance between the current picture and the reference picture of the neighboring block in the list 0 direction is not included in the reference picture list 1, the motion information obtainer 2030 may select a picture with an index having a minimum value (e.g., 0) among the pictures in the reference picture list 1 as the reference picture of the current block in the list 1 direction.

[0291] According to another embodiment, when the number of pictures included in reference picture list 1 is greater than 1 and the distance between the current picture and the reference picture of the neighboring block in the list 0 direction is the same as the distance between the current picture and the picture indexed 1 in reference picture list 1, the motion information obtainer 2030 may select the picture indexed 1 in reference picture list 1 as the reference picture for the current block in the list 1 direction. When the number of pictures included in reference picture list 1 is not greater than 1, the motion information obtainer 2030 may select the picture indexed 0 in reference picture list 1 as the reference picture for the current block in the list 1 direction. When the number of pictures included in reference picture list 1 is greater than 1, but the distance between the current picture and the reference picture of the neighboring block in the list 0 direction is different from the distance between the current picture and the picture indexed 1 in reference picture list 1, the motion information obtainer 2030 may select the picture indexed 0 in reference picture list 1 as the reference picture for the current block in the list 1 direction. In this case, it is not necessary to identify the POCs of all the pictures included in reference picture list 1, and thus the process of selecting a reference picture can be simplified.

[0292] 3. When the prediction direction of the neighboring block is list 1 and the prediction direction of the current block is list 0

[0293] Based on the distance between the current picture and the reference picture of the neighboring block in the list 1 direction, one of the pictures included in the reference picture list 0 is selected as the reference picture of the current block in the list 0 direction.

[0294] According to an embodiment, the motion information obtainer 2030 may select a picture in reference picture list 0 that is spaced apart from the current picture by the distance between the current picture and the reference picture of the neighboring block in the list 1 direction as the reference picture of the current block in the list 0 direction.

[0295] Reference Figure 23 , when the POC of the current picture is 5 and the POC of the reference picture of the neighboring block in the list 1 direction is 7, a picture with a POC of 3 among the pictures included in the reference picture list 0 may be selected as the reference picture of the current block in the list 0 direction. When a picture spaced apart from the current picture by the distance between the current picture and the reference picture of the neighboring block in the list 1 direction is not included in the reference picture list 0, the motion information obtainer 2030 may select a picture with an index having a minimum value (e.g., 0) among the pictures in the reference picture list 0 as the reference picture of the current block in the list 0 direction.

[0296] According to another embodiment, when the number of pictures included in reference picture list 0 is greater than 1 and the distance between the current picture and the reference picture of the neighboring block in the list 1 direction is the same as the distance between the current picture and the picture indexed 1 in reference picture list 0, the motion information obtainer 2030 may select the picture indexed 1 in reference picture list 0 as the reference picture for the current block in the list 0 direction. When the number of pictures included in reference picture list 0 is not greater than 1, the motion information obtainer 2030 may select the picture indexed 0 in reference picture list 0 as the reference picture for the current block in the list 0 direction. When the number of pictures included in reference picture list 0 is greater than 1, but the distance between the current picture and the reference picture of the neighboring block in the list 1 direction is different from the distance between the current picture and the picture indexed 1 in reference picture list 0, the motion information obtainer 2030 may select the picture indexed 0 in reference picture list 0 as the reference picture for the current block in the list 0 direction. In this case, it is not necessary to identify the POCs of all the pictures included in reference picture list 0, and thus the process of selecting a reference picture can be simplified.

[0297] 4. When the prediction direction of the neighboring block is list 0 direction and the prediction direction of the current block is bidirectional

[0298] The reference picture of the neighboring block in the List 0 direction is selected as the reference picture of the current block in the List 0 direction. Then, based on the distance between the current picture and the reference picture of the neighboring block in the List 0 direction, one of the pictures included in the reference picture list 1 is selected as the reference picture of the current block in the List 1 direction. Because the method of selecting one of the pictures included in the reference picture list 1 as the reference picture of the current block in the List 1 direction based on the distance between the current picture and the reference picture of the neighboring block in the List 0 direction has been described with reference to "2. When the prediction direction of the neighboring block is the List 0 direction and the prediction direction of the current block is the List 1 direction", its detailed description is omitted.

[0299] 5. When the prediction direction of the neighboring block is list 1 and the prediction direction of the current block is bidirectional

[0300] The reference picture of the neighboring block in the List 1 direction is selected as the reference picture of the current block in the List 1 direction. Then, based on the distance between the current picture and the reference picture of the neighboring block in the List 1 direction, one of the pictures included in the reference picture list 0 is selected as the reference picture of the current block in the List 0 direction. Because the method of selecting one of the pictures included in the reference picture list 0 as the reference picture of the current block in the List 0 direction based on the distance between the current picture and the reference picture of the neighboring block in the List 1 direction has been described with reference to "3. When the prediction direction of the neighboring block is the List 1 direction and the prediction direction of the current block is the List 0 direction", its detailed description is omitted.

[0301] When the reference picture of the current block is the same as the reference picture of the neighboring block, the motion vector of the current block can be obtained by applying the differential motion vector to the motion vector of the neighboring block. Specifically, when the change information is not included in the bitstream or the change information indicates no change, the motion vector of the current block can be obtained by applying the differential motion vector to the motion vector of the neighboring block. When the prediction direction of the neighboring block is bidirectional and the prediction direction of the current block is in the List 0 direction or the List 1 direction, the motion vector of the current block in the List 0 direction or the List 1 direction can be obtained by applying the differential motion vector to the motion vector of the neighboring block in the List 0 direction or the List 1 direction.

[0302] When the reference picture of the current block and the reference picture of the neighboring block are not the same, the motion vector of the current block may be obtained by scaling the motion vector of the neighboring block and applying the differential motion vector to the scaled motion vector.

[0303] Hereinafter, a process of scaling the motion vectors of neighboring blocks will be described.

[0304] The motion information obtainer 2030 may scale the motion vector of the neighboring block by multiplying the ratio of the distance between the reference picture of the neighboring block and the current picture to the distance between the reference picture of the current block and the current picture by the motion vector of the neighboring block. The motion vector of the current block may be obtained by applying the differential motion vector to the scaled motion vector.

[0305] The motion information obtainer 2030 may be configured as follows: Figure 24 and Figure 25 The sign of the scaled motion vector is changed according to the positional relationship between the reference picture of the neighboring block, the current picture and the reference picture of the current block.

[0306] Figure 24 and Figure 25 2 is a diagram illustrating a positional relationship among reference pictures 2430 and 2530 of a neighboring block, current pictures 2410 and 2510 , and reference pictures 2450 and 2550 of a current block.

[0307] exist Figure 24 and Figure 25 , the distance between the current pictures 2410 and 2510 and the reference pictures 2430 and 2530 of the neighboring blocks will be referred to as d1, and the distance between the current pictures 2410 and 2510 and the reference pictures 2450 and 2550 of the current block will be referred to as d2. The distance between pictures may represent the difference in POC values ​​of the two pictures.

[0308] Reference Figure 24 , the current picture 2410 has POC B, and the reference picture 2430 of the neighboring block and the reference picture 2450 of the current block have POC A and POC C, respectively. When POC B has a value between POC A and POC C, the motion vector of the neighboring block is scaled according to the ratio of d1 to d2, and its sign is inverted. In other words, Figure 24 As shown in , when the current picture 2410 is located between the reference picture 2450 of the current block and the reference picture 2430 of the neighboring block, the sign of the scaled motion vector of the neighboring block is reversed. When the values ​​of d1 and d2 are the same, only the sign of the motion vector of the neighboring block is reversed.

[0309] Next, refer to Figure 25 , the current picture 2510 has POC A, and the reference picture 2530 of the neighboring block and the reference picture 2550 of the current block have POC B and POC C, respectively. When POC A is less than POC B and POC C or greater than POC B and POC C, the motion vector of the neighboring block is scaled according to the ratio of d1 to d2 and its sign is maintained. In other words, Figure 25 As shown in , when the reference picture 2550 of the current block and the reference picture 2530 of the neighboring block are different from each other, the current picture 2510 is before the reference picture 2550 of the current block and the reference picture 2530 of the neighboring block in terms of POC, or after the reference picture 2550 of the current block and the reference picture 2530 of the neighboring block, the sign of the scaled motion vector of the neighboring block is maintained.

[0310] The motion information obtainer 2030 may obtain motion information of the current block by applying the differential motion vector to the motion vector of the neighboring block or the scaled motion vector of the neighboring block.

[0311] According to an embodiment, a differential motion vector may be calculated based on change distance information and change direction information obtained from a bitstream. The bitstream obtainer 2010 may obtain the change distance information and change direction information from the bitstream, and the motion information obtainer 2030 may apply the differential motion vector calculated based on the change distance information and change direction information to the motion vector of the neighboring block or the scaled motion vector of the neighboring block.

[0312] The change distance information may indicate the distance of the differential motion vector from the origin. Alternatively, the change distance information may indicate the size of the differential motion vector. Here, the change distance may be a distance in sub-pixel units. For example, when the reference picture is interpolated to have sub-pixels with a 1 / 4 pixel unit and the change distance information indicates that the change distance is 2, the differential motion vector may have a size in 2 / 4 pixel units.

[0313] The change direction information may indicate in which direction the differential motion vectors are spaced apart based on the origin. Alternatively, the change direction information may indicate a sign of the differential motion vector.

[0314] Figure 26 is a diagram showing differential motion vectors displayed on a coordinate plane.

[0315] Based on the origin, the differential motion vector may have various values ​​depending on the change distance and change direction. For example, when the change distance is 1 and the change direction is the +x-axis direction, the differential motion vector may be (1, 0), and when the change distance is 1 and the change direction is the -x-axis direction, the differential motion vector may be (-1, 0). In addition, when the change distance is 2 and the change direction is the +y-axis direction, the differential motion vector may be (0, 2), and when the change distance is 2 and the change direction is the -y-axis direction, the differential motion vector may be (0, -2).

[0316] Figure 27 is an exemplary table showing change distances corresponding to values ​​of change distance information, and Figure 28 is an exemplary table showing change directions corresponding to values ​​of change direction information.

[0317] Reference Figure 27 In response to the value indicated by the change distance information mmvd_distance_idx increasing, the change distance may increase in a logarithmic scale. In other words, when the value indicated by the change distance information mmvd_distance_idx is n, the change distance may be 2 n .

[0318] Reference Figure 28, the sign of the differential motion vector is determined according to the value indicated by the change direction information mmvd_direction_idx. When the value indicated by the change direction information mmvd_direction_idx is 0, the differential motion vector may have a + sign in the x-axis direction, and when the value indicated by the change direction information mmvd_direction_idx is 1, the differential motion vector may have a - sign in the x-axis direction. In addition, when the value indicated by the change direction information mmvd_direction_idx is 2, the differential motion vector may have a + sign in the y-axis direction, and when the value indicated by the change direction information mmvd_direction_idx is 3, the differential motion vector may have a - sign in the y-axis direction.

[0319] According to the embodiment, the Figure 27 The change distance information indicates the change distance of the value and the change distance of the value according to the Figure 28 The change direction information indicates the change direction of the value.

[0320] According to an embodiment, when the prediction direction of the current block is bidirectional, the differential motion vector derived from the change distance information and the change direction information may be scaled and applied to the motion vector in the list 0 direction and the motion vector in the list 1 direction. Specifically, when the distance between the current picture and the reference picture of the current block in the list 0 direction is greater than the distance between the current picture and the reference picture of the current block in the list 1 direction, the differential motion vector may be scaled and applied to the motion vector in the list 0 direction, and the unscaled differential motion vector may be applied to the motion vector in the list 1 direction. On the other hand, when the distance between the current picture and the reference picture of the current block in the list 1 direction is greater than the distance between the current picture and the reference picture of the current block in the list 0 direction, the differential motion vector may be scaled and applied to the motion vector in the list 1 direction, and the unscaled differential motion vector may be applied to the motion vector in the list 0 direction.

[0321] The differential motion vector may be scaled based on the ratio of the distance between the current picture and the reference picture in the list 0 direction to the distance between the current picture and the reference picture in the list 1 direction. For example, when the distance between the current picture and the reference picture in the list 0 direction is d0 and the distance between the current picture and the reference picture in the list 1 direction is d1, the differential motion vector may be multiplied by d0 / d1. When the POC of the current picture has a value between the POC of the reference picture in the list 0 direction and the POC of the reference picture in the list 1 direction, the sign of the scaled differential motion vector may be reversed.

[0322] When the distance d0 between the current picture and the reference picture in the direction of list 0 and the distance d1 between the current picture and the reference picture in the direction of list 1 are the same and the POC of the current picture has a value between the POC of the reference picture in the direction of list 0 and the POC of the reference picture in the direction of list 1, the differential motion vector derived from the change distance information and the change direction information can be applied to the motion vector in the direction of list 0, and the differential motion vector with its sign reversed can be applied to the motion vector in the direction of list 1.

[0323] According to an embodiment, scaling of the differential motion vector may be expressed as Equation 1 below.

[0324] [Equation 1]

[0325] mMvdL=Clip3(-32767,32767,((distScaleFactor*mMvdL+16)>>5))

[0326] In Equation 1, distScaleFactor represents a ratio of a distance between the current picture and the reference picture in a list 0 direction and a distance between the current picture and the reference picture in a list 1 direction, and may be calculated according to Equation 2 below.

[0327] [Equation 2]

[0328] distScaleFactor=(Abs(currPocDiffL1)<<5) / Abs(currPocDiffL0)

[0329] In Equation 2, currPocDiffL1 represents a POC difference between the current picture and the reference picture in the list 1 direction, and currPocDiffL0 represents a POC difference between the current picture and the reference picture in the list 0 direction.

[0330] In Equation 1, the upper and lower limits of the clipping operation are set to 32767 and -32767, respectively, where 32767 is the highest possible number that can be represented by the 15-bit numeric portion and the 1-bit sign portion. Here, the actual lower limit that can be represented by the 15-bit numeric portion and the 1-bit sign portion should be -32768. However, when the differential motion vector is determined to be -32768 (i.e., the lower limit) via the clipping operation and the POC of the current picture has a value between the POC of the reference picture in the list 0 direction and the POC of the reference picture in the list 1 direction, the sign of -32768 needs to be reversed, and in this case, 32767, which is the upper limit that can be represented by the 15-bit numeric portion and the 1-bit sign portion, is exceeded. Therefore, in Equation 1, the lower limit of the clipping operation is set to -32767. According to an embodiment, the lower limit of the clipping operation of Equation 1 may be set to -32768.

[0331] Hereinafter, a method of obtaining motion information of a current block in consideration of change information when the type of an upper block of the current block can use only the reference picture list 0 will be described.

[0332] II. When the upper block is a block capable of using reference picture list 0

[0333] When the upper block is a block that can use only the reference picture list 0 (for example, predicting a P slice), the prediction direction of the current block is determined to be the list 0 direction. Figure 29 As described, the change information indicates how the reference picture of the current picture is to be determined.

[0334] Figure 29 is a table for describing a method of selecting a reference picture ref_idx of a current block according to the number of pictures included in a reference picture list and a value indicated by the change information mmvd_group_idx.

[0335] Reference Figure 29 When the change information mmvd_group_idx is 0, that is, when the change information mmvd_group_idx indicates that the motion information of the neighboring block is not changed, the reference picture ref_idx_curr of the neighboring block is selected as the reference picture ref_idx of the current block. Then, the motion vector of the current block is obtained by applying the differential motion vector to the motion vector of the neighboring block.

[0336] When the change information mmvd_group_idx is 1 or 2, that is, when the change information mmvd_group_idx indicates that the motion information of the neighboring block is changed, the reference picture ref_idex of the current block is adaptively selected according to the number of pictures included in the reference picture list 0.

[0337] Specifically, when the change information mmvd_group_idx is 1 and the number of pictures included in reference picture list 0 (active reference number) is 1, the reference picture ref_idx of the current block is selected to be the same as the reference picture ref_idx_curr of the neighboring block. When the number of pictures included in reference picture list 0 (active reference number) is not 1 (for example, 2 or 3), the reference picture ref_idx of the current block is selected to be different from the reference picture ref_idx_curr of the neighboring block. For example, when the number of pictures included in reference picture list 0 (active reference number) is 2 and one of the two pictures is the reference picture ref_idx_curr of the neighboring block, the other picture may be selected as the reference picture ref_idx of the current block.

[0338] When the change information mmvd_group_idx is 2 and the number of pictures included in the reference picture list 0 (the number of active references) is less than 3 (for example, 2), the reference picture ref_idx of the current block is selected to be the same as the reference picture ref_idx_curr of the neighboring block. Since the reference picture ref_idx of the current block is selected to be different from the reference picture ref_idx_curr of the neighboring block when the change information mmvd_group_idx is 1 and the number of pictures included in the reference picture list 0 (the number of active references) is 2, the reference picture ref_idx of the current block is selected to be the same as the reference picture ref_idx_curr of the neighboring block when the change information mmvd_group_idx is 2.

[0339] When the change information mmvd_group_idx is 2, the number of pictures included in the reference picture list 0 (the active reference number) is 3 or more, and the index of the reference picture ref_idx_curr of the neighboring block is less than 2, the reference picture ref_idx of the current block is selected as the picture with an index of 2 among the pictures included in the reference picture list 0. In other words, the reference picture ref_idx of the current block is selected to be different from the reference picture ref_idx_curr of the neighboring block.

[0340] When the change information mmvd_group_idx is 2, the number of pictures included in the reference picture list 0 (the active reference number) is 3 or more, and the index of the reference picture ref_idx_curr of the neighboring block is 2 or more, the reference picture ref_idx of the current block is selected as the picture with an index of 1 among the pictures included in the reference picture list 0. In other words, when the index of the reference picture ref_idx_curr of the neighboring block is 2, 3, 4, etc., the reference picture ref_idx of the current block may be selected as the picture with an index of 1.

[0341] In other words, when the change information indicates a change and the reference picture list 0 includes a picture different from the reference picture of the neighboring block, the reference picture of the current block is first selected to be different from the reference picture of the neighboring block, but when the reference picture list 0 does not include a picture different from the reference picture of the neighboring block, the reference picture of the current block may be selected to be the same as the reference picture of the neighboring block.

[0342] When the change information indicates a change and the reference picture of the current block selected according to the change information is different from the reference picture of the neighboring block, the motion vector of the neighboring block is scaled and the differential motion vector is applied to the scaled motion vector to obtain the motion vector of the current block. Since the method of scaling the motion vector of the neighboring block by considering the ratio of the distance between the current picture and the reference picture of the current block and the distance between the current picture and the reference picture of the neighboring block when the reference picture of the current block is different has been described above, its detailed description is omitted.

[0343] When the change information indicates a change and the reference picture of the current block selected according to the change information is the same as the reference picture of the neighboring block, the motion information obtainer 2030 may apply an offset to the motion vector of the neighboring block to distinguish the case where the change information indicates no change, and apply a differential motion vector to the motion vector to which the offset is applied.

[0344] Will refer to Figure 30 A method of changing a motion vector of a neighboring block by applying an offset to the motion vector of the neighboring block when change information indicates a change and a reference picture of a current block is the same as a reference picture of the neighboring block is described.

[0345] Figure 30 is a diagram for describing a method of changing a motion vector mv of a neighboring block when a reference picture of the neighboring block and a reference picture of a current block are the same.

[0346] According to an embodiment, the motion information obtainer 2030 may change the motion vector mv of the neighboring block by adding at least one preset offset to the x component or y component of the motion vector mv of the neighboring block. The offset may be a predetermined real number.

[0347] According to an embodiment, the offset may be an odd number, for example, 3. It has been described above that the change distance may increase in a logarithmic scale as the value indicated by the change distance information increases, and in this case, the change distance has a value of 2. n When the offset is set to an odd number, the result obtained by adding the differential motion vector to the motion vector of the neighboring block to which the offset is not applied is necessarily different from the result obtained by adding the differential motion vector to the motion vector of the neighboring block to which the offset is applied. In other words, the candidates that can be selected as the motion vector of the current block may be different by applying an odd-number offset.

[0348] like Figure 30 As shown in , the motion information obtainer 2030 may apply an offset of +3 or -3 to the x component of the motion vector mv of the neighboring block. When the offset of +3 or -3 is applied to the x component of the motion vector mv of the neighboring block, the motion vector mv of the neighboring block is shifted by 3 / 4 pixel units when the reference picture is interpolated to 1 / 4 pixel units. Depending on the embodiment, the motion information obtainer 2030 may apply an offset of +3 or -3 to the y component of the motion vector mv of the neighboring block, or apply an offset of +3 or -3 to both the x component and the y component of the motion vector mv of the neighboring block.

[0349] When the number of pictures included in the reference picture list 0 is 1 and the change information has a value of 1, the motion information obtainer 2030 may add +3 to the x component of the motion vector mv of the neighboring block, and when the change information has a value of 2, add -3 to the x component of the motion vector mv of the neighboring block.

[0350] In addition, since the reference picture of the current block is selected to be different from the reference picture of the neighboring block when the number of pictures included in the reference picture list 0 is 2 and the change information has a value of 1, the motion information obtainer 2030 may scale the motion vector mv of the neighboring block. When the change information has a value of 2, the motion information obtainer 2030 may add +3 to the x component of the motion vector mv of the neighboring block.

[0351] Also, since the reference picture of the current block is different from the reference picture of the neighboring block when the number of pictures included in the reference picture list 0 is 3 or more and the change information has a value of 1 or 2, the motion information obtainer 2030 may scale the motion vector mv of the neighboring block.

[0352] The motion information obtainer 2030 may obtain the motion vector of the current block by applying a differential motion vector after scaling or applying an offset to the motion vector mv of the neighboring block according to the number of pictures included in the reference picture list 0 or a value indicated by the change information.

[0353] When the motion information of the current block is obtained, the prediction decoder 2050 performs inter-frame prediction on the current block based on the motion information of the current block. The prediction decoder 2050 may select a picture indicated by a reference picture index from pictures included in a reference picture list corresponding to a prediction direction of the current block as a reference picture of the current block, and obtain a prediction block of the current block from a reference block indicated by a motion vector in the reference picture of the current block.

[0354] The prediction block of the current block may be determined as the reconstructed block of the current block, and when a bitstream includes residual data according to an embodiment, the reconstructed block of the current block may be obtained when the residual data is applied to the prediction block.

[0355] As described above, even when information obtained from a higher level of the current block indicates that a change mode should be applied, the bitstream obtainer 2010 may not obtain change information from the bitstream when the size of the current block is equal to or smaller than a preset size. In this case, to prevent bidirectional prediction in small blocks, the motion information obtainer 2030 may determine the prediction direction of the current block to be in the List 0 direction or the List 1 direction when the prediction direction of the neighboring block is bidirectional. Therefore, the motion information obtainer 2030 may determine the reference picture of the neighboring block in the List 0 direction or the reference picture of the neighboring block in the List 1 direction as the reference picture of the current block, and obtain the motion vector of the current block by applying the differential motion vector to the motion vector mv of the neighboring block. In other words, according to an embodiment, when the size of the current block is small, the current block can be unidirectionally predicted even when the prediction direction of the neighboring block is bidirectional.

[0356] Figure 31 is a flowchart of a method of decoding motion information according to an embodiment.

[0357] In operation S3110, the image decoding apparatus 2000 obtains change information indicating a change in motion information of a neighboring block temporally or spatially related to a current block from a bitstream.

[0358] According to an embodiment, when information obtained from a higher level of the current block (e.g., 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 of a bitstream) indicates that a change mode is not applied, the image decoding device 2000 may not obtain change information of the current block from the bitstream, and when the information indicates that a change mode is applied, the image decoding device 2000 may obtain change information of the current block from the bitstream.

[0359] According to an embodiment, even when information obtained from a higher level of the current block indicates that a change mode should be applied, the image decoding apparatus 2000 may not obtain change information from the bitstream when the size of the current block is equal to or smaller than a preset size. In this case, when the prediction direction of the neighboring block is bidirectional, the image decoding apparatus 2000 may determine the prediction direction of the current block to be in the list 0 direction or the list 1 direction. The image decoding apparatus 2000 may then determine the reference picture of the neighboring block in the list 0 direction or the reference picture of the neighboring block in the list 1 direction as the reference picture of the current block, and obtain the motion vector of the current block by applying the differential motion vector to the motion vector of the neighboring block.

[0360] In operation S3120, when the change information indicates that the motion information is changed and the upper block of the current block can use one reference picture list, that is, when the upper block of the current block cannot use two reference picture lists, the image decoding apparatus 2000 identifies the number of pictures included in the reference picture list.

[0361] According to an embodiment, when the change information indicates a change in motion information and the upper block of the current block can use two reference picture lists, the image decoding apparatus 2000 changes the prediction direction of the neighboring block according to the change information. The changed prediction direction of the neighboring block can be selected as the prediction direction of the current block. In other words, the prediction direction of the current block can be determined based on the change information.

[0362] In operation S3130, the image decoding apparatus 2000 may obtain motion information of a current block from motion information of neighboring blocks according to the number of pictures in the reference picture list.

[0363] Specifically, the image decoding apparatus 2000 selects a reference picture of a neighboring block or a picture different from the reference picture of the neighboring block as a reference picture of the current block based on the number of pictures in the reference picture list. Then, when the reference picture of the neighboring block is selected as the reference picture of the current block, the image decoding apparatus 2000 obtains a motion vector of the current block by applying an offset to at least one of the x component or the y component of the motion vector of the neighboring block. The image decoding apparatus 2000 can obtain the motion vector of the current block by applying a differential motion vector to the motion vector to which the offset is applied.

[0364] When the number of pictures in the reference picture list is 1, the image decoding apparatus 2000 may select a reference picture of a neighboring block as a reference picture of the current block. When the change information indicates a first type of change (e.g., when the change information has a value of 1), the image decoding apparatus 2000 may apply a + sign offset to the motion vector of the neighboring block. When the change information indicates a second type of change (e.g., when the change information has a value of 2), the image decoding apparatus 2000 may apply a - sign offset to the motion vector of the neighboring block.

[0365] When the number of pictures in the reference picture list is 2 and the change information indicates a first type change, the image decoding apparatus 2000 may determine that the reference picture of the current block is different from the reference picture of the neighboring block and scale the motion vector of the neighboring block. When the number of pictures in the reference picture list is 2 and the change information indicates a second type change, the image decoding apparatus 2000 may determine that the reference picture of the current block is the same as the reference picture of the neighboring block and apply an offset to at least one of the x component or the y component of the motion vector of the neighboring block.

[0366] When the number of pictures in the reference picture list is 3 or more and the change information indicates a first type change or a second type change, the image decoding apparatus 2000 may determine that the reference picture of the current block is different from the reference picture of the neighboring block and scale the motion vector of the neighboring block. Here, the reference picture of the current block may be selected differently depending on whether the change information indicates the first type change or the change information indicates the second type change.

[0367] When the change information indicates a change in motion information and the upper block of the current block is able to use two reference picture lists, the image decoding device 2000 may select a reference picture of the current block considering the prediction direction of the current block, and scale the motion vector of the adjacent block according to the ratio of the distance between the current picture and the reference picture of the current block and the distance between the current picture and the reference picture of the adjacent block.

[0368] The image decoding apparatus 2000 may obtain a motion vector of a current block by applying a differential motion vector to a motion vector of a neighboring block, a scaled motion vector of a neighboring block, or a motion vector of a neighboring block to which an offset is applied.

[0369] In operation S3140, the image decoding apparatus 2000 reconstructs the current block by using the motion information of the current block.

[0370] The image decoding device 2000 can select a picture indicated by a reference picture index as a reference picture of the current block from the pictures included in the reference picture list corresponding to the prediction direction of the current block, and obtain the prediction block of the current block from the reference block indicated by the motion vector in the reference picture of the current block.

[0371] According to an embodiment, the prediction block of the current block may be determined as the reconstructed block of the current block, and when a bitstream includes residual data according to an embodiment, the reconstructed block of the current block may be obtained when the residual data is applied to the prediction block.

[0372] Figure 32 is a block diagram showing a configuration of an image encoding apparatus 3200 according to an embodiment.

[0373] Reference Figure 32 , the image encoding apparatus 3200 includes a prediction encoder 3210 and a bit stream generator 3230. The prediction encoder 3210 may correspond to Figure 2 The encoder 220 and the bitstream generator 3230 may correspond to Figure 2 A bitstream generator 210 is provided.

[0374] The prediction encoder 3210 and the bitstream generator 3230 according to an embodiment may be implemented as at least one processor. The image encoding apparatus 3200 may include at least one memory (not shown) for storing input and output data of the prediction encoder 3210 and the bitstream generator 3230. In addition, the image encoding apparatus 3200 may include a memory controller (not shown) for controlling data input and output of the memory.

[0375] The prediction encoder 3210 encodes an image according to a prediction mode, and the bitstream generator 3230 generates a bitstream including information generated as a result of encoding the image.

[0376] The prediction encoder 3210 may determine a prediction mode of a current block in a current image. When the prediction mode of the current block is determined to be an inter prediction mode, the bitstream generator 3230 includes information indicating motion information of the current block into a bitstream.

[0377] When the prediction mode of the current block is a mode for deriving the motion information of the current block from the motion information of the neighboring blocks, the prediction encoder 3210 constructs a candidate list including a plurality of pieces of motion information of the neighboring blocks temporally or spatially related to the current block as candidates. The prediction encoder 3210 can derive the motion information of the current block by selecting one piece of motion information from among the plurality of pieces of motion information included in the candidate list.

[0378] The prediction encoder 3210 may determine whether a change mode may be applied to a block included in a higher-level block (e.g., a picture sequence, a picture, a video, a slice, a slice segment, or a tile) of a current block in the higher-level block. When a change mode may be applied to a block included in the higher-level block, the prediction encoder 3210 may determine whether to change motion information of a neighboring block to derive motion information of the current block.

[0379] According to an embodiment, when the size of the current block is less than or equal to a preset size, the prediction encoder 3210 may determine not to change motion information of a neighboring block even when a change mode may be applied to blocks included in an upper block.

[0380] When it is determined that the motion information of the neighboring block is not changed, the prediction encoder 3210 may obtain the difference between the motion vector of the neighboring block and the motion vector of the current block as a differential motion vector. The bitstream generator 3230 may generate a bitstream including change information indicating that the motion information of the neighboring block is not changed, information indicating one of the candidates included in the candidate list, and information indicating the differential motion vector.

[0381] When determining to change the motion information of the neighboring block, the prediction encoder 3210 may determine how to change the motion information of the neighboring block considering whether the number of reference picture lists usable by the upper block including the current block is 1 or 2.

[0382] As described above, when the upper block is able to use only the reference picture list 0, the prediction encoder 3210 may select a reference picture of the current block in consideration of the number of pictures included in the reference picture list 0.

[0383] When the upper block is able to use reference picture list 0 and reference picture list 1, the prediction encoder 3210 can determine in which direction the prediction direction of the neighboring block will be changed, and select the reference picture of the current block considering the prediction direction of the neighboring block, the change direction and the reference picture of the neighboring block.

[0384] The method of selecting a reference picture of a current block when an upper block can use only reference picture list 0 and when an upper block can use reference picture list 0 and reference picture list 1 has been described in detail with reference to the image decoding apparatus 2000 , and thus a detailed description thereof is omitted.

[0385] When the upper block can use only reference picture list 0 and the reference picture of the current block is the same as the reference picture of the neighboring block, the prediction encoder 3210 may apply an offset to at least one of the x component and the y component of the motion vector of the neighboring block.

[0386] When the upper block is able to use only reference picture list 0 and the reference picture of the current block and the reference picture of the neighboring block are different from each other, the prediction encoder 3210 can scale the motion vector of the neighboring block according to the ratio of the distance between the current picture and the reference picture of the neighboring block and the distance between the current picture and the reference picture of the current block.

[0387] In addition, when the upper block is able to use reference picture list 0 and reference picture list 1, and the reference picture of the current block and the reference picture of the neighboring block are different from each other, the prediction encoder 3210 can scale the motion vector of the neighboring block according to the ratio of the distance between the current picture and the reference picture of the neighboring block and the distance between the current picture and the reference picture of the current block.

[0388] The prediction encoder 3210 may obtain a differential motion vector, where the differential motion vector is a difference between a motion vector of a current block and a motion vector of a neighboring block, a scaled motion vector of a neighboring block, or a motion vector of a neighboring block to which an offset is applied.

[0389] The bitstream generator 3230 may generate a bitstream including, as the motion information of the current block, information indicating a neighboring block, change information indicating whether and how to change the motion information of the neighboring block, and information indicating a differential motion vector. When the size of the current block is equal to or smaller than a preset size, the change information may not be included in the bitstream.

[0390] According to an embodiment, the information indicating the differential motion vector may include change distance information and change direction information.

[0391] Figure 33 is a flowchart of a method of encoding motion information according to an embodiment.

[0392] In operation S3310, the image encoding apparatus 3200 determines whether to change motion information of a neighboring block temporally or spatially related to a current block to induce a motion vector of the current block.

[0393] According to an embodiment, the image encoding apparatus 3200 may determine whether a change mode can be applied at a higher level (e.g., a picture sequence, a picture, a video, a slice, a slice segment, or a tile) of the current block, and when it is determined that the change mode can be applied to the higher level, determine whether to change the motion information of the neighboring blocks to obtain the motion information of the current block.

[0394] According to an embodiment, even when it is determined that a change mode is applicable to a higher level of the current block, when the size of the current block is equal to or smaller than a preset size, the image encoding apparatus 3200 may determine not to change motion information of a neighboring block.

[0395] In operation S3320, the image encoding apparatus 3200 may generate a bitstream including information indicating a neighboring block used to derive motion information of a current block, information indicating whether to change the motion information of the neighboring block, and information indicating a differential motion vector. When it is determined that the change mode is not applicable to a higher level or the size of the current block is equal to or smaller than the preset size, the change information may not be included in the bitstream.

[0396] The image encoding apparatus 3200 may obtain the difference between the motion vector of the current block and the motion vector of the adjacent block, the scaled motion vector of the adjacent block, or the motion vector of the adjacent block to which an offset is applied as a differential motion vector. The image encoding apparatus 3200 may include change distance information and change direction information indicating the differential motion vector in the bitstream.

[0397] In addition, the above-described embodiments may be written as a computer-executable program that may be stored in a medium.

[0398] The medium may store computer executable programs continuously or may temporarily store computer executable programs or instructions 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 over a network. Examples of media include magnetic media (such as hard disks, floppy disks, and magnetic tapes) configured to store program instructions, optical recording media (such as CD-ROMs and DVDs), magneto-optical media (such as floppy disks), as well as ROM, RAM, and flash memory. Other examples of media 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.

[0399] Although one or more embodiments have been described with reference to the drawings, people skilled in the art will understand that various changes in form and details may be made in the one or more embodiments without departing from the spirit and scope defined by the claims.

Claims

1. A method for decoding motion information performed by a decoding device, the method comprising: obtaining, from a bitstream, information indicating whether motion information of a neighboring block is changed to obtain a motion vector of a current block, the information representing index information indicating one of a first value, a second value, or a third value; When the information does not indicate a change in the motion information of the neighboring block, obtaining the motion vector of the current block by applying a differential motion vector to the motion vector of the neighboring block; when the information indicates a change in motion information of the neighboring block, obtaining a motion vector of the current block by applying the differential motion vector to a motion vector of the neighboring block to which a predefined offset of at least one of an x ​​component or a y component of the motion vector of the neighboring block is applied; and reconstructing the current block by using a reference block indicated by a motion vector of the current block in a reference picture of the current block, When the information indicates the third value, it is determined not to change the motion information of the neighboring block; and when the information indicates the first value or the second value, it is determined to change the motion information of the neighboring block. Wherein, when the information indicates a first value, the predefined offset has a + sign, and when the information indicates a second value, the predefined offset has a - sign, The differential motion vector is derived from the change distance information and the change direction information included in the bit stream.

2. A device for decoding motion information, the device comprising: a bitstream obtainer configured to obtain, from a bitstream, information indicating whether motion information of a neighboring block is changed to obtain a motion vector of a current block, the information representing index information indicating one of a first value, a second value, or a third value; a motion information obtainer configured to: obtain the motion vector of the current block by applying a differential motion vector to the motion vector of the neighboring block when the information does not indicate a change in the motion information of the neighboring block; and obtain the motion vector of the current block by applying the differential motion vector to the motion vector of the neighboring block to which a predefined offset of at least one of an x ​​component or a y component of the motion vector of the neighboring block is applied when the information indicates a change in the motion information of the neighboring block; and a prediction decoder configured to reconstruct the current block by using a reference block indicated by a motion vector of the current block in a reference picture of the current block, When the information indicates the third value, it is determined not to change the motion information of the neighboring block; and when the information indicates the first value or the second value, it is determined to change the motion information of the neighboring block. Wherein, when the information indicates a first value, the predefined offset has a + sign, and when the information indicates a second value, the predefined offset has a - sign, The differential motion vector is derived from the change distance information and the change direction information included in the bit stream.

3. A method for encoding motion information, performed by an encoding device, the method comprising: determining whether to change motion information of a neighboring block to obtain a differential motion vector of the current block; When it is determined that the motion information of the neighboring block is not changed, obtaining the differential motion vector using the motion vector of the neighboring block and the motion vector of the current block; When it is determined to change the motion information of the neighboring block, obtaining the differential motion vector using the motion vector of the neighboring block to which a predefined offset of at least one of an x ​​component or a y component of the motion vector of the neighboring block is applied, and the motion vector of the current block; and generating a bitstream, wherein the bitstream includes first information indicating whether the motion information of the neighboring block is changed and second information indicating the differential motion vector, The first information represents index information indicating one of the first value, the second value, or the third value. When it is determined that the motion information of the neighboring block is not changed, the first information indicates the third value; when it is determined that the motion information of the neighboring block is changed, the first information indicates the first value or the second value. Wherein, when the predefined offset has a + sign, the first information indicates a first value, and when the predefined offset has a - sign, the first information indicates a second value, The second information includes change distance information and change direction information.

4. A device for encoding motion information, the device comprising: A predictive encoder configured to: determine whether to change motion information of a neighboring block to obtain a differential motion vector of a current block; When it is determined that the motion information of the neighboring block is not to be changed, the differential motion vector is obtained by using the motion vector of the neighboring block and the motion vector of the current block; when it is determined that the motion information of the neighboring block is to be changed, the differential motion vector is obtained by using the motion vector of the neighboring block to which a predefined offset of at least one of an x ​​component or a y component of the motion vector of the neighboring block is applied, and the motion vector of the current block; as well as a bitstream generator configured to generate a bitstream, wherein the bitstream includes first information indicating whether the motion information of the neighboring block is changed and second information indicating the differential motion vector, The first information represents index information indicating one of the first value, the second value, or the third value. When it is determined that the motion information of the neighboring block is not changed, the first information indicates the third value; when it is determined that the motion information of the neighboring block is changed, the first information indicates the first value or the second value. Wherein, when the predefined offset has a + sign, the first information indicates a first value, and when the predefined offset has a - sign, the first information indicates a second value, The second information includes change distance information and change direction information.

5. A method for transmitting a bitstream generated by an image encoding device, the image encoding device comprising: A predictive encoder configured to: determine whether to change motion information of a neighboring block to obtain a differential motion vector of a current block; When it is determined that the motion information of the neighboring block is not to be changed, the differential motion vector is obtained by using the motion vector of the neighboring block and the motion vector of the current block; when it is determined that the motion information of the neighboring block is to be changed, the differential motion vector is obtained by using the motion vector of the neighboring block to which a predefined offset of at least one of an x ​​component or a y component of the motion vector of the neighboring block is applied, and the motion vector of the current block; as well as a bitstream generator configured to generate a bitstream, wherein the bitstream includes first information indicating whether the motion information of the neighboring block is changed and second information indicating the differential motion vector, The first information represents index information indicating one of the first value, the second value, or the third value. When it is determined that the motion information of the neighboring block is not changed, the first information indicates the third value; when it is determined that the motion information of the neighboring block is changed, the first information indicates the first value or the second value. Wherein, when the predefined offset has a + sign, the first information indicates a first value, and when the predefined offset has a - sign, the first information indicates a second value, The second information includes change distance information and change direction information.

Citation Information

Patent Citations

  • Video encoding and decoding with improved error resilience

    EP2664142A1