Devices used to decode motion information, devices used to encode motion information, and computer-readable recording objects are non-volatile.

VN10062749BActive Publication Date: 2026-11-05SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
VN1202405889
Authority / Receiving Office
VN · VN
Patent Type
Patents
Current Assignee / Owner
Priority Date
2017-09-12
Filing Date
2018-09-12
Publication Date
2026-11-05
Estimated Expiration
2038-09-12

AI Technical Summary

Technical Problem

Current video encoding and decoding methods face challenges in efficiently encoding and decoding motion information with a small number of bits, particularly in expressing motion vectors and residual motion vectors effectively.

Method used

A method and apparatus that determine a basic motion vector and residual motion vectors based on information from a bitstream, using candidates classified by transition distance and direction, to generate and encode motion vectors efficiently.

Benefits of technology

This approach allows for accurate and efficient expression of motion information with a reduced bit usage, enhancing the compression efficiency in video encoding and decoding processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure VN1202405889_0
    Figure VN1202405889_0
Patent Text Reader

Abstract

The invention proposes a device for decoding motion information, a device for encoding motion information, and a computer-readable recording object that is non-volatile. The method for decoding motion information follows a scheme comprising the following steps: determining the baseline motion vector of the current block; determining the primary differential motion vector for the current block based on information obtained from a bit stream among one or more candidate primary differential motion vectors classified by different distances and orientations; and determining the motion vector of the current block by applying the primary differential motion vector to the baseline motion vector.
Need to check novelty before this filing date? Find Prior Art

Description

Method for encoding and decoding motion information, and device for encoding and decoding motion information

[0001] The present disclosure relates to the field of video encoding and decoding. More specifically, the present disclosure relates to a method and device for encoding motion information used in video encoding and decoding, and a method and device for decoding motion information.

[0002] In the method of encoding and decoding an image, a picture is divided into blocks to encode the image, and each block can be predicted and encoded through inter prediction or intra prediction.

[0003] Inter prediction is a method of compressing images by removing temporal redundancy between pictures, and motion estimation coding is a representative example. Motion estimation coding predicts blocks of the current picture using at least one reference picture. A reference block most similar to the current block can be searched for within a predetermined search range using a predetermined evaluation function. The current block is predicted based on the reference block, and the predicted block generated as a result of the prediction is subtracted from the current block to generate and encode a residual block. At this time, in order to perform prediction more accurately, interpolation can be performed on the search range of the reference picture to generate pixels of sub-pel units smaller than integer pel units, and inter prediction can be performed based on the generated pixels of the sub-pel units.

[0004] Codecs such as H.264 AVC (Advanced Video Coding) and HEVC (High Efficiency Video Coding) use the motion vectors of previously encoded blocks adjacent to the current block or blocks included in previously encoded pictures as the prediction motion vector of the current block to predict the motion vector of the current block. The differential motion vector, which is the difference between the motion vector of the current block and the predicted motion vector, is signaled to the decoder side through a predetermined method.

[0005] A method for encoding and decoding motion information according to one embodiment, and a device for encoding and decoding motion information, have as a technical task the expression of motion information with a small number of bits.

[0006] In addition, a method for encoding and decoding motion information according to one embodiment, and a device for encoding and decoding motion information, have as a technical challenge the expression of a residual motion vector with a small number of bits.

[0007] A method for decoding motion information according to one embodiment of the present disclosure may include: determining a base motion vector of a current block; determining a first residual motion vector for the current block based on information obtained from a bitstream among at least one first residual motion vector candidate distinguished according to a displacement distance and a displacement direction; and determining a motion vector of the current block by applying the first residual motion vector to the base motion vector.

[0008] In one embodiment, the step of determining the motion vector of the current block may further include the step of obtaining information representing a secondary residual motion vector related to the current block from a bitstream; and the step of applying the secondary residual motion vector determined based on the information representing the secondary residual motion vector to a base motion vector modified by applying the primary residual motion vector to determine the motion vector of the current block.

[0009] A method for encoding and decoding motion information according to one embodiment, and a device for encoding and decoding motion information, can express motion information with a small number of bits.

[0010] In addition, a method for encoding and decoding motion information according to one embodiment, and a device for encoding and decoding motion information, can express a residual motion vector with a small number of bits.

[0011] However, the effects that can be achieved by the method for encoding and decoding motion information and the device for encoding and decoding motion information according to one embodiment are not limited to those mentioned above, and other effects that are not mentioned can be clearly understood by a person having ordinary skill in the art to which the present disclosure pertains from the description below.

[0012] To facilitate a more thorough understanding of the drawings cited herein, a brief description of each drawing is provided.

[0013] FIG. 1 is a block diagram of an image decoding device according to one embodiment.

[0014] FIG. 2 is a block diagram of an image encoding device according to one embodiment.

[0015] FIG. 3 illustrates a process in which an image decoding device divides a current encoding unit to determine at least one encoding unit according to one embodiment.

[0016] FIG. 4 illustrates a process in which an image decoding device determines at least one encoding unit by dividing a non-square encoding unit according to one embodiment.

[0017] FIG. 5 illustrates a process in which an image decoding device divides an encoding unit based on at least one of block shape information and division shape mode information, according to one embodiment.

[0018] FIG. 6 illustrates a method for a video decoding device to determine a predetermined encoding unit among an odd number of encoding units according to one embodiment.

[0019] FIG. 7 illustrates the order in which multiple encoding units are processed when an image decoding device determines multiple encoding units by dividing a current encoding unit according to one embodiment.

[0020] FIG. 8 illustrates a process for determining that a current encoding unit is divided into an odd number of encoding units when the encoding units cannot be processed in a predetermined order, according to one embodiment.

[0021] FIG. 9 illustrates a process in which an image decoding device divides a first encoding unit to determine at least one encoding unit according to one embodiment.

[0022] FIG. 10 illustrates that, according to one embodiment, a video decoding device limits the shapes into which a second encoding unit can be divided when a non-square shape of a second encoding unit determined by dividing a first encoding unit satisfies a predetermined condition.

[0023] FIG. 11 illustrates a process of a video decoding device dividing a square-shaped encoding unit when the split shape mode information cannot indicate that the encoding unit is divided into four square-shaped encoding units according to one embodiment.

[0024] FIG. 12 illustrates that, according to one embodiment, the processing order between multiple encoding units may vary depending on the process of dividing the encoding units.

[0025] FIG. 13 illustrates a process in which the depth of an encoding unit is determined as the shape and size of the encoding unit change when the encoding unit is recursively divided to determine a plurality of encoding units according to one embodiment.

[0026] FIG. 14 illustrates an index (part index, hereinafter referred to as PID) for depth and encoding unit distinction that can be determined according to the shape and size of encoding units according to one embodiment.

[0027] FIG. 15 illustrates that a plurality of encoding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment.

[0028] FIG. 16 illustrates a processing block that serves as a criterion for determining the order of determination of reference coding units included in a picture according to one embodiment.

[0029] FIG. 17 illustrates encoding units that can be determined for each picture when the combination of forms into which encoding units can be divided is different for each picture according to one embodiment.

[0030] FIG. 18 illustrates various forms of encoding units that can be determined based on segmentation mode information that can be expressed in binary code according to one embodiment.

[0031] FIG. 19 illustrates another form of a coding unit that can be determined based on segmentation mode information that can be expressed in binary code according to one embodiment.

[0032] Figure 20 is a block diagram of an image encoding and decoding system that performs loop filtering.

[0033] Fig. 21 is a block diagram of an image decoding device according to one embodiment.

[0034] Figures 22 to 25 are diagrams showing first-order residual motion vector candidates displayed on a coordinate plane.

[0035] FIG. 26 is a diagram for explaining an index representing first residual motion vector candidates according to one embodiment.

[0036] Figure 27 is a diagram for explaining motion information used for bidirectional prediction of a block.

[0037] Figure 28 is a diagram showing the positional relationship between the current picture and two reference pictures.

[0038] Figure 29 is a diagram showing first residual motion vector candidates for the current block predicted in both directions.

[0039] Figure 30 is a diagram showing the positional relationship between the current picture and two reference pictures.

[0040] Figure 31 is a diagram showing first residual motion vector candidates for the current block predicted in both directions.

[0041] Figure 32 is a flowchart for explaining an image decoding method according to one embodiment.

[0042] Fig. 33 is a block diagram of an image encoding device according to one embodiment.

[0043] Figure 34 is a flowchart for explaining an image encoding method according to one embodiment.

[0044] A method for decoding motion information according to one embodiment of the present disclosure may include: determining a base motion vector of a current block; determining a first residual motion vector for the current block based on information obtained from a bitstream among at least one first residual motion vector candidate distinguished according to a displacement distance and a displacement direction; and determining a motion vector of the current block by applying the first residual motion vector to the base motion vector.

[0045] In one embodiment, the step of determining the motion vector of the current block may further include the step of obtaining information representing a secondary residual motion vector related to the current block from a bitstream; and the step of applying the secondary residual motion vector determined based on the information representing the secondary residual motion vector to a base motion vector modified by applying the primary residual motion vector to determine the motion vector of the current block.

[0046] In one embodiment, the method for decoding the motion information further includes a step of obtaining an index indicating at least one of a displacement distance and a displacement direction of the first residual motion vector from a bitstream, and the step of determining the first residual motion vector may include a step of determining a first residual motion vector candidate corresponding to the obtained index among the at least one first residual motion vector candidate as the first residual motion vector for the current block.

[0047] In one embodiment, the method for decoding the motion information may further include a step of determining one of the at least one basic motion vector candidate as the basic motion vector of the current block.

[0048] In one embodiment, the step of determining the motion vector of the current block may include: when the base motion vector of the current block corresponds to a bidirectional motion vector, the prediction direction of the current block corresponds to a bidirectional motion vector, and the first residual motion vector is determined for the first unidirectional direction, determining a first residual motion vector for the second unidirectional direction based on the first residual motion vector for the first unidirectional direction; determining the motion vector of the first unidirectional direction of the current block by applying the first residual motion vector for the first unidirectional direction to the base motion vector of the first unidirectional direction; and determining the motion vector of the second unidirectional direction of the current block by applying the first residual motion vector for the second unidirectional direction to the base motion vector of the second unidirectional direction.

[0049] In one embodiment, the step of determining the first residual motion vector for the second unidirectional direction may include the step of determining at least one of a magnitude and a sign of a component value of the first residual motion vector for the second unidirectional direction based on a positional relationship between a reference picture corresponding to the base motion vector of the first unidirectional direction, a reference picture corresponding to the base motion vector of the second unidirectional direction, and a current picture including the current block.

[0050] In one embodiment, the step of determining the motion vector of the current block may include, when the base motion vector of the current block corresponds to a first unidirectional motion vector and the prediction direction of the current block corresponds to a second unidirectional different from the first unidirectional, determining a second unidirectional base motion vector based on the first unidirectional base motion vector, and determining a first residual motion vector for the second unidirectional based on the first residual motion vector for the first unidirectional; and determining the motion vector of the current block by applying the first residual motion vector for the second unidirectional to the second unidirectional base motion vector.

[0051] In one embodiment, the step of determining the motion vector of the current block may include, when the base motion vector of the current block corresponds to a first unidirectional motion vector and the prediction direction of the current block corresponds to a bidirectional motion vector, determining the second unidirectional base motion vector based on the first unidirectional base motion vector and determining the first residual motion vector for the second unidirectional based on the first residual motion vector for the first unidirectional; determining the first unidirectional motion vector of the current block by applying the first residual motion vector for the first unidirectional to the first unidirectional base motion vector; and determining the second unidirectional motion vector of the current block by applying the first residual motion vector for the second unidirectional to the second unidirectional base motion vector.

[0052] In one embodiment, the method for decoding the motion information may further include a step of entropy decoding at least some of the indices representing the first residual motion vector from the bitstream according to a context model.

[0053] In one embodiment, the method for decoding motion information further comprises the step of determining at least one first residual motion vector candidate for each of at least one base motion vector candidate, wherein the first residual motion vector candidate determined corresponding to the bidirectional base motion vector candidate among the at least one first residual motion vector candidate may include a first residual motion vector candidate in the direction of list 0 and a first residual motion vector candidate in the direction of list 1, which include values ​​of the same sign or opposite signs.

[0054] In one embodiment, the size of at least one of the first residual motion vector candidate in the list 0 direction and the first residual motion vector candidate in the list 1 direction may be scaled by considering the distance between a first reference picture corresponding to the first unidirectional base motion vector candidate, a current picture including the current block, and a second reference picture corresponding to the second unidirectional base motion vector candidate.

[0055] In one embodiment, the method for decoding motion information may further include, when the current block corresponds to a first child block divided from a parent block, determining a motion vector of the current block as a base motion vector of the second child block; and applying a first residual motion vector determined for the second child block to the base motion vector of the second child block to determine a motion vector of the second child block.

[0056] In one embodiment, the method for decoding motion information may further include, when the current block corresponds to a first child block divided from a parent block, a step of applying at least one of information indicating a basic motion vector obtained in relation to the current block, information indicating a variation distance, and information indicating a variation direction to a second child block.

[0057] In one embodiment, the method for decoding motion information may further include a step of obtaining information indicating at least one of whether a predetermined encoding mode is applied to the current block, a base motion vector for the current block, a first residual motion vector for the current block, a priority of disparity distances, and a priority of disparity directions, at at least one level among a transform unit level, a encoding unit level, a maximum encoding unit level, a slice level, and a picture level.

[0058] A method for encoding motion information according to one embodiment of the present disclosure,

[0059] The method may include: determining a base motion vector of a current block; determining a first residual motion vector for the current block from among at least one first residual motion vector candidate distinguished according to a displacement distance and a displacement direction based on a difference between the motion vector of the current block and the base motion vector; and generating a bitstream including at least one of information representing the base motion vector and information representing the first residual motion vector.

[0060] The present disclosure may be subject to various modifications and embodiments. Specific embodiments are illustrated in the drawings and described in detail herein. However, this is not intended to limit the embodiments of the present disclosure, and it should be understood that the present disclosure encompasses all modifications, equivalents, and alternatives falling within the spirit and technical scope of the various embodiments.

[0061] In describing the embodiments, detailed descriptions of related known technologies are omitted if they are deemed to unnecessarily obscure the gist of the present disclosure. Furthermore, numbers (e.g., "first," "second," etc.) used throughout the description of the specification are merely identifiers used to distinguish one component from another.

[0062] Additionally, in this specification, when a component is referred to as being “connected” or “connected” to another component, it should be understood that the component may be directly connected or connected to the other component, but may also be connected or connected via another component in between, unless there is a specific description to the contrary.

[0063] In addition, components expressed as 'unit', 'module', etc. in this specification may be two or more components combined into one component, or one component may be divided into two or more components with more detailed functions. In addition, each component described below may additionally perform some or all of the functions performed by other components in addition to its own main function, and of course, some of the main functions performed by each component may be performed exclusively by other components.

[0064] Additionally, in this specification, 'image' or 'picture' may refer to a still image of a video or a moving image, i.e., the video itself.

[0065] Additionally, in this specification, "sample" refers to data assigned to a sampling location in an image and is the subject of processing. For example, pixel values ​​in a spatial domain image and transform coefficients in a transform domain may be samples. A unit containing at least one such sample may be defined as a block.

[0066] Additionally, in this specification, 'current block' may mean a block of the maximum encoding unit, encoding unit, prediction unit, or transformation unit of the current image to be encoded or decoded.

[0067] Also, in this specification, when a motion vector is in the direction of list 0, it may mean that the motion vector is used to point to a block in a reference picture included in list 0, and when a motion vector is in the direction of list 1, it may mean that the motion vector is used to point to a block in a reference picture included in list 1. Also, when a motion vector is unidirectional, it may mean that the motion vector is used to point to a block in a reference picture included in list 0 or list 1, and when a motion vector is bidirectional, it may mean that the motion vector includes a motion vector in the direction of list 0 and a motion vector in the direction of list 1.

[0068] Hereinafter, with reference to FIGS. 1 to 20, an image encoding method and device based on a tree-structured encoding unit and a transformation unit, and an image decoding method and device are disclosed according to an embodiment. Each of the image encoding device (200) and the image decoding device (100) to be described with reference to FIGS. 1 to 20 may include each of the image encoding device (3300) and the image decoding device (2100) to be described with reference to FIGS. 21 to 34.

[0069] FIG. 1 illustrates a block diagram of an image decoding device (100) according to one embodiment.

[0070] The video decoding device (100) may include a bitstream acquisition unit (110) and a decoding unit (120). The bitstream acquisition unit (110) and the decoding unit (120) may include at least one processor. In addition, the bitstream acquisition unit (110) and the decoding unit (120) may include a memory that stores commands to be executed by at least one processor.

[0071] The bitstream acquisition unit (110) can receive a bitstream. The bitstream includes information obtained by encoding an image by an image encoding device (200) described below. 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 by wire or wirelessly, and the bitstream acquisition unit (110) can receive the bitstream by wire or wirelessly. The bitstream acquisition unit (110) can receive the bitstream from a storage medium such as an optical medium, a hard disk, etc. The decoding unit (120) can restore the image based on information obtained from the received bitstream. The decoding unit (120) can obtain syntax elements for restoring the image from the bitstream. The decoding unit (120) can restore the image based on the syntax elements.

[0072] To describe in detail the operation of the video decoding device (100), the bitstream acquisition unit (110) can receive a bitstream.

[0073] The image decoding device (100) may perform an operation of obtaining a binstring corresponding to a splitting shape mode of an encoding unit from a bitstream. In addition, the image decoding device (100) may perform an operation of determining a splitting rule of the encoding unit. In addition, the image decoding device (100) may perform an operation of splitting the encoding unit into a plurality of encoding units based on at least one of the binstring corresponding to the splitting shape mode and the splitting rule. In order to determine the splitting rule, the image decoding device (100) may determine a first allowable range of the size of the encoding unit according to a ratio of the width and height of the encoding unit. In order to determine the splitting rule, the image decoding device (100) may determine a second allowable range of the size of the encoding unit according to the splitting shape mode of the encoding unit.

[0074] Below, the division of encoding units according to one embodiment of the present disclosure is described in detail.

[0075] First, a picture can be divided into one or more slices. A slice can be a sequence of one or more Coding Tree Units (CTUs). The concept that contrasts with a Coding Tree Block (CTB) is a Coding Tree Block (CTB).

[0076] A maximum coding block (CTB) is an NxN block containing NxN samples (where N is an integer). Each color component can be divided into one or more maximum coding blocks.

[0077] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), a maximum coding unit (CTU) is a unit that includes a maximum coding block of luma samples, two maximum coding blocks of corresponding chroma samples, and syntax structures used to encode the luma samples and chroma samples. When a picture is a monochrome picture, a maximum coding unit is a unit that includes a maximum coding block of monochrome samples and syntax structures used to encode the monochrome samples. When a picture is a picture that is encoded with a color plane that is separated by color components, a maximum coding unit is a unit that includes syntax structures used to encode the picture and samples of the picture.

[0078] A single maximum coding block (CTB) can be divided into MxN coding blocks containing MxN samples (M, N are integers).

[0079] When a picture has a sample array for each Y, Cr, and Cb component, a coding unit (CU) is a unit that includes a coding block for a luma sample and two coding blocks for corresponding chroma samples, and syntax structures used to encode the luma sample and the chroma samples. When a picture is a monochrome picture, a coding unit is a unit that includes a coding block for a monochrome sample and syntax structures used to encode the monochrome samples. When a picture is a picture that is encoded with a color plane that is separated by color component, a coding unit is a unit that includes syntax structures used to encode the picture and samples of the picture.

[0080] As explained above, the maximum coding block and the maximum coding unit are distinct concepts, and the coding block and the coding unit are distinct concepts. That is, the (maximum) coding unit refers to a data structure including a (maximum) coding block including the corresponding sample and a syntax structure corresponding to it. However, since a person skilled in the art can understand that the (maximum) coding unit or the (maximum) coding block refers to a block of a predetermined size including a predetermined number of samples, the following specification will refer to the maximum coding block and the maximum coding unit, or the coding block and the coding unit, without distinction unless there are special circumstances.

[0081] An image can be divided into Coding Tree Units (CTUs). The size of the CTUs can be determined based on information obtained from the bitstream. The shape of the CTUs can be a square of equal size, but is not limited thereto.

[0082] For example, information about the maximum size of a luma coding block can 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 can be one of 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, and 256x256.

[0083] For example, information about the maximum size of a luma coding block capable of being split into two and the luma block size difference can be obtained from the bitstream. The information about the luma block size difference can indicate the size difference between a luma maximum coding unit and a maximum luma coding block capable of being split into two. Therefore, by combining the information about the maximum size of a luma coding block capable of being split into two obtained from the bitstream and the information about the luma block size difference, the size of the luma maximum coding unit can be determined. Using the size of the luma maximum coding unit, the size of the chroma maximum coding unit can also be determined. For example, if the Y: Cb: Cr ratio is 4:2:0 according to the color format, the size of the chroma block can be half the size of the luma block, and similarly, the size of the chroma maximum coding unit can be half the size of the luma maximum coding unit.

[0084] According to one embodiment, since information about the maximum size of a luma coding block capable of binary splitting is obtained from a bitstream, the maximum size of the luma coding block capable of binary splitting can be determined variably. Alternatively, the maximum size of the luma coding block capable of ternary splitting can be fixed. For example, the maximum size of a luma coding block capable of ternary splitting in an I slice may be 32x32, and the maximum size of a luma coding block capable of ternary splitting in a P slice or a B slice may be 64x64.

[0085] Additionally, the maximum coding unit can be hierarchically divided into coding units based on the division shape mode information obtained from the bitstream. As the division shape mode information, at least one of information indicating whether quad division is performed, information indicating whether multi-division is performed, division direction information, and division type information can be obtained from the bitstream.

[0086] For example, information indicating whether a quad split is present may indicate whether the current encoding unit is to be quad split (QUAD_SPLIT) or not to be quad split.

[0087] If the current encoding unit is not quad-split, the information indicating whether it is multi-split may indicate whether the current encoding unit will not be split any further (NO_SPLIT) or will be binary / ternary split.

[0088] When the current encoding unit is binary or ternary split, the split direction information indicates that the current encoding unit is split in either the horizontal or vertical direction.

[0089] When the current encoding unit is split in the horizontal or vertical direction, the split type information indicates that the current encoding unit is split into binary split or ternary split.

[0090] Depending on the split direction information and the split type information, the split mode of the current encoding unit can be determined. The split mode when the current encoding unit is split into binaries in the horizontal direction can be determined as binary horizontal split (SPLIT_BT_HOR), the split mode when the current encoding unit is split into ternary horizontal split (SPLIT_TT_HOR), the split mode when the current encoding unit is split into binaries in the vertical direction can be determined as binary vertical split (SPLIT_BT_VER), and the split mode when the current encoding unit is split into ternary vertical split (SPLIT_BT_VER).

[0091] The image decoding device (100) can obtain segmentation shape mode information from a bitstream from a single binstring. The format of the bitstream received by the image decoding device (100) can include a fixed length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The binstring represents information as a series of binary numbers. The binstring can be composed of at least one bit. The image decoding device (100) can obtain segmentation shape mode information corresponding to the binstring based on a segmentation rule. The image decoding device (100) can determine whether to quad-segment an encoding unit, whether not to quad-segment, or the segmentation direction and segmentation type based on a single binstring.

[0092] The coding unit may be smaller than or equal to the maximum coding unit. For example, the maximum coding unit is also a coding unit with the maximum size, so it is a coding unit. If the split shape mode information for the maximum coding unit indicates that it is not split, the coding unit determined from the maximum coding unit has the same size as the maximum coding unit. If the split shape mode information for the maximum coding unit indicates that it is split, the maximum coding unit may be split into coding units. In addition, if the split shape mode information for the coding unit indicates splitting, the coding units may be split into coding units of smaller sizes. However, the splitting of the image is not limited thereto, and the maximum coding unit and the coding units may not be distinguished. The splitting of the coding unit is described in more detail with reference to FIGS. 3 to 16.

[0093] Additionally, one or more prediction blocks for prediction may be determined from the coding unit. The prediction blocks may be equal to or smaller than the coding unit. Additionally, one or more transformation blocks for transformation may be determined from the coding unit. The transformation blocks may be equal to or smaller than the coding unit.

[0094] The shape and size of the transformation block and the prediction block may be unrelated.

[0095] In another embodiment, prediction may be performed using the encoding unit as a prediction block. Transformation may also be performed using the encoding unit as a transform block.

[0096] The division of a coding unit is described in more detail with reference to FIGS. 3 to 16. The current block and neighboring blocks of the present disclosure may represent one of a maximum coding unit, a coding unit, a prediction block, and a transform block. In addition, the current block or the current coding unit is a block currently being decoded or encoded, or a block currently being divided. The 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 on one of the lower left, left, upper left, upper right, upper right, right, and lower right sides of the current block.

[0097] FIG. 3 illustrates a process in which an image decoding device (100) divides a current encoding unit to determine at least one encoding unit according to one embodiment.

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

[0099] The shape of the encoding unit may include square and non-square. When the width and height of the encoding unit are equal (i.e., when the block shape of the encoding unit is 4Nx4N), the image decoding device (100) may determine the block shape information of the encoding unit as square. The image decoding device (100) may determine the shape of the encoding unit as non-square.

[0100] When the width and height of the encoding unit are different (i.e., when the block shape of the encoding unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the image decoding device (100) may determine the block shape information of the encoding unit to be non-square. When the shape of the encoding unit is non-square, the image decoding device (100) may determine the ratio of the width and height among the block shape information of the encoding unit to be at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. Additionally, based on the width length and height length of the encoding unit, the image decoding device (100) can determine whether the encoding unit is in the horizontal or vertical direction. Additionally, based on at least one of the width length, height length, or area of ​​the encoding unit, the image decoding device (100) can determine the size of the encoding unit.

[0101] According to one embodiment, the image decoding device (100) can determine the shape of an encoding unit using block shape information, and can determine the shape into which the encoding unit is divided using segmentation shape mode information. That is, the splitting method of the encoding unit indicated by the segmentation shape mode information can be determined depending on which block shape the block shape information used by the image decoding device (100) indicates.

[0102] The image decoding device (100) can obtain the segmentation shape mode information from the bitstream. However, the present invention is not limited thereto, and the image decoding device (100) and the image encoding device (200) can determine the pre-agreed segmentation shape mode information based on the block shape information. The image decoding device (100) can determine the pre-agreed segmentation shape mode information for the maximum coding unit or the minimum coding unit. For example, the image decoding device (100) can determine the segmentation shape mode information for the maximum coding unit as quad split. In addition, the image decoding device (100) can determine the segmentation shape mode information for the minimum coding unit as “not split.” Specifically, the image decoding device (100) can determine the size of the maximum coding unit as 256x256. The image decoding device (100) can determine the pre-agreed segmentation shape mode information as quad split. Quad splitting is a splitting mode that divides both the width and height of an encoding unit in half. The image decoding device (100) can obtain a coding unit of size 128x128 from a maximum coding unit of size 256x256 based on the splitting mode information. In addition, the image decoding device (100) can determine the size of the minimum coding unit as 4x4. The image decoding device (100) can obtain splitting mode information indicating "not splitting" for the minimum coding unit.

[0103] According to one embodiment, the image decoding device (100) may use block shape information indicating that the current encoding unit is a square shape. For example, the image decoding device (100) may determine whether to not split a square encoding unit, to split it vertically, to split it horizontally, to split it into four encoding units, etc., according to the split shape mode information. Referring to FIG. 3, when the block shape information of the current encoding unit (300) indicates a square shape, the decoding unit (120) may not split an encoding unit (310a) having the same size as the current encoding unit (300) according to the split shape mode information indicating that it is not split, or may determine a split encoding unit (310b, 310c, 310d, 310e, 310f, etc.) based on the split shape mode information indicating a predetermined splitting method.

[0104] Referring to FIG. 3, the image decoding device (100) may determine two coding units (310b) by vertically dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is vertically divided, according to an embodiment. The image decoding device (100) may determine two coding units (310c) by horizontally dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is horizontally divided, according to an embodiment. The image decoding device (100) may determine four coding units (310d) by vertically and horizontally dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is vertically and horizontally divided, according to an embodiment. The image decoding device (100) may determine three coding units (310e) by vertically dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is ternary divided, according to an embodiment. The image decoding device (100) can determine three coding units (310f) into which the current coding unit (300) is horizontally divided based on the division shape mode information indicating that the ternary division is horizontally divided. However, the division shapes into which a square coding unit can be divided should not be interpreted as being limited to the above-described shapes, and may include various shapes that can be indicated by the division shape mode information. Specified division shapes into which a square coding unit is divided will be specifically described below through various embodiments.

[0105] FIG. 4 illustrates a process in which an image decoding device (100) divides a non-square coding unit to determine at least one coding unit according to one embodiment.

[0106] According to one embodiment, the image decoding device (100) may utilize block shape information indicating that the current encoding unit is non-square. The image decoding device (100) may determine whether to not split the current non-square encoding unit or to split it using a predetermined method based on the split shape mode information. Referring to FIG. 4, when the block shape information of the current encoding unit (400 or 450) indicates a non-square shape, the image decoding device (100) may determine an encoding unit (410 or 460) having the same size as the current encoding unit (400 or 450) according to the split shape mode information indicating that it is not split, or may determine a split encoding unit (420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, 480c) based on the split shape mode information indicating a predetermined splitting method. The predetermined splitting method by which a non-square encoding unit is split will be described in detail through various embodiments below.

[0107] According to one embodiment, the image decoding device (100) may determine a form in which an encoding unit is split using split form mode information, and in this case, the split form mode information may indicate the number of at least one encoding unit generated by splitting the encoding unit. Referring to FIG. 4, when the split form mode information indicates that the current encoding unit (400 or 450) is split into two encoding units, the image decoding device (100) may split the current encoding unit (400 or 450) based on the split form mode information to determine two encoding units (420a, 420b, or 470a, 470b) included in the current encoding unit.

[0108] According to one embodiment, when the image decoding device (100) splits a current encoding unit (400 or 450) having a non-square shape based on split shape mode information, the image decoding device (100) may split the current encoding unit by considering the position of the long side of the non-square current encoding unit (400 or 450). For example, the image decoding device (100) may split the current encoding unit (400 or 450) in a direction that splits the long side of the current encoding unit (400 or 450) by considering the shape of the current encoding unit (400 or 450) to determine a plurality of encoding units.

[0109] According to one embodiment, if the split shape mode information indicates that the coding unit is split into an odd number of blocks (ternary splitting), the image decoding device (100) may determine an odd number of coding units included in the current coding unit (400 or 450). For example, if the split shape mode information indicates that the current coding unit (400 or 450) is split into three coding units, the image decoding device (100) may split the current coding unit (400 or 450) into three coding units (430a, 430b, 430c, 480a, 480b, 480c).

[0110] According to one embodiment, the ratio of the width and height of the current encoding unit (400 or 450) may be 4:1 or 1:4. When the ratio of the width and height is 4:1, the block shape information may be in the horizontal direction because the length of the width is longer than the length of the height. When the ratio of the width and height is 1:4, the block shape information may be in the vertical direction because the length of the width is shorter than the length of the height. The image decoding device (100) may determine to split the current encoding unit into an odd number of blocks based on the split shape mode information. In addition, the image decoding device (100) may determine the splitting direction of the current encoding unit (400 or 450) based on the block shape information of the current encoding unit (400 or 450). For example, if the current encoding unit (400) is in the vertical direction, the image decoding device (100) can divide the current encoding unit (400) in the horizontal direction to determine encoding units (430a, 430b, 430c). Also, if the current encoding unit (450) is in the horizontal direction, the image decoding device (100) can divide the current encoding unit (450) in the vertical direction to determine encoding units (480a, 480b, 480c).

[0111] According to one embodiment, the image decoding device (100) may determine an odd number of coding units included in the current coding unit (400 or 450), and the sizes of the determined coding units may not all be the same. For example, among the determined odd number of coding units (430a, 430b, 430c, 480a, 480b, 480c), the size of a given coding unit (430b or 480b) may have a different size from the other coding units (430a, 430c, 480a, 480c). That is, the encoding units into which the current encoding unit (400 or 450) can be divided and determined can have multiple types of sizes, and in some cases, an odd number of encoding units (430a, 430b, 430c, 480a, 480b, 480c) can each have different sizes.

[0112] According to one embodiment, when the split shape mode information indicates that the coding unit is split into an odd number of blocks, the image decoding device (100) can determine an odd number of coding units included in the current coding unit (400 or 450), and further, the image decoding device (100) can place a predetermined restriction on at least one coding unit among the odd number of coding units generated by splitting. Referring to FIG. 4, the image decoding device (100) can perform a decoding process for a coding unit (430b, 480b) located in the center among three coding units (430a, 430b, 430c, 480a, 480b, 480c) generated by splitting the current coding unit (400 or 450) differently from the decoding process for other coding units (430a, 430c, 480a, 480c). For example, the image decoding device (100) can restrict the encoding unit (430b, 480b) located in the center from being split any further, unlike other encoding units (430a, 430c, 480a, 480c), or can restrict it to be split only a predetermined number of times.

[0113] FIG. 5 illustrates a process in which an image decoding device (100) divides an encoding unit based on at least one of block shape information and division shape mode information according to one embodiment.

[0114] According to one embodiment, the image decoding device (100) may determine whether to split or not to split a first coding unit (500) having a square shape into coding units based on at least one of block shape information and split shape mode information. According to one embodiment, when the split shape mode information indicates splitting the first coding unit (500) in the horizontal direction, the image decoding device (100) may split the first coding unit (500) in the horizontal direction to determine a second coding unit (510). The first coding unit, the second coding unit, and the third coding unit used according to one embodiment are terms used to understand the relationship before and after splitting between coding units. For example, when the first coding unit is split, the second coding unit may be determined, and when the second coding unit is split, the third coding unit may be determined. Hereinafter, the relationship between the first coding unit, the second coding unit, and the third coding unit used may be understood to follow the above-described characteristics.

[0115] According to one embodiment, the image decoding device (100) may determine to split or not split the determined second encoding unit (510) into encoding units based on the split shape mode information. Referring to FIG. 5, the image decoding device (100) may split the first encoding unit (500) based on the split shape mode information to split the determined second encoding unit (510) of a non-square shape into at least one third encoding unit (520a, 520b, 520c, 520d, etc.) or may not split the second encoding unit (510). The image decoding device (100) can obtain split shape mode information, and the image decoding device (100) can split the first encoding unit (500) based on the obtained split shape mode information to split a plurality of second encoding units (e.g., 510) of various shapes, and the second encoding unit (510) can be split according to the way in which the first encoding unit (500) is split based on the split shape mode information. According to one embodiment, when the first encoding unit (500) is split into the second encoding unit (510) based on the split shape mode information for the first encoding unit (500), the second encoding unit (510) can also be split into the third encoding unit (e.g., 520a, 520b, 520c, 520d, etc.) based on the split shape mode information for the second encoding unit (510). That is, the coding unit can be recursively split based on the split shape mode information associated with each coding unit. Accordingly, a square coding unit can be determined from a non-square coding unit, and such a square coding unit can be recursively split to determine a non-square coding unit.

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

[0117] According to one embodiment, the image decoding device (100) may split each of the third encoding units (520a, 520b, 520c, 520d, etc.) into encoding units based on the split shape mode information. In addition, the image decoding device (100) may determine not to split the second encoding unit (510) based on the split shape mode information. According to one embodiment, the image decoding device (100) may split the second encoding unit (510) having a non-square shape into an odd number of third encoding units (520b, 520c, 520d). The image decoding device (100) may place a predetermined restriction on a predetermined third encoding unit among the odd number of third encoding units (520b, 520c, 520d). For example, the image decoding device (100) can limit the encoding unit (520c) located in the middle among an odd number of third encoding units (520b, 520c, 520d) to not be divided any further or to be divided a settable number of times.

[0118] Referring to FIG. 5, the image decoding device (100) may limit the coding unit (520c) located in the middle among the odd number of third coding units (520b, 520c, 520d) included in the second coding unit (510) having a non-square shape to not be split any further, or to be split in a predetermined split form (for example, to be split only into four coding units or to be split in a form corresponding to the split form of the second coding unit (510), or to be split only a predetermined number of times (for example, to be split only n times, where n>0). However, the above limitations on the coding unit (520c) located in the middle are merely simple embodiments and should not be interpreted as being limited to the above-described embodiments, but should be interpreted as including various limitations in which the coding unit (520c) located in the middle can be decoded differently from the other coding units (520b, 520d).

[0119] According to one embodiment, the image decoding device (100) can obtain the segmentation shape mode information used to segment the current encoding unit from a predetermined location within the current encoding unit.

[0120] FIG. 6 illustrates a method for an image decoding device (100) to determine a predetermined encoding unit among an odd number of encoding units according to one embodiment.

[0121] Referring to FIG. 6, the split shape mode information of the current encoding unit (600, 650) can be obtained from a sample at a predetermined position among a plurality of samples included in the current encoding unit (600, 650) (for example, a sample (640, 690) located in the center). However, the predetermined position within the current encoding unit (600) from which at least one of the split shape mode information can be obtained should not be interpreted as being limited to the center position illustrated in FIG. 6, but should be interpreted as including various positions (for example, top, bottom, left, right, upper left, lower left, upper right, or lower right, etc.) that can be included within the current encoding unit (600). The image decoding device (100) can obtain the split shape mode information obtained from the predetermined position and determine whether or not to split the current encoding unit into encoding units of various shapes and sizes.

[0122] According to one embodiment, the image decoding device (100) may select one of the coding units when the current coding unit is divided into a predetermined number of coding units. Various methods may be used to select one of the multiple coding units, and descriptions of such methods will be provided later through various embodiments.

[0123] According to one embodiment, the image decoding device (100) can divide the current encoding unit into a plurality of encoding units and determine an encoding unit at a predetermined position.

[0124] According to one embodiment, the image decoding device (100) may use information indicating the positions of each of the odd-numbered coding units to determine an coding unit located in the middle of the odd-numbered coding units. Referring to FIG. 6, the image decoding device (100) may divide the current coding unit (600) or the current coding unit (650) to determine odd-numbered coding units (620a, 620b, 620c) or odd-numbered coding units (660a, 660b, 660c). The image decoding device (100) may use information about the positions of the odd-numbered coding units (620a, 620b, 620c) or odd-numbered coding units (660a, 660b, 660c) to determine the middle coding unit (620b) or the middle coding unit (660b). For example, the image decoding device (100) can determine the coding unit (620b) located in the center by determining the positions of the coding units (620a, 620b, 620c) based on information indicating the positions of predetermined samples included in the coding units (620a, 620b, 620c). Specifically, the image decoding device (100) can determine the coding unit (620b) located in the center by determining the positions of the coding units (620a, 620b, 620c) based on information indicating the positions of samples (630a, 630b, 630c) at the upper left of the coding units (620a, 620b, 620c).

[0125] According to one embodiment, information indicating the positions of the upper left samples (630a, 630b, 630c) included in each of the coding units (620a, 620b, 620c) may include information on the positions or coordinates of the coding units (620a, 620b, 620c) within the picture. According to one embodiment, information indicating the positions of the upper left samples (630a, 630b, 630c) included in each of the coding units (620a, 620b, 620c) may include information indicating the width or height of the coding units (620a, 620b, 620c) included in the current coding unit (600), and this width or height may correspond to information indicating the difference between the coordinates of the coding units (620a, 620b, 620c) within the picture. That is, the image decoding device (100) can determine the encoding unit (620b) located in the center by directly using information about the positions or coordinates of the encoding units (620a, 620b, 620c) within the picture or by using information about the width or height of the encoding unit corresponding to the difference between the coordinates.

[0126] According to one embodiment, information indicating the position of the sample (630a) at the upper left of the upper encoding unit (620a) may represent (xa, ya) coordinates, information indicating the position of the sample (530b) at the upper left of the middle encoding unit (620b) may represent (xb, yb) coordinates, and information indicating the position of the sample (630c) at the upper left of the lower encoding unit (620c) may represent (xc, yc) coordinates. The image decoding device (100) may determine the middle encoding unit (620b) using the coordinates of the upper left samples (630a, 630b, 630c) included in the encoding units (620a, 620b, 620c), respectively. For example, when the coordinates of the samples (630a, 630b, 630c) on the upper left are sorted in ascending or descending order, the encoding unit (620b) including the coordinates (xb, yb) of the sample (630b) located in the center can be determined as the encoding unit located in the center among the encoding units (620a, 620b, 620c) determined by dividing the current encoding unit (600). However, the coordinates indicating the positions of the upper left samples (630a, 630b, 630c) may indicate coordinates indicating the absolute positions within the picture, and further, based on the position of the upper left sample (630a) of the upper left coding unit (620a), the (dxb, dyb) coordinates, which are information indicating the relative position of the sample (630b) of the upper left of the middle coding unit (620b), and the (dxc, dyc) coordinates, which are information indicating the relative position of the sample (630c) of the upper left of the lower coding unit (620c), may be used. In addition, the method of determining the coding unit of a given position by using the coordinates of the corresponding sample as information indicating the position of the sample included in the coding unit should not be interpreted as being limited to the above-described method, but should be interpreted as various arithmetic methods that can utilize the coordinates of the sample.

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

[0128] According to one embodiment, the image decoding device (100) may determine the width or height of each of the encoding units (620a, 620b, 620c) by using the (xa, ya) coordinate, which is information indicating the position of the sample (630a) at the upper left of the upper encoding unit (620a), the (xb, yb) coordinate, which is information indicating the position of the sample (630b) at the upper left of the middle encoding unit (620b), and the (xc, yc) coordinate, which is information indicating the position of the sample (630c) at the upper left of the lower encoding unit (620c). The image decoding device (100) can determine the size of each of the encoding units (620a, 620b, 620c) using coordinates (xa, ya), (xb, yb), (xc, yc) indicating the positions of the encoding units (620a, 620b, 620c). According to one embodiment, the image decoding device (100) can determine the width of the upper encoding unit (620a) as the width of the current encoding unit (600). The image decoding device (100) can determine the height of the upper encoding unit (620a) as yb-ya. According to one embodiment, the image decoding device (100) can determine the width of the middle encoding unit (620b) as the width of the current encoding unit (600). The image decoding device (100) may determine the height of the middle encoding unit (620b) as yc-yb. According to one embodiment, the image decoding device (100) may determine the width or height of the lower encoding unit using the width or height of the current encoding unit and the width and height of the upper encoding unit (620a) and the middle encoding unit (620b). The image decoding device (100) may determine an encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (620a, 620b, 620c).Referring to FIG. 6, the image decoding device (100) can determine the middle encoding unit (620b) having a different size from the sizes of the upper encoding unit (620a) and the lower encoding unit (620c) as the encoding unit of a predetermined position. However, the process by which the image decoding device (100) described above determines the encoding unit having a different size from other encoding units is merely an embodiment of determining the encoding unit of a predetermined position using the size of the encoding unit determined based on sample coordinates, and therefore, various processes of determining the encoding unit of a predetermined position by comparing the sizes of the encoding units determined according to predetermined sample coordinates can be used.

[0129] The image decoding device (100) can determine the width or height of each of the encoding units (660a, 660b, 660c) by using the (xd, yd) coordinate, which is information indicating the position of the sample (670a) at the upper left of the left encoding unit (660a), the (xe, ye) coordinate, which is information indicating the position of the sample (670b) at the upper left of the middle encoding unit (660b), and the (xf, yf) coordinate, which is information indicating the position of the sample (670c) at the upper left of the right encoding unit (660c). The image decoding device (100) can determine the size of each of the encoding units (660a, 660b, 660c) by using the (xd, yd), (xe, ye), (xf, yf), which are coordinates indicating the positions of the encoding units (660a, 660b, 660c).

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

[0131] However, the location of the sample considered for determining the location of the encoding unit should not be interpreted as being limited to the upper left corner described above, and it can be interpreted that information on the location of any sample included in the encoding unit can be used.

[0132] According to one embodiment, the image decoding device (100) may select an encoding unit at a predetermined position from among an odd number of encoding units determined by splitting the current encoding unit, taking into consideration the shape of the current encoding unit. For example, if the current encoding unit has a non-square shape in which the width is longer than the height, the image decoding device (100) may determine an encoding unit at a predetermined position in the horizontal direction. That is, the image decoding device (100) may determine one of the encoding units whose positions vary in the horizontal direction and place a restriction on the corresponding encoding unit. If the current encoding unit has a non-square shape in which the height is longer than the width, the image decoding device (100) may determine an encoding unit at a predetermined position in the vertical direction. That is, the image decoding device (100) may determine one of the encoding units whose positions vary in the vertical direction and place a restriction on the corresponding encoding unit.

[0133] According to one embodiment, the image decoding device (100) may use information indicating the positions of each of the even-numbered coding units to determine the coding unit at a predetermined position among the even-numbered coding units. The image decoding device (100) may determine the even-numbered coding units by dividing the current coding unit (binary dividing) and may determine the coding unit at a predetermined position using information about the positions of the even-numbered coding units. A specific process for this may correspond to a process of determining the coding unit at a predetermined position (e.g., the center position) among the odd-numbered coding units described above in FIG. 6, and thus will be omitted.

[0134] According to one embodiment, when a current encoding unit having a non-square shape is split into a plurality of encoding units, predetermined information about the encoding unit at a predetermined position may be used during the splitting process to determine an encoding unit at a predetermined position among the plurality of encoding units. For example, the image decoding device (100) may use at least one of block shape information and split shape mode information stored in a sample included in a middle encoding unit during the splitting process to determine an encoding unit located in the middle among the encoding units into which the current encoding unit is split.

[0135] Referring to FIG. 6, the image decoding device (100) can split the current encoding unit (600) into a plurality of encoding units (620a, 620b, 620c) based on the split shape mode information, and can determine the encoding unit (620b) located in the middle among the plurality of encoding units (620a, 620b, 620c). Furthermore, the image decoding device (100) can determine the encoding unit (620b) located in the middle by considering the position where the split shape mode information is acquired. That is, the split shape mode information of the current encoding unit (600) can be obtained from a sample (640) located in the center of the current encoding unit (600), and when the current encoding unit (600) is split into a plurality of encoding units (620a, 620b, 620c) based on the split shape mode information, the encoding unit (620b) including the sample (640) can be determined as the encoding unit located in the center. However, the information used to determine the encoding unit located in the center should not be interpreted as being limited to the split shape mode information, and various types of information can be used in the process of determining the encoding unit located in the center.

[0136] According to one embodiment, predetermined information for identifying a coding unit at a predetermined position may be obtained from a predetermined sample included in the coding unit to be determined. Referring to FIG. 6, the image decoding device (100) may use split shape mode information obtained from a sample at a predetermined position within the current coding unit (600) (e.g., a sample located at the center of the current coding unit (600)) to determine a coding unit at a predetermined position among a plurality of coding units (620a, 620b, 620c) determined by splitting the current coding unit (600) (e.g., a coding unit located at the center of the coding units split into multiple units). That is, the image decoding device (100) can determine the sample at the predetermined position by considering the block shape of the current encoding unit (600), and the image decoding device (100) can determine an encoding unit (620b) that includes a sample from which predetermined information (e.g., division shape mode information) can be obtained among a plurality of encoding units (620a, 620b, 620c) determined by dividing the current encoding unit (600), and can set a predetermined restriction. Referring to FIG. 6, according to one embodiment, the image decoding device (100) can determine a sample (640) located at the center of the current encoding unit (600) as a sample from which predetermined information can be obtained, and the image decoding device (100) can set a predetermined restriction on the encoding unit (620b) that includes such a sample (640) during the decoding process. However, the location of the sample from which certain information can be obtained should not be interpreted as being limited to the above-described location, but may be interpreted as samples at any location included in the encoding unit (620b) to be determined in order to set a limitation.

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

[0138] According to one embodiment, when the image decoding device (100) divides the current encoding unit into a plurality of encoding units, the image decoding device (100) may use the split shape mode information to determine the encoding unit at a predetermined position among the plurality of encoding units. According to one embodiment, the image decoding device (100) may obtain the split shape mode information from a sample at a predetermined position included in the encoding unit, and the image decoding device (100) may divide the plurality of encoding units generated by splitting the current encoding unit using the split shape mode information obtained from the sample at a predetermined position included in each of the plurality of encoding units. That is, the encoding unit may be recursively divided using the split shape mode information obtained from the sample at a predetermined position included in each of the encoding units. Since the recursive division process of the encoding unit has been described above with reference to FIG. 5, a detailed description thereof will be omitted.

[0139] According to one embodiment, the image decoding device (100) can divide a current encoding unit to determine at least one encoding unit, and can determine the order in which the at least one encoding unit is decoded according to a predetermined block (e.g., the current encoding unit).

[0140] FIG. 7 illustrates the order in which multiple encoding units are processed when an image decoding device (100) divides a current encoding unit to determine multiple encoding units according to one embodiment.

[0141] According to one embodiment, the image decoding device (100) may determine second encoding units (710a, 710b) by vertically splitting the first encoding unit (700) according to the splitting shape mode information, determine second encoding units (730a, 730b) by horizontally splitting the first encoding unit (700), or determine second encoding units (750a, 750b, 750c, 750d) by vertically and horizontally splitting the first encoding unit (700).

[0142] Referring to FIG. 7, the image decoding device (100) can determine the order in which the second encoding units (710a, 710b) determined by vertically dividing the first encoding unit (700) are processed in the horizontal direction (710c). The image decoding device (100) can determine the order in which the second encoding units (730a, 730b) determined by horizontally dividing the first encoding unit (700) are processed in the vertical direction (730c). The image decoding device (100) can determine the second encoding units (750a, 750b, 750c, 750d) determined by dividing the first encoding unit (700) in the vertical and horizontal directions according to a predetermined order (e.g., raster scan order (750e) or z scan order (z scan order)) in which encoding units located in one row are processed and then encoding units located in the next row are processed.

[0143] According to one embodiment, the image decoding device (100) can recursively split the encoding units. Referring to FIG. 7, the image decoding device (100) can split the first encoding unit (700) to determine a plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d), and can recursively split each of the determined plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d). A method for splitting a plurality of coding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may be a method corresponding to a method for splitting the first coding unit (700). Accordingly, the plurality of coding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may each be independently split into a plurality of coding units. Referring to FIG. 7, the image decoding device (100) may split the first coding unit (700) in the vertical direction to determine the second coding units (710a, 710b), and further may determine to independently split or not split each of the second coding units (710a, 710b).

[0144] According to one embodiment, the image decoding device (100) may horizontally divide the second encoding unit (710a) on the left into third encoding units (720a, 720b), and may not divide the second encoding unit (710b) on the right.

[0145] According to one embodiment, the processing order of the coding units may be determined based on the splitting process of 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 splitting. The image decoding device (100) may determine the processing order of the third coding units (720a, 720b) ​​determined by splitting the second coding unit (710a) on the left, independently from the second coding unit (710b) on the right. Since the second coding unit (710a) on the left is split horizontally and the third coding units (720a, 720b) ​​are determined, the third coding units (720a, 720b) ​​may be processed in the vertical direction (720c). In addition, since the order in which the second encoding unit (710a) on the left and the second encoding unit (710b) on the right are processed corresponds to the horizontal direction (710c), the right encoding unit (710b) can be processed after the third encoding units (720a, 720b) ​​included in the second encoding unit (710a) on the left are processed in the vertical direction (720c). Since the above-described content is intended to explain the process in which the processing order of the encoding units is determined according to the encoding units before splitting, it should not be interpreted as being limited to the above-described embodiment, but should be interpreted as being used in various ways in which encoding units that are split and determined in various forms can be independently processed according to a predetermined order.

[0146] FIG. 8 illustrates a process for determining that a current encoding unit is divided into an odd number of encoding units when the encoding units cannot be processed in a predetermined order, according to one embodiment of the present invention.

[0147] According to one embodiment, the image decoding device (100) may determine that the current encoding unit is split into an odd number of encoding units based on the acquired split shape mode information. Referring to FIG. 8, a first encoding unit (800) having a square shape may be split into second encoding units (810a, 810b) having a non-square shape, and the second encoding units (810a, 810b) may each be independently split into third encoding units (820a, 820b, 820c, 820d, 820e). According to one embodiment, the image decoding device (100) can determine a plurality of third encoding units (820a, 820b) by horizontally dividing the left encoding unit (810a) among the second encoding units, and can divide the right encoding unit (810b) into an odd number of third encoding units (820c, 820d, 820e).

[0148] According to one embodiment, the image decoding device (100) can determine whether there is an odd number of split coding units by determining whether the third coding units (820a, 820b, 820c, 820d, 820e) can be processed in a predetermined order. Referring to FIG. 8, the image decoding device (100) can determine the third coding units (820a, 820b, 820c, 820d, 820e) by recursively splitting the first coding unit (800). The image decoding device (100) can determine whether the first encoding unit (800), the second encoding unit (810a, 810b), or the third encoding unit (820a, 820b, 820c, 820d, 820e) is divided into an odd number of encoding units based on at least one of the block shape information and the split shape mode information. For example, the encoding unit located on the right side of the second encoding unit (810a, 810b) can be divided into an odd number of third encoding units (820c, 820d, 820e). The order in which the plurality of encoding units included in the first encoding unit (800) are processed can be a predetermined order (e.g., z-scan order (830)), and the image decoding device (100) can determine whether the third encoding unit (820c, 820d, 820e) determined by dividing the second encoding unit (810b) on the right into odd numbers satisfies the condition that it can be processed according to the predetermined order.

[0149] According to one embodiment, the image decoding device (100) may determine whether the third encoding units (820a, 820b, 820c, 820d, 820e) included in the first encoding unit (800) satisfy a condition that they can be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the second encoding unit (810a, 810b) is split in half according to the boundary of the third encoding unit (820a, 820b, 820c, 820d, 820e). For example, the third encoding unit (820a, 820b) determined by splitting the height of the left second encoding unit (810a) of a non-square shape in half may satisfy the condition. Since the boundaries of the third encoding units (820c, 820d, 820e) determined by dividing the right second encoding unit (810b) into three encoding units do not divide the width or height of the right second encoding unit (810b) in half, it may be determined that the third encoding units (820c, 820d, 820e) do not satisfy the condition. In the case where this condition is not satisfied, the image decoding device (100) may determine that there is a disconnection in the scanning order, and may determine that the right second encoding unit (810b) is divided into an odd number of encoding units based on the determination result. According to an embodiment, the image decoding device (100) may place a predetermined restriction on an encoding unit at a predetermined position among the divided encoding units when the encoding unit is divided into an odd number of encoding units. Since the contents of such restrictions or predetermined positions have been described above through various embodiments, a detailed description thereof will be omitted.

[0150] FIG. 9 illustrates a process in which an image decoding device (100) divides a first encoding unit (900) to determine at least one encoding unit according to one embodiment.

[0151] According to one embodiment, the image decoding device (100) may split the first coding unit (900) based on the split shape mode information acquired through the bitstream acquisition unit (110). The first coding unit (900) having a square shape may be split into four coding units having a square shape or may be split into a plurality of coding units having a non-square shape. For example, referring to FIG. 9, when the first coding unit (900) is square and the split shape mode information indicates that it is split into coding units having a non-square shape, the image decoding device (100) may split the first coding unit (900) into a plurality of non-square coding units. Specifically, when the split shape mode information indicates that the first encoding unit (900) is split in the horizontal direction or the vertical direction to determine an odd number of encoding units, the image decoding device (100) can split the first encoding unit (900) having a square shape into second encoding units (910a, 910b, 910c) determined by splitting them in the vertical direction into an odd number of encoding units or second encoding units (920a, 920b, 920c) determined by splitting them in the horizontal direction.

[0152] According to one embodiment, the image decoding device (100) can determine whether the second encoding units (910a, 910b, 910c, 920a, 920b, 920c) included in the first encoding unit (900) satisfy a condition that allows them to be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the first encoding unit (900) is split in half according to the boundary of the second encoding units (910a, 910b, 910c, 920a, 920b, 920c). Referring to FIG. 9, since the boundaries of the second coding units (910a, 910b, 910c) determined by vertically dividing the first coding unit (900) in a square shape do not divide the width of the first coding unit (900) in half, it may be determined that the first coding unit (900) does not satisfy the condition that it can be processed in a predetermined order. In addition, since the boundaries of the second coding units (920a, 920b, 920c) determined by horizontally dividing the first coding unit (900) in a square shape do not divide the width of the first coding unit (900) in half, it may be determined that the first coding unit (900) does not satisfy the condition that it can be processed in a predetermined order. If such a condition is not satisfied, the image decoding device (100) may determine that the scan order is disconnected, and based on the determination result, may determine that the first encoding unit (900) is divided into an odd number of encoding units. According to one embodiment, the image decoding device (100) may place a predetermined restriction on an encoding unit at a predetermined position among the divided encoding units when the encoding unit is divided into an odd number of encoding units. Since the contents of such restrictions or predetermined positions, etc. have been described above through various embodiments, a detailed description thereof will be omitted.

[0153] According to one embodiment, the image decoding device (100) can divide the first encoding unit to determine encoding units of various shapes.

[0154] Referring to FIG. 9, the image decoding device (100) can divide the first encoding unit (900) having a square shape and the first encoding unit (930 or 950) having a non-square shape into encoding units of various shapes.

[0155] FIG. 10 illustrates that, according to one embodiment, a video decoding device (100) limits the shapes into which a second encoding unit can be divided when a non-square shape of a second encoding unit determined by splitting a first encoding unit (1000) satisfies a predetermined condition.

[0156] According to one embodiment, the image decoding device (100) may determine to split a first coding unit (1000) having a square shape into second coding units (1010a, 1010b, 1020a, 1020b) having a non-square shape based on the split shape mode information acquired through the bitstream acquisition unit (110). The second coding units (1010a, 1010b, 1020a, 1020b) may be split independently. Accordingly, the image decoding device (100) may determine to split or not split into a plurality of coding units based on the split shape mode information related to each of the second coding units (1010a, 1010b, 1020a, 1020b). According to one embodiment, the image decoding device (100) may determine third encoding units (1012a, 1012b) by horizontally dividing the left second encoding unit (1010a) having a non-square shape determined by vertically dividing the first encoding unit (1000). However, when the image decoding device (100) divides the left second encoding unit (1010a) in the horizontal direction, the right second encoding unit (1010b) may be restricted from being horizontally divided in the same direction as the direction in which the left second encoding unit (1010a) is divided. If the second encoding unit on the right (1010b) is split in the same direction to determine the third encoding unit (1014a, 1014b), the second encoding unit on the left (1010a) and the second encoding unit on the right (1010b) may be independently split in the horizontal direction to determine the third encoding unit (1012a, 1012b, 1014a, 1014b). However, this is the same result as the image decoding device (100) splitting the first encoding unit (1000) into four square-shaped second encoding units (1030a, 1030b, 1030c, 1030d) based on the split shape mode information, which may be inefficient in terms of image decoding.

[0157] According to one embodiment, the image decoding device (100) may determine third coding units (1022a, 1022b, 1024a, 1024b) by vertically dividing a second coding unit (1020a or 1020b) having a non-square shape determined by dividing a first coding unit (1000) in a horizontal direction. However, when the image decoding device (100) vertically divides one of the second coding units (e.g., the upper second coding unit (1020a)), the other second coding units (e.g., the lower coding unit (1020b)) may be restricted from being vertically divided in the same direction as the direction in which the upper second coding unit (1020a) is divided, for the reasons described above.

[0158] FIG. 11 illustrates a process in which an image decoding device (100) divides a square-shaped encoding unit when the split shape mode information cannot indicate that the encoding unit is divided into four square-shaped encoding units according to one embodiment.

[0159] According to one embodiment, the image decoding device (100) may split the first encoding unit (1100) based on the split shape mode information to determine the second encoding units (1110a, 1110b, 1120a, 1120b, etc.). The split shape mode information may include information about various shapes into which the encoding unit may be split, but the information about various shapes may not include information for splitting the encoding unit into four encoding units having a square shape. According to this split shape mode information, the image decoding device (100) cannot split the first encoding unit (1100) having a square shape into four second encoding units having a square shape (1130a, 1130b, 1130c, 1130d). Based on the segmentation shape mode information, the image decoding device (100) can determine a second encoding unit (1110a, 1110b, 1120a, 1120b, etc.) of a non-square shape.

[0160] According to one embodiment, the image decoding device (100) can independently split each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) having a non-square shape. Each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) can be split in a predetermined order using a recursive method, which may be a splitting method corresponding to a method in which the first encoding unit (1100) is split based on splitting shape mode information.

[0161] For example, the image decoding device (100) can determine third coding units (1112a, 1112b) having a square shape by splitting the left second coding unit (1110a) in the horizontal direction, and can determine third coding units (1114a, 1114b) having a square shape by splitting the right second coding unit (1110b) in the horizontal direction. Furthermore, the image decoding device (100) can also determine third coding units (1116a, 1116b, 1116c, 1116d) having a square shape by splitting both the left second coding unit (1110a) and the right second coding unit (1110b) in the horizontal direction. In this case, the encoding unit can be determined in the same form as the first encoding unit (1100) being divided into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d).

[0162] As another example, the image decoding device (100) may determine third coding units (1122a, 1122b) having a square shape by vertically splitting the upper second coding unit (1120a), and may determine third coding units (1124a, 1124b) having a square shape by vertically splitting the lower second coding unit (1120b). Furthermore, the image decoding device (100) may determine third coding units (1126a, 1126b, 1126a, 1126b) having a square shape by vertically splitting both the upper second coding unit (1120a) and the lower second coding unit (1120b). In this case, the encoding unit can be determined in the same form as the first encoding unit (1100) being divided into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d).

[0163] FIG. 12 illustrates that, according to one embodiment, the processing order between multiple encoding units may vary depending on the process of dividing the encoding units.

[0164] According to one embodiment, the image decoding device (100) may split the first encoding unit (1200) based on the split shape mode information. If the block shape is square and the split shape mode information indicates that the first encoding unit (1200) is split in at least one of the horizontal direction and the vertical direction, the image decoding device (100) may split the first encoding unit (1200) to determine second encoding units (e.g., 1210a, 1210b, 1220a, 1220b, etc.). Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) having a non-square shape determined by splitting the first encoding unit 1200 only in the horizontal direction or the vertical direction may be independently split based on the split shape mode information for each. For example, the image decoding device (100) can determine third encoding units (1216a, 1216b, 1216c, 1216d) by horizontally dividing second encoding units (1210a, 1210b) generated by vertically dividing the first encoding unit (1200), and can determine third encoding units (1226a, 1226b, 1226c, 1226d) by horizontally dividing second encoding units (1220a, 1220b) generated by horizontally dividing the first encoding unit (1200). Since the process of dividing the second encoding units (1210a, 1210b, 1220a, 1220b) has been described above with reference to FIG. 11, a detailed description thereof will be omitted.

[0165] According to one embodiment, the image decoding device (100) can process encoding units according to a predetermined order. Since the characteristics of processing encoding units according to a predetermined order have been described above with reference to FIG. 7, a detailed description thereof will be omitted. Referring to FIG. 12, the image decoding device (100) can divide a first encoding unit (1200) having a square shape and determine four third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) having a square shape. According to one embodiment, the image decoding device (100) can determine the processing order of the third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) depending on the form in which the first encoding unit (1200) is divided.

[0166] According to one embodiment, the image decoding device (100) may determine third encoding units (1216a, 1216b, 1216c, 1216d) by horizontally dividing the second encoding units (1210a, 1210b) generated by vertically dividing them, and the image decoding device (100) may process the third encoding units (1216a, 1216b, 1216c, 1216d) according to an order (1217) of first processing the third encoding units (1216a, 1216c) included in the left second encoding unit (1210a) in the vertical direction and then processing the third encoding units (1216b, 1216d) included in the right second encoding unit (1210b) in the vertical direction.

[0167] According to one embodiment, the image decoding device (100) may determine third encoding units (1226a, 1226b, 1226c, 1226d) by vertically dividing the second encoding units (1220a, 1220b) generated by being divided in the horizontal direction, and the image decoding device (100) may process the third encoding units (1226a, 1226b, 1226c, 1226d) according to an order (1227) of first processing the third encoding units (1226a, 1226b) included in the upper second encoding unit (1220a) in the horizontal direction and then processing the third encoding units (1226c, 1226d) included in the lower second encoding unit (1220b) in the horizontal direction.

[0168] Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) can be divided into third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) having a square shape. The second encoding units (1210a, 1210b) determined by being split in the vertical direction and the second encoding units (1220a, 1220b) determined by being split in the horizontal direction are split into different shapes, but according to the third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) determined later, the first encoding unit (1200) is ultimately split into encoding units of the same shape. Accordingly, even if the image decoding device (100) determines encoding units of the same shape as a result by recursively splitting the encoding units through different processes based on the split shape mode information, it can process a plurality of encoding units determined in the same shape in different orders.

[0169] FIG. 13 illustrates a process in which the depth of an encoding unit is determined as the shape and size of the encoding unit change when the encoding unit is recursively divided to determine a plurality of encoding units according to one embodiment.

[0170] According to one embodiment, the image decoding device (100) may determine the depth of an encoding unit according to a predetermined criterion. For example, the predetermined criterion may be the length of a long side of the encoding unit. If the length of the long side of the current encoding unit is split to be 2n (n>0) times the length of the long side of the encoding unit before splitting, the image decoding device (100) may determine that the depth of the current encoding unit is increased by n compared to the depth of the encoding unit before splitting. Hereinafter, an encoding unit with an increased depth is expressed as an encoding unit of a lower depth.

[0171] Referring to FIG. 13, according to one embodiment, based on block shape information indicating a square shape (for example, the block shape information may indicate '0: SQUARE'), the image decoding device (100) may divide a first coding unit (1300) having a square shape to determine a second coding unit (1302), a third coding unit (1304), etc. of a lower depth. If the size of the first coding unit (1300) having a square shape is 2Nx2N, the second coding unit (1302) determined by dividing the width and height of the first coding unit (1300) by half may have a size of NxN. Furthermore, the third coding unit (1304) determined by dividing the width and height of the second coding unit (1302) by half may have a size of N / 2xN / 2. In this case, the width and height of the third encoding unit (1304) correspond to 1 / 4 of the width and height of the first encoding unit (1300). When the depth of the first encoding unit (1300) is D, the depth of the second encoding unit (1302), which is 1 / 2 of the width and height of the first encoding unit (1300), may be D+1, and the depth of the third encoding unit (1304), which is 1 / 4 of the width and height of the first encoding unit (1300), may be D+2.

[0172] According to one embodiment, based on block shape information indicating a non-square shape (for example, the block shape information may indicate '1: NS_VER' indicating a non-square shape in which the height is longer than the width or '2: NS_HOR' indicating a non-square shape in which the width is longer than the height), the image decoding device (100) may split a first coding unit (1310 or 1320) having a non-square shape to determine a second coding unit (1312 or 1322), a third coding unit (1314 or 1324) of a lower depth, etc.

[0173] The image decoding device (100) can determine a second encoding unit (e.g., 1302, 1312, 1322, etc.) by splitting at least one of the width and height of the first encoding unit (1310) having a size of Nx2N. That is, the image decoding device (100) can split the first encoding unit (1310) in the horizontal direction to determine a second encoding unit (1302) having a size of NxN or a second encoding unit (1322) having a size of NxN / 2, and can also split the first encoding unit (1310) in the horizontal direction and the vertical direction to determine a second encoding unit (1312) having a size of N / 2xN.

[0174] According to one embodiment, the image decoding device (100) may determine a second coding unit (e.g., 1302, 1312, 1322, etc.) by splitting at least one of the width and the height of the first coding unit (1320) having a size of 2NxN. That is, the image decoding device (100) may split the first coding unit (1320) in the vertical direction to determine a second coding unit (1302) having a size of NxN or a second coding unit (1312) having a size of N / 2xN, and may also split the first coding unit (1320) in the horizontal direction and the vertical direction to determine a second coding unit (1322) having a size of NxN / 2.

[0175] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by splitting at least one of the width and the height of the second encoding unit (1302) having a size of NxN. That is, the image decoding device (100) may split the second encoding unit (1302) in the vertical direction and the horizontal direction to determine a third encoding unit (1304) having a size of N / 2xN / 2, a third encoding unit (1314) having a size of N / 4xN / 2, or a third encoding unit (1324) having a size of N / 2xN / 4.

[0176] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by splitting at least one of the width and the height of the second encoding unit (1312) having a size of N / 2xN. That is, the image decoding device (100) may split the second encoding unit (1312) in the horizontal direction to determine a third encoding unit (1304) having a size of N / 2xN / 2 or a third encoding unit (1324) having a size of N / 2xN / 4, or split the second encoding unit (1312) in the vertical direction and the horizontal direction to determine a third encoding unit (1314) having a size of N / 4xN / 2.

[0177] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by splitting at least one of the width and the height of the second encoding unit (1322) having a size of NxN / 2. That is, the image decoding device (100) may split the second encoding unit (1322) in the vertical direction to determine a third encoding unit (1304) having a size of N / 2xN / 2 or a third encoding unit (1314) having a size of N / 4xN / 2, or split the second encoding unit (1322) in the vertical direction and the horizontal direction to determine a third encoding unit (1324) having a size of N / 2xN / 4.

[0178] According to one embodiment, the image decoding device (100) may split a square-shaped encoding unit (e.g., 1300, 1302, 1304) in a horizontal direction or a vertical direction. For example, a first encoding unit (1300) having a size of 2Nx2N may be split in the vertical direction to determine a first encoding unit (1310) having a size of Nx2N, or may be split in the horizontal direction to determine a first encoding unit (1320) having a size of 2NxN. According to one embodiment, when the depth is determined based on the length of the longest side of the encoding unit, the depth of the encoding unit determined by splitting the first encoding unit (1300) having a size of 2Nx2N in the horizontal direction or the vertical direction may be the same as the depth of the first encoding unit (1300).

[0179] According to one embodiment, the width and height of the third coding unit (1314 or 1324) may be 1 / 4 times that of the first coding unit (1310 or 1320). When the depth of the first coding unit (1310 or 1320) is D, the depth of the second coding unit (1312 or 1322), which is 1 / 2 times the width and height of the first coding unit (1310 or 1320), may be D+1, and the depth of the third coding unit (1314 or 1324), which is 1 / 4 times the width and height of the first coding unit (1310 or 1320), may be D+2.

[0180] FIG. 14 illustrates an index (part index, hereinafter referred to as PID) for depth and encoding unit distinction that can be determined according to the shape and size of encoding units according to one embodiment.

[0181] According to one embodiment, the image decoding device (100) may split a first encoding unit (1400) having a square shape to determine second encoding units of various shapes. Referring to FIG. 14, the image decoding device (100) may split the first encoding unit (1400) in at least one of a vertical direction and a horizontal direction according to the split shape mode information to determine second encoding units (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d). That is, the image decoding device (100) can determine the second encoding unit (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) based on the split shape mode information for the first encoding unit (1400).

[0182] According to one embodiment, the depth of the second coding units (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) determined according to the split shape mode information for the first coding unit (1400) having a square shape may be determined based on the length of the long side. For example, since the length of one side of the first coding unit (1400) having a square shape and the length of the long side of the second coding unit (1402a, 1402b, 1404a, 1404b) having a non-square shape are the same, the depth of the first coding unit (1400) and the second coding units (1402a, 1402b, 1404a, 1404b) having a non-square shape may be considered to be the same as D. In contrast, when the image decoding device (100) divides the first encoding unit (1400) into four square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) based on the split shape mode information, the length of one side of the square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) is half the length of one side of the first encoding unit (1400), so the depth of the second encoding units (1406a, 1406b, 1406c, 1406d) may be a depth of D+1, which is one depth lower than D, the depth of the first encoding unit (1400).

[0183] According to one embodiment, the image decoding device (100) may split a first encoding unit (1410) having a height greater than its width into a plurality of second encoding units (1412a, 1412b, 1414a, 1414b, 1414c) in a horizontal direction according to the splitting shape mode information. According to one embodiment, the image decoding device (100) may split a first encoding unit (1420) having a width greater than its height into a plurality of second encoding units (1422a, 1422b, 1424a, 1424b, 1424c) in a vertical direction according to the splitting shape mode information.

[0184] According to one embodiment, the depth of the second coding unit (1412a, 1412b, 1414a, 1414b, 1414c. 1422a, 1422b, 1424a, 1424b, 1424c) determined based on the split shape mode information for the first coding unit (1410 or 1420) of a non-square shape may be determined based on the length of the long side. For example, since the length of one side of the second encoding unit (1412a, 1412b) in the shape of a square is half the length of one side of the first encoding unit (1410) in the shape of a non-square having a height longer than a width, the depth of the second encoding unit (1412a, 1412b) in the shape of a square is D+1, which is one depth lower than the depth D of the first encoding unit (1410) in the shape of a non-square.

[0185] Furthermore, the image decoding device (100) may split a non-square first encoding unit (1410) into an odd number of second encoding units (1414a, 1414b, 1414c) based on the split shape mode information. The odd number of second encoding units (1414a, 1414b, 1414c) may include a non-square second encoding unit (1414a, 1414c) and a square second encoding unit (1414b). In this case, since the length of the long side of the second encoding unit (1414a, 1414c) of a non-square shape and the length of one side of the second encoding unit (1414b) of a square shape are half the length of one side of the first encoding unit (1410), the depth of the second encoding unit (1414a, 1414b, 1414c) may be a depth of D+1, which is one depth lower than D, which is the depth of the first encoding unit (1410). The image decoding device (100) may determine the depth of the encoding units associated with the first encoding unit (1420) of a non-square shape, in which the width is longer than the height, in a manner corresponding to the above method of determining the depth of the encoding units associated with the first encoding unit (1410).

[0186] According to one embodiment, when determining an index (PID) for distinguishing divided coding units, the image decoding device (100) may determine the index based on a size ratio between the coding units when the coding units divided into an odd number are not of the same size. Referring to FIG. 14, among the coding units (1414a, 1414b, 1414c) divided into an odd number, the coding unit (1414b) located in the middle may have the same width as the other coding units (1414a, 1414c) but may have a height that is twice the height of the coding units (1414a, 1414c) that are different in height. That is, in this case, the coding unit (1414b) located in the middle may include two of the other coding units (1414a, 1414c). Accordingly, if the index (PID) of the encoding unit (1414b) located in the middle according to the scanning order is 1, the index of the encoding unit (1414c) located in the next order may be 3, which is an increase of 2. In other words, there may be a discontinuity in the index value. According to one embodiment, the image decoding device (100) may determine whether the encoding units divided into an odd number are not of the same size based on the presence or absence of discontinuity in the index for distinguishing between the divided encoding units.

[0187] According to one embodiment, the image decoding device (100) may determine whether the current encoding unit is divided into a specific split shape based on the value of an index for distinguishing a plurality of encoding units determined by division. Referring to FIG. 14, the image decoding device (100) may divide a first encoding unit (1410) having a rectangular shape in which a height is longer than a width, to determine an even number of encoding units (1412a, 1412b) or an odd number of encoding units (1414a, 1414b, 1414c). The image decoding device (100) may use an index (PID) indicating each encoding unit to distinguish each of the plurality of encoding units. According to one embodiment, the PID may be obtained from a sample (e.g., an upper left sample) at a predetermined position of each encoding unit.

[0188] According to one embodiment, the image decoding device (100) may determine an coding unit at a predetermined position among the coding units that are divided and determined using an index for distinguishing the coding units. According to one embodiment, when the split shape mode information for the first coding unit (1410) having a rectangular shape with a height longer than the width indicates that the first coding unit (1410) is divided into three coding units, the image decoding device (100) may divide the first coding unit (1410) into three coding units (1414a, 1414b, 1414c). The image decoding device (100) may assign an index to each of the three coding units (1414a, 1414b, 1414c). The image decoding device (100) may compare the indexes for each coding unit to determine the middle coding unit among the coding units divided into an odd number of coding units. The image decoding device (100) may determine a coding unit (1414b) having an index corresponding to a middle value among the indices of the coding units as a coding unit at a middle position among the coding units determined by splitting the first coding unit (1410). According to an embodiment, when determining an index for distinguishing the split coding units, the image decoding device (100) may determine the index based on a size ratio between the coding units when the coding units do not have the same size. Referring to FIG. 14, the coding unit (1414b) generated by splitting the first coding unit (1410) may have the same width as other coding units (1414a, 1414c) but may be twice the height of the coding units (1414a, 1414c) that are different in height. In this case, if the index (PID) of the encoding unit (1414b) located in the middle is 1, the index of the encoding unit (1414c) located in the next order may be 3, which is an increase of 2.In cases like this where the index increases uniformly and then the increase amount changes, the image decoding device (100) may determine that the current encoding unit is divided into a plurality of encoding units including encoding units having different sizes from other encoding units. According to one embodiment, when the split shape mode information indicates that the current encoding unit is divided into an odd number of encoding units, the image decoding device (100) may divide the current encoding unit into a form in which an encoding unit at a predetermined position among the odd number of encoding units (for example, a middle encoding unit) has a different size from the other encoding units. In this case, the image decoding device (100) may determine a middle encoding unit having a different size using an index (PID) for the encoding unit. However, the above-described index, the size or position of the encoding unit at the predetermined position to be determined are specific for explaining one embodiment and should not be interpreted as being limited thereto, and it should be interpreted that various indexes, positions and sizes of encoding units can be used.

[0189] According to one embodiment, the image decoding device (100) may utilize a predetermined data unit from which recursive division of the encoding unit begins.

[0190] FIG. 15 illustrates that a plurality of encoding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment.

[0191] According to one embodiment, a predetermined data unit may be defined as a data unit from which a coding unit begins to be recursively split using split shape mode information. That is, it may correspond to a coding unit of the highest depth used in the process of determining multiple coding units for splitting the current picture. For convenience of explanation, this predetermined data unit will be referred to as a reference data unit hereinafter.

[0192] In one embodiment, the reference data unit may exhibit a predetermined size and shape. In one embodiment, the reference coding unit may include MxN samples, where M and N may be the same and may be integers expressed as powers of 2. That is, the reference data unit may exhibit a square or non-square shape, and may be subsequently divided into an integer number of coding units.

[0193] According to one embodiment, the video decoding device (100) can divide the current picture into a plurality of reference data units. According to one embodiment, the video decoding device (100) can divide the plurality of reference data units into which the current picture is divided using division type mode information for each reference data unit. This division process of the reference data units can correspond to a division process using a quad-tree structure.

[0194] According to one embodiment, the image decoding device (100) may predetermine the minimum size that a reference data unit included in the current picture may have. Accordingly, the image decoding device (100) may determine reference data units of various sizes having a size greater than or equal to the minimum size, and may determine at least one encoding unit using segmentation mode information based on the determined reference data unit.

[0195] Referring to FIG. 15, the image decoding device (100) may use a reference coding unit (1500) having a square shape, or may use a reference coding unit (1502) having a non-square shape. According to one embodiment, the shape and size of the reference coding unit may be determined according to various data units (e.g., sequence, picture, slice, slice segment, maximum coding unit, etc.) that may include at least one reference coding unit.

[0196] According to one embodiment, the bitstream acquisition unit (110) of the image decoding device (100) can acquire at least one of information on the shape of the reference coding unit and information on the size of the reference coding unit from the bitstream for each of the various data units. The process of determining at least one coding unit included in the square-shaped reference coding unit (1500) has been described above through the process of splitting the current coding unit (300) of FIG. 3, and the process of determining at least one coding unit included in the non-square-shaped reference coding unit (1502) has been described above through the process of splitting the current coding unit (400 or 450) of FIG. 4, so a detailed description thereof will be omitted.

[0197] According to one embodiment, the image decoding device (100) may use an index for identifying the size and shape of the reference coding unit to determine the size and shape of the reference coding unit according to some data units that are predetermined based on a predetermined condition. That is, the bitstream acquisition unit (110) may acquire only an index for identifying the size and shape of the reference coding unit for each slice, slice segment, maximum coding unit, etc., among the various data units (e.g., sequences, pictures, slices, slice segments, maximum coding units, etc.) from the bitstream, as a data unit that satisfies a predetermined condition (e.g., a data unit having a size smaller than a slice). The image decoding device (100) may determine the size and shape of the reference data unit for each data unit that satisfies the predetermined condition by using the index. When information about the shape of the reference coding unit and information about the size of the reference coding unit are obtained from the bitstream for each relatively small-sized data unit and used, the efficiency of the bitstream may not be good. Therefore, instead of directly obtaining information about the shape of the reference coding unit and information about the size of the reference coding unit, only the index may be obtained and used. In this case, at least one of the size and shape of the reference coding unit corresponding to the index indicating the size and shape of the reference coding unit may be determined in advance. That is, the image decoding device (100) can determine at least one of the size and shape of the reference coding unit included in the data unit that serves as the basis for obtaining the index by selecting at least one of the sizes and shapes of the predetermined reference coding units according to the index.

[0198] According to one embodiment, the image decoding device (100) may use at least one reference coding unit included in one maximum coding unit. That is, a maximum coding unit for dividing an image may include at least one reference coding unit, and a coding unit may be determined through a recursive splitting process of each reference coding unit. According to one embodiment, at least one of the width and the height of the maximum coding unit may correspond to an integer multiple of at least one of the width and the height of the reference coding unit. According to one embodiment, the size of the reference coding unit may be a size obtained by splitting the maximum coding unit n times according to a quad tree structure. That is, the image decoding device (100) may split the maximum coding unit n times according to the quad tree structure to determine the reference coding unit, and may split the reference coding unit based on at least one of block shape information and split shape mode information according to various embodiments.

[0199] FIG. 16 illustrates a processing block that serves as a criterion for determining the order of determination of reference encoding units included in a picture (1600) according to one embodiment.

[0200] According to one embodiment, the image decoding apparatus (100) may determine at least one processing block for dividing a picture. The processing block is a data unit including at least one reference coding unit for dividing an image, and at least one reference coding unit included in the processing block may be determined in a specific order. That is, the determination order of at least one reference coding unit determined in each processing block may correspond to one of various types of orders in which the reference coding unit may be determined, and the determination order of the reference coding unit determined in each processing block may be different for each processing block. The determination order of the reference coding unit determined for each processing block may be one of various orders such as raster scan, Z-scan, N-scan, up-right diagonal scan, horizontal scan, and vertical scan, but the order in which it may be determined should not be interpreted as being limited to the above scan orders.

[0201] According to one embodiment, the image decoding device (100) can obtain information about the size of a processing block to determine the size of at least one processing block included in an image. The image decoding device (100) can obtain information about the size of a processing block from a bitstream to determine the size of at least one processing block included in an image. The size of the processing block may be a predetermined size of a data unit indicated by the information about the size of the processing block.

[0202] According to one embodiment, the bitstream acquisition unit (110) of the image decoding device (100) can acquire information about the size of a processing block from the bitstream for each specific data unit. For example, information about the size of a processing block can be acquired from the bitstream for each data unit such as an image, a sequence, a picture, a slice, a slice segment, etc. That is, the bitstream acquisition unit (110) can acquire information about the size of a processing block from the bitstream for each of the above-described multiple data units, and the image decoding device (100) can determine the size of at least one processing block for dividing a picture using the acquired information about the size of the processing block, and the size of the processing block can be an integer multiple of a reference coding unit.

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

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

[0205] According to one embodiment, the image decoding device (100) can obtain information about a determination order of at least one reference coding unit included in at least one processing block from a bitstream, and can determine an order in which at least one reference coding unit is determined based on the obtained information about the determination order. The information about the determination order can be defined as an order or direction in which the reference coding units are determined within the processing block. That is, the order in which the reference coding units are determined can be independently determined for each processing block.

[0206] According to one embodiment, the image decoding device (100) can obtain information about the determination order of the reference coding unit for each specific data unit from the bitstream. For example, the bitstream acquisition unit (110) can obtain information about the determination order of the reference coding unit for each data unit such as an image, sequence, picture, slice, slice segment, processing block, etc. from the bitstream. Since the information about the determination order of the reference coding unit indicates the determination order of the reference coding unit within the processing block, the information about the determination order can be obtained for each specific data unit including an integer number of processing blocks.

[0207] The image decoding device (100) can determine at least one reference encoding unit based on an order determined according to one embodiment.

[0208] According to one embodiment, the bitstream acquisition unit (110) may acquire information on the reference coding unit determination order as information related to the processing blocks (1602, 1612) from the bitstream, and the image decoding device (100) may determine the order in which at least one reference coding unit included in the processing blocks (1602, 1612) is determined and at least one reference coding unit included in the picture (1600) may be determined according to the determination order of the coding units. Referring to FIG. 16, the image decoding device (100) may determine the determination order (1604, 1614) of at least one reference coding unit related to each processing block (1602, 1612). For example, when information on the determination order of the reference coding unit is acquired for each processing block, the determination order of the reference coding unit related to each processing block (1602, 1612) may be different for each processing block. If the reference encoding unit determination order (1604) related to the processing block (1602) is a raster scan order, the reference encoding unit included in the processing block (1602) can be determined according to the raster scan order. In contrast, if the reference encoding unit determination order (1614) related to another processing block (1612) is a reverse order of the raster scan order, the reference encoding unit included in the processing block (1612) can be determined according to the reverse order of the raster scan order.

[0209] According to one embodiment, the image decoding device (100) can decode at least one determined reference coding unit. The image decoding device (100) can decode an image based on the determined reference coding unit through the above-described embodiment. The method of decoding the reference coding unit may include various methods of decoding an image.

[0210] According to one embodiment, the video decoding device (100) may obtain and use block shape information indicating the shape of a current encoding unit or split shape mode information indicating a method of splitting the current encoding unit from a bitstream. The split shape mode information may be included in a bitstream related to various data units. For example, the video decoding device (100) may use split shape mode information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. Furthermore, the video decoding device (100) may obtain and use a syntax element corresponding to block shape information or split shape mode information from the bitstream for each maximum encoding unit, reference encoding unit, and processing block.

[0211] Hereinafter, a method for determining a partitioning rule according to one embodiment of the present disclosure will be described in detail.

[0212] The video decoding device (100) can determine a segmentation rule of the video. The segmentation rule may be predetermined between the video decoding device (100) and the video encoding device (200). The video decoding device (100) can determine the segmentation rule of the video based on information obtained from a bitstream. The video decoding device (100) can determine the segmentation rule based on information obtained from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. The video decoding device (100) can determine the segmentation rule differently depending on a frame, a slice, a temporal layer, a maximum coding unit, or an coding unit.

[0213] The image decoding device (100) can determine a segmentation rule based on the block shape of the encoding unit. The block shape can include the size, shape, width and height ratio, and direction of the encoding unit. The image encoding device (200) and the image decoding device (100) can determine in advance that the segmentation rule will be determined based on the block shape of the encoding unit. However, the present invention is not limited thereto. The image decoding device (100) can determine the segmentation rule based on information obtained from the bitstream received from the image encoding device (200).

[0214] The shape of the encoding unit may include a square and a non-square. If the width and height of the encoding unit are equal, the image decoding device (100) may determine the shape of the encoding unit as a square. In addition, if the width and height of the encoding unit are not equal, the image decoding device (100) may determine the shape of the encoding unit as a non-square.

[0215] The size of the coding unit may include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ..., 256x256. The size of the coding unit may be classified according to the length of the long side, the length of the short side, or the area of ​​the coding unit. The image decoding device (100) may apply the same splitting rule to the coding units classified into the same group. For example, the image decoding device (100) may classify the coding units having the same long side length into the same size. In addition, the image decoding device (100) may apply the same splitting rule to the coding units having the same long side length.

[0216] The ratio of the width to the height of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, or 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 a case where the length of the width of the coding unit is longer than the length of the height. The vertical direction may indicate a case where the length of the width of the coding unit is shorter than the length of the height.

[0217] The image decoding device (100) can adaptively determine a splitting rule based on the size of the encoding unit. The image decoding device (100) can determine a different allowable splitting mode based on the size of the encoding unit. For example, the image decoding device (100) can determine whether splitting is allowed based on the size of the encoding unit. The image decoding device (100) can determine a splitting direction based on the size of the encoding unit. The image decoding device (100) can determine an allowable splitting type based on the size of the encoding unit.

[0218] Determining the splitting rule based on the size of the encoding unit may be a splitting rule predetermined between the image encoding device (200) and the image decoding device (100). In addition, the image decoding device (100) may determine the splitting rule based on information obtained from the bitstream.

[0219] The image decoding device (100) can adaptively determine a segmentation rule based on the position of the encoding unit. The image decoding device (100) can adaptively determine a segmentation rule based on the position that the encoding unit occupies in the image.

[0220] Additionally, the image decoding device (100) can determine a splitting rule so that encoding units generated through different splitting paths do not have the same block shape. However, this is not limited thereto, and encoding units generated through different splitting paths may have the same block shape. Encoding units generated through different splitting paths may have different decoding processing orders. Since the decoding processing order has been described together with FIG. 12, a detailed description thereof will be omitted.

[0221] FIG. 17 illustrates encoding units that can be determined for each picture when the combination of forms into which encoding units can be divided is different for each picture according to one embodiment.

[0222] Referring to FIG. 17, the image decoding device (100) can determine a different combination of partitioning shapes into which a coding unit can be partitioned for each picture. For example, the image decoding device (100) can decode an image using a picture (1700) that can be partitioned into four coding units, a picture (1710) that can be partitioned into two or four coding units, and a picture (1720) that can be partitioned into two, three, or four coding units, among at least one picture included in the image. The image decoding device (100) can use only partitioning shape information indicating that the picture (1700) is partitioned into four square coding units to partition the picture (1700) into a plurality of coding units. The image decoding device (100) can use only partitioning shape information indicating that the picture (1710) is partitioned into two or four coding units to partition the picture. The video decoding device (100) can only use the segmentation type information indicating that the picture (1720) is segmented into two, three, or four encoding units. The above-described combination of segmentation types is merely an example for explaining the operation of the video decoding device (100), and therefore the above-described combination of segmentation types should not be interpreted as being limited to the above-described example, but should be interpreted as being capable of using various combinations of segmentation types for each predetermined data unit.

[0223] According to one embodiment, the bitstream acquisition unit (110) of the image decoding device (100) can acquire a bitstream including an index indicating a combination of segmentation type information for each predetermined data unit (e.g., sequence, picture, slice, etc.). For example, the bitstream acquisition unit (110) can acquire an index indicating a combination of segmentation type information from a sequence parameter set, a picture parameter set, or a slice header. The image decoding device (100) of the image decoding device (100) can determine a combination of segmentation types by which an encoding unit can be divided for each predetermined data unit using the acquired index, and thus can use a different combination of segmentation types for each predetermined data unit.

[0224] FIG. 18 illustrates various forms of encoding units that can be determined based on segmentation mode information that can be expressed in binary code according to one embodiment.

[0225] According to one embodiment, the image decoding device (100) can split an encoding unit into various shapes using block shape information and split shape mode information acquired through the bitstream acquisition unit (110). The shapes of the encoding unit that can be split may correspond to various shapes including the shapes described through the above-described embodiments.

[0226] Referring to FIG. 18, the image decoding device (100) can split a square-shaped encoding unit in at least one of the horizontal direction and the vertical direction based on the split shape mode information, and can split a non-square-shaped encoding unit in the horizontal direction or the vertical direction.

[0227] According to one embodiment, when the image decoding device (100) can divide a square-shaped encoding unit into four square encoding units by horizontally and vertically splitting the encoding unit, there may be four types of splitting modes that the splitting mode information for the square encoding unit can indicate. According to one embodiment, the splitting mode information may be expressed as a two-digit binary code, and a binary code may be assigned to each splitting mode. For example, when the encoding unit is not split, the splitting mode information may be expressed as (00)b, when the encoding unit is split in the horizontal direction and the vertical direction, the splitting mode information may be expressed as (01)b, when the encoding unit is split in the horizontal direction, the splitting mode information may be expressed as (10)b, and when the encoding unit is split in the vertical direction, the splitting mode information may be expressed as (11)b.

[0228] According to one embodiment, when the image decoding device (100) splits a non-square coding unit in a horizontal direction or a vertical direction, the type of split shape that the split shape mode information can indicate may be determined depending on the number of coding units into which the coding unit is split. Referring to FIG. 18, the image decoding device (100) may split a non-square coding unit into up to three according to one embodiment. The image decoding device (100) may split the coding unit into two coding units, in which case the split shape mode information may be expressed as (10)b. The image decoding device (100) may split the coding unit into three coding units, in which case the split shape mode information may be expressed as (11)b. The image decoding device (100) may determine not to split the coding unit, in which case the split shape mode information may be expressed as (0)b. That is, the image decoding device (100) can use variable length coding (VLC) rather than fixed length coding (FLC) to use a binary code representing segmentation mode information.

[0229] According to one embodiment, referring to FIG. 18, the binary code of the partition shape mode information indicating that the coding unit is not split may be expressed as (0)b. If the binary code of the partition shape mode information indicating that the coding unit is not split is set to (00)b, all binary codes of the 2-bit partition shape mode information must be used even if there is no partition shape mode information set to (01)b. However, as illustrated in FIG. 18, if three partition shapes for a non-square coding unit are used, the image decoding device (100) can determine that the coding unit is not split even if it uses a 1-bit binary code (0)b as the partition shape mode information, and thus can efficiently use the bitstream. However, the partition shapes of the non-square coding unit indicated by the partition shape mode information should not be interpreted as being limited to only the three shapes illustrated in FIG. 18, but should be interpreted as various shapes including the above-described embodiments.

[0230] FIG. 19 illustrates another form of a coding unit that can be determined based on segmentation mode information that can be expressed in binary code according to one embodiment.

[0231] Referring to FIG. 19, the image decoding device (100) can split a square-shaped encoding unit in the horizontal direction or the vertical direction based on the split shape mode information, and can split a non-square-shaped encoding unit in the horizontal direction or the vertical direction. That is, the split shape mode information can indicate that a square-shaped encoding unit is split in one direction. In this case, the binary code of the split shape mode information indicating that a square-shaped encoding unit is not split can be expressed as (0)b. If the binary code of the split shape mode information indicating that the encoding unit is not split is set to (00)b, all binary codes of the 2-bit split shape mode information must be used even though there is no split shape mode information set to (01)b. However, as illustrated in FIG. 19, if three types of division forms for a square-shaped encoding unit are used, the image decoding device (100) can determine that the encoding unit is not divided even if it uses a 1-bit binary code (0)b as the division form mode information, and thus can efficiently use the bitstream. However, the division forms of the square-shaped encoding unit indicated by the division form mode information should not be interpreted as being limited to only the three types illustrated in FIG. 19, but should be interpreted as various types including the embodiments described above.

[0232] In one embodiment, block shape information or segmentation shape mode information may be expressed using binary code, and such information may be directly generated as a bitstream. Furthermore, block shape information or segmentation shape mode information that may be expressed using binary code may not be directly generated as a bitstream, but may instead be used as a binary code input into CABAC (context adaptive binary arithmetic coding).

[0233] According to one embodiment, the image decoding device (100) describes a process of obtaining syntax for block shape information or segmentation shape mode information through CABAC. A bitstream including a binary code for the syntax can be obtained through a bitstream obtaining unit (110). The image decoding device (100) can detect a syntax element indicating block shape information or segmentation shape mode information by de-binarizing a bin string included in the obtained bitstream. According to one embodiment, the image decoding device (100) can obtain a set of binary bin strings corresponding to syntax elements to be decoded, and decode each bin using probability information, and the image decoding device (100) can repeat the process until a bin string composed of the decoded bins becomes equal to one of the previously obtained bin strings. The image decoding device (100) can determine syntax elements by performing inverse binarization of an empty string.

[0234] According to one embodiment, the image decoding device (100) may perform a decoding process of adaptive binary arithmetic coding to determine a syntax for a bin string, and the image decoding device (100) may update a probability model for bins acquired through the bitstream acquisition unit (110). Referring to FIG. 18, the bitstream acquisition unit (110) of the image decoding device (100) may acquire a bitstream representing a binary code representing segmentation mode information according to one embodiment. Using the acquired binary code having a size of 1 or 2 bits, the image decoding device (100) may determine a syntax for the segmentation mode information. In order to determine the syntax for the segmentation mode information, the image decoding device (100) may update a probability for each bit of the 2-bit binary code. That is, the image decoding device (100) can update the probability of having a value of 0 or 1 when decoding the next bin, depending on whether the value of the first bin among the 2-bit binary codes is 0 or 1.

[0235] According to one embodiment, the image decoding device (100) may, in the process of determining the syntax, update the probability for the bins used in the process of decoding the bins of the empty string for the syntax, and the image decoding device (100) may determine that certain bits among the empty strings have the same probability without updating the probability.

[0236] Referring to FIG. 18, in the process of determining a syntax using an empty string indicating split shape mode information for a non-square coding unit, the image decoding device (100) may determine the syntax for the split shape mode information using one bin having a value of 0 when the non-square coding unit is not split. That is, when the block shape information indicates that the current coding unit is a non-square shape, the first bin of the empty string for the split shape mode information may be 0 when the non-square coding unit is not split, and may be 1 when it is split into 2 or 3 coding units. Accordingly, the probability that the first bin of the empty string of the split shape mode information for the non-square coding unit is 0 may be 1 / 3, and the probability that it is 1 may be 2 / 3. As described above, the image decoding device (100) can only express a 1-bit empty string having a value of 0 for the partition shape mode information indicating that a non-square-shaped encoding unit is not partitioned, so the image decoding device (100) can determine the syntax for the partition shape mode information by determining whether the second bin is 0 or 1 only when the first bin of the partition shape mode information is 1. According to one embodiment, the image decoding device (100) can decode the bin by considering that the probability that the second bin is 0 or 1 when the first bin for the partition shape mode information is 1 is the same probability.

[0237] According to one embodiment, the image decoding device (100) may use various probabilities for each bin in the process of determining a bin of a bin string for the partition shape mode information. According to one embodiment, the image decoding device (100) may determine the probability of a bin for the partition shape mode information differently depending on the direction of a non-square block. According to one embodiment, the image decoding device (100) may determine the probability of a bin for the partition shape mode information differently depending on the area or the length of the long side of the current encoding unit. According to one embodiment, the image decoding device (100) may determine the probability of a bin for the partition shape mode information differently depending on at least one of the shape and the length of the long side of the current encoding unit.

[0238] According to one embodiment, the image decoding device (100) may determine that the bin probability for the segmentation shape mode information is the same for encoding units of a predetermined size or larger. For example, the bin probability for the segmentation shape mode information may be determined to be the same for encoding units of a size of 64 samples or larger based on the length of the long side of the encoding unit.

[0239] According to one embodiment, the image decoding device (100) may determine the initial probability for bins constituting the empty string of the segmentation shape mode information based on the slice type (e.g., I slice, P slice, or B slice…).

[0240] Figure 20 is a block diagram of an image encoding and decoding system that performs loop filtering.

[0241] The encoding unit (2010) of the video encoding and decoding system (2000) transmits an encoded bitstream of the video, and the decoding unit (2050) receives the bitstream and decodes it to output a restored video. Here, the encoding unit (2010) may have a configuration similar to that of the video encoding device (200) described below, and the decoding unit (2050) may have a configuration similar to that of the video decoding device (100).

[0242] In the encoding unit (2010), the prediction encoding unit (2015) outputs a reference image through inter prediction and intra prediction, and the transformation and quantization unit (2020) quantizes residual data between the reference image and the current input image into quantized transform coefficients and outputs them. The entropy encoding unit (2025) encodes and transforms the quantized transform coefficients and outputs them as a bitstream. The quantized transform coefficients are restored as spatial domain data through the inverse quantization and inverse transformation unit (2030), and the restored spatial domain data are output as a restored image through the deblocking filtering unit (2035) and the loop filtering unit (2040). The restored image can be used as a reference image for the next input image through the prediction encoding unit (2015).

[0243] The encoded image data among the bitstreams received by the decoding unit (2050) is restored to residual data in the spatial domain through the entropy decoding unit (2055) and the inverse quantization and inverse transformation unit (2060). The reference image and residual data output from the prediction decoding unit (2075) are combined to form image data in the spatial domain, and the deblocking filtering unit (2065) and the loop filtering unit (2070) can perform filtering on the image data in the spatial domain to output a restored image for the current original image. The restored image can be used as a reference image for the next original image by the prediction decoding unit (2075).

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

[0245] The various embodiments described above describe operations related to the image decoding method performed by the image decoding device (100). Hereinafter, the operations of the image encoding device (200), which performs the image encoding method corresponding to the reverse process of the image decoding method, will be described through various embodiments.

[0246] FIG. 2 illustrates a block diagram of an image encoding device (200) capable of encoding an image based on at least one of block shape information and segmentation shape mode information according to one embodiment.

[0247] The video encoding device (200) may include an encoding unit (220) and a bitstream generation unit (210). The encoding unit (220) may receive an input image and encode the input image. The encoding unit (220) may encode the input image to obtain at least one syntax element. The syntax element may include at least one of a skip flag, a prediction mode, a motion vector difference, a motion vector prediction method (or index), a transform quantized coefficient, a coded block pattern, a coded block flag, an intra prediction mode, a direct flag, a merge flag, a delta QP, a reference index, a prediction direction, and a transform index. The encoding unit (220) may determine a context model based on block shape information including at least one of a shape, a direction, a ratio of width and height, or a size of an encoding unit.

[0248] The bitstream generation unit (210) can generate a bitstream based on an encoded input image. For example, the bitstream generation unit (210) can generate a bitstream by entropy encoding syntax elements based on a context model. In addition, the image encoding device (200) can transmit the bitstream to the image decoding device (100).

[0249] According to one embodiment, the encoding unit (220) of the image encoding device (200) can determine the shape of an encoding unit. For example, the encoding unit may be square or have a non-square shape, and information indicating such shape may be included in the block shape information.

[0250] According to one embodiment, the encoding unit (220) can determine the shape into which the encoding unit is to be split. The encoding unit (220) can determine the shape of at least one encoding unit included in the encoding unit, and the bitstream generation unit (210) can generate a bitstream including split shape mode information including information about the shape of such encoding unit.

[0251] According to one embodiment, the encoder (220) may determine whether the encoding unit is split or not. If the encoder (220) determines that the encoding unit includes only one encoding unit or that the encoding unit is not split, the bitstream generation unit (210) may generate a bitstream including split shape mode information indicating that the encoding unit is not split. In addition, the encoder (220) may split the encoding unit into a plurality of encoding units, and the bitstream generation unit (210) may generate a bitstream including split shape mode information indicating that the encoding unit is split into a plurality of encoding units.

[0252] According to one embodiment, information indicating the number of encoding units to be split into or the direction in which the encoding unit is to be split may be included in the splitting mode information. For example, the splitting mode information may indicate splitting in at least one of the vertical and horizontal directions, or may indicate no splitting.

[0253] The video encoding device (200) determines information about the segmentation shape mode based on the segmentation shape mode of the encoding unit. The video encoding device (200) determines a context model based on at least one of the shape, direction, width, and height ratio or size of the encoding unit. Then, the video encoding device (200) generates information about the segmentation shape mode for segmenting the encoding unit based on the context model as a bitstream.

[0254] In order to determine a context model, the video encoding device (200) may obtain an array for matching at least one of the shape, direction, width and height ratio or size of the encoding unit with an index for the context model. The video encoding device (200) may obtain an index for the context model based on at least one of the shape, direction, width and height ratio or size of the encoding unit in the array. The video encoding device (200) may determine the context model based on the index for the context model.

[0255] The video encoding device (200) may further determine the context model based on block shape information including at least one of the shape, direction, width, and height ratio or size of a neighboring encoding unit adjacent to the encoding unit, in order to determine the context model. In addition, the neighboring encoding unit may include at least one of encoding units located on the lower left, left, upper left, upper right, right, or lower right of the encoding unit.

[0256] In addition, the video encoding device (200) may compare the length of the width of the upper peripheral encoding unit with the length of the width of the encoding unit to determine the context model. In addition, the video encoding device (200) may compare the length of the height of the left and right peripheral encoding units with the length of the height of the encoding unit. In addition, the video encoding device (200) may determine the context model based on the comparison results.

[0257] Since the operation of the video encoding device (200) includes similar contents to the operation of the video decoding device (100) described in FIGS. 3 to 20, a detailed description is omitted.

[0258] Hereinafter, with reference to FIGS. 21 to 34, an image decoding device (2100) and an image encoding device (3300) according to one embodiment will be described.

[0259] FIG. 21 is a block diagram of an image decoding device (2100) according to one embodiment.

[0260] Referring to FIG. 21, an image decoding device (2100) according to one embodiment may include an acquisition unit (2110) and a motion information decoding unit (2130).

[0261] The image decoding device (2100) can obtain a bitstream generated as a result of encoding an image, and decode motion information for inter prediction based on information included in the bitstream.

[0262] According to one embodiment, the image decoding device (2100) may include a central processor (not shown) that controls the acquisition unit (2110) and the motion information decoding unit (2130). Alternatively, the acquisition unit (2110) and the motion information decoding unit (2130) may be operated by their own processors (not shown), and the image decoding device (2100) may be operated as a whole as the processors (not shown) organically operate with each other. Alternatively, the acquisition unit (2110) and the motion information decoding unit (2130) may be controlled according to the control of an external processor (not shown) of the image decoding device (2100).

[0263] The image decoding device (2100) may include one or more data storage units (not shown) in which input / output data of the acquisition unit (2110) and the motion information decoding unit (2130) are stored. The image decoding device (2100) may also include a memory control unit (not shown) that controls data input / output of the data storage unit (not shown).

[0264] The video decoding device (2100) can perform a video decoding operation including prediction by operating in conjunction with an internally installed video decoding processor or an external video decoding processor to restore an image through video decoding. The internal video decoding processor of the video decoding device (2100) according to one embodiment can implement a basic video decoding operation not only as a separate processor, but also by including a central processing unit or a graphics processing unit with a video decoding processing module.

[0265] The image decoding device (2100) may be included in the image decoding device (100) described above. For example, the acquisition unit (2110) may be included in the bitstream acquisition unit (110) of the image decoding device (100) illustrated in FIG. 1, and the motion information decoding unit (2130) may be included in the decoding unit (120) of the image decoding device (100).

[0266] The acquisition unit (2110) receives a bitstream generated as a result of encoding an image. The bitstream may include information for determining a motion vector used for inter prediction of the current block. The current block is a block generated by dividing the image according to a tree structure, and may correspond to, for example, a maximum coding unit, an encoding unit, or a transformation unit.

[0267] The acquisition unit (2110) can determine the current block based on block shape information and / or information about a segmentation shape mode included in at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. Furthermore, the acquisition unit (2110) can obtain syntax elements corresponding to block shape information or information about a segmentation shape mode from the bitstream for each maximum coding unit, reference coding unit, and processing block, and use the obtained syntax elements to determine the current block.

[0268] The bitstream may include information indicating a prediction mode of a current block, wherein the prediction mode of the current block may include at least one of an intra mode, an inter mode, a merge mode, a skip mode, and a preset mode according to the present disclosure. The preset mode may be a mode for determining at least one first residual motion vector candidate among first residual motion vector candidates classified according to a disparity distance and a disparity direction as a first residual motion vector for the current block. The first residual motion vector is described in detail below.

[0269] In one embodiment, the bitstream may include information indicating at least one of whether a preset mode is applied to the current block, a base motion vector of the current block, a first residual motion vector of the current block, a priority of disparity distances for distinguishing first residual motion vector candidates, and a priority of disparity directions for distinguishing first residual motion vector candidates. The acquisition unit (2110) may acquire the information included in the bitstream at a level corresponding to at least one unit among a coding unit, a transformation unit, a maximum coding unit, a slice unit, and a picture unit.

[0270] The motion information decoding unit (2130) determines the motion vector of the current block based on information included in the bitstream.

[0271] The motion information decoding unit (2130) can determine whether a preset mode has been applied to the current block based on information included in the bitstream. Information indicating whether a preset mode has been applied may include a flag or an index.

[0272] The motion information decoding unit (2130) can obtain information indicating whether a preset mode is applied from a bitstream at a unit level corresponding to the current block and decode the current block according to the preset mode, and can also obtain information indicating whether a preset mode is applied from a bitstream at a unit level corresponding to an upper block, slice, or picture and decode blocks included in the upper block, slice, or picture according to the preset mode.

[0273] In one example, the motion information decoding unit (2130) may determine whether a preset mode is applied to the current block based on information related to at least one of the current block, a previously decoded block, the current slice, a previously decoded slice, the current picture, and the previously decoded picture. In this case, the motion information decoding unit (2130) may determine whether the preset mode is applied based on the same criteria as the video encoding device (3300).

[0274] When a preset mode is applied to the current block, the motion information decoding unit (2130) can determine first residual motion vector candidates for each of at least one basic motion vector candidate. The first residual motion vector candidates can be distinguished according to the displacement distance and displacement direction.

[0275] In one embodiment, at least one base motion vector candidate of the current block may be determined based on the motion vectors of neighboring blocks that are spatially and temporally related to the current block. The neighboring blocks that are spatially and temporally related to the current block may include blocks that were decoded before the current block. The neighboring blocks that are spatially related to the current block may include, but are not limited to, blocks located to the left of the current block and blocks located above the current block, for example.

[0276] Additionally, the surrounding blocks temporally related to the current block may include, for example, blocks located at the same point as the current block among blocks included in a reference picture different from the current picture including the current block, and blocks spatially adjacent to the blocks at the same point.

[0277] In one embodiment, the motion information decoding unit (2130) may determine motion vectors of surrounding blocks related to the current block as at least one basic motion vector candidate. Alternatively, the motion information decoding unit (2130) may determine at least one basic motion vector candidate by changing motion vectors of surrounding blocks related to the current block. Alternatively, the motion information decoding unit (2130) may determine at least one basic motion vector candidate by combining motion vectors of surrounding blocks related to the current block according to a predetermined formula.

[0278] In one embodiment, the motion information decoding unit (2130) may determine at least one basic motion vector candidate in the same manner as determining a candidate list of a motion vector predictor in the merge mode or AMVP mode of HEVC.

[0279] In one embodiment, the motion information decoding unit (2130) may determine a zero motion vector having 0 as a component as a basic motion vector candidate.

[0280] When at least one basic motion vector candidate is determined, the motion information decoding unit (2130) can determine the basic motion vector of the current block based on information included in the bitstream. The information indicating the basic motion vector of the current block may include an index, and the index indicating the basic motion vector of the current block may be obtained from a bitstream corresponding to at least one level among a transform unit level, a coding unit level, a maximum coding unit level, a slice level, and a picture level.

[0281] In one embodiment, information representing the base motion vector of the current block may be encoded using a fixed length coding (FLC), unary coding, or truncated unary coding method and included in the bitstream.

[0282] In one embodiment, the motion information decoding unit (2130) may determine a base motion vector of the current block among at least one base motion vector candidate based on information related to at least one of the current block, a previously decoded block, a current slice, a previously decoded slice, a current picture, and a previously decoded picture. In this case, the motion information decoding unit (2130) may determine the base motion vector using the same criteria as the video encoding device (3300).

[0283] Once the basic motion vector for the current block is determined, the motion information decoding unit (2130) can determine the first residual motion vector of the current block among at least one first residual motion vector candidate.

[0284] The primary residual motion vector candidates of the current block can be distinguished according to the variation distance and variation direction. The acquisition unit (2110) acquires information indicating at least one of the variation distance and variation direction from the bitstream, and the motion information decoding unit (2130) can determine the primary residual motion vector corresponding to the information indicating at least one of the variation distance and variation direction.

[0285] At least one of information indicating a variation distance for specifying a first residual motion vector of a current block and information indicating a variation direction can be obtained from a bitstream at a transform unit level, a coding unit level, a maximum coding unit level, a slice level, or a picture level.

[0286] Information indicating a disparity distance and a disparity direction for specifying the first residual motion vector of the current block may be encoded using a fixed length coding (FLC) method, a unary coding method, or a truncated unary coding method and included in the bitstream. The acquisition unit (2110) may also decode information indicating a disparity direction, for example, at least one of the indices indicating a disparity direction, from the bitstream using a context model.

[0287] In one embodiment, the motion information decoding unit (2130) may determine a first residual motion vector of the current block among at least one first residual motion vector candidate based on information related to at least one of the current block, a previously decoded block, a current slice, a previously decoded slice, a current picture, and a previously decoded picture. In this case, the motion information decoding unit (2130) may determine the first residual motion vector based on the same criteria as the video encoding apparatus (3300).

[0288] Once the first residual motion vector of the current block is determined, the motion information decoding unit (2130) can determine the motion vector of the current block by applying the first residual motion vector to the base motion vector of the current block. In one example, the motion information decoding unit (2130) can determine the motion vector of the current block by adding the first residual motion vector to the base motion vector of the current block.

[0289] The motion information decoding unit (2130) can determine the second residual motion vector of the current block based on the information representing the second residual motion vector, if the bitstream includes information representing the second residual motion vector. The information representing the second residual motion vector can be encoded and included in the bitstream using a different encoding method from the encoding method of the information representing the first residual motion vector (e.g., fixed-length encoding, unary encoding, or truncated unary encoding). As an example, the information representing the second residual motion vector can be encoded and included in the bitstream using the exponential global encoding method. The acquisition unit (2110) can acquire the information representing the second residual motion vector from a bitstream at a transform unit level, a encoding unit level, a maximum encoding unit level, a slice level, or a picture level.

[0290] The motion information decoding unit (2130) may determine the motion vector of the current block by applying the second residual motion vector to the base motion vector changed by applying the first residual motion vector. In one example, the motion information decoding unit (2130) may determine the motion vector of the current block by adding the second residual motion vector to the base motion vector changed by applying the first residual motion vector.

[0291] In one embodiment, if the prediction direction of the current block is bidirectional, the second residual motion vector may be included in the bitstream for only one unidirectional direction. For example, information representing the second residual motion vector may be included in the bitstream for only one unidirectional direction among the list 0 direction and the list 1 direction.

[0292] When the second residual motion vector is included in the bitstream only for the list 0 direction, the motion information decoding unit (2130) can determine the motion vector in the list 0 direction of the current block by applying the second residual motion vector for the list 0 direction to the base motion vector in the list 0 direction to which the first residual motion vector for the list 0 direction is applied and changed. In addition, the motion information decoding unit (2130) can determine the motion vector in the list 1 direction of the current block by applying the first residual motion vector for the list 1 direction to the base motion vector in the list 1 direction, or can determine the motion vector in the list 1 direction of the current block by applying the second residual motion vector for the list 0 direction to the result of applying the first residual motion vector for the list 1 direction to the base motion vector in the list 1 direction.

[0293] Comparing the preset mode according to the present disclosure with the AMVP mode of HEVC, in the AMVP mode, the decoding device determines a predicted motion vector and a residual motion vector, and then combines the two to determine the motion vector of the block. In the preset mode according to the present disclosure, the base motion vector functions similarly to the predicted motion vector, and the first residual motion vector functions similarly to the residual motion vector of the AMVP mode. However, there is a difference in that, in the preset mode according to the present disclosure, the first residual motion vector is distinguished according to the disparity distance and disparity direction and is encoded by at least one of fixed-length coding, unary coding, and truncated unary coding, whereas the residual motion vector of the AMVP mode is encoded by the exponential global coding method. Additionally, the preset mode according to the present disclosure can improve the accuracy of the motion vector of the block by encoding / decoding the second residual motion vector.

[0294] Hereinafter, with reference to FIGS. 22 to 25, a method for determining first residual motion vector candidates corresponding to any one basic motion vector candidate is described.

[0295] Figures 22 to 25 are diagrams showing first-order residual motion vector candidates displayed on a coordinate plane.

[0296] Referring to FIGS. 22 to 25, the motion information decoding unit (2130) may determine candidates positioned according to a predetermined shape when configuring first residual motion vector candidates. The predetermined shape may be a polygon such as a rhombus or square, or a shape similar to a circle.

[0297] The motion information decoding unit (2130) may determine candidates at a certain disparity distance from a preset point (e.g., the point of (0,0)) as first residual motion vector candidates. The motion information decoding unit (2130) may determine first residual motion vector candidates at a first disparity distance from the preset point as a first candidate group, first residual motion vector candidates at a second disparity distance as a second candidate group, and first residual motion vector candidates at an n-th disparity distance as an n-th candidate group. The motion information decoding unit (2130) may determine first residual motion vector candidates closest to the preset point as the first candidate group, and next closest first residual motion vector candidates as the second candidate group. That is, the number of the candidate groups may sequentially increase as the disparity distance increases.

[0298] As the number of candidate groups increases, the intervals of the mutation distances may increase in a logarithmic scale or non-linear interval. Furthermore, as the number of candidate groups increases, the mutation distances may increase in intervals of an integer N (e.g., N, 2N, 3N, ...). Furthermore, as the number of candidate groups increases, the mutation distances may be determined such that the difference from the previous mutation distances increases uniformly.

[0299] Additionally, the mutation distance may be determined based on the user's definition. Alternatively, the motion information decoding unit (2130) may directly determine the mutation distance based on information related to the current block, temporal layer, GOP, etc., or may obtain information indicating the mutation distance for determining the first residual motion vector candidates through the bitstream.

[0300] The motion information decoding unit (2130) may also determine a mutation distance for determining a first residual motion vector candidate of the current block based on a mutation distance determined at a high level above the level corresponding to the current block.

[0301] The number of primary residual motion vector candidates can be independently determined for each candidate group. The motion information decoding unit (2130) can also determine the number of primary residual motion vector candidates for each candidate group of the current block based on the number information determined at a higher level than the level corresponding to the current block.

[0302] Figures 22 and 23 illustrate a case where the number of primary residual motion vector candidates within each candidate group is four. Furthermore, although Figures 22 and 23 illustrate a case where there are three candidate groups, the number of candidate groups is not limited to three.

[0303] Referring to Fig. 22, the motion information decoding unit (2130) can determine primary residual motion vector candidates having a diamond-shaped distribution based on a preset point. Although the interval between each pixel corresponds to a 1 / 4 pixel distance, the component values ​​of the vector candidates are displayed by scaling them by 4 for convenience. A 1 / 4 pixel distance can correspond to a variation distance of 1.

[0304] The motion information decoding unit (2130) can determine the first residual motion vector candidates ((1, 0), (-1, 0), (0, 1), (0, -1)) at a distance of 1 / 4 pixel from a preset point as the first candidate group.

[0305] The motion information decoding unit (2130) can determine the first residual motion vector candidates ((2, 0), (-2, 0), (0, 2), (0, -2)) at a distance of 1 / 2 pixel from a preset point as a second candidate group.

[0306] The motion information decoding unit (2130) can determine the first residual motion vector candidates ((4, 0), (-4, 0), (0, 4), (0, -4)) at a distance of 1 pixel from a preset point as the third candidate group.

[0307] Referring to FIG. 23, the motion information decoding unit (2130) can determine primary residual motion vector candidates having a rectangular distribution based on a preset point.

[0308] The motion information decoding unit (2130) can determine the first residual motion vector candidates ((1, 1), (1, -1), (-1, 1), (-1, -1)) at a distance of about 1 / 4 pixel from a preset point as the first candidate group.

[0309] The motion information decoding unit (2130) can determine the first residual motion vector candidates ((2, 2), (2, -2), (-2, 2), (-2, -2)) at a distance of about 1 / 2 pixel from a preset point as a second candidate group.

[0310] The motion information decoding unit (2130) can determine the first residual motion vector candidates ((4, 4), (4, -4), (-4, 4), (-4, -4)) at a distance of about 1 pixel from a preset point as the third candidate group.

[0311] Referring to FIG. 24, the motion information decoding unit (2130) may determine the number of first residual motion vector candidates included in at least one candidate group among multiple candidate groups differently from other candidate groups.

[0312] Specifically, the motion information decoding unit (2130) can determine eight primary residual motion vector candidates ((1, 0), (-1, 0), (0, 1), (0, -1), (1, 1), (1, -1), (-1, 1), (-1, -1)) located at a distance of about 1 / 4 pixel from a preset point as the first candidate group.

[0313] In addition, the motion information decoding unit (2130) can determine eight primary residual motion vector candidates ((2, 0), (-2, 0), (0, 2), (0, -2), (2, 2), (2, -2), (-2, 2), (-2, -2)) located at a distance of about 1 / 2 pixel from a preset point as a second candidate group.

[0314] The motion information decoding unit (2130) can determine four primary residual motion vector candidates ((4, 0), (-4, 0), (0, 4), (0, -4)) located at a distance of about 1 pixel from a preset point as a third candidate group.

[0315] Referring to FIG. 25, the motion information decoding unit (2130) can determine various distribution forms of the first residual motion vector candidates for each candidate group. For example, the motion information decoding unit (2130) can determine the first residual motion vector candidates ((1, 0), (-1, 0), (0, 1), (0, -1)) having a diamond-shaped distribution based on a preset point as the first candidate group.

[0316] Additionally, the motion information decoding unit (2130) can determine the first residual motion vector candidates ((2, 2), (-2, 2), (2, -2), (-2, -2)) having a rectangular distribution based on a preset point as a second candidate group.

[0317] In addition, the motion information decoding unit (2130) can determine the first residual motion vector candidates ((4, 0), (-4, 0), (0, 4), (0, -4)) having a diamond-shaped distribution based on a preset point as a third candidate group. The distribution form of the first residual motion vector candidates included in each candidate group can have various distribution forms other than the distribution form illustrated in FIG. 25.

[0318] FIG. 26 is a diagram for explaining an index representing first residual motion vector candidates according to one embodiment.

[0319] As illustrated in FIG. 26, reference numeral 2601 may be a bit representation corresponding to an index indicating a basic motion vector candidate, reference numeral 2602 may be a bit representation corresponding to an index indicating a variation distance (or candidate group) of a first residual motion vector candidate, and reference numerals 2603 and 2604 may be bit representations corresponding to an index indicating a variation direction of a first residual motion vector candidate.

[0320] The motion information decoding unit (2130) may assign an index to each of at least one basic motion vector candidate to determine the basic motion vector of the current block based on an index indicating the basic motion vector included in the bitstream. In addition, the motion information decoding unit (2130) may assign an index to each of the first residual motion vector candidates to determine the first residual motion vector of the current block based on an index indicating the first residual motion vector included in the bitstream.

[0321] Referring to FIG. 26, the basic motion vector candidate 0 may be assigned an index of 0, and the basic motion vector candidate 1 may be assigned an index of 10. The indices representing each of the basic motion vector candidates may be expressed in a unary encoding method or a truncated unary encoding method according to a predetermined order.

[0322] As the number of bits representing an index increases from basic motion vector candidate 0 to basic motion vector candidate 4, the priority among basic motion vector candidates for assigning an index can be set according to the same standard as that of the video encoding device (3300).

[0323] In one embodiment, information indicating a priority order among basic motion vector candidates for assigning an index may be included in the bitstream, and in this case, the motion information decoding unit (2130) may assign an index to each basic motion vector candidate according to the information indicating a priority order obtained from the bitstream. The information indicating a priority order among basic motion vector candidates obtained from the bitstream may include information about a change in the priority order compared to the priorities among basic motion vector candidates determined in a previous block, a previous slice, or a previous picture. For example, if the priority of basic motion vector candidate 0 was 1 in the previous block, the previous slice, or the previous picture, but the priority of basic motion vector candidate 0 was changed to 3 with respect to the current block, the current slice, or the current picture, the bitstream may include information indicating that the priority of basic motion vector candidate 0 was changed to 3. Additionally, the bitstream may include information that no change in priority between base motion vector candidates in the current block, current slice, or current picture has occurred compared to the priority between base motion vector candidates determined in the previous block, previous slice, or previous picture.

[0324] The primary residual motion vector candidates determined in correspondence to a single base motion vector candidate can be grouped into candidate groups according to a predetermined criterion. Here, the predetermined criterion may be a certain distance of variation from a preset point. The index for each grouped candidate group can be expressed using unary coding or truncated unary coding. Depending on the implementation, the index for each grouped candidate group can also be expressed using a fixed-length coding method.

[0325] Referring to FIG. 26, the number of bits for expressing the index of a candidate group increases from candidate group 0 corresponding to mutation distance 1 to candidate group 7 corresponding to mutation distance 8, and the priority order among candidate groups for assigning an index can be set according to the same standard as that of the video encoding device (3300).

[0326] In one embodiment, information indicating priorities among candidate groups for assigning indices may be included in the bitstream, and in this case, the motion information decoding unit (2130) may assign indices to each of the candidate groups according to the information indicating priorities obtained from the bitstream. The information indicating priorities among candidate groups obtained from the bitstream may also include information about a change in priorities compared to priorities determined among candidate groups in a previous block, a previous slice, or a previous picture. For example, if the priority of candidate group 0 was 1 in the previous block, the previous slice, or the previous picture, but the priority of candidate group 0 was changed to 3 with respect to the current block, the current slice, or the current picture, the bitstream may include information indicating that the priority of candidate group 0 was changed to 3. In addition, the bitstream may also include information indicating that no change in priorities among candidate groups occurred in the current block, the current slice, or the current picture, compared to priorities determined among candidate groups in the previous block, the previous slice, or the previous picture.

[0327] Meanwhile, candidate group 0 illustrated in FIG. 26 may include candidates spaced apart by a variation distance of 1 from a preset point, and in one embodiment, candidate group 0 may include candidates spaced apart by a distance of 0 from the preset point. Since a candidate spaced apart by a distance of 0 from the preset point means the preset point itself, as described in FIGS. 22 to 25, when the preset point corresponds to (0,0), the first residual motion vector candidate becomes (0,0). In this case, if the information representing the candidate group for specifying the first residual motion vector of the current block points to candidate group 0, the basic motion vector of the current block can become the motion vector of the current block as long as the second residual motion vector does not exist, without the need to acquire information representing the variation direction. In other words, if one base motion vector is determined for the current block and the information indicating the candidate group indicates candidate group 0, the base motion vector becomes the motion vector of the current block, so it can replace the merge mode or skip mode of the conventional HEVC.

[0328] An index (or flag) indicating the transition direction may be assigned to each of the first residual motion vector candidates included in a candidate group. In this case, the index indicating the transition direction may be expressed using a fixed-length encoding method. For example, if a candidate group includes four first residual motion vector candidates, two bits may be required to indicate each first residual motion vector candidate.

[0329] The motion information decoding unit (2130) can divide the first residual motion vector candidates included in one candidate group into groups according to their positions on the coordinate plane, and assign an index or flag corresponding to the divided group.

[0330] Referring to FIG. 26, the first residual motion vector candidates (1, 0), (-1, 0), (0, 1), (0, -1), corresponding to candidate group 0 of the basic motion vector 0, are assigned an index (or flag) of 0 or 1, as shown in the drawing symbol 2603, depending on whether they are located on the x-axis or the y-axis, and an index (or flag) of 0 or 1, as shown in the drawing symbol 2604, depending on whether they are located in the + direction or the - direction.

[0331] As described above, the acquisition unit (2110) can decode at least one of the indices indicating the variation direction of the first residual motion vector from the bitstream using a context model. For example, the acquisition unit (2110) can divide four first residual motion vector candidates included in one candidate group into two groups, each including two candidates located on the x-axis and two candidates located on the y-axis, and can decode an index (2603) indicating whether the candidate is located on the x-axis or the y-axis according to the context model. Once it is determined whether the candidate is located on the x-axis or the y-axis, the acquisition unit (2110) can decode an index (2604) indicating whether the candidate is located in the + direction or the - direction according to the context model.

[0332] In one embodiment, the motion information decoding unit (2130) may include only candidates located at preset points on the coordinate plane in each candidate group. For example, the motion information decoding unit (2130) may include only candidates located on the x-axis or only candidates located on the y-axis in each candidate group based on information about at least one of the previous picture, the current picture, the previous slice, the current slice, the previous block, and the current block. For example, among the candidates (1, 0), (-1, 0), (0, 1), and (0, -1) included in candidate group 0 in FIG. 26, only (1, 0) and (-1, 0) are included in candidate group 0, and only the index of the drawing reference numeral 2604 may be assigned to each candidate as an index indicating a transition direction.

[0333] Below, we describe a method for determining a first residual motion vector candidate when the base motion vector candidate is a bidirectional motion vector.

[0334] First, Fig. 27 is a drawing for explaining motion information used for bidirectional prediction of a block, and illustrates a case where a block is bidirectionally predicted in the AMVP mode of HEVC.

[0335] A block (2710) can be unidirectionally predicted using a reference picture (2730) included in list 0 or a reference picture (2750) included in list 1, or can be bidirectionally predicted using two reference pictures (2730, 2750) included in list 0 and list 1.

[0336] Referring to FIG. 27, when the prediction direction of the block (2710) is unidirectional in the list 0 direction, the motion vector (MV0) of the block (2710) in the list 0 direction is determined based on the prediction motion vector (MVP0) corresponding to the list 0 direction and the residual motion vector (MVD0) for the list 0 direction. In addition, when the prediction direction of the block (2710) is unidirectional in the list 1 direction, the motion vector (MV1) of the block (2710) in the list 1 direction is determined based on the prediction motion vector (MVP1) corresponding to the list 1 direction and the residual motion vector (MVD1) for the list 1 direction.

[0337] When the prediction direction of the block (2710) is bidirectional including the list 0 direction and the list 1 direction, the motion vector (MV0) of the block (2710) in the list 0 direction is determined based on the predicted motion vector (MVP0) corresponding to the list 0 direction and the residual motion vector (MVD0) for the list 0 direction, and the motion vector (MV1) of the block (2710) in the list 1 direction is determined based on the predicted motion vector (MVP1) corresponding to the list 1 direction and the residual motion vector (MVD1) for the list 1 direction.

[0338] That is, if a block is bidirectionally predicted, it may mean that the motion vector of the block includes a motion vector in the direction of list 0 and a motion vector in the direction of list 1, and the residual motion vector may also mean that the residual motion vector includes a residual motion vector for the direction of list 0 and a residual motion vector for the direction of list 1.

[0339] In one embodiment of the present disclosure, if any one of the basic motion vector candidates corresponds to a bidirectional motion vector, it includes a basic motion vector candidate in the list 0 direction and a basic motion vector candidate in the list 1 direction, and a method of determining a first residual motion vector candidate for the list 0 direction and a first residual motion vector candidate for the list 1 direction is described below.

[0340] FIG. 28 illustrates a positional relationship between a first reference picture (2830) indicated by a first unidirectional basic motion vector candidate, a second reference picture (2850) indicated by a second unidirectional basic motion vector candidate, and a current picture (2810) including a current block, when a basic motion vector candidate corresponds to a bidirectional motion vector. In FIG. 28, the distance between the current picture (2810) and the first reference picture (2830) is d1, and the distance between the current picture (2810) and the second reference picture (2850) is d2. The distance between pictures may mean the difference in POC values ​​of the two pictures. In addition, the first unidirectional direction means the list 0 direction or the list 1 direction, and the second unidirectional direction means a direction different from the first unidirectional direction.

[0341] Referring to FIG. 28, the current picture (2810) has a POC of B, and the first reference picture (2830) and the second reference picture (2850) each have a POC of A and a POC of C. The first residual motion vector candidates when POC B has a value between POC A and POC C are illustrated in FIG. 29.

[0342] The first residual motion vector candidates illustrated in the aforementioned FIG. 26 are composed of a residual candidate for list 0 or a residual candidate for list 1 depending on the direction of the basic motion vector candidate. However, if the basic motion vector candidate is bidirectional, each of the first residual motion vector candidates may include a residual candidate for list 0 and a residual candidate for list 1.

[0343] When POC B has a value between POC A and POC C, each of the first residual motion vector candidates distinguished according to the displacement distance and displacement direction may include a first residual motion vector candidate for the first unidirectional direction having a value of a size corresponding to the displacement distance, and a first residual motion vector candidate for the second unidirectional direction having a value of a size corresponding to the displacement distance but having a value of the opposite sign.

[0344] For example, referring to FIG. 29, among the first residual motion vector candidates belonging to candidate group 0, the first residual motion vector candidate specified by the index 00 indicating the transition direction may include (1,0) having a component having a value of a magnitude corresponding to the transition distance and (-1,0) having a component having a value of the opposite sign. (1,0) may correspond to the first residual motion vector candidate for the first unidirectional direction, and (-1,0) may correspond to the first residual motion vector candidate for the second unidirectional direction. If the index indicating the transition direction is obtained as 00 from the bitstream, the motion information decoding unit (2130) may determine (1,0) as the first residual motion vector for the first unidirectional direction of the current block, and (-1,0) as the first residual motion vector for the second unidirectional direction of the current block.

[0345] In one embodiment, the value of the first residual motion vector candidate for one unidirectional direction may be scaled depending on the distance between d1 and d2. For example, if the first residual motion vector candidate for the first unidirectional direction when d1 is 1 is (1, 0), the first residual motion vector candidate for the second unidirectional direction when d2 is 2 may be determined as (-2, 0).

[0346] In other words, if the first residual motion vector candidate for the first unidirectional direction is (x, y), the first residual motion vector candidate for the second unidirectional direction can be determined as ((d2 / d1)*(-x), (d2 / d1)*(-y)). In one example, d2 / d1 can be calculated as an integer (int), or it can be calculated as a double or float type depending on the implementation. Alternatively, depending on the implementation, d2 / d1 can be converted using a bit shift operator (<<, >>), rounded, and then calculated by applying the bit shift operator again.

[0347] FIG. 30 illustrates a positional relationship between a first reference picture (2930) indicated by a first unidirectional basic motion vector candidate, a second reference picture (2950) indicated by a second unidirectional basic motion vector candidate, and a current picture (2910) including a current block, when a basic motion vector candidate corresponds to a bidirectional motion vector. In FIG. 30, the distance between the current picture (2910) and the first reference picture (2930) is d1, and the distance between the current picture (2910) and the second reference picture (2950) is d2.

[0348] Referring to FIG. 30, the current picture (2910) has a POC of A, and the first reference picture (2930) and the second reference picture (2950) each have a POC of B and a POC of C. The first residual motion vector candidates when POC A is smaller than POC B and POC C are illustrated in FIG. 31. The first residual motion vector candidates when POC A is larger than POC B and POC C may also be the same as illustrated in FIG. 31.

[0349] Each of the first residual motion vector candidates distinguished by the mutation distance and mutation direction may include a residual candidate for the first unidirectional direction and a residual candidate for the second unidirectional direction.

[0350] When POC A has a value greater than or less than POC B and POC C, each of the first residual motion vector candidates distinguished according to the displacement distance and displacement direction may include a first residual motion vector candidate for the first unidirectional direction having a value of a size corresponding to the displacement distance, and a first residual motion vector candidate for the second unidirectional direction having a value of the same sign and a size corresponding to the displacement distance as a component.

[0351] For example, referring to FIG. 31, among the first residual motion vector candidates included in candidate group 0, the first residual motion vector candidate specified by the index 00 indicating the mutation direction may include (1,0) having a value of a size corresponding to the mutation distance as a component, and (1,0) having a value of the same size and the same sign as (1,0) as a component.

[0352] In one embodiment, the value of the first residual motion vector candidate for one unidirectional direction may be scaled according to the distance between d1 and d2. For example, if the first residual motion vector candidate for the first unidirectional direction when d1 is 1 is (1, 0), the first residual motion vector candidate for the second unidirectional direction when d2 is 2 may be determined as (2, 0).

[0353] In other words, if the first residual motion vector candidate for the first unidirectional direction is (x, y), the first residual motion vector candidate for the second unidirectional direction can be determined as ((d2 / d1)*(x), (d2 / d1)*(y)). In one example, d2 / d1 can be calculated as an integer (int), or, depending on the implementation, d2 / d1 can be calculated as a double or float. Alternatively, depending on the implementation, d2 / d1 can be converted using a bit shift operator (<<, >>), rounded, and then calculated by applying the bit shift operator again.

[0354] Below, we describe a method for determining the motion vector of the current block by considering the predicted direction of the current block and the direction of the base motion vector.

[0355] If the predicted direction of the current block and the direction of the basic motion vector of the current block are the same, the motion information decoding unit (2130) can determine the motion vector of the current block by applying the first residual motion vector to the basic motion vector of the current block.

[0356] In one embodiment, the acquisition unit (2110) can extract information, for example, an index, indicating the direction of use of the basic motion vector from the bitstream. The information indicating the direction of use of the basic motion vector can correspond to the prediction direction of the current block. In one example, if the direction of use of the basic motion vector is in the direction of list 0, the current block can be unidirectionally predicted in the direction of list 0, and if the direction of use of the basic motion vector is in the direction of list 1, the current block can be unidirectionally predicted in the direction of list 1. In addition, if the direction of use of the basic motion vector is bidirectional, the current block can be bidirectionally predicted.

[0357] For example, if the basic motion vector is bidirectional, a bit value of 0 may indicate that the usage direction of the basic motion vector is bidirectional, a bit value of 10 may indicate that the usage direction of the basic motion vector is in the list 0 direction, and a bit value of 11 may indicate that the usage direction of the basic motion vector is in the list 1 direction.

[0358] Also, for example, if the basic motion vector is the first unidirectional in the list 0 direction or the list 1 direction, a bit value of 0 may indicate that the usage direction of the basic motion vector is the first unidirectional, a bit value of 10 may indicate that the usage direction of the basic motion vector is the second unidirectional different from the first unidirectional, and a bit value of 11 may indicate that the usage direction of the basic motion vector is bidirectional.

[0359] The direction of use of the basic motion vector corresponding to the above bit value may be changed.

[0360] If the basic motion vector is bidirectional and the direction of use of the basic motion vector is bidirectional

[0361] The motion information decoding unit (2130) can determine the motion vector in the list 0 direction of the current block by applying the first residual motion vector for the list 0 direction to the basic motion vector in the list 0 direction. In addition, the motion information decoding unit (2130) can determine the motion vector in the list 1 direction of the current block by applying the first residual motion vector for the list 1 direction to the basic motion vector in the list 1 direction.

[0362] If the basic motion vector is bidirectional and the direction of use of the basic motion vector is bidirectional, but the bitstream only includes information indicating the first residual motion vector for the list 0 direction, the motion information decoding unit (2130) can generate the first residual motion vector for the list 1 direction based on the first residual motion vector for the list 0 direction.

[0363] The motion information decoding unit (2130) can generate a first residual motion vector for the list 1 direction by considering the positional relationship between the reference picture corresponding to the basic motion vector in the list 0 direction, the current picture including the current block, and the reference picture corresponding to the basic motion vector in the list 1 direction.

[0364] In one example, the motion information decoding unit (2130) may change the sign of the value of the first residual motion vector for the list 0 direction to the opposite when the current picture is located between the reference picture in the list 0 direction and the reference picture in the list 1 direction, and may determine the first residual motion vector for the list 1 direction by scaling the value of the first residual motion vector for the list 0 direction according to the ratio between d1 (the distance between the current picture and the reference picture in the list 0 direction) and d2 (the distance between the current picture and the reference picture in the list 1 direction). For example, when the first residual motion vector for the list 0 direction is (1, 1), d1 is 1, and d2 is 2, the first residual motion vector for the list 1 direction may be determined as (-2, -2).

[0365] In another example, the motion information decoding unit (2130) may determine the first residual motion vector for the list 1 direction by keeping the sign of the value of the first residual motion vector for the list 0 direction the same and scaling the value of the first residual motion vector for the list 0 direction according to the ratio between d1 and d2 when the current picture is located before or after the reference picture in the list 0 direction and the reference picture in the list 1 direction. For example, when the first residual motion vector for the list 0 direction is (1, 1), d1 is 1, and d2 is 2, the first residual motion vector for the list 1 direction may be determined as (2, 2).

[0366] If the basic motion vector is bidirectional and the direction of use of the basic motion vector is unidirectional

[0367] When the basic motion vector is bidirectional and the direction of use of the basic motion vector is in the list 0 direction or the list 1 direction, the motion information decoding unit (2130) can determine the motion vector of the current block in the list 0 direction or the list 1 direction by applying the first residual motion vector for the list 0 direction or the first residual motion vector for the list 1 direction to the basic motion vector in the list 0 direction or the basic motion vector in the list 1 direction.

[0368] If the direction of use of the basic motion vector is the first unidirectional, but the bitstream only contains information indicating the first residual motion vector for the second unidirectional, the motion information decoding unit (2130) can determine the first residual motion vector for the first unidirectional from the first residual motion vector for the second unidirectional by considering the positional relationship and distance between the current picture, the reference picture in the list 0 direction, and the reference picture in the list 1 direction, as previously discussed.

[0369] When the basic motion vector and the direction of use of the basic motion vector are unidirectional

[0370] If the basic motion vector is a first unidirectional direction in the list 0 direction or the list 1 direction, and the direction of use of the basic motion vector is a second unidirectional direction different from the first unidirectional direction, and the bitstream includes only information indicating a first residual motion vector for the first unidirectional direction, the motion information decoding unit (2130) can determine a basic motion vector for the second unidirectional direction based on the basic motion vector for the first unidirectional direction, and can determine a first residual motion vector for the second unidirectional direction based on the first residual motion vector for the first unidirectional direction.

[0371] First, the motion information decoding unit (2130) can determine a second reference picture located in the opposite direction from the first reference picture with respect to the current picture, by considering d1 (the distance between the current picture and the first reference picture indicated by the first unidirectional basic motion vector).

[0372] In one example, a second reference picture spaced apart by the same distance as d1 can be determined. In this case, since d1 and d2 (the distance between the current picture and the second reference picture) are the same and the current picture is located between the first reference picture and the second reference picture, the motion information decoding unit (2130) can generate a second unidirectional basic motion vector by reversing the sign of the first unidirectional basic motion vector, and can generate a first unidirectional residual motion vector by reversing the sign of the first unidirectional residual motion vector.

[0373] If there is no picture spaced apart by the same distance as d1, a picture that is located in the opposite direction from the first reference picture and closest to the current picture with the current picture as the second reference picture can be determined. In this case, the current picture is located between the first reference picture and the second reference picture, but d1 and d2 are different from each other. The motion information decoding unit (2130) can generate a second unidirectional basic motion vector by changing the sign of the first unidirectional basic motion vector to the opposite and scaling it according to the ratio between d1 and d2. In addition, the motion information decoding unit (2130) can generate a first unidirectional residual motion vector by changing the sign of the first unidirectional residual motion vector to the opposite and scaling it according to the ratio between d1 and d2.

[0374] If the current picture corresponds to the last picture of a GOP (Group of Pictures), the motion information decoding unit (2130) can determine any one picture located in the same direction as the first reference picture with the current picture as the second reference picture. The first reference picture or the picture located closest to the current picture can be determined as the second reference picture. In this case, since the current picture is located after the first reference picture and the second reference picture, the motion information decoding unit (2130) can generate the second unidirectional basic motion vector by scaling the value of the first unidirectional basic motion vector according to the ratio between d1 and d2 (without changing the sign). Additionally, the motion information decoding unit (2130) can generate a first residual motion vector for the second unidirectional direction by scaling the value of the first residual motion vector for the first unidirectional direction according to the ratio between d1 and d2 (without changing the sign).

[0375] In one example, if the current picture corresponds to the last picture of the GOP, and the first reference picture itself is determined as the second reference picture, the motion information decoding unit (2130) may determine the first unidirectional basic motion vector as the second unidirectional basic motion vector and the first residual motion vector for the first unidirectional.

[0376] When the basic motion vector and the first residual motion vector for the second unidirectional direction are generated, the motion information decoding unit (2130) can determine the second unidirectional motion vector of the current block by applying the first residual motion vector for the second unidirectional direction to the basic motion vector for the second unidirectional direction.

[0377] If the basic motion vector is unidirectional and the direction of use of the basic motion vector is bidirectional

[0378] If the basic motion vector is the first unidirectional in the list 0 direction or the list 1 direction, the direction of use of the basic motion vector is bidirectional, and the bitstream includes only information indicating the first residual motion vector for the first unidirectional, the motion information decoding unit (2130) can generate the second unidirectional basic motion vector based on the first unidirectional basic motion vector, and generate the first residual motion vector for the second unidirectional based on the first residual motion vector for the first unidirectional.

[0379] First, the motion information decoding unit (2130) can determine a second reference picture located in the opposite direction from the first reference picture with respect to the current picture, by considering d1 (the distance between the current picture and the first reference picture indicated by the first unidirectional basic motion vector).

[0380] In one example, a second reference picture spaced apart by the same distance as d1 can be determined. In this case, since d1 and d2 (the distance between the current picture and the second reference picture) are the same and the current picture is located between the first reference picture and the second reference picture, the motion information decoding unit (2130) can generate a second unidirectional basic motion vector by reversing the sign of the first unidirectional basic motion vector, and can generate a first unidirectional residual motion vector by reversing the sign of the first unidirectional residual motion vector.

[0381] If there is no picture spaced apart by the same distance as d1, a picture that is located in the opposite direction from the first reference picture and closest to the current picture with the current picture as the second reference picture can be determined. In this case, the current picture is located between the first reference picture and the second reference picture, but d1 and d2 are different from each other. The motion information decoding unit (2130) can generate a second unidirectional basic motion vector by changing the sign of the first unidirectional basic motion vector to the opposite and scaling it according to the ratio between d1 and d2. In addition, the motion information decoding unit (2130) can generate a first unidirectional residual motion vector by changing the sign of the first unidirectional residual motion vector to the opposite and scaling it according to the ratio between d1 and d2.

[0382] If the current picture corresponds to the last picture of a GOP (Group of Pictures), the motion information decoding unit (2130) can determine any one picture located in the same direction as the first reference picture with the current picture as the second reference picture. The first reference picture or the picture located closest to the current picture can be determined as the second reference picture. In this case, since the current picture is located after the first reference picture and the second reference picture, the motion information decoding unit (2130) can generate the second unidirectional basic motion vector by scaling the value of the first unidirectional basic motion vector according to the ratio between d1 and d2 (without changing the sign). Additionally, the motion information decoding unit (2130) can generate a first residual motion vector for the second unidirectional direction by scaling the value of the first residual motion vector for the first unidirectional direction according to the ratio between d1 and d2 (without changing the sign).

[0383] In one example, if the current picture corresponds to the last picture of the GOP, and the first reference picture itself is determined as the second reference picture, the motion information decoding unit (2130) may determine the first unidirectional basic motion vector as the second unidirectional basic motion vector and the first residual motion vector for the first unidirectional.

[0384] When the basic motion vector and the first residual motion vector for the second unidirectional direction are generated, the motion information decoding unit (2130) can determine the second unidirectional motion vector of the current block by applying the first residual motion vector for the second unidirectional direction to the basic motion vector of the second unidirectional direction, and can determine the first unidirectional motion vector of the current block by applying the first residual motion vector for the first unidirectional direction to the basic motion vector of the first unidirectional direction.

[0385] Meanwhile, in one embodiment, the acquisition unit (2110) may acquire information indicating whether the current block has been multi-pass coded from the bitstream, and, if multi-pass coding has been applied, information regarding the encoding mode applied to the current block. Multi-pass coding may mean encoding a block using two different encoding modes, and then ultimately selecting the encoding mode with better efficiency to encode the block.

[0386] When the acquisition unit (2110) confirms that the current block is multi-pass coded, it can acquire information, for example, a flag, indicating which of the two encoding modes the current block was encoded in.

[0387] If it is confirmed that the current block to which multi-pass coding is applied is encoded in a preset mode according to the present disclosure, the motion information decoding unit (2130) can decode the motion information of the current block based on information indicating the basic motion vector of the current block and information indicating the first residual motion vector. If it is confirmed that the current block to which multi-pass coding is applied is encoded in a mode other than the preset mode, for example, merge mode, skip mode, or AMVP mode, the motion information decoding unit (2130) can decode the motion information according to the confirmed mode.

[0388] Meanwhile, the current block according to the present disclosure may correspond to a first child block divided from a parent block. If the bitstream includes information indicating the division of the parent block, the motion information decoding unit (2130) may divide the parent block into a first child block and a second child block corresponding to the current block. Alternatively, the motion information decoding unit (2130) may divide the parent block into a first child block and a second child block corresponding to the current block by considering at least one of the size, width, and height of the parent block. For example, if the width of the parent block is greater than the height, the motion information decoding unit (2130) may determine two child blocks by dividing the width of the parent block by half, and if the height of the parent block is greater than the width, the height of the parent block may be divided by half to determine two child blocks. The parent block may mean a block that is a basis for prediction, such as a prediction unit of HEVC. According to an implementation example, the motion information decoding unit (2130) may divide the parent block into a first child block corresponding to the current block, a second child block, and a third child block, i.e., into three child blocks.

[0389] Additionally, the shape of the child block can include not only squares or rectangles, but also triangles, trapezoids, etc.

[0390] When the preset mode according to the present disclosure is applied to the first child block, the motion information decoding unit (2130) can determine the motion vector of the first child block according to the methods described above.

[0391] As an example of a method for determining a motion vector of a second child block, the motion information decoding unit (2130) may, similarly to the first child block, determine a basic motion vector of the second child block and a first residual motion vector of the second child block based on information representing a basic motion vector obtained from a bitstream and information representing a first residual motion vector, and may determine a motion vector of the second child block by combining the basic motion vector and the first residual motion vector. In this case, basic motion vector candidates and first residual motion vector candidates determined for the parent block may be equally used for the first child block and the second child block. In other words, the basic motion vector candidates and the first residual motion vector candidates are determined at the parent block level, the motion vector of the first child block is determined based on information indicating the basic motion vector of the first child block and information indicating the first residual motion vector, and the motion vector of the second child block can be determined based on information indicating the basic motion vector of the second child block and information indicating the first residual motion vector.

[0392] As another example, the motion vector determined for the first child block may be determined as the base motion vector of the second child block, and only information indicating the first residual motion vector of the second child block may be obtained from the bitstream to determine the first residual motion vector of the second child block. The motion information decoding unit (2130) may determine the motion vector of the second child block by adding the first residual motion vector of the second child block to the base motion vector of the second child block.

[0393] As another example, at least one of the information indicating a basic motion vector, the information indicating a disparity distance, and the information indicating a disparity direction, which are acquired from the bitstream in relation to the first child block, may also be shared with the second child block. In this case, the motion information decoding unit (2130) may determine the basic motion vector and the first residual motion vector of the second child block based on the information shared with the second child block among the information indicating a basic motion vector, the information indicating a disparity distance, and the information indicating a disparity direction, which are acquired from the bitstream in relation to the first child block, and the remaining information acquired from the bitstream in relation to the second child block.

[0394] Additionally, information indicating a second residual motion vector may be included only in a bitstream related to one of the first child block and the second child block described above. For example, if a second residual motion vector is determined related to the first child block, the motion information decoding unit (2130) may also apply the second residual motion vector of the first child block to the second child block.

[0395] In one embodiment, the first child block may be encoded in a preset mode according to the present disclosure, and the second child block may be encoded in a mode different from the mode applied to the first child block. In this case, the motion information decoding unit (2130) may decode the first child block and the second child block according to the respective modes applied to the first child block and the second child block.

[0396] When motion vectors are determined for each of the first child block and the second child block, a first prediction block corresponding to the first child block and a second prediction block corresponding to the second child block can be determined through inter prediction. Then, the boundary between the first prediction block and the second prediction block is smoothed filtered, and a residual block is added to the final prediction block generated through the filtering process, so that the parent block can be finally restored. For the smoothing filtering, an N-tap filter or an OBMC (overlapped block motion compensation) method can be applied. According to the OBMC method, a weight can be applied to an overlapping portion between the first prediction block and the second prediction block. The weight of the boundary region can be 0.5:0.5, but the weight can increase as the area gets farther from the boundary.

[0397] Figure 32 is a flowchart for explaining an image decoding method according to one embodiment.

[0398] In step S3210, the video decoding device (2100) determines a base motion vector of the current block. The video decoding device (2100) may determine any one of at least one base motion vector candidate as the base motion vector of the current block.

[0399] The video decoding device (2100) can determine the basic motion vector of the current block based on information indicating the basic motion vector included in the bitstream. In one example, the video decoding device (2100) can obtain information indicating the basic motion vector at the block level, slice level, or picture level.

[0400] At step S3220, the video decoding device (2100) determines the first residual motion vector of the current block.

[0401] The video decoding device (2100) determines first residual motion vector candidates for each of at least one basic motion vector candidate, and obtains information indicating a variation distance and a variation direction of the first residual motion vector from a bitstream to determine the first residual motion vector of the current block among the first residual motion vector candidates.

[0402] The image decoding device (2100) can obtain at least one of information indicating a variation distance and information indicating a variation direction at a block level, a slice level, or a picture level.

[0403] At step S3230, the image decoding device (2100) can determine the motion vector of the current block by applying the first residual motion vector to the base motion vector of the current block.

[0404] If the bitstream includes information indicating a second residual motion vector, the image decoding device (2100) may determine the motion vector of the current block by applying the second residual motion vector to the base motion vector changed by applying the first residual motion vector.

[0405] Fig. 33 is a block diagram of an image encoding device (3300) according to one embodiment.

[0406] Referring to FIG. 33, an image encoding device (3300) according to one embodiment of the present invention may include a motion information encoding unit (3310) and a generation unit (3330).

[0407] The image encoding device (3300) can encode an image and generate a bitstream including information generated as a result of the encoding.

[0408] According to one embodiment, the video encoding device (3300) may include a central processor (not shown) that controls the motion information encoding unit (3310) and the generation unit (3330). Alternatively, the motion information encoding unit (3310) and the generation unit (3330) may be operated by their own processors (not shown), and the video encoding device (3300) may be operated as a whole as the processors (not shown) organically operate with each other. Alternatively, the motion information encoding unit (3310) and the generation unit (3330) may be controlled under the control of an external processor (not shown).

[0409] The video encoding device (3300) may include one or more data storage units (not shown) in which input / output data of the motion information encoding unit (3310) and the generation unit (3330) are stored. The video encoding device (3300) may also include a memory control unit (not shown) that controls data input / output of the data storage unit (not shown).

[0410] The video encoding device (3300) can perform a video encoding operation including prediction by operating in conjunction with an internally installed video encoding processor or an external video encoding processor to encode a video. The internal video encoding processor of the video encoding device (3300) according to one embodiment can implement a basic video encoding operation not only as a separate processor, but also by including a central processing unit or a graphics processing unit with a video encoding processing module.

[0411] The video encoding device (3300) may be included in the video encoding device (200) described above. For example, the generation unit (3330) may be included in the bitstream generation unit (210) of the video encoding device (200) illustrated in FIG. 2, and the motion information encoding unit (3310) may be included in the encoding unit (220) of the video encoding device (200).

[0412] The motion information encoding unit (3310) encodes the motion vector of the current block. The current block is a block generated by dividing an image according to a tree structure, and may correspond to, for example, a maximum coding unit, an coding unit, or a transformation unit. The motion information encoding unit (3310) may determine a prediction mode to be applied to the current block. The prediction mode may include, for example, at least one of an intra mode, an inter mode, a merge mode, a skip mode, and a preset mode according to the present disclosure.

[0413] The generation unit (3330) generates a bitstream including information generated as a result of encoding a motion vector. In one embodiment, the bitstream may include information indicating at least one of whether a preset mode is applied to a current block, a base motion vector of the current block, a first residual motion vector of the current block, a priority of disparity distances for distinguishing first residual motion vector candidates, and a priority of disparity directions for distinguishing first residual motion vector candidates. The generation unit (3330) may include the above information in a bitstream corresponding to at least one level of a coding unit level, a transform unit level, a maximum coding unit level, a slice unit level, and a picture unit level.

[0414] The motion information encoding unit (3310) can determine whether to apply a preset mode to the current block.

[0415] The motion information encoding unit (3310) can determine whether to apply a preset mode to the current block based on information related to at least one of the current block, a previously encoded block, the current slice, the previously encoded slice, the current picture, and the previously encoded picture.

[0416] In one example, the motion information encoding unit (3310) may determine whether to apply a preset mode to the current block by considering statistical information about the prediction mode in the previous slice or the previous picture. The motion information encoding unit (3310) may also determine not to apply the preset mode to the current block based on the statistical information.

[0417] In one example, the motion information encoding unit (3310) may determine to apply a preset mode to the current block based on the cost corresponding to each of several prediction modes applicable to the current block. A rate-distortion cost may be used when calculating the cost.

[0418] When a preset mode is applied to the current block, the motion information encoding unit (3310) can determine primary residual motion vector candidates for each of at least one basic motion vector candidate. The primary residual motion vector candidates can be distinguished according to the displacement distance and displacement direction. Since the method for determining the primary residual motion vector candidates is the same as that described with respect to the image decoding device (2100), a detailed description thereof will be omitted.

[0419] In one embodiment, at least one base motion vector candidate of the current block may be determined based on motion vectors of surrounding blocks that are spatially and temporally related to the current block. The surrounding blocks that are spatially and temporally related to the current block may include blocks encoded before the current block.

[0420] In one embodiment, the motion information encoding unit (3310) may determine motion vectors of neighboring blocks related to the current block as at least one basic motion vector candidate. Alternatively, the motion information encoding unit (3310) may determine at least one basic motion vector candidate by changing motion vectors of neighboring blocks related to the current block. Alternatively, the motion information encoding unit (3310) may determine at least one basic motion vector candidate by combining motion vectors of neighboring blocks related to the current block according to a predetermined formula.

[0421] In one embodiment, the motion information encoding unit (3310) may determine at least one base motion vector candidate in the same manner as determining a candidate list of a motion vector predictor in the merge mode or AMVP mode of HEVC.

[0422] In one embodiment, the motion information encoding unit (3310) may determine a zero motion vector having 0 as a component as a basic motion vector candidate.

[0423] When at least one basic motion vector candidate is determined, the motion information encoding unit (3310) can determine a basic motion vector of the current block from among the at least one basic motion vector candidate. The motion information encoding unit (3310) can determine the basic motion vector of the current block based on information related to at least one of the current block, a previously encoded block, a current slice, a previously encoded slice, a current picture, and a previously encoded picture.

[0424] In one example, the motion information encoding unit (3310) may determine the base motion vector of the current block by considering statistical information from the previous slice or the previous picture. In another example, the motion information encoding unit (3310) may determine the base motion vector of the current block based on the cost among at least one base motion vector candidate. A rate-distortion cost may be used when calculating the cost.

[0425] In one embodiment, information representing the base motion vector of the current block may be encoded using a fixed length coding (FLC), unary coding, or truncated unary coding method and included in the bitstream.

[0426] Once the basic motion vector for the current block is determined, the motion information encoding unit (3310) can determine the first residual motion vector of the current block among at least one first residual motion vector candidate.

[0427] The motion information encoding unit (3310) can determine the first residual motion vector of the current block among at least one first residual motion vector candidate by considering the difference value between the motion vector of the current block and the basic motion vector of the current block.

[0428] Information indicating a disparity distance and a disparity direction for specifying the first residual motion vector of the current block may be encoded using at least one of fixed-length encoding, unary encoding, and truncated unary encoding and included in the bitstream. The generation unit (3330) may encode information indicating a disparity direction, for example, at least one of the indices indicating a disparity direction, using a context model and include the encoded information in the bitstream.

[0429] In one embodiment, the motion information encoding unit (3310) may determine a first residual motion vector of the current block among at least one first residual motion vector candidate based on information related to at least one of the current block, a previously encoded block, a current slice, a previously encoded slice, a current picture, and a previously encoded picture.

[0430] Once the first residual motion vector of the current block is determined, the motion information encoding unit (3310) can apply the first residual motion vector to the basic motion vector of the current block, and compare the value generated as a result of the application with the motion vector of the current block to determine the second residual motion vector. For example, the second residual motion vector may correspond to a value obtained by subtracting the result of adding the basic motion vector of the current block and the first residual motion vector from the motion vector of the current block.

[0431] Once the secondary residual motion vector is determined, the generation unit (3330) can generate a bitstream including information representing the secondary residual motion vector of the current block. The generation unit (3330) can encode the information representing the secondary residual motion vector using a different encoding method (e.g., fixed-length encoding, unary encoding, or truncated unary encoding) from the encoding method of the information representing the primary residual motion vector and include it in the bitstream. As an example, the information representing the secondary residual motion vector can be encoded using an exponential global coding method and included in the bitstream. The generation unit (3330) can include the information representing the secondary residual motion vector in a bitstream corresponding to a transform unit level, a coding unit level, a maximum coding unit level, a slice level, or a picture level.

[0432] In one embodiment, if the prediction direction of the current block is bi-directional, the generator (3330) may include in the bitstream only information indicating a secondary residual motion vector for one uni-direction, rather than a secondary residual motion vector for bi-directionality.

[0433] The generation unit (3330) can include an index indicating a basic motion vector of the current block and an index indicating a first residual motion vector in the bitstream. To this end, the motion information encoding unit (3310) can assign an index to at least one basic motion vector candidate and at least one first residual motion vector candidate.

[0434] As illustrated in FIG. 26, reference numeral 2601 may correspond to an index indicating a basic motion vector candidate, reference numeral 2602 may correspond to an index indicating a variation distance (or candidate group) of a first residual motion vector candidate, and reference numerals 2603 and 2604 may correspond to indices indicating variation directions of the first residual motion vector candidate.

[0435] Referring to FIG. 26, the basic motion vector candidate 0 may be assigned an index of 0, and the basic motion vector candidate 1 may be assigned an index of 10. That is, the indices representing each of the basic motion vector candidates may be expressed in a predetermined order using a unary encoding method or a truncated unary encoding method.

[0436] As the number of bits representing the index increases from basic motion vector candidate 0 to basic motion vector candidate 4, the priority among basic motion vector candidates for assigning the index can be determined according to a preset standard.

[0437] In one embodiment, the motion information encoding unit (3310) may determine the priority among the basic motion vector candidates for the current block by considering the number of times or the ratio of the basic motion vector candidates selected as the basic motion vector in the previous slice or the previous picture. For example, if the basic motion vector candidate 3 was selected most frequently as the basic motion vector of the block in the previous slice or the previous picture, the motion information encoding unit (3310) may assign an index of 0 to the basic motion vector candidate 3.

[0438] In one embodiment, information indicating the priority order among base motion vector candidates for assigning an index may be included in the bitstream. The information indicating the priority order among base motion vector candidates may also include information regarding the order in which a change has occurred compared to the priority order among base motion vector candidates determined in a previous block, previous slice, or previous picture.

[0439] The primary residual motion vector candidates determined in correspondence to a single base motion vector candidate can be grouped into candidate groups according to a predetermined criterion. Here, the predetermined criterion may be a certain distance of variation from a preset point. The index for each grouped candidate group can be expressed using unary coding or truncated unary coding. Depending on the implementation, the index for each grouped candidate group can also be expressed using a fixed-length coding method.

[0440] Referring to FIG. 26, the number of bits for expressing the index of a candidate group increases from candidate group 0 corresponding to mutation distance 1 to candidate group 7 corresponding to mutation distance 8, and the priority among candidate groups for assigning an index can be determined according to a preset criterion.

[0441] In one embodiment, the motion information encoding unit (3310) may determine the priority among the candidate groups for the current block by considering the number of times or ratios selected for specifying the first residual motion vector in the previous slice or the previous picture among the candidate groups. For example, if the first residual motion vector candidate included in candidate group 3 in the previous slice or the previous picture was selected most frequently as the first residual motion vector of the block, the motion information encoding unit (3310) may assign an index of 0 to candidate group 3.

[0442] In one embodiment, information indicating priorities among candidate groups for assigning indices may be included in the bitstream. The information indicating priorities among candidate groups may also include information regarding the order in which changes have occurred compared to priorities among candidate groups determined in previous blocks, previous slices, or previous pictures.

[0443] Meanwhile, candidate group 0 illustrated in FIG. 26 may include candidates spaced apart by a displacement distance of 1 from a preset point. However, in one embodiment, candidate group 0 may also include candidates spaced apart by a displacement distance of 0 from the preset point. Since a candidate spaced apart by a displacement distance of 0 from the preset point means the preset point itself, when the preset point corresponds to (0,0) as described in FIGS. 22 to 25, the first residual motion vector candidate becomes (0,0). In this case, if the information representing the candidate group for specifying the first residual motion vector indicates candidate group 0, the base motion vector can become the motion vector of the block as long as the second residual motion vector does not exist. In other words, the motion information encoding unit (3310) may select candidate group 0 if the base motion vector of the current block is identical to the motion vector of the current block, and may include information representing candidate group 0 in the bitstream. When candidate group 0 is selected, the base motion vector becomes the motion vector of the current block, so it can replace the merge mode or skip mode of the conventional HEVC.

[0444] An index (or flag) indicating the transition direction may be assigned to each of the first residual motion vector candidates included in a candidate group. In this case, the index indicating the transition direction may be expressed using a fixed-length encoding method. For example, if a candidate group includes four first residual motion vector candidates, two bits may be required to indicate each first residual motion vector candidate.

[0445] The motion information encoding unit (3310) can divide the primary residual motion vector candidates included in one candidate group into groups according to their positions on a coordinate plane, and assign indices corresponding to the divided groups.

[0446] Referring to FIG. 26, the first residual motion vector candidates (1, 0), (-1, 0), (0, 1), (0, -1), corresponding to candidate group 0 of the basic motion vector 0, are assigned an index (or flag) of 0 or 1, as shown in the drawing symbol 2603, depending on whether they are located on the x-axis or the y-axis, and an index (or flag) of 0 or 1, as shown in the drawing symbol 2604, depending on whether they are located in the + direction or the - direction.

[0447] As described above, the generation unit (3330) can encode at least one of the indices indicating the variation direction of the first residual motion vector using a context model. For example, the generation unit (3330) can divide four first residual motion vector candidates included in one candidate group into two groups, each including two candidates located on the x-axis and two candidates located on the y-axis, and can encode an index (2603) indicating whether the candidate is located on the x-axis or the y-axis according to the context model. Once it is determined whether the candidate is located on the x-axis or the y-axis, the generation unit (3330) can encode an index (2604) indicating whether the candidate is located in the + direction or the - direction according to the context model.

[0448] In one embodiment, the motion information encoding unit (3310) may include only candidates located at preset points on the coordinate plane in each candidate group. For example, the motion information encoding unit (3310) may include only candidates located on the x-axis or candidates located on the y-axis in each candidate group based on information about at least one of the previous picture, the current picture, the previous slice, the current slice, the previous block, and the current block. For example, among the candidates (1, 0), (-1, 0), (0, 1), and (0, -1) included in candidate group 0 in FIG. 26, only (1, 0) and (-1, 0) may be included in candidate group 0, and only the index of the drawing reference numeral 2704 may be assigned to each candidate as an index indicating a variation direction for specifying a candidate.

[0449] The motion information encoding unit (3310) may, when the basic motion vector candidate is a bidirectional motion vector, allow each of the first residual motion vector candidates distinguished according to the displacement distance and displacement direction to include a first residual motion vector candidate for the list 0 direction and a first residual motion vector candidate for the list 1 direction. Since the method for determining the first residual motion vector candidate for both directions is the same as that described with respect to the image decoding device (2100), a detailed description thereof will be omitted.

[0450] In one embodiment, the video encoding method determines the direction of use of the basic motion vector when the basic motion vector of the current block is determined, and the generation unit (3330) can include information indicating the direction of use of the basic motion vector in the bitstream.

[0451] The basic motion vector may correspond to a motion vector for the list 0 direction, a motion vector for the list 1 direction, or a motion vector for both directions, and the image encoding method can determine the direction of use of the basic motion vector so as to increase the encoding efficiency of the motion vector of the current block.

[0452] Information indicating the direction of use of the above basic motion vector may include an index. For example, if the basic motion vector is bidirectional, a bit value of 0 may indicate that the direction of use of the basic motion vector is bidirectional, a bit value of 10 may indicate that the direction of use of the basic motion vector is in the direction of list 0, and a bit value of 11 may indicate that the direction of use of the basic motion vector is in the direction of list 1.

[0453] Also, for example, if the basic motion vector is the first unidirectional in the list 0 direction or the list 1 direction, a bit value of 0 may indicate that the usage direction of the basic motion vector is the first unidirectional, a bit value of 10 may indicate that the usage direction of the basic motion vector is the second unidirectional different from the first unidirectional, and a bit value of 11 may indicate that the usage direction of the basic motion vector is bidirectional.

[0454] The direction of use of the basic motion vector corresponding to the above bit value may be changed.

[0455] In one example, if the basic motion vector is bidirectional and the direction of use of the basic motion vector is determined to be bidirectional, the motion information encoding unit (3310) can determine the first residual motion vector for the list 0 direction of the current block and the first residual motion vector for the list 1 direction. In addition, the generation unit (3330) can include information indicating the bidirectional basic motion vector and information indicating the first residual motion vector for the list 0 direction of the current block and the first residual motion vector for the list 1 direction in the bitstream.

[0456] As another example, if the basic motion vector is bidirectional and the direction of use of the basic motion vector is determined to be bidirectional, the motion information encoding unit (3310) can determine the first residual motion vector for the list 0 direction of the current block and the first residual motion vector for the list 1 direction, but the generation unit (3330) can include in the bitstream information indicating only one of the first residual motion vector for the list 0 direction and the first residual motion vector for the list 1 direction, and information indicating the basic motion vector.

[0457] As another example, if the basic motion vector is bidirectional and the direction of use of the basic motion vector is the first unidirectional direction of the list 0 direction or the list 1 direction, the motion information encoding unit (3310) determines the first residual motion vector for the first unidirectional direction of the current block, and the generation unit (3330) can include information indicating the basic motion vector and information indicating the first residual motion vector for the first unidirectional direction in the bitstream.

[0458] As another example, if the basic motion vector is bidirectional and the direction of use of the basic motion vector is the first unidirectional direction of the list 0 direction or the list 1 direction, the motion information encoding unit (3310) determines a first residual motion vector for a second unidirectional direction different from the first unidirectional direction of the current block, and the generation unit (3330) can include information indicating the basic motion vector and information indicating the first residual motion vector for the second unidirectional direction in the bitstream.

[0459] As another example, if the basic motion vector is a first unidirectional direction in the list 0 direction or the list 1 direction, and the direction of use of the basic motion vector is a second unidirectional direction different from the first unidirectional direction, the motion information encoding unit (3310) may determine the first residual motion vector of the current block for the first unidirectional direction, and the generation unit (3330) may include information indicating the basic motion vector and information indicating the first residual motion vector for the first unidirectional direction in the bitstream.

[0460] As another example, when the basic motion vector is the first unidirectional in the list 0 direction or the list 1 direction, and the direction of use of the basic motion vector is bidirectional, the motion information encoding unit (3310) determines the first residual motion vector of the current block for the first unidirectional, and the generation unit (3330) can include information indicating the basic motion vector and information indicating the first residual motion vector for the first unidirectional in the bitstream.

[0461] Meanwhile, in one embodiment, the motion information encoding unit (3310) can determine whether to apply multi-pass coding to the current block. The motion information encoding unit (3310) can encode the current block according to two different encoding modes, and then select one of the encoding modes based on the cost. The generation unit (3330) can include information indicating whether the current block has been multi-pass coded and, if multi-pass coding has been applied, information regarding the encoding mode applied to the current block in the bitstream.

[0462] The two different encoding modes may include any one of AMVP mode, merge mode and skip mode, and a preset mode according to the present disclosure.

[0463] In one embodiment, the motion information encoding unit (3310) may determine whether to split the parent block, and may split the parent block into a first child block corresponding to the current block and a second child block adjacent thereto. According to an implementation example, the motion information encoding unit (3310) may also determine whether to split the parent block, and may split the parent block into a first child block corresponding to the current block, a second child block adjacent thereto, and a third child block.

[0464] The motion information encoding unit (3310) can encode the first child block according to the preset mode described above, and the generation unit (3330) can generate a bitstream including information generated as a result of encoding the first child block.

[0465] With respect to the encoding method of the second child block, as an example, the motion information encoding unit (3310) may encode the second child block according to a preset mode according to the present disclosure, similarly to the first child block. In this case, the basic motion vector candidates and the first residual motion vector candidates determined for the parent block may be equally used for the first child block and the second child block. In other words, the basic motion vector candidates and the first residual motion vector candidates are determined at the parent block level, and among the basic motion vector candidates, the basic motion vector of the first child block and the basic motion vector of the second child block may be independently determined, and among the first residual motion vector candidates, the first residual motion vector of the first child block and the first residual motion vector of the second child block may be independently determined.

[0466] As another example, the motion information encoding unit (3310) may determine the motion vector determined for the first child block as the basic motion vector of the second child block, and determine the first residual motion vector of the second child block among the first residual motion vector candidates. The generation unit (3330) may not include information indicating the basic motion vector of the second child block in the bitstream, but instead may include information indicating the first residual motion vector of the second child block in the bitstream.

[0467] As another example, at least one of the basic motion vector, the variation distance, and the variation direction determined in relation to the first child block may also be applied to the second child block. In this case, the motion information encoding unit (3310) may encode the motion vector of the second child block using at least one of the basic motion vector, the variation distance, and the variation direction determined in relation to the first child block.

[0468] Additionally, the motion information encoding unit (3310) may determine only the second residual motion vector associated with one of the first child block and the second child block, and the generation unit (3330) may include information indicating the determined second residual motion vector in the bitstream.

[0469] In one embodiment, the motion information encoding unit (3310) may encode the first child block in a preset mode according to the present disclosure, and may encode the second child block in a mode different from the mode applied to the first child block.

[0470] Figure 34 is a flowchart for explaining an image encoding method according to one embodiment.

[0471] In step S3410, the video encoding device (3300) determines a base motion vector of the current block. The video encoding device (3300) may determine any one of at least one base motion vector candidate as the base motion vector of the current block.

[0472] At step S3420, the video encoding device (3300) determines the first residual motion vector of the current block.

[0473] The video encoding device (3300) can determine first residual motion vector candidates for each of at least one basic motion vector candidate, and determine the first residual motion vector of the current block among the first residual motion vector candidates.

[0474] The video encoding device (3300) may determine a first residual motion vector candidate having a value most similar to a value obtained by subtracting the base motion vector of the current block from the motion vector of the current block as the first residual motion vector of the current block.

[0475] In step S3430, the image encoding device (3300) generates a bitstream generated as a result of encoding the current block.

[0476] The bitstream may include information indicating at least one of whether a preset mode is applied to the current block, a base motion vector of the current block, a first residual motion vector of the current block, a priority of disparity distances for distinguishing first residual motion vector candidates, and a priority of disparity directions for distinguishing first residual motion vector candidates. The generation unit (3330) may include the above information in a bitstream corresponding to at least one level of a coding unit level, a transform unit level, a maximum coding unit level, a slice unit level, and a picture unit level.

[0477] Meanwhile, the embodiments of the present disclosure described above can be written as a program that can be executed on a computer, and the written program can be stored in a medium.

[0478] A medium may be something that permanently stores a computer-executable program, or may be something that temporarily stores it for execution or download. Furthermore, the medium may be a variety of recording or storage means, including a single piece of hardware or a combination of several pieces, and is not limited to media directly connected to a computer system, but may also be distributed across a network. Examples of media include magnetic media such as hard disks, floppy disks, and magnetic tapes; optical recording media such as CD-ROMs and DVDs; magneto-optical media such as floptical disks; and anything configured to store program instructions, including ROM, RAM, and flash memory. Furthermore, other examples of media may include recording or storage media managed by app stores that distribute applications, sites that supply or distribute various software, servers, etc.

[0479] Above, the technical idea of ​​the present disclosure has been described in detail with reference to preferred embodiments, but the technical idea of ​​the present disclosure is not limited to the above embodiments, and various modifications and changes are possible by a person having ordinary knowledge in the art within the scope of the technical idea of ​​the present disclosure.

Claims

1. In a method for decoding motion information, A step of determining the base motion vector of the current block; A step of determining a first residual motion vector for the current block based on information obtained from a bitstream among at least one first residual motion vector candidate distinguished according to a mutation distance and a mutation direction; and A method for decoding motion information, characterized by comprising a step of determining a motion vector of the current block by applying the first residual motion vector to the basic motion vector.

2. In paragraph 1, The step of determining the motion vector of the current block is: A step of obtaining information representing a second residual motion vector related to the current block from a bitstream; and A method for decoding motion information, characterized in that it further includes a step of determining a motion vector of the current block by applying a second residual motion vector determined based on information representing the second residual motion vector to a base motion vector changed by applying the first residual motion vector.

3. In paragraph 1, The method for decoding the above motion information is as follows: Further comprising a step of obtaining an index indicating at least one of a displacement distance and a displacement direction of the first residual motion vector from the bitstream, The step of determining the first residual motion vector is as follows: A method for decoding motion information, characterized by comprising a step of determining a first residual motion vector candidate corresponding to the obtained index among at least one first residual motion vector candidate as a first residual motion vector for the current block.

4. In paragraph 1, The method for decoding the above motion information is as follows: A method for decoding motion information, characterized in that it further comprises a step of determining one of at least one basic motion vector candidate as the basic motion vector of the current block.

5. In paragraph 1, The step of determining the motion vector of the current block is: A step of determining a first residual motion vector for a second unidirectional direction based on the first residual motion vector for the first unidirectional direction, when the base motion vector of the current block corresponds to a bidirectional motion vector, the prediction direction of the current block corresponds to a bidirectional direction, and the first residual motion vector is determined for the first unidirectional direction; A step of determining the first unidirectional motion vector of the current block by applying the first residual motion vector for the first unidirectional basic motion vector to the first unidirectional basic motion vector; and A method for decoding motion information, characterized in that it comprises a step of determining a motion vector for the second unidirectional direction of the current block by applying a first residual motion vector for the second unidirectional direction to the basic motion vector for the second unidirectional direction.

6. In paragraph 5, The step of determining the first residual motion vector for the second unidirectional is: A method for decoding motion information, characterized by comprising a step of determining at least one of a magnitude and a sign of a component value of a first residual motion vector for the second unidirectional motion based on a positional relationship between a reference picture corresponding to a first unidirectional basic motion vector, a reference picture corresponding to a second unidirectional basic motion vector, and a current picture including the current block.

7. In paragraph 1, The step of determining the motion vector of the current block is: A step of determining a basic motion vector of the second unidirectional direction based on the basic motion vector of the first unidirectional direction and determining a first residual motion vector for the second unidirectional direction based on the first residual motion vector for the first unidirectional direction, when the basic motion vector of the current block corresponds to a first unidirectional direction and the prediction direction of the current block corresponds to a second unidirectional direction different from the first unidirectional direction; and A method for decoding motion information, characterized in that it comprises a step of determining a motion vector of the current block by applying a first residual motion vector for the second unidirectional direction to the basic motion vector of the second unidirectional direction.

8. In paragraph 1, The step of determining the motion vector of the current block is: A step of determining a second unidirectional basic motion vector based on the first unidirectional basic motion vector, and determining a first residual motion vector for the second unidirectional based on the first residual motion vector for the first unidirectional, when the basic motion vector of the current block corresponds to a first unidirectional motion vector and the prediction direction of the current block corresponds to a bidirectional motion vector; A step of determining the first unidirectional motion vector of the current block by applying the first residual motion vector for the first unidirectional basic motion vector to the first unidirectional basic motion vector; and A method for decoding motion information, characterized in that it comprises a step of determining the second unidirectional motion vector of the current block by applying the first residual motion vector for the second unidirectional to the second unidirectional basic motion vector.

9. In paragraph 1, The method for decoding the above motion information is as follows: A method for decoding motion information, characterized in that it further comprises a step of entropy decoding at least some of the indices representing the first residual motion vector from the bitstream according to a context model.

10. In paragraph 1, The method of decoding motion information is as follows: Further comprising the step of determining at least one first residual motion vector candidate for each of at least one base motion vector candidate, A method for decoding motion information, characterized in that the first residual motion vector candidate determined corresponding to the bidirectional basic motion vector candidate among the at least one first residual motion vector candidate includes a first residual motion vector candidate in the list 0 direction and a first residual motion vector candidate in the list 1 direction, which include values ​​of the same sign or opposite sign.

11. In paragraph 10, The magnitude of at least one value among the first residual motion vector candidate in the list 0 direction and the first residual motion vector candidate in the list 1 direction is A method for decoding motion information, characterized in that the motion information is scaled by taking into account the distance between a first reference picture corresponding to a first unidirectional basic motion vector candidate, a current picture including the current block, and a second reference picture corresponding to the second unidirectional basic motion vector candidate.

12. In paragraph 1, The method for decoding the above motion information is as follows: If the current block corresponds to a first child block divided from a parent block, a step of determining the motion vector of the current block as the base motion vector of the second child block; and A method for decoding motion information, characterized in that it further comprises a step of determining a motion vector of the second child block by applying the first residual motion vector determined for the second child block to the basic motion vector of the second child block.

13. In paragraph 1, The method for decoding the above motion information is as follows: A method for decoding motion information, characterized in that it further includes a step of applying at least one of information indicating a basic motion vector obtained in relation to the current block, information indicating a variation distance, and information indicating a variation direction to a second child block, when the current block corresponds to a first child block divided from a parent block.

14. In paragraph 1, The method for decoding the above motion information is as follows: A method for decoding motion information, characterized in that it further comprises a step of obtaining information indicating at least one of whether a predetermined encoding mode is applied to the current block, a base motion vector for the current block, a first residual motion vector for the current block, a priority of mutation distances, and a priority of mutation directions at at least one level among a transform unit level, an encoding unit level, a maximum encoding unit level, a slice level, and a picture level.

15. In a method for encoding motion information, A step of determining the base motion vector of the current block; A step of determining a first residual motion vector for the current block among at least one first residual motion vector candidate distinguished according to a displacement distance and a displacement direction based on a difference between the motion vector of the current block and the base motion vector; and A method for encoding motion information, comprising the step of generating a bitstream including at least one of information representing the basic motion vector and information representing the first residual motion vector.