Methods and equipment for encoding and decoding video data.

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

Patent Information

Application Number
VN1202406448
Authority / Receiving Office
VN · VN
Patent Type
Patents
Current Assignee / Owner
Priority Date
2018-12-21
Filing Date
2019-10-10
Publication Date
2026-11-27
Estimated Expiration
2039-10-10

AI Technical Summary

Technical Problem

Current video encoding and decoding methods face inefficiencies in predicting and encoding motion vectors, particularly in codecs like H.264 and HEVC, where accurate prediction and efficient encoding of motion vectors are hindered by limitations in interpolation and reference block selection.

Method used

A method and apparatus for encoding and decoding motion vectors that generate a merge candidate list of neighboring blocks, determine merge difference mode information, and use merge motion vector differences to efficiently predict and encode motion vectors, improving prediction accuracy and efficiency.

Benefits of technology

This approach enhances the prediction and encoding of motion vectors, leading to improved video encoding and decoding performance by effectively utilizing neighboring blocks and merge candidate information, thereby optimizing video compression.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure VN1202406448_0
    Figure VN1202406448_0
Patent Text Reader

Abstract

The invention relates to a method and apparatus for encoding and decoding video data, a computer-readable recording, wherein the method for decoding video data comprises the following steps: generating a list of coupled motion vectors containing adjacent image blocks referenced to predict the motion vector of the current image block in skip mode or combination mode; determining the basic motion vector from a coupled motion vector determined from the list of coupled motion vectors based on information about the coupled motion vector when the differential combination motion vector is used according to information about the differential combination mode indicating whether the differential combination motion vector is used and the motion vector determined from the list of coupled motion vectors;Determine the motion vector of the current image block by using the basic motion vector and the differential combined motion vector of the current image block. The differential combined motion vector is determined by using the distance index and direction index of the differential combined motion vector of the current image block; and reconstruct the current image block using the motion vector of the current image block.
Need to check novelty before this filing date? Find Prior Art

Description

Video encoding and decoding method using motion vector difference, and motion information encoding and decoding device

[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 vectors used in video encoding and decoding, and a method and device for decoding motion vectors.

[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 a motion vector according to one embodiment, and a device for encoding and decoding a motion vector, have as their technical task the efficient prediction of a motion vector and the encoding and decoding of the motion vector.

[0006] A method for decoding a motion vector according to an embodiment of the present disclosure may include the steps of: generating a merge candidate list including neighboring blocks referenced for predicting a motion vector of a current block in a skip mode or a merge mode; obtaining merge differential mode information indicating whether to use a motion vector determined from the merge candidate list and a merge motion vector differential; obtaining merge candidate information from a bitstream when the merge motion vector differential is used according to the merge differential mode information, and determining a base motion vector from one candidate determined based on the merge candidate information among the merge candidate list; determining a motion vector of the current block using the base motion vector and the merge motion vector differential determined using a distance index of the merge motion vector differential of the current block and a direction index of the merge motion vector differential; and restoring the current block using the motion vector of the current block.

[0007] A method for encoding and decoding a motion vector according to one embodiment, and a device for encoding and decoding motion information, refer to the motion vector of a neighboring block to efficiently predict a motion vector, and effectively provide a list of neighboring blocks suitable for reference.

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

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

[0010] FIG. 1 illustrates a schematic block diagram of an image decoding device according to one embodiment.

[0011] FIG. 2 illustrates a flowchart of an image decoding method according to one embodiment.

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

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

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

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

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

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

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

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

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

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

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

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

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

[0025] Figure 16 is a block diagram showing a video encoding and decoding system.

[0026] FIG. 17 illustrates a block diagram of a video decoding device according to one embodiment.

[0027] FIG. 18 illustrates a flowchart of a video decoding method according to one embodiment.

[0028] FIG. 19 illustrates a block diagram of a video encoding device according to one embodiment.

[0029] FIG. 20 illustrates a flowchart of a video encoding method according to one embodiment.

[0030] Figure 21 shows the positions of motion vector candidates according to one embodiment.

[0031] Figure 22 is a drawing showing motion vector candidates displayed on a coordinate plane.

[0032] Figure 23 shows the values ​​and meanings of merge candidate information, merge differential distance index, and merge differential direction index according to one embodiment.

[0033] Figure 24 illustrates a formula for obtaining a motion vector using the difference between a reference motion vector and a merge motion vector according to one embodiment.

[0034] FIG. 25 illustrates a syntax for obtaining merge differential mode information, merge candidate information, merge differential distance index, and merge differential direction index according to one embodiment.

[0035] FIG. 26 illustrates a syntax for obtaining merge differential mode information, merge candidate information, merge differential distance index, and merge differential direction index according to another embodiment.

[0036] FIG. 27 illustrates a reference table for determining a binarization method of merge-related information according to another embodiment.

[0037] FIG. 28 illustrates a reference table for determining context information of merge-related information according to another embodiment.

[0038] A method for decoding motion information according to an embodiment of the present disclosure may include the steps of: generating a merge candidate list including neighboring blocks referenced for predicting a motion vector of a current block in a skip mode or a merge mode; obtaining merge differential mode information indicating whether to use a motion vector determined from the merge candidate list and a merge motion vector differential; obtaining merge candidate information from a bitstream when the merge motion vector differential is used according to the merge differential mode information, and determining a base motion vector from one candidate determined based on the merge candidate information among the merge candidate list; determining a motion vector of the current block using the base motion vector and the merge motion vector differential determined using a distance index of the merge motion vector differential of the current block and a direction index of the merge motion vector differential; and restoring the current block using the motion vector of the current block.

[0039] The step of determining the merge motion vector difference according to one embodiment may include the step of performing entropy decoding using context information on the bitstream to obtain a first bin of the distance index of the merge motion vector difference; and the step of performing entropy decoding through a bypass mode on the bitstream to obtain the remaining bins of the distance index of the merge motion vector difference.

[0040] According to one embodiment, the maximum number of candidates allowed for selection by the merge candidate information may be less than the maximum number of candidates included in the merge candidate list.

[0041] According to one embodiment, the merge candidate information, which is 1 bit of information, can be obtained through entropy decoding that applies the one context information to the bitstream.

[0042] In one embodiment, when prediction is performed in the merge mode, the number of context information required to obtain a general merge index pointing to one candidate among the merge candidate list and the number of context information required to obtain the merge candidate information may be the same.

[0043] A motion information decoding device according to one embodiment of the present disclosure may include: an inter-prediction information obtaining unit that obtains merge differential mode information indicating whether a motion vector determined from a merge candidate list of a current block and a merge motion vector differential are used, and if the merge motion vector differential is used according to the merge differential mode information, obtains merge candidate information from a bitstream; an inter-prediction performing unit that generates the merge candidate list including neighboring blocks referenced for predicting the motion vector of the current block in a skip mode or a merge mode, determines a base motion vector from one candidate determined based on the merge candidate information among the merge candidate list, determines the merge motion vector differential using a distance index of the merge motion vector differential of the current block and a direction index of the merge motion vector differential, and determines a motion vector of the current block using the base motion vector and the merge motion vector differential; and a restoration unit that restores the current block using the motion vector.

[0044] According to one embodiment, the inter prediction information acquisition unit may perform entropy decoding using context information on the bitstream to acquire a first bin of the distance index of the merge motion vector difference, and perform entropy decoding through a bypass mode on the bitstream to acquire the remaining bins of the distance index of the merge motion vector difference.

[0045] In one embodiment, the maximum number of candidates allowed for selection by the merge candidate information may be less than the maximum number of candidates included in the merge candidate list.

[0046] According to one embodiment, the inter prediction acquisition unit can acquire the merge candidate information, which is 1 bit of information, through entropy decoding that applies the one context information to the bitstream.

[0047] In one embodiment, when prediction is performed in the merge mode, the number of context information required to obtain a general merge index pointing to one candidate among the merge candidate list and the number of context information required to obtain the merge candidate information may be the same.

[0048] A video encoding method according to one embodiment of the present disclosure may include the steps of: generating a merge candidate list including neighboring blocks referenced for predicting a motion vector of a current block when inter prediction is performed on the current block in one of a skip mode and a merge mode; generating merge difference information indicating whether a base motion vector determined in the merge candidate list of the current block and a merge motion vector difference are used; generating merge candidate information indicating one base motion vector among the merge candidate list when the merge motion vector difference is used; and generating a distance index of the merge motion vector difference and a direction index of the merge motion vector difference corresponding to a difference between the base motion vector and the motion vector of the current block.

[0049] According to one embodiment, the step of generating the distance index of the merge motion vector difference and the direction index of the merge motion vector difference may include the step of performing entropy encoding using context information on a first bin of the distance index of the merge motion vector difference; and the step of performing entropy encoding through a bypass mode on the remaining bins of the distance index of the merge motion vector difference.

[0050] According to one embodiment of the present disclosure, a video encoding device may include: an inter-prediction performing unit configured to perform inter-prediction on a current block to determine a motion vector of the current block, and generate a merge candidate list including neighboring blocks referred to for predicting a motion vector of the current block when inter-prediction is performed on the current block in one of a skip mode and a merge mode; and an inter-prediction information generating unit configured to generate merge difference information indicating whether a base motion vector determined in the merge candidate list of the current block and a merge motion vector difference are used, and when the merge motion vector difference is used, generate merge candidate information indicating one base motion vector among the merge candidate list, and generate a distance index of the merge motion vector difference and a direction index of the merge motion vector difference corresponding to a difference between the base motion vector and the motion vector of the current block.

[0051] According to one embodiment, the inter prediction information generation unit may perform entropy encoding using context information on the first bin of the distance index of the merge motion vector difference, and perform entropy encoding through a bypass mode on the remaining bins of the distance index of the merge motion vector difference.

[0052] A computer-readable recording medium having recorded thereon a program for implementing a video decoding method according to one embodiment of the present disclosure on a computer is disclosed.

[0053] A computer-readable recording medium having recorded thereon a program for implementing a video encoding method according to one embodiment of the present disclosure on a computer is disclosed.

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

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

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

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

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

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

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

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

[0062] Hereinafter, with reference to FIGS. 1 to 16, an image encoding device, an image decoding device, an image encoding method, and an image decoding method according to an embodiment are described in detail. With reference to FIGS. 3 to 16, a method for determining a data unit of an image according to an embodiment is described, and with reference to FIGS. 17 to 28, a video encoding / decoding method in which an inter prediction method is extended using a probabilistic motion representation method according to an embodiment is described.

[0063] Hereinafter, with reference to FIGS. 1 and 2, a method and device for adaptively selecting based on various types of encoding units according to one embodiment of the present disclosure are described.

[0064] FIG. 1 illustrates a schematic block diagram of an image decoding device according to one embodiment.

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

[0066] The receiving unit (110) can receive a bitstream. The bitstream includes information obtained by encoding an image by an image encoding device (2200) described below. In addition, the bitstream can be transmitted from the image encoding device (2200). The image encoding device (2200) and the image decoding device (100) can be connected by wire or wirelessly, and the receiving unit (110) can receive the bitstream by wire or wirelessly. The receiving unit (110) can receive the bitstream from a storage medium such as an optical medium or a hard disk. 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.

[0067] The operation of the video decoding device (100) will be described in more detail with reference to FIG. 2.

[0068] FIG. 2 illustrates a flowchart of an image decoding method according to one embodiment.

[0069] According to one embodiment of the present disclosure, the receiving unit (110) receives a bitstream.

[0070] The image decoding device (100) performs a step (210) of obtaining a binstring corresponding to a splitting shape mode of an encoding unit from a bitstream. The image decoding device (100) performs a step (220) of determining a splitting rule of the encoding unit. In addition, the image decoding device (100) performs a step (230) 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.

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

[0072] First, a picture can be divided into one or more slices or one or more tiles. A slice or a tile 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).

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

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

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

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

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

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

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

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

[0081] 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. In contrast, the maximum size of a 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 picture may be 32x32, and the maximum size of a luma coding block capable of ternary splitting in a P picture or a B picture may be 64x64.

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

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

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

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

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

[0087] 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 ternaries in the horizontal direction can be determined as 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 ternaries in the vertical direction can be determined as ternary vertical split (SPLIT_BT_VER).

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

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

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

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

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

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

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

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

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

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

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

[0099] 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 (2200) 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.

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

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

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

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

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

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

[0106] 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).

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

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

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

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

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

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

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

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

[0115] 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).

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

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

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

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

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

[0121] 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).

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

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

[0124] 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).

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

[0126] 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).

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

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

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

[0130] 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 be a process corresponding to the 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.

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

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

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

[0134] 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 including a boundary that divides the long side of the current encoding unit in half as a sample from which predetermined information can be obtained.

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

[0136] 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).

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

[0138] 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).

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

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

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

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

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

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

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

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

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

[0148] According to one embodiment, the image decoding device (100) may split the first encoding unit (900) based on the split shape mode information obtained through the receiver (110). The first encoding unit (900) having a square shape may be split into four square-shaped encoding units or may be split into a plurality of non-square encoding units. For example, referring to FIG. 9, when the first encoding unit (900) is square and the split shape mode information indicates that it is split into non-square encoding units, the image decoding device (100) may split the first encoding unit (900) into a plurality of non-square encoding 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.

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

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

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

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

[0153] 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 obtained through the receiver (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.

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

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

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

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

[0158] 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).

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0175] 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).

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

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

[0178] 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).

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

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

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

[0182] Furthermore, the image decoding device (100) can 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) can include non-square second encoding units (1414a, 1414c) and square second encoding units (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).

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

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

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

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

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

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

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

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

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

[0192] 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, tile, tile group, maximum coding unit, etc.) that may include at least one reference coding unit.

[0193] According to one embodiment, the receiving unit (110) of the image decoding device (100) can obtain 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.

[0194] 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 receiving unit (110) may obtain only an index for identifying the size and shape of the reference coding unit for each slice, slice segment, tile, tile group, maximum coding unit, etc., among the various data units (e.g., sequences, pictures, slices, slice segments, tiles, tile groups, maximum coding units, etc.) that satisfy a predetermined condition (e.g., data units having a size smaller than a slice) from the bitstream. 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.

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

[0196] According to one embodiment, the video decoding device (100) may obtain and use block shape information indicating the shape of the current encoding unit or split shape mode information indicating a method of splitting the current encoding unit from the 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, a slice segment header, a tile header, and a tile group 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, each reference encoding unit, and each processing block.

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

[0198] 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 (2200). 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, a slice segment header, a tile header, and a tile group header. The video decoding device (100) can determine the segmentation rule differently according to a frame, a slice, a tile, a temporal layer, a maximum coding unit, or an coding unit.

[0199] The image decoding device (100) may determine a segmentation rule based on the block shape of the encoding unit. The block shape may include the size, shape, width and height ratio, and direction of the encoding unit. The image decoding device (100) may 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) may determine the segmentation rule based on information obtained from the received bitstream.

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

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

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

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

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

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

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

[0207] Figure 16 is a block diagram showing a video encoding and decoding system.

[0208] The encoding unit (1610) of the image encoding and decoding system (1600) transmits an encoded bitstream of an image, and the decoding unit (1650) receives the bitstream and decodes it to output a restored image. Here, the decoding unit (1650) may have a configuration similar to that of the image decoding device (100).

[0209] In the encoding unit (1610), the prediction encoding unit (1615) outputs a reference image through inter prediction and intra prediction, and the transformation and quantization unit (1616) quantizes residual data between the reference image and the current input image into quantized transform coefficients and outputs them. The entropy encoding unit (1625) 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 (1630), and the restored spatial domain data are output as a restored image through the deblocking filtering unit (1635) and the loop filtering unit (1640). The restored image can be used as a reference image of the next input image through the prediction encoding unit (1615).

[0210] The encoded image data among the bitstreams received by the decoding unit (1650) is restored to residual data in the spatial domain through the entropy decoding unit (1655) and the inverse quantization and inverse transformation unit (1660). The reference image and residual data output from the prediction decoding unit (1675) are combined to form image data in the spatial domain, and the deblocking filtering unit (1665) and the loop filtering unit (1670) 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 (1675).

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

[0212] Hereinafter, with reference to FIGS. 17 to 20, a method and apparatus for encoding or decoding a video by extending an inter prediction method using a probabilistic motion representation method according to an embodiment disclosed in the present specification are described.

[0213] FIG. 17 illustrates a block diagram of a video decoding device according to one embodiment.

[0214] Referring to FIG. 17, a video decoding device (1700) according to one embodiment may include an inter prediction information acquisition unit (1710), an inter prediction performance unit (1720), and a restoration unit (1730).

[0215] A video decoding device (1700) 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.

[0216] A video decoding device (1700) according to one embodiment may include a central processor (not shown) that controls an inter-prediction information acquisition unit (1710), an inter-prediction performance unit (1720), and a restoration unit (1730). Alternatively, the inter-prediction information acquisition unit (1710), the inter-prediction performance unit (1720), and the restoration unit (1730) may each be operated by their own processors (not shown), and the video decoding device (1700) may be operated as a whole as the processors (not shown) organically operate with each other. Alternatively, the inter-prediction information acquisition unit (1710), the inter-prediction performance unit (1720), and the restoration unit (1730) may be controlled under the control of an external processor (not shown) of the video decoding device (1700).

[0217] The video decoding device (1700) may include one or more data storage units (not shown) in which input / output data of an inter-prediction information acquisition unit (1710), an inter-prediction performance unit (1720), and a restoration unit (1730) are stored. The video decoding device (1700) may also include a memory control unit (not shown) that controls data input / output of the data storage unit (not shown).

[0218] The video decoding device (1700) 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 image decoding. According to one embodiment, the internal video decoding processor of the video decoding device (1700) can implement a basic image decoding operation not only as a separate processor, but also by including a central processing unit or a graphics processing unit with an image decoding processing module.

[0219] The video decoding device (1700) may be included in the video decoding device (100) described above. For example, the inter prediction information acquisition unit (1710) may be included in the bitstream acquisition unit (110) of the video decoding device (100) illustrated in FIG. 1, and the inter prediction performing unit (1720) and the restoration unit (1730) may be included in the decoding unit (120) of the video decoding device (100).

[0220] The inter prediction information acquisition unit (1710) 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 coding unit, or a transformation unit.

[0221] The inter prediction information acquisition unit (1710) 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 inter prediction information acquisition unit (1710) 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.

[0222] The bitstream may include information indicating a prediction mode of a current block, and the prediction mode of the current block may include an intra mode and an inter mode. If the prediction mode of the current block is an inter mode, a motion vector encoding / decoding method may include at least one of a merge mode, a skip mode, and a merge motion vector differential mode according to the present disclosure. The merge motion vector differential mode may be a mode for determining a predicted motion vector of the current block by applying a motion vector differential, which is distinguished according to a differential distance and a differential direction, to one reference motion vector determined based on merge motion vector candidates.

[0223] In one embodiment, information related to a merge motion vector differential mode can be obtained from a bitstream. The information related to the merge motion vector differential mode according to one embodiment can include at least one of information indicating whether the merge motion vector differential mode is applied to a current block (hereinafter, “merge differential mode information”), information indicating a base motion vector of the current block (hereinafter, “merge candidate information”), information indicating a differential distance from a base motion vector to motion vector candidates (hereinafter, “difference distance index”), and information indicating a differential direction from a base motion vector to motion vector candidates (hereinafter, “difference direction index”).

[0224] The inter prediction information acquisition unit (1710) can acquire information related to the merge motion vector difference mode at a level corresponding to at least one unit among an encoding unit, a transformation unit, a maximum encoding unit, a slice unit, and a picture unit.

[0225] The inter prediction unit (1720) determines the motion vector of the current block based on information included in the bitstream.

[0226] The inter prediction performing unit (1720) can determine whether the merge motion vector difference mode is applied to the current block based on information included in the bitstream. Information indicating whether the merge motion vector difference mode is applied may include a flag or an index.

[0227] In one example, the inter prediction information acquisition unit (1710) can extract information indicating whether the merge motion vector difference mode is applied from the bitstream when the skip mode or merge mode is applied to the current block.

[0228] When the merge motion vector difference mode is applied to the current block, motion vector candidates can be set along variable difference distances and difference directions from the base motion vector.

[0229] The above differential distance is a value determined based on a basic pixel unit (e.g., 1 / 4 pixel unit), and the differential distance can indicate how many basic pixel units there is a difference. For example, a differential distance of 1 between a basic motion vector and a motion vector can mean that the motion vector and the basic motion vector differ by a pixel distance corresponding to one 1 / 4 pixel unit. The differential distance can have a value corresponding to an integer, a rational number, or an irrational number.

[0230] If the minimum pixel unit that the motion vector of the current block can point to is the same as the basic pixel unit, the inter prediction performing unit (1720) can determine motion vectors according to a predetermined differential distance.

[0231] However, if the minimum pixel unit that the motion vector of the current block can point to is different from the basic pixel unit, the inter prediction performing unit (1720) can scale a predetermined differential distance and then determine a motion vector candidate for the basic motion vector based on the scaled differential distance.

[0232] If the motion vector of the current block can point to pixels corresponding to integer pixel units, 1 / 2 pixel units, 1 / 4 pixel units, and 1 / 8 pixel units, the smallest pixel unit that the motion vector of the current block can point to is 1 / 8 pixel units. In addition, if the basic pixel unit is 1 / 4 pixel units, the inter prediction performing unit (1720) can upscale the differential distance for determining the motion vector.

[0233] In one example, the inter prediction performing unit (1720) can scale the differential distance according to the ratio of the basic pixel unit and the minimum pixel unit that the motion vector of the current block can point to.

[0234] In one example, the inter prediction performing unit (1720) can upscale the differential distance if the basic pixel unit is larger than the minimum pixel unit that the motion vector of the current block can point to.

[0235] In one embodiment, the base motion vector of the current block may be determined from a merge candidate list used in skip mode and merge mode. The merge candidate list may include 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. Therefore, according to one embodiment, the base motion vector may be determined from the motion vector of the neighboring block determined from the merge candidate list.

[0236] The surrounding blocks 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. In addition, 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.

[0237] In one embodiment, the inter prediction unit (1720) may determine motion vectors of surrounding blocks related to the current block as base motion vectors. The inter prediction unit (1720) may determine a base motion vector from a merge candidate list using merge candidate information obtained from a bitstream.

[0238] According to one embodiment, the merge candidate information can only point to the second candidate at most in the merge candidate list.

[0239] Alternatively, the inter prediction unit (1720) may determine the base motion vector by transforming the motion vectors of surrounding blocks related to the current block. In one embodiment, the inter prediction unit (1720) may determine the base motion vector in the same way as the method for determining the candidate list of the motion vector predictor in the AMVP mode of the HEVC standard.

[0240] In one embodiment, the inter prediction performing unit (1720) may determine a zero motion vector having 0 as a component as a base motion vector.

[0241] According to one embodiment, the merge candidate information 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. For example, when the merge candidate information is decoded using a fixed length coding (FLC) method, the cMax value may be 1.

[0242] Once the base motion vector for the current block is determined, the inter prediction performing unit (1720) can determine the motion vector by applying a merge motion vector difference to the base motion vector.

[0243] The inter prediction information acquisition unit (1710) acquires information indicating at least one of a differential distance index and a differential direction index from a bitstream, and the inter prediction performing unit (1720) can determine a merge motion vector difference based on at least one of the differential distance index and the differential direction index. The motion vector of the current block can be determined from the base motion vector.

[0244] An inter prediction information acquisition unit (1710) according to one embodiment decodes a differential distance index using a truncated unary coding method, and at this time, the cMax value may be 7 and the cRiceParam value may be 0. An inter prediction information acquisition unit (1710) according to one embodiment decodes a differential direction index using a fixed length coding (FLC) method, and at this time, the cMax value may be 3 and the cRiceParam value may be 0.

[0245] According to one embodiment, the inter prediction performing unit (1720) can scale the differential distance identified from the bitstream according to the ratio between the basic pixel unit and the minimum pixel unit that the motion vector of the current block can point to. The inter prediction performing unit (1720) can upscale the differential distance identified from the bitstream if the basic pixel unit (e.g., 1 / 4 pixel unit) is larger than the minimum pixel unit (e.g., 1 / 8 pixel unit) that the motion vector of the current block can point to.

[0246] The scaled difference distance can indicate how many minimum pixel units there is a difference. For example, if the minimum pixel unit that the motion vector of the current block can point to is 1 / 8 pixel unit and the scaled difference distance is 2, the inter prediction performing unit (1720) can determine a motion vector that has a difference from the base motion vector by the pixel distance corresponding to two 1 / 8 pixel units.

[0247] As described above, in determining the motion vector of the current block based on the basic motion vector determined from the merge candidate list, a predetermined differential distance based on the basic pixel unit is used, and since information indicating the differential distance based on the basic pixel unit is signaled through the bitstream, the precision inter prediction performing unit (1720) that can point to a minimum pixel unit different from the basic pixel unit can scale the differential distance signaled through the bitstream according to the minimum pixel unit.

[0248] The difference distance determined based on the basic pixel unit and the difference distance scaled based on the minimum pixel unit can be equal to each other in pixel distance.

[0249] In one embodiment, information indicating the minimum pixel unit that the motion vector of the current block can point to may be included in the bitstream. The inter-prediction information acquisition unit (1710) may acquire information indicating the minimum pixel unit from the bitstream corresponding to at least one level among a block, slice, and picture.

[0250] At least one of the differential distance index and the differential direction index for determining the motion vector of the current block 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.

[0251] According to one embodiment, the inter prediction information acquisition unit (1710) can acquire the difference distance index by performing entropy decoding on some bins using context information (context variable) and performing entropy decoding on the remaining bins in bypass mode.

[0252] By performing entropy decoding using the CABAC (Context Adaptive Binary Arithmetic Coding) method on the bitstream, each syntax element is extracted for each bin, and context information can be used for each bin. Decoding in bypass mode, which performs probability-based entropy decoding with an equal probability (0.5) without using context information, can also be performed. It must be determined whether context information is used for entropy decoding of the current bin, and if so, which context information is used.

[0253] According to one embodiment, the inter prediction information acquisition unit (1710) can perform entropy decoding using context information on the bitstream to acquire the first bin of the distance index of the merge motion vector difference. In addition, the inter prediction acquisition unit (1710) can perform entropy decoding using a bypass mode on the bitstream to acquire the remaining bins of the distance index of the merge motion vector difference.

[0254] According to one embodiment, the inter prediction information acquisition unit (1710) may acquire 2-bit bins representing differential direction indices by performing entropy decoding on the bitstream in bypass mode.

[0255] The inter prediction information acquisition unit (1710) can acquire information representing a residual motion vector from a bitstream at a transformation unit level, an encoding unit level, a maximum encoding unit level, a slice level, or a picture level.

[0256] In a merge motion vector difference mode according to one embodiment, motion vector candidates determinable from a reference motion vector are described below with reference to FIG. 21.

[0257] Figure 21 shows the positions of motion vector candidates according to one embodiment.

[0258] According to one embodiment, the inter prediction performing unit (1720) may determine the motion vector of the current block by applying the merge motion vector difference to the base motion vector. In one embodiment, if the prediction direction of the current block is bi-directional, the merge motion vector difference may be included in the bitstream for only one uni-direction. For example, information indicating the merge motion vector difference may be included in the bitstream for only one uni-direction among the list 0 direction and the list 1 direction.

[0259] Figure 21 illustrates motion vectors that can be determined in merge motion vector difference mode in the case of bidirectional prediction.

[0260] The reference motion vector (2125) in the L0 direction and the reference motion vector (2135) in the L1 direction of the current block (2110) of the current picture (2100) are determined from among the merge candidate lists. The reference motion vector (2125) in the L0 direction points to a dotted line-shaped position among the L0 reference picture (2120), and the reference motion vector (2135) in the L1 direction points to a dotted line-shaped position among the L1 reference picture (2130).

[0261] However, in the merge motion vector difference mode, motion vector differences can be applied to the reference motion vector (2125) and the reference motion vector (2135) in the L1 direction, respectively, based on the difference direction index and the difference distance index.

[0262] For example, the distance between the reference motion vector and the motion vector candidate can be determined to be s, 2s, or 3s depending on the differential distance index. If the differential distance index indicates s, the motion vector candidate generated as a result of applying the motion vector difference to the reference motion vector can indicate the location of the black circle among the L0 reference picture (2120) and the L1 reference picture (2130). If the differential distance index indicates 2s, the motion vector candidate generated as a result of applying the motion vector difference to the reference motion vector can indicate the location of the white circle among the L0 reference picture (2120) and the L1 reference picture (2130).

[0263] For example, the direction between the reference motion vector and the motion vector candidate can be determined as + or - in the x, y-axis direction based on the difference direction index. Specifically, the difference direction index can point to one of (+, 0), (-, 0), (0, +), and (0, -) in the (x, y)-axis direction.

[0264] Accordingly, by combining the differential distance index and the differential direction index, a motion vector pointing to the location of one of the L0 reference picture (2120) and the L1 reference picture (2130) can be determined.

[0265] Hereinafter, a method for determining motion vector candidates that can be determined from a basic motion vector will be described with reference to FIG. 22. FIG. 22 is a drawing showing motion vector candidates displayed on a coordinate plane, and shows motion vector candidates determined according to a predetermined differential distance based on a basic pixel unit corresponding to a 1 / 4 pixel unit.

[0266] Referring to FIG. 22, the inter prediction performing unit (1720) may determine candidates positioned along a predetermined shape when configuring motion vector candidates. The predetermined shape may be a polygon such as a rhombus or square, or a shape similar to a circle.

[0267] The inter prediction unit (1720) can determine candidates at a certain differential distance from a point corresponding to a base motion vector as motion vector candidates. The inter prediction unit (1720) can determine motion vector candidates at a first differential distance from a preset point, motion vector candidates at a second differential distance from the preset point, and motion vector candidates at an n-th differential distance from the preset point. The differential distance may be determined according to a user's definition. Alternatively, the inter prediction unit (1720) can directly determine the differential distance based on information related to the current block, Temporal layer, GOP, etc., or can obtain information indicating the differential distance for determining motion vector candidates through a bitstream.

[0268] The inter prediction performing unit (1720) may also determine a differential distance for determining a motion vector candidate of the current block based on a differential distance determined at a high level higher than the level corresponding to the current block.

[0269] The number of motion vector candidates can be independently determined for each differential distance. The inter prediction unit (1720) can also determine the number of motion vector candidates for each differential distance of the current block based on the number information determined at a higher level than the level corresponding to the current block.

[0270] Figure 22 illustrates a case where the number of motion vector candidates within each differential distance is four. Furthermore, although Figure 22 illustrates a case where the differential distance is three, the number of differential distances is not limited to three.

[0271] Referring to FIG. 22, the inter prediction performing unit (1720) can determine motion vector candidates having a diamond-shaped distribution based on the basic motion vector (x, y) (2201).

[0272] The inter prediction performing unit (1720) can determine motion vector candidates (x+1, y)(2202), (x-1, y)(2203), (x, y+1)(2204), (x, y-1)(2205) that are at a differential distance of 1 from the base motion vector (x, y)(2201).

[0273] The inter prediction performing unit (1720) can determine motion vector candidates (x+2, y)(2206), (x-2, y)(2207), (x, y+2)(2208), (x, y-2)(2209) at a differential distance of 2 from the base motion vector (x, y)(2201).

[0274] The inter prediction performing unit (1720) can determine motion vector candidates (x+4, y)(2210), (x-4, y)(2211), (x, y+4)(2212), (x, y-4)(2213) at a differential distance of 4 from the base motion vector (x, y)(2201).

[0275] In one embodiment, the inter prediction performing unit (1720) may determine motion vector candidates located at different differential distances for each basic motion vector. For example, among the plurality of basic motion vectors, a motion vector candidate having a differential distance of 1 may be determined for a first basic motion vector, and a motion vector candidate having a differential distance of 2 may be determined for a second basic motion vector. Alternatively, for example, a motion vector candidate having a differential distance of 1 and a motion vector candidate having a differential distance of 2 may be determined for the first basic motion vector, and a motion vector candidate having a differential distance of 4 and a motion vector candidate having a differential distance of 8 may be determined for the second basic motion vector.

[0276] In a case where different differential distances are mapped 1:1 for each basic motion vector, the inter prediction information acquisition unit (1710) can acquire only information indicating the basic motion vector of the current block or information indicating the differential distance from the bitstream, and determine the differential distance for specifying the basic motion vector of the current block and the motion vector of the current block.

[0277] As described above, the differential distance for determining motion vector candidates can be determined based on the basic pixel unit. If the minimum pixel unit that the motion vector of the current block can point to is different from the basic pixel unit, the inter prediction performing unit (1720) can scale the preset differential distance for forming a candidate group for each basic motion vector.

[0278] If the motion vector of the current block can point to pixels corresponding to integer pixel units, 1 / 2 pixel units, 1 / 4 pixel units, and 1 / 8 pixel units, the minimum pixel unit that the motion vector of the current block can point to is 1 / 8 pixel units. And, if the basic pixel unit is 1 / 4 pixel unit, the inter prediction performing unit (1720) can upscale the differential distance. In one example, the inter prediction performing unit (1720) can upscale the differential distance according to the ratio of the basic pixel unit and the minimum pixel unit that the motion vector of the current block can point to. If the minimum pixel unit that the motion vector of the current block can point to is m pixel units, the basic pixel unit is n pixel units, and the differential distance is k, the inter prediction performing unit (1720) can upscale the differential distance of k to k * n / m.

[0279] An inter prediction information acquisition unit (1710) according to one embodiment may determine a prediction mode of a current block as one of skip mode and merge mode. In the case of skip mode or merge mode, an inter prediction performing unit (1720) according to one embodiment may generate a merge candidate list including neighboring blocks referenced for predicting a motion vector of the current block in skip mode or merge mode.

[0280] In the case of skip mode or merge mode, the inter prediction information obtaining unit (1710) can obtain merge differential mode information indicating whether to use the motion vector determined from the merge candidate list of the current block and the merge motion vector differential. If the merge motion vector differential is used according to the merge differential mode information, prediction can be performed according to the merge motion vector differential mode that uses the motion vector determined from the merge candidate list of the current block and the merge motion vector differential. If the merge motion vector differential is used according to the merge differential mode information, the inter prediction information obtaining unit (1710) can obtain merge candidate information from the bitstream. The inter prediction performing unit (1720) according to an embodiment can determine a base motion vector from one candidate determined based on the merge candidate information among the merge candidate list. The inter prediction performing unit (1720) can determine the merge motion vector difference using the distance index of the merge motion vector difference of the current block and the direction index of the merge motion vector difference, and can determine the motion vector of the current block using the base motion vector and the merge motion vector difference.

[0281] According to one embodiment, a restoration unit (1730) can restore a current block using a motion vector of the current block. The restoration unit (1730) can determine a reference block within a reference picture using the motion vector of the current block, and determine prediction samples corresponding to the current block from reference samples included in the reference block.

[0282] In one embodiment, when the prediction mode of the current block is the merge mode and the merge motion vector difference mode is adopted, the inter prediction performing unit (1720) can determine the base motion vector of the current block from the merge candidate list and determine the motion vector of the current block using the base motion vector and the merge motion vector difference. When the prediction mode of the current block is the merge mode, the video decoding device (1700) can parse the transform coefficients of the current block from the bitstream and perform inverse quantization and inverse transformation on the transform coefficients to obtain residual samples. The restoration unit (1730) can determine the restoration samples of the current block by combining the residual samples of the current block with the prediction samples of the current block.

[0283] Even when the prediction mode of the current block according to one embodiment is the skip mode and the merge motion vector difference mode is adopted, the inter prediction performing unit (1720) can determine the motion vector of the current block using the base motion vector and the merge motion vector difference determined from the merge candidate list. However, since the prediction mode of the current block is the skip mode, the video decoding device (1700) does not parse the transform coefficients of the current block from the bitstream and thus does not obtain a residual sample. In the skip mode, the restoration unit (1730) can determine the prediction samples of the current block as the restoration samples of the current block without the residual sample.

[0284] Hereinafter, a video decoding method for performing inter prediction by obtaining prediction information to execute a merge motion vector difference mode in skip mode or merge mode is described with reference to FIG. 18.

[0285] FIG. 18 illustrates a flowchart of a video decoding method according to one embodiment.

[0286] In step 1810, if the prediction mode of the current block is determined to be skip mode or merge mode, the inter prediction performing unit (1720) can generate a merge candidate list including neighboring blocks referenced to predict the motion vector of the current block.

[0287] In step 1820, the inter prediction information acquisition unit (1710) can acquire merge difference mode information indicating whether to use the motion vector determined from the merge candidate list of the current block and the merge motion vector difference. That is, the merge difference mode information indicates whether the merge motion vector difference mode is applied when the current block is in skip mode or merge mode.

[0288] The inter prediction information acquisition unit (1710) can perform entropy decoding using context information to acquire merge differential mode information in case of skip mode or merge mode.

[0289] Once the merge difference mode information is obtained, proceed to step 1830.

[0290] In step 1830, the inter prediction information acquisition unit (1710) can acquire merge candidate information from the bitstream when the merge motion vector difference is used according to the merge difference mode information. The merge candidate information indicates one candidate among the merge candidate list. The inter prediction information acquisition unit (1710) can determine the base motion vector from one candidate among the merge candidate list, which is determined based on the merge candidate information.

[0291] The inter prediction performing unit (1710) can determine whether the merge motion vector differential mode is adopted for the current block based on the merge differential mode information acquired when in skip mode or merge mode. The inter prediction information acquiring unit (1710) can acquire merge candidate information from the bitstream when the merge motion vector differential mode is adopted for the current block, i.e., when the motion vector determined in the merge candidate list of the current block and the merge motion vector differential are used.

[0292] Merge candidate information is 1-bit information. Furthermore, merge candidate information can be acquired using a single piece of context information for the first bin of the merge candidate information. The inter-prediction information acquisition unit (1710) can perform entropy decoding using context information to acquire merge candidate information in skip mode or merge mode.

[0293] When the merge motion vector difference mode is adopted in skip mode or merge mode, the maximum number of candidates allowed to be selected by the merge candidate information may be less than the maximum number of candidates included in the merge candidate list. For example, since the merge candidate information is a 1-bit flag, the merge candidate information may point to one of at most two candidates in the merge candidate list.

[0294] In one embodiment, when prediction is performed in merge mode, the number of context information required to obtain a general merge index pointing to one candidate among the merge candidate list and the number of context information required to obtain merge candidate information may be the same.

[0295] In step 1840, the inter prediction performing unit (1720) determines the merge motion vector difference of the current block using the distance index of the merge motion vector difference of the current block and the direction index of the merge motion vector difference, and can determine the motion vector of the current block using the base motion vector and the merge motion vector difference.

[0296] The inter prediction information acquisition unit (1710) can perform entropy decoding on the bitstream through a bypass mode to obtain two bins indicating the direction index of the merge motion vector difference. The inter prediction information acquisition unit (1710) can perform entropy decoding using context information on the bitstream to obtain the first bin indicating the distance index of the merge motion vector difference, and perform entropy decoding through a bypass mode to obtain the remaining bins indicating the distance index of the merge motion vector difference.

[0297] In step 1850, a restoration unit (1730) according to an embodiment can restore the current block using the motion vector of the current block. The restoration unit (1730) can determine a reference block in a reference picture using the motion vector of the current block, and determine prediction samples corresponding to the current block from reference samples included in the reference block. The restoration unit (1730) can determine the restoration samples of the current block by adding the prediction samples of the current block and the residual samples of the current block in a prediction mode other than the skip mode. In a case where there are no residual samples, such as in the skip mode, the restoration samples of the current block can be determined using only the prediction samples of the current block.

[0298] In the case of a conventional motion vector prediction method (AMVP or ATMVP) that is neither skip mode nor merge mode, the video decoding device (1700) obtains a motion vector predictor index and a motion vector differential. The video decoding device (1700) can determine a motion vector predictor indicated by the motion vector predictor index from a motion vector predictor list, and determine a motion vector by combining motion vector differential information with the motion vector predictor.

[0299] Skip mode and merge mode differ from conventional motion vector prediction methods in that they do not utilize motion vector differentials. However, if the merge motion vector differential mode is adopted in skip mode or merge mode, the merge motion vector differential is utilized. Compared to conventional motion vector prediction methods and motion vector differentials, the merge motion differential in merge motion vector differential mode offers a simpler representation method.

[0300] As a specific example, information required to express the conventional motion vector difference in the L0 prediction direction or the L1 prediction direction includes information abs_mvd_greater0_flag indicating whether the absolute value of the motion vector difference is greater than 0, information abs_mvd_greater1_flag indicating whether the absolute value of the motion vector difference is greater than 1, information abs_mvd_minus2 indicating a value obtained by subtracting 2 from the absolute value of the motion vector difference, and information mvd_sign_flag indicating the sign of the motion vector difference.

[0301] In contrast, the information required to express the merge motion vector difference in the L0 prediction direction or L1 prediction direction is only the difference direction information and the difference distance index. Therefore, since the merge motion vector difference can be expressed using only the difference direction information and the difference distance index, the number of bits required to signal the merge motion vector difference can be significantly reduced compared to the number of bits required to signal the conventional motion vector difference.

[0302] Hereinafter, a video encoding device that performs inter prediction by adopting a merge motion vector difference mode in a skip mode or a merge mode will be described with reference to FIG. 19.

[0303] FIG. 19 illustrates a block diagram of a video encoding device according to one embodiment.

[0304] Referring to FIG. 19, a video encoding device (1900) according to one embodiment may include an inter prediction performing unit (1910) and an inter prediction information generating unit (1920).

[0305] A video encoding device (1900) can perform inter prediction to encode motion information determined and output it in the form of a bitstream.

[0306] A video encoding device (1900) according to one embodiment may include a central processor (not shown) that controls an inter-prediction performing unit (1910) and an inter-prediction information generating unit (1920). Alternatively, the inter-prediction performing unit (1910) and the inter-prediction information generating unit (1920) may be operated by their own processors (not shown), and the video encoding device (1900) may be operated as a whole as the processors (not shown) organically operate with each other. Alternatively, the inter-prediction performing unit (1910) and the inter-prediction information generating unit (1920) may be controlled under the control of an external processor (not shown) of the video encoding device (1900).

[0307] The video encoding device (1900) may include one or more data storage units (not shown) in which input / output data of the inter prediction performing unit (1910) and the inter prediction information generating unit (1920) are stored. The video encoding device (1900) may also include a memory control unit (not shown) that controls data input / output of the data storage unit (not shown).

[0308] The video encoding device (1900) 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 for video encoding. The internal video encoding processor of the video encoding device (1900) 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.

[0309] An inter prediction performing unit (1910) according to one embodiment can perform inter prediction on a current block to determine a motion vector of the current block.

[0310] An inter prediction information generation unit (1920) according to one embodiment can generate a merge candidate list including neighboring blocks referenced for predictive encoding of a motion vector of a current block when inter prediction is performed on the current block in one of skip mode and merge mode.

[0311] An inter prediction information generation unit (1920) according to one embodiment may determine whether to use the base motion vector and the merge motion vector difference determined from the merge candidate list of the current block in skip mode or merge mode. If the merge motion vector difference is used, the inter prediction information generation unit (1920) may generate merge candidate information and perform entropy encoding on the bit string of the merge candidate information. The merge candidate information refers to the base motion vector among the merge candidate list.

[0312] The inter prediction information generation unit (1920) can generate a distance index of a merge motion vector difference and a direction index of a merge motion vector difference corresponding to the difference between the base motion vector and the motion vector of the current block. The inter prediction information generation unit (1920) can perform entropy encoding on a bit string of the distance index of the merge motion vector difference and perform entropy encoding on a direction index of the merge motion vector difference.

[0313] Hereinafter, a process in which a video encoding device (1900) performs inter prediction by adopting a merge motion vector difference mode in a skip mode or a merge mode will be described with reference to FIG. 20.

[0314] FIG. 20 illustrates a flowchart of a video encoding method according to one embodiment.

[0315] In step 2010, the inter prediction performing unit (1910) may generate a merge candidate list including neighboring blocks referenced for predicting the motion vector of the current block when inter prediction is performed on the current block in one of the skip mode and the merge mode. In step 2020, the inter prediction information generating unit (1920) may generate merge difference information indicating whether to use the base motion vector and the merge motion vector difference determined in the merge candidate list of the current block.

[0316] In step 2030, the inter prediction information generation unit (1920) may generate merge candidate information pointing to one base motion vector among the merge candidate list when a merge motion vector difference is used. The inter prediction information generation unit (1920) may perform entropy encoding on the bit string of the merge candidate information using one piece of context information.

[0317] In step 2040, the inter prediction information generation unit (1920) can generate a distance index of a merge motion vector difference and a direction index of a merge motion vector difference corresponding to the difference between the base motion vector and the motion vector of the current block.

[0318] An inter prediction performing unit (1910) according to one embodiment can determine a motion vector pointing to a reference block within a reference picture of a current block.

[0319] An inter prediction performing unit (1910) according to one embodiment may determine a prediction mode of a motion vector of a current block as one of a skip mode and a merge mode. An inter prediction information generating unit (1920) may generate skip mode information indicating whether the prediction mode of the current block is a skip mode, and merge mode information indicating whether the prediction mode is a merge mode.

[0320] If the prediction mode of the current block is skip mode or merge mode, the inter prediction information generation unit (1920) can determine whether to predict the motion vector of the current block using the merge motion vector difference mode that uses the base motion vector and the merge motion vector difference determined from the merge candidate list of the current block. The inter prediction information generation unit (1920) can generate merge difference mode information that indicates whether the motion vector is predicted using the merge motion vector difference mode.

[0321] An inter prediction information generation unit (1920) according to one embodiment may determine merge candidate information indicating a basic motion vector from among a merge candidate list when motion information is predicted according to a merge motion vector difference mode. The inter prediction information generation unit (1920) may perform entropy encoding by applying one context information to the merge candidate information in order to encode merge candidate information indicating one candidate from among the merge candidate list.

[0322] In one embodiment, the number of candidates that can be indicated by merge candidate information among the merge candidate list is at most 2, so the merge candidate information can be 1-bit information.

[0323] The inter prediction information generation unit (1920) can determine a merge motion vector difference between a motion vector of a current block and a base motion vector, and generate a distance index of the merge motion vector difference of the current block and a direction index of the merge motion vector difference.

[0324] In a case where the prediction mode of the current block according to one embodiment is a merge mode and a merge motion vector difference mode is adopted, the inter prediction information generation unit (1920) can generate merge candidate information indicating the basic motion vector of the current block from among the merge candidate list, and generate differential distance information and differential direction information for indicating the merge motion vector difference between the motion vector of the current block and the basic motion vector.

[0325] If the prediction mode of the current block is merge mode, the video encoding device (1900) can determine samples of a reference block pointed to by the motion vector of the current block as prediction samples of the current block. The video encoding device (1900) can determine residual samples, which are differences between the original samples and prediction samples of the current block. The video encoding device (1900) can encode transform coefficients generated by performing transformation and quantization on the residual samples of the current block.

[0326] According to one embodiment, when the prediction mode of the current block is skip mode, the current block is encoded using only the prediction samples of the current block, so the video encoding device (1900) does not encode the residual samples of the current block. Even when the prediction mode of the current block is skip mode and the merge motion vector differential mode is adopted according to one embodiment, the inter prediction information generating unit (1920) can encode merge differential mode information, merge candidate information, differential distance information, and differential direction information without encoding residual samples.

[0327] The inter prediction information generation unit (1920) can perform entropy encoding by applying one piece of context information to merge candidate information when a motion vector is post-coded in the merge motion vector difference mode. The merge candidate information indicates one candidate from the merge candidate list. According to one embodiment, the merge candidate information is 1-bit information, and thus can be obtained using one piece of context information for the first bin.

[0328]

[0329] In one embodiment, when prediction is performed in merge mode, the number of context information required to obtain a general merge index pointing to one candidate among the merge candidate list and the number of context information required to obtain merge candidate information may be the same.

[0330] The inter prediction information generation unit (1920) can generate entropy encoding for the distance index of the merge motion vector difference of the current block and the direction index of the merge motion vector difference.

[0331] The inter prediction information acquisition unit (1710) according to one embodiment may perform entropy encoding through a bypass mode on each of two bins indicating the direction index of the merge motion vector difference. The inter prediction information acquisition unit (1710) may perform entropy decoding using context information on the first bin indicating the distance index of the merge motion vector difference, and may perform entropy decoding through a bypass mode on each of the remaining bins indicating the distance index of the merge motion vector difference.

[0332] Figure 23 shows the values ​​and meanings of merge candidate information, merge differential distance index, and merge differential direction index according to one embodiment.

[0333] The merge difference distance index represents the distance index of the merge motion vector difference. The merge difference direction index represents the direction index of the merge motion vector difference.

[0334] The video decoding device (1700) can determine the motion vector of the current block based on the merge candidate information, the merge differential distance index, and the merge differential direction index.

[0335] Table 2600 of FIG. 23 illustrates merge candidate information and corresponding motion vector candidates according to one embodiment. The merge candidate list according to one embodiment includes four motion vector candidates (1 st , 2 nd , 3 rd , 4th MV candidate), and the merge candidate information can be indicated by an index (0, 1, 2, 3) indicating one of them.

[0336] In the merge motion vector difference mode, one motion vector candidate indicated by the merge candidate information among the merge candidate list can be determined as the reference motion vector.

[0337] Table 2610 of FIG. 23 shows that a merge differential distance index according to one embodiment is an integer from 0 to 7, and each index can be binarized according to a truncated unary encoding method. The index of the merge differential distance can indicate one of 2 to the power of N (N is 0 to 7). The merge differential distance is determined based on a basic pixel unit, and when the basic pixel unit is 1 / 4, the merge motion vector differential distance corresponding to the merge differential distance index 0 can represent a 1 / 4 pixel distance, and the merge motion vector differential distance corresponding to the merge differential distance index 1 can represent a 1 / 2 pixel distance. The merge motion vector differential distance corresponding to the merge differential distance index 7 can represent a 32 pixel distance.

[0338] As described above, if the minimum pixel unit that the motion vector of the current block can point to is smaller than the basic pixel unit, the merge motion vector differential distance can be scaled according to the ratio between the minimum pixel unit and the basic pixel unit. For example, if the basic pixel unit is 1 / 4 pixel unit and the minimum pixel unit is 1 / 8 pixel unit, if the index indicating the merge motion vector differential distance obtained from the bitstream is 0, the merge motion vector differential distance 1 corresponding to index 0 can be upscaled to 2.

[0339] Also, in Table 2620, the merge motion vector difference direction index of binary 00 points to a motion vector candidate changed along the + direction to the x-axis with the base motion vector as the center, and the merge motion vector difference direction index of binary 11 points to a motion vector candidate changed along the - direction to the y-axis with the base motion vector as the center.

[0340] The merge candidate information, merge differential distance index, and merge differential direction index illustrated in FIG. 23 are merely examples, and the indexes available in the merge motion vector differential mode proposed in the present disclosure are not limited thereto.

[0341] For example, in the merge motion vector difference mode, the number of candidates that can be selected from the merge candidate list is limited to two, and the merge candidate information can be a 1-bit index.

[0342] Figure 24 illustrates a formula for obtaining a motion vector using the difference between a reference motion vector and a merge motion vector according to one embodiment.

[0343] mvLX[x][y][n] represents the motion vector of the current block. x, y represent the x, y coordinates of the current block, and n represents one of the horizontal and vertical components of the motion vector mvLX. mvLX[x][y][0] represents the horizontal component of the motion vector mvLX , and mvLX[x][y][1] represents the vertical component of the motion vector mvLX .

[0344] mxLXN[m] represents the base motion vector indicated by the merge candidate information among the merge candidate list. m represents one of the horizontal component and the vertical component of the base motion vector mvLXN. mvLXN[0] represents the horizontal component of the base motion vector mvLXN, and mvLXN[1] represents the vertical component of the base motion vector mvLXN.

[0345] refineMxLX[l] represents the merge motion vector difference. l represents either the horizontal component or the vertical component of the merge motion vector difference refineMxLX . refineMxLX[0] represents the horizontal component of the merge motion vector difference refineMxLX , and refineMxLX[1] represents the vertical component of the merge motion vector difference refineMxLX .

[0346] In mvLX, mxLXN, and refineMxLX, LX refers to either the L0 prediction direction or the L1 prediction direction. Therefore, mvL0, mxL0N, and refineMxL0 represent the motion vector, base motion vector, and merge motion vector differences in the L0 prediction direction, and mvL1, mxL1N, and refineMxL1 represent the motion vector, base motion vector, and merge motion vector differences in the L1 prediction direction.

[0347] A video decoding device (1700) according to one embodiment obtains merge candidate information from a bitstream, and determines a horizontal direction component mxLXN[0] of a basic motion vector indicated by the merge candidate information among a merge candidate list, and a vertical direction component mxLXN[1] of the basic motion vector.

[0348] A video decoding device (1700) according to one embodiment obtains a merge differential direction index and a merge differential distance index from a bitstream, and determines a horizontal direction component refineMxLX[0] of a merge motion vector difference and a vertical direction component refineMxLX[1] of a merge motion vector difference using the merge differential direction index and the merge differential distance index.

[0349] A video decoding device (1700) according to one embodiment may obtain a horizontal component mvLX[0][0][0] of a motion vector of a current block by adding a horizontal component mxLXN[0] of a base motion vector and a horizontal component refineMxLX[0] of a merge motion vector difference, and may obtain a vertical component mvLX[0][0][1] of a motion vector of a current block by adding a vertical component mxLXN[1] of a base motion vector and a vertical component refineMxLX[1] of a merge motion vector difference.

[0350] FIG. 25 illustrates a syntax for obtaining merge differential mode information, merge candidate information, merge differential distance index, and merge differential direction index according to one embodiment.

[0351] A video decoding device (1700) according to one embodiment can obtain a syntax element cu_skip_flag indicating whether a current block is predicted in skip mode from a coding_unit syntax of a bitstream. If the current block is predicted in skip mode (if(cu_skip_flag)), the video decoding device (1700) can obtain a syntax element umve_flag indicating whether the current block is predicted in merge motion vector difference mode. If umve_flag is 1, the video decoding device (1700) can call the umve_idx_coding syntax. The video decoding device (1700) can obtain, from the umve_idx_coding syntax of the bitstream, a syntax element base_mv_idx corresponding to merge candidate information, a syntax element distance_idx corresponding to a distance index of a merge motion vector difference, and a syntax element direction_idx corresponding to a direction index of a merge motion vector difference.

[0352] The video decoding device (1700) may obtain a syntax element merge_flag indicating whether the current block is predicted in the merge mode if the current block is not predicted in the skip mode (cu_skip_flag is 0). If the current block is predicted in the merge mode (if(merge_flag)), the video decoding device (1700) may obtain a syntax element umve_flag indicating whether the current block is predicted in the merge motion vector differential mode. The video decoding device (1700) may call the umve_idx_coding syntax if umve_flag is 1. The video decoding device (1700) may obtain a syntax element base_mv_idx corresponding to the merge candidate information, a syntax element distance_idx corresponding to the merge differential distance index, and a syntax element direction_idx corresponding to the merge differential direction index from the umve_idx_coding syntax of the bitstream.

[0353] Accordingly, the video decoding device (1700) can obtain the syntax element umve_flag indicating whether prediction is made in the merge motion vector difference mode in the skip mode and the merge mode. Even if the umve_flag of the skip mode and the umve_flag of the merge mode are obtained separately, they can be obtained through entropy decoding using the same context information.

[0354] Additionally, the video decoding device (1700) can obtain merge candidate information base_mv_idx in skip mode and merge mode. Even if the base_mv_idx of skip mode and the base_mv_idx of merge mode are obtained separately, they can be obtained through entropy decoding using the same context information.

[0355] FIG. 26 illustrates a syntax for obtaining merge differential mode information, merge candidate information, merge differential distance index, and merge differential direction index according to another embodiment.

[0356] A video decoding device (1700) according to another embodiment can obtain a syntax element regular_merge_flag indicating whether a current block is encoded in merge mode from a merge_data syntax of a bitstream. If the current block is predicted in merge mode (if(regular_merge_flag==1)), the video decoding device (1700) can obtain a syntax element mmvd_merge_flag indicating whether the current block is predicted in merge motion vector difference mode. If the current block is predicted in merge motion vector difference mode (if(mmvd_merge_flag==1)), the video decoding device (1700) can obtain a syntax element mmvd_cand_flag corresponding to merge candidate information, a syntax element mmvd_distance_idx corresponding to a distance index of the merge motion vector difference, and a syntax element mmvd_direction_idx corresponding to a direction index of the merge motion vector difference.

[0357] The video decoding device (1700) can implicitly consider regular_merge_flag as 1 even if the current block is predicted in skip mode. Accordingly, if the current block is predicted in skip mode, the video decoding device (1700) can obtain a syntax element mmvd_merge_flag indicating whether the current block is predicted in merge motion vector differential mode, and if the current block is predicted in merge motion vector differential mode (if(mmvd_merge_flag==1)), can obtain a syntax element mmvd_cand_flag corresponding to merge candidate information, a syntax element mmvd_distance_idx corresponding to a distance index of the merge motion vector differential, and a syntax element mmvd_direction_idx corresponding to a direction index of the merge motion vector differential.

[0358] According to the merge_data syntax, the video decoding device (1700) can interpret information related to the merge motion vector difference mode (whether predicted by the merge motion vector difference mode, merge candidate information, distance index of the merge motion vector difference, and direction index of the merge motion vector difference) through the same syntax elements, mmvd_merge_flag, mmvd_cand_flag, mmvd_distance_idx, and mmvd_direction_idx, in the case of skip mode and merge mode. However, since the prediction mode of the current block cannot be both skip mode and merge mode, mmvd_merge_flag, mmvd_cand_flag, mmvd_distance_idx and mmvd_direction_idx of skip mode are not acquired at the same time as mmvd_merge_flag, mmvd_cand_flag, mmvd_distance_idx and mmvd_direction_idx of merge mode, and information related to merge motion vector difference mode in skip mode and information related to merge motion vector difference mode in merge mode must be interpreted as independent information.

[0359] The video decoding device (1700) obtains the syntax element mmvd_merge_flag, which indicates whether the prediction is made in the merge motion vector difference mode, in the skip mode and the merge mode, respectively, but the mmvd_merge_flag can be obtained through entropy decoding using one context information.

[0360] Additionally, the video decoding device (1700) can obtain merge candidate information mmvd_cand_flag in skip mode and merge mode. Even if mmvd_cand_flag in skip mode and mmvd_cand_flag in merge mode are obtained individually, mmvd_cand_flag can be obtained through entropy decoding using the same context information.

[0361] FIG. 27 illustrates a reference table for determining a binarization method of merge-related information according to another embodiment.

[0362] For example, the binarization method of the syntax element mmvd_merge_flag, which indicates whether prediction is made in the merge motion vector difference mode, is a fixed-length binarization (FL) method, and the cMax parameter value is 1. The binarization method of mmvd_cand_flag corresponding to the merge candidate information may also be a fixed-length binarization method, and the cMax parameter value may be 1.

[0363] The binarization method of the syntax element mmvd_distance_idx corresponding to the distance index of the merge motion vector difference is the truncated Rice binarization (TR) method, and in this case, the cMax parameter value can be 7 and the cRiceParam value can be 0. The binarization method of the syntax element mmvd_direction_idx corresponding to the direction index of the merge motion vector difference is the fixed-length binarization method, and in this case, the cMax parameter value can be 3.

[0364] FIG. 28 illustrates a reference table for determining context information of merge-related information according to another embodiment.

[0365] The reference table in Figure 28 shows the context information required for entropy decoding for each empty index of each syntax element.

[0366] For example, the context information required to decode the first bin, i.e., the bin index 0 of the syntax element mmvd_merge_flag indicating whether prediction is made in the merge motion vector differential mode, is 0. Since mmvd_merge_flag is 1-bit information, context information for bins other than bin index 0 is not defined (na). Accordingly, the number of context information required to entropy-decode the syntax element mmvd_merge_flag indicating whether prediction is made in the merge motion vector differential mode, i.e., the merge differential mode information, may be 1.

[0367] In addition, when predicted in merge mode, the video decoding device (1700) can obtain information indicating one motion vector candidate among the merge candidate list from the bitstream. The video decoding device (1700) can obtain a syntax element merge_idx corresponding to the information indicating the motion vector candidate among the merge candidate list through entropy decoding. The context information required to decode the bin index 0 of merge_idx, i.e., the first bin, is 0. The remaining bins of merge_idx can be decoded in bypass mode.

[0368] Accordingly, the number of context information required to obtain information indicating whether the video decoding device (1700) is predicted in the merge motion vector difference mode and information indicating a motion vector candidate among the merge candidate list is the same as 1.

[0369] To obtain the first bin of the syntax element mmvd_distance_idx corresponding to the distance index of the merge motion vector difference, one context information is required, and the remaining bins can be decoded in bypass mode without context information. The syntax element mmvd_direction_idx corresponding to the direction index of the merge motion vector difference can be decoded in bypass mode without context information.

[0370] Hereinafter, a method for a video decoding device (1700) and a video encoding device (1900) to construct a merge candidate list in a merge motion vector difference mode according to another embodiment will be described in detail.

[0371] The conventional method for constructing a merge candidate list compares the motion vectors of neighboring blocks that can be included in the merge candidate list, and removes motion vectors that are identical to motion vectors that already exist in the merge candidate list. However, when constructing a candidate list only for the merge motion vector differential mode (hereinafter, 'merge differential mode candidate list'), a method different from the merge candidate list in the general merge mode can be applied to search for candidates in a wider search range.

[0372] In general, there is a pruning process for candidates in the process of constructing a merge differential mode candidate list. However, if the pruning process is partially performed on some candidates, there may be duplicate candidates among the basic motion vector candidates.

[0373] Therefore, when using two or more base motion vector candidates, a pruning process may be added to prevent duplication of the base motion vectors. If there are two base motion vector candidates, after checking the two motion vectors and finding that they are identical, one non-duplicate candidate from the merge candidate list may be added as the second motion vector candidate.

[0374] Additionally, after the motion vector resolution is signaled first, only the motion vector differential values ​​+1 and -1 may be additionally signaled. In this case, the offset (distance) and sign (direction) of the same motion vector differential may be applied simultaneously in the x-direction and the y-direction.

[0375] As another example, separate offsets and signs of motion vector differences may be applied in the x-direction and y-direction, respectively.

[0376] The motion vector resolution information according to one embodiment may also be matched with the resolution information used to predict the motion vector differential in an advanced motion vector prediction (AMVP) prediction mode.

[0377] When deriving a default motion vector candidate in the merge motion vector difference mode, if no motion vector is detected in a neighboring block, the zero motion vector (0,0) may be used as the default motion vector candidate, or a specific motion vector value may be used as the default value.

[0378] When constructing a merge differential mode candidate list in the merge motion vector difference mode, information from the existing merge candidate list is borrowed, but new candidates can be constructed and used. The total number of merge candidates in the merge differential mode candidate list is set to N (N: 1, 2, 3, .. integer).

[0379] The list of merge difference mode candidates may include:

[0380] i) The first candidate in the general merge candidate list

[0381] ii) A modified version of one of the candidates in the merge difference mode candidate list.

[0382] ii-1) A motion vector in the merge difference mode candidate list can be generated by adding a specific offset. The offset can be determined based on information accumulated within the frame, such as a history-based motion vector. The accumulated information can be determined by looking at the offset of the merge motion vector difference of a neighboring block. The offset can be determined from information acquired at a high level, such as a slice or picture.

[0383] ii-2) The reference picture index of the merge differential mode candidate list can be modified and used. The reference picture index can be determined based on information accumulated within the frame. The accumulated information can be determined based on the reference picture index of a neighboring block. The accumulated information can also be obtained at a high level, such as a slice or picture. In this case, the motion vector can be scaled and used according to the modified reference picture index, or can be used without scaling.

[0384] iii) Candidates included in the candidate list in the ATMVP (advanced temporal motion vector prediction) method can be used.

[0385] iii-1) Only the representative temporal motion vector predictor (TMVP) at the center position (x0, y0) can be borrowed as a candidate for the merge difference mode candidate list. Here, the center position (x0, y0) means the following.

[0386] x0 = x + (block width / 2 ),

[0387] y0 = y + (block height / 2), x, y are the left-top position of the block.

[0388] iii-2) The TMVP of all sub-blocks used in AMVP can also be borrowed as candidates for the merge differential mode candidate list.

[0389] iii-3) When iii-1) and iii-2) are true, candidates having the closest reference picture to the current picture can be preferentially selected.

[0390] iii-4) When iii-1) and iii-2), candidates using the most frequently referenced reference pictures in neighboring blocks can be preferentially selected.

[0391] iv) Candidates from other merge candidate lists may be used. Alternatively, candidates included in the affine merge candidate list derived from neighboring blocks may be used in the merge differential mode candidate list.

[0392] v) A pruning process may be performed on candidates in a general merge candidate list to generate candidates up to the maximum number of candidates that can be included in the merge differential mode candidate list, thereby constructing a merge differential mode candidate list.

[0393] Below, the pruning process of the merge difference mode candidate list is described in detail.

[0394] In one embodiment, if the difference in motion vectors among candidates included in the merge differential mode candidate list is not greater than a certain size N, the candidate is considered to be a similar motion vector and is eliminated. At this time, the motion vectors of the candidates can be compared after adjusting the reference picture indices of the candidates to be the same. To this end, the two motion vectors to be compared can be moved to the same reference picture index location, and then the motion vectors can be compared.

[0395] To prevent the use of similar motion vectors as the default motion vector predictor of the merge motion vector difference mode, a pruning process can be performed as follows. With respect to the motion vector inserted into the merge differential mode candidate list, if the coordinates of the previously inserted motion vector predictor are on the x-axis, the candidate on the x-axis will not be inserted into the merge differential mode candidate list in the next turn. Similarly, if the previously inserted predictor is on the y-axis, the candidate on the y-axis will not be inserted in the next turn. The information on the x-axis or on the y-axis mentioned here may be a motion vector expressed with an accuracy of 1 / 16 (or 1 / 4). As another example, the information on the x-axis or on the y-axis may be the x, y coordinate values ​​after performing rounding of a predetermined N pel in the merge motion vector difference mode. This is to confirm the large directionality of the current motion vector, not the coordinates on the x-axis or y-axis with fine values ​​such as noise.

[0396] According to another embodiment, the video decoding device (1700) and the video encoding device (1900) according to one embodiment can directly use a specific candidate list without a separate pruning process because they borrow candidates that have already been pruned from a specific candidate list according to certain conditions. That is, up to N candidates from among the candidates in the general merge candidate list can be selected as the merge differential mode candidate list.

[0397] Hereinafter, various embodiments of a video decoding device (1700) and a video encoding device (1900) pruning a base motion vector in a merge motion vector difference mode according to another embodiment are described.

[0398] As described above, the merge motion vector difference mode according to one embodiment includes the first N candidates of a general merge candidate list used in the merge mode or skip mode. A candidate selected from the general merge candidate list becomes a base motion vector, and an offset (distance) of the merge motion vector difference may be added to the base motion vector in one of the x and y directions.

[0399] If the x-coordinate or y-coordinate of the base motion vector is the same, candidates according to the merge motion vector difference may overlap. Therefore, candidates according to the merge motion vector difference are less uniformly distributed in the spatial domain. Therefore, it is necessary to prune candidates of the merge difference mode motion vector so that candidates according to the merge motion vector difference can be more uniformly distributed. To this end, it is possible to determine whether to subtract the newly added base motion vector from the existing candidates and add the motion vector difference between the existing candidate and the newly added base motion vector to the merge difference mode candidate list. If the motion vector difference has a value of 0 in the x-axis or a value of 0 in the y-axis in at least one of the L0 and L1 prediction directions, the motion vector difference cannot be added to the merge difference mode candidate list.

[0400] Hereinafter, various embodiments of a method for a video decoding device (1700) and a video encoding device (1900) to derive a merge differential mode candidate list according to another embodiment are described.

[0401] If the merge difference mode candidate list uses the same method as the general merge candidate list, the list construction process can be terminated immediately when at most N candidates are secured in the merge difference mode candidate list.

[0402] If there is a merge type other than the general merge mode, candidates included in the candidate list of that merge type may not be included in the merge differential mode candidate list.

[0403] Hereinafter, a merge motion vector difference mode in uni-prediction performed in a video decoding device (1700) and a video encoding device (1900) according to another embodiment will be described in detail.

[0404] According to one embodiment, the merge motion vector difference mode may operate in a different manner depending on the motion vector predictor (hereinafter, referred to as the "base motion vector predictor") determined by the base motion vector. In the case of unidirectional prediction, the motion vector information may be reset by adding difference information derived from the distance index and direction index of the merge motion vector difference to the base motion vector predictor.

[0405] In another embodiment, if the base motion vector predictor is unidirectional, another predictor can be generated and used. This method can achieve high performance in P-slice and low-delay B situations. The method below can additionally signal one bit in unidirectional prediction cases to indicate whether two or more predictors are used.

[0406] The method of creating two or more predictors in one-way prediction in merge motion vector difference mode is as follows.

[0407] i) A first predictor can be generated using the motion vector and reference picture index of the basic motion vector predictor. A second predictor can be generated using a new motion vector created by adding merge motion vector differential information (distance index, direction index) centered on the above motion vector and the reference index of the basic motion vector predictor.

[0408] ii) Same as the process of i), but when creating a second predictor, an additional reference picture index is transmitted together with merge motion vector differential information, and the motion vector of the basic motion vector predictor can be scaled according to the distance to the reference picture pointed to by the transmitted reference picture index. The second predictor can be created using the newly generated motion vector by adding the scaled merge motion vector differential information centered on the scaled motion vector.

[0409] iii) In the process of ii), before scaling based on the reference picture index, a motion vector is generated in advance by adding merge motion vector differential information to the motion vector of the basic motion vector predictor, and the reference picture index is additionally transmitted or, depending on the distance to the reference picture indicated by the implicit reference picture index, the pre-generated motion vector may be scaled and used.

[0410] Hereinafter, a context model of information used by a video decoding device (1700) and a video encoding device (1900) in a merge motion vector difference mode according to another embodiment will be described in detail.

[0411] First, various embodiments of the context model of merge differential information are as follows.

[0412] According to one embodiment, the merge difference information may be used after the skip mode flag or after the merge mode flag. The merge difference information (skip mv difference information) used after the skip mode flag and the merge difference information (merge mv difference information) used after the merge mode flag may be used separately, and the context models may also be encoded separately. As another example, the skip mv difference information and the merge mv difference information may be encoded as a single context model without being distinguished by separate flags.

[0413] When using a context model for entropy decoding of merge differential information, a different number of context models can be determined depending on the number of neighboring blocks.

[0414] For example, if the surrounding blocks are the left and upper blocks, there are three possible cases: when none of the surrounding blocks use the MVP mode, when there is one block, and when both blocks are encoded using the MVP mode.

[0415] In the above three cases, one or more context models can be used for entropy decoding of merge difference information, examples of which are as follows.

[0416] First, two context models can be used. The first context model can be used when none of the surrounding blocks have been used in MVC mode. The second context model can be used when at least one of the surrounding blocks has been used in MVC mode.

[0417] The following examples illustrate the cases where three context models are used for entropy decoding of merge differential information. The first context model may be used when none of the surrounding blocks are used in the merge motion vector differential mode, the second context model may be used when one of the surrounding blocks is used in the merge motion vector differential mode, and the third context model may be used when two of the surrounding blocks are used in the merge motion vector differential mode.

[0418] The context information for entropy decoding merge candidate information according to one embodiment may be determined as follows. For example, the context model may be applied only when decoding the first bin of the merge candidate information. Alternatively, the merge candidate information may be decoded using the same context model as the context model used to decode a general merge index pointing to a candidate included in the merge candidate list in the general merge mode.

[0419] A context model may be used to decode only the first bin of the distance index of the merge motion vector difference according to one embodiment. The context model is not applied to decode the remaining bins of the distance index of the merge motion vector difference.

[0420] One of the bins of the direction index of the merge motion vector difference according to one embodiment may represent the x-axis direction or the y-axis direction, and a context model may be applied to decode the bin. Another of the bins may represent a cross shape or an X shape, and a context model may be applied to decode the bin.

[0421] Below, we propose a method to represent motion vector differences at various resolutions in the merge motion vector difference mode.

[0422] In Merge Motion Vector Difference mode, multiple motion vector resolutions can be applied, and this application method will be explained. However, first, the encoding method of the existing motion vector form will be described.

[0423] Information in the form of conventional motion vectors, including motion vector difference forms, is expressed by dividing the information of x and y coordinates respectively. The x coordinate is explained as an example. In the conventional method, sign information (+, -) corresponding to the direction of movement is signaled. In addition, the magnitude of how far the direction is on the axis is signaled. In addition, since the occurrence probability of 0 and 1 is high, bits representing information of 0 or not, 1 or not are also signaled, and a context model can be applied to each bit.

[0424] A video decoding device (1700) and a video encoding device (1900) according to another embodiment may signal a distance index of a motion vector difference instead of a magnitude of a motion vector in the merge motion vector difference mode. Additionally, instead of sign information indicating a direction of a motion vector, a direction index of a merge motion vector difference may be signaled in the merge motion vector difference mode.

[0425] The distance index of the motion vector difference can be expressed based on the resolution of the motion vector used in the video codec mounted on the video decoding device (1700) and the video encoding device (1900). For example, in the VVC codec, MV is internally used in units of 1 / 16 pixels. However, the resolution representing the motion vector is expressed as 1 / 4. Therefore, if the distance index of the merge motion vector difference mode is 1, it means that the variation of the motion vector is expressed with a resolution of 1 / 4. If the distance index of the merge motion vector difference mode is 2, it means that the variation of the motion vector is expressed with a resolution of 1 / 2. Multiple motion vector resolutions can be expressed by the distance index, and the direction of the motion vector can be expressed by the direction index of the merge motion vector difference.

[0426] The merge motion vector difference can be added to the motion vector predictor corresponding to the base motion vector selected from the merge candidate list. Since the distance index represents the resolution of the motion vector, the motion vector predictor must also be rounded to the same resolution so that the resolution of the final motion vector matches the resolution of the distance index.

[0427] Predictor (rounded value with information from distance index) + Merge motion vector difference (distance index * preset resolution) * direction index

[0428] The resolution of the merge motion vector difference can also be applied to the inter prediction mode currently used by the motion vector. The concept of motion vector resolution according to the distance index of the merge motion vector difference can be applied to the motion vector predictor of the inter prediction mode such as skip mode, merge mode, affine skip mode, affine merge mode, inter / intra combination mode, generalized B mode, triangle partition mode, AMVP mode, AMVR (Adaptive Motion Vector Resolution) mode, and affine AMVP mode available in the current video codec. In addition, the concept of motion vector resolution according to the distance index of the merge motion vector difference according to the distance index can also be applied to the motion vector difference component (including the 1st residual component, the 2nd residual component, and the Nth residual component) in each inter prediction mode. Therefore, various indices used in each inter prediction mode can be interpreted and used as the corresponding motion vector resolution.

[0429] As another example, the distance index of the merge motion vector difference may not be used for more than two inter prediction modes, since it can be interpreted as resolution information of the motion vector.

[0430] As information representing the resolution of multiple motion vectors, a distance index can be signaled after the syntax element pred_mode_flag to indicate whether the mode is inter prediction mode or intra prediction mode. If decoding is performed in inter prediction mode (pred_mode_flag == MODE_INTER), the motion vector resolution according to the distance index can be applied to motion vectors to be decoded in all prediction modes applied thereafter.

[0431] The motion vector resolution according to the above distance index is a resolution applicable to all currently used prediction modes and can be directly applied to the AMVR mode currently proposed for VVC. In other words, information representing the motion vector resolution of AMVR can be expressed by the proposed distance index. Therefore, the distance index of the merge motion vector difference mode can be used without separately signaling information for the motion vector resolution in the AMVR mode, and the motion vector resolution corresponding to the distance index can be applied to the motion vector predictor and the motion vector difference corresponding to the base motion vector.

[0432] Multiple resolutions applied to motion vector encoding and decoding can be controlled by the distance index of the Merge Motion Vector Difference mode. Since the information for the appropriate multiple resolutions may vary depending on the characteristics of the image, a resolution list containing multiple or more resolutions may be required.

[0433] For example, we need a list of resolutions in sub-pel units and a list of resolutions greater than integer-pel.

[0434] List of resolutions in subpixel units: index 0 (corresponds to 1 / 16 pixel units), index 1 (1 / 8 pixel units), index 2 (1 / 4 pixel units), index 3 (1 / 2 pixel units)

[0435] List of resolutions in integer pixels: index 0 (corresponds to 1 pixel unit), index 1 (2 pixel unit), index 2 (4 pixel unit), index 3 (8 pixel unit), index 4 (16 pixel unit)

[0436] The list information indicating the list used among the above resolution lists is applied equally to the video decoding device (1700) and the video encoding device (1900), and may be signaled at a high level (slice header level or picture level). Alternatively, the list information may be signaled at an encoding unit level (level at which pred_mode_flag is signaled). Alternatively, one list may be implicitly used by the video decoding device (1700) and the video encoding device (1900).

[0437] Alternatively, if the list information is signaled at a high level, such as a slice level or tile level, separate list information may be signaled for each temporal layer, and an implicitly predetermined resolution may be used.

[0438] As another example, a motion vector candidate that can be a reference motion vector of the merge motion vector difference mode may be determined as one representative candidate among sub-block motion vector candidates used in ATMVP (advanced temporal motion vector prediction), etc. For example, among the sub-block motion vector candidates, the motion vector of the sub-block corresponding to the center position or the motion vector of the sub-block corresponding to the upper left position may be determined as the representative candidate.

[0439] According to another embodiment, sub-block candidates may be excluded from motion vector candidates that can serve as reference motion vectors in the merge motion vector difference mode. This may reduce computational complexity.

[0440] Below, we describe in detail whether to use ATMVP merge candidates when determining a reference motion vector in merge motion vector difference mode.

[0441] In a merge motion vector difference mode according to one embodiment, a reference motion vector is first determined from a merge candidate list used in the merge mode. In a merge motion vector difference mode according to another embodiment, a reference motion vector can be selected not only from the merge candidate list but also from ATMVP candidates. Information indicating whether to predict a motion vector using an ATMVP candidate in the merge motion vector difference mode can be signaled at a slice level or a higher level (picture or sequence, Sequence parameter set (SPS) or Picture parameter set (PPS)).

[0442] If ATMVP candidates are also available in the Merge Motion Vector Difference mode, all candidates in the Merge Candidate List and the ATMVP Candidate List must be generated. However, if ATMVP candidates are not used, the video decoding device (1700) does not need to access memory for ATMVP, and does not need to access memory in the temporal direction to construct the ATMVP candidate list, thereby achieving significant efficiency in terms of memory access.

[0443] A motion vector prediction mode that adjusts relatively inaccurate motion vectors into more precise motion vectors in a video decoding device (1700) without signaling all or part of information related to motion vectors is hereinafter collectively referred to as decoder-side motion vector derivation technology. A method of combining the merge motion vector difference mode with the BIO mode and the DMVR mode, as a representative decoder-side motion vector derivation technology, is described below.

[0444] Below, a method for combining the merge motion vector difference mode and the BIO (Bi-directional optical flow) technology is described in detail.

[0445] When the Merge Motion Vector Difference mode is applied to bi-prediction, prediction blocks in both directions (L0 and L1) are used. Among inter prediction techniques, there is a BIO technique that creates a single prediction block when bi-directional prediction blocks exist. In BIO technique, when bi-directional reference blocks exist, an optical motion vector is determined using the motion vector, and a single reference block is derived by applying the optical motion vector to each pixel of the bi-directional reference blocks.

[0446] In Merge Motion Vector Difference mode, a single reference block may be generated and used from bidirectional reference blocks. In this case, when the reference blocks are secured, BIO mode may or may not be implicitly applied without separate signaling to determine whether to apply BIO mode.

[0447] However, in one embodiment, the BIO mode may be used only in certain cases when the merge motion vector difference mode is applied.

[0448] The Merge Motion Vector Difference mode searches for various points centered around the motion vectors included in the merge candidate list. The searched points can be grouped based on their distance from the center. These groups can be distinguished by a distance index.

[0449] According to one embodiment, the BIO mode can be set to operate only when the distance index is less than or equal to a predetermined N in the Merge Motion Vector Difference mode. In the BIO mode, encoding efficiency is improved by correcting fine-grained pixels as a kind of post-processing mode of the predicted block. This is because when the optical flow of the motion vector is stable, i.e., when the motion vector is not large, the pixels need to be corrected more finely.

[0450] When the video decoding device (1700) according to one embodiment operates in the merge motion vector difference mode, a large distance index means that a reference block is obtained by predicting a motion vector with a large motion. In this case, even if the BIO mode is applied, it may be difficult to obtain high encoding efficiency. Therefore, encoding efficiency can be improved only when the distance index is below a certain size by additionally applying the BIO mode.

[0451] For example, if the BIO mode is applied only when the distance index is less than or equal to a preset N, if N is 0, the BIO mode can be applied only to search points with a distance index of 0, and if N is 1, the BIO mode can be applied only to search points with a distance index of 0 or 1.

[0452] BIO mode compensates for the current pixel by considering the consistency of motion between reference frames located at different temporal locations. Based on the initially given motion vectors in the bidirectional prediction direction, a decision can be made as to whether or not BIO mode should be applied to the motion vectors. This is because while some motion vectors derived from neighboring blocks accurately describe the object's motion, others are simply determined for encoding efficiency.

[0453] Therefore, if the bidirectional motion vectors do not follow optical consistency, even if separate refinement is applied, only the complexity increases and encoding efficiency cannot be expected. Therefore, if a certain level of optical consistency is followed, the BIO mode can be applied.

[0454] Therefore, complexity can be significantly reduced while maintaining encoding efficiency under the following two conditions.

[0455] MV_L: Movement information in the L direction

[0456] (e.g., MV_0: motion vector in L0 direction, MV_1: motion vector in L1 direction)

[0457] MV_L.x, MV_L.y: x and y coordinates in the L direction, respectively

[0458] (e.g., MV_0.x is the x-coordinate of the motion vector in the L0 direction)

[0459] OPT_x, OPT_y: Motion vectors that should occur assuming optical consistency

[0460] For example, if MV_0.x is -10, the optimal x-coordinate over another reference frame that is the same distance from the current frame is called OPT_x and is set to 10 with the opposite sign of MV_0.x. If the distance from the current frame is different, it can be scaled.

[0461] Condition 1: MV_0.x * MV_1.x > 0

[0462] Condition 2: ABS(OPT_x - MV_1.x) > N (where N is a real number and a preset threshold)

[0463] The above two conditions can be used individually or simultaneously. A combination of the two conditions is as follows:

[0464] (Assume that the distance from the center to both reference frames is equal)

[0465] OPT_x = -1 * MV_0.x

[0466] OPT_y = -1 * MV_0.y

[0467] If( (ABS(OPT_x - MV_1.x ) > N ) && (MV_0.x * MV_1.x > 0 ) ||

[0468] (ABS(OPT_y - MV_1.y ) > N ) && (MV_0.y * MV_1.y > 0 ) ) BIO off

[0469] That is, if the distance between the x-coordinate and the optimal x-coordinate among the motion vectors in the L1 direction is greater than N, and the sign of the x-coordinate among the motion vectors in the L1 direction is the same as the sign of the x-coordinate among the motion vectors in the L0 direction, the BIO mode may not be applied. Similarly, if the distance between the y-coordinate and the optimal y-coordinate among the motion vectors in the L1 direction is greater than N, and the sign of the y-coordinate among the motion vectors in the L1 direction is the same as the sign of the y-coordinate among the motion vectors in the L0 direction, the BIO mode may not be applied.

[0470] Conversely, if the distance between the x-coordinate and the optimal x-coordinate among the motion vectors in the L1 direction is not greater than N, or the sign of the x-coordinate among the motion vectors in the L1 direction is not the same as the sign of the x-coordinate among the motion vectors in the L0 direction, or the distance between the y-coordinate among the motion vectors in the L1 direction and the optimal y-coordinate is not greater than N, or the sign of the y-coordinate among the motion vectors in the L1 direction is not the same as the sign of the y-coordinate among the motion vectors in the L0 direction, the BIO mode can be applied.

[0471] Below, a method for combining the merge motion vector difference mode and the Decoder side MV derivation method (DMVR) is described in detail.

[0472] The DMVR (Decoder-side MV derivation method) technique uses two bidirectional motion vectors to determine two reference blocks, thereby generating a virtual original block using the two reference blocks and generating a new motion vector using the virtual original block. Since this process operates identically in a video decoding device (1700) and a video encoding device (1900), no additional information needs to be signaled. Therefore, the DMVR mode may or may not be implicitly applied without the need to signal separate information to indicate that the DMVR mode is used.

[0473] However, a video decoding device (1700) and a video encoding device (1900) according to one embodiment propose a method of applying a merge motion vector difference mode and applying a DMVR mode in a specific case.

[0474] In one embodiment, DMVR mode can be configured to operate only when the distance index is less than or equal to a predetermined N in Merge Motion Vector Difference mode. DMVR mode is a type of post-processing mode for predicted blocks, which improves encoding efficiency by correcting fine-grained pixels. This means that when the motion vector is stable, i.e., when the motion along the motion vector is not large, pixel correction needs to be performed more finely.

[0475] When the video decoding device (1700) according to one embodiment operates in the merge motion vector difference mode, a large distance index means that a reference block is obtained by predicting a motion vector with a large motion. In this case, even if the DMVR mode is applied, it may be difficult to obtain high encoding efficiency. Therefore, the DMVR mode may be additionally applied only when the distance index is below a certain size to improve encoding efficiency.

[0476] For example, if the DMVR mode is applied only when the distance index is less than or equal to a preset N, if N is 0, the DMVR mode can be applied only to the search points with a distance index of 0, and if N is 1, the DMVR mode can be applied only to the search points with a distance index of 0 or 1.

[0477] DMVR mode compensates for the current pixel by considering the similarity between blocks in reference frames located at different temporal locations. Based on the initially given motion vectors in the bidirectional prediction direction, whether DMVR mode is applied to the motion vectors can be determined. This is because while some motion vectors derived from neighboring blocks accurately describe the object's motion, others are simply determined for encoding efficiency.

[0478] Therefore, DMVR mode can be applied if the motion vectors in both directions follow a certain degree of consistency.

[0479] Therefore, complexity can be significantly reduced while maintaining encoding efficiency under the following two conditions.

[0480] MV_L: Movement information in the L direction

[0481] (e.g., MV_0: motion vector in L0 direction, MV_1: motion vector in L1 direction)

[0482] MV_L.x, MV_L.y: x and y coordinates in the L direction, respectively

[0483] (e.g., MV_0.x is the x-coordinate of the motion vector in the L0 direction)

[0484] OPT_x, OPT_y: Motion vectors that should occur assuming optical consistency

[0485] For example, if MV_0.x is -10, the optimal x-coordinate over another reference frame that is the same distance from the current frame is called OPT_x and is set to 10 with the opposite sign of MV_0.x. If the distance from the current frame is different, it can be scaled.

[0486] Condition 1: MV_0.x * MV_1.x > 0

[0487] Condition 2: ABS(OPT_x - MV_1.x) > N (where N is a real number and a preset threshold)

[0488] The above two conditions can be used individually or simultaneously. A combination of the two conditions is as follows:

[0489] (Assume that the distance from the center to both reference frames is equal)

[0490] OPT_x = -1 * MV_0.x

[0491] OPT_y = -1 * MV_0.y

[0492] If( (ABS(OPT_x - MV_1.x ) > N ) && (MV_0.x * MV_1.x > 0 ) ||

[0493] (ABS(OPT_y - MV_1.y ) > N ) && (MV_0.y * MV_1.y > 0 ) ) DMVR off

[0494] That is, if the distance between the x-coordinate and the optimal x-coordinate among the motion vectors in the L1 direction is greater than N, and the sign of the x-coordinate among the motion vectors in the L1 direction is the same as the sign of the x-coordinate among the motion vectors in the L0 direction, the DMVR mode may not be applied. Similarly, if the distance between the y-coordinate and the optimal y-coordinate among the motion vectors in the L1 direction is greater than N, and the sign of the y-coordinate among the motion vectors in the L1 direction is the same as the sign of the y-coordinate among the motion vectors in the L0 direction, the DMVR mode may not be applied.

[0495] Conversely, if the distance between the x-coordinate and the optimal x-coordinate among the motion vectors in the L1 direction is not greater than N, or the sign of the x-coordinate among the motion vectors in the L1 direction is not the same as the sign of the x-coordinate among the motion vectors in the L0 direction, or the distance between the y-coordinate among the motion vectors in the L1 direction and the optimal y-coordinate is not greater than N, or the sign of the y-coordinate among the motion vectors in the L1 direction is not the same as the sign of the y-coordinate among the motion vectors in the L0 direction, the DMVR mode can be applied.

[0496] Hereinafter, a method of combining a merge motion vector difference mode with deblocking filtering according to one embodiment is described in detail.

[0497] The variable bs (boundary strength) to define the strength of the deblocking filter to be applied to the boundary between two blocks can be determined based on the motion vector of each block. Hereinafter, when the motion vector is predicted based on the merge motion vector difference mode, how the motion vector difference information decoded according to the merge motion vector difference mode can be used to determine the filtering strength of the deblocking filter is described.

[0498] When the merge motion vector difference mode is not applied to a sub-block, deblocking filtering can be performed on the sub-block as if it were a block encoded in the general skip mode or general merge mode.

[0499] A video decoding device (1700) according to one embodiment can apply a merge motion vector difference mode to sub-blocks as well. Since each base motion vector (motion vector predictor) is determined for each sub-block, a different motion vector can be predicted for each sub-block. The motion vectors of all or some sub-blocks can be corrected using the distance index and direction index of the merge motion vector difference mode. The strength of deblocking filtering for these sub-blocks is determined by considering each motion vector, and deblocking filtering can be performed on the boundaries of the sub-blocks based on the strength.

[0500] The deblocking filtering method can be coded in the same way as when different coding units have different motion vectors.

[0501] Coding units can be divided into predetermined rules, and predictions can be made for each determined sub-block. The predetermined rules can be determined on a slice-by-slice basis, or can be a minimum unit of division agreed upon in advance by the encoder / decoder. The motion vector of each sub-block can be determined according to a predetermined process. Various embodiments for determining the motion vector of each coding unit using sub-blocks are described below.

[0502] i) In skip mode, merge mode, merge motion vector difference mode in skip mode, or merge motion vector difference mode in merge mode, the size and shape of the sub-blocks of the block can be known by signaling a specific bit. For example, if the bit indicating whether to split is 0, the block is not split into sub-blocks. If the bit indicating whether to split is 1, the block can be split into sub-blocks. If the method of splitting into sub-blocks is a method implicitly agreed upon by the video encoding device (1900) and the video decoding device (1700), no additional information is signaled. As another example, information on whether the block is split horizontally or vertically into sub-blocks can be signaled after the bit indicating whether to split.

[0503] ii) When a block is divided into sub-blocks, information on how to derive the motion vector of the sub-block can also be signaled. If the information on how to derive the motion vector of the sub-block is 0, a temporal motion vector predictor can be derived and used to determine the motion vector of the sub-block, or if the information on the derivation method is 1, the motion vector of the sub-block can be additionally signaled.

[0504] iii) Information about the signaled motion vector may be signaled in the same manner as the motion vector information of the AMVP mode of the VVC standard, including candidate information pointing to one of the MVP lists, prediction direction information, a reference picture index, absolute value information of the motion vector difference, and sign information of the motion vector difference. Alternatively, the motion vector of a subblock may be signaled using motion information of the merge motion vector difference mode (merge candidate information, distance index of the merge motion vector difference, direction index). In addition, the motion vector difference information related to the merge motion vector mode of a subblock may be shared as the motion vector difference information of another subblock. For the subsequent blocks, only the distance index and the direction index, or both, may be signaled, and motion vector difference information that is redundant between subblocks may not be transmitted.

[0505] Below, an embodiment in which the merge motion vector difference mode is used in the deblocking filtering process is described.

[0506] For example, a block decoded in the merge motion vector difference mode in the skip mode and a block decoded in the merge motion vector difference mode in the merge mode can be considered as separate blocks, and deblocking filtering can be performed at the boundary between the blocks.

[0507] As another example, in blocks decoded in skip mode with merge motion vector difference mode and blocks decoded in merge mode with merge motion vector difference mode, the deblocking filtering method used in blocks decoded in general skip mode or blocks decoded in general merge mode may not be performed. The deblocking filtering method applied to blocks decoded in AMVP mode, from which residual blocks are generated, may be applied as is to blocks decoded in skip mode with merge motion vector difference mode and blocks decoded in merge mode with merge motion vector difference mode.

[0508] As another example, for a block decoded in skip mode with merge motion vector difference mode, a deblocking filtering method applied to a block decoded in general skip mode or a block decoded in general merge mode may be performed. For a block decoded in merge mode with merge motion vector difference mode, a deblocking filtering method applied to a block decoded in AMVP mode accompanied by a residual block may be used.

[0509] As another example, in AMVP mode, if the motion vectors between blocks are different, the strength bs of the deblocking filtering can be determined based on the difference in the motion vectors. The motion vector difference between blocks decoded with merge motion vector difference mode, or the motion vector difference between a block decoded with merge motion vector difference mode and a block decoded with AMVP mode, can use the distance index or direction index of the merge motion vector difference. For a block decoded with merge motion vector difference mode, the base motion vector and the distance index and direction index of the merge motion vector difference can be obtained. Therefore, since the base motion vectors of two blocks may be the same, the difference between the motion vectors of the two blocks can be determined using only the distance index of the merge motion vector difference. Therefore, the strength of the deblocking filter for the boundary between two blocks can be determined using only the distance index of the merge motion vector difference.

[0510] However, if it is not decoded in the merge motion vector difference mode, merge motion vector difference information corresponding to the current motion vector can be generated, and the distance index of the generated merge motion vector difference can be used to determine the strength of deblocking filtering.

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

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

[0513] 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. A step of generating a merge candidate list including neighboring blocks referenced to predict the motion vector of the current block in skip mode or merge mode; A step of obtaining merge difference mode information indicating whether to use the motion vector determined from the merge candidate list and the merge motion vector difference; When the merge motion vector difference is used according to the merge difference mode information, a step of obtaining merge candidate information from a bitstream and determining a basic motion vector from one candidate determined based on the merge candidate information among the merge candidate list; A step of determining a motion vector of the current block using the merge motion vector difference determined using the distance index of the merge motion vector difference of the current block and the direction index of the merge motion vector difference and the base motion vector; and A video decoding method, characterized by comprising a step of restoring the current block using a motion vector of the current block.

2. In the first paragraph, the step of determining the merge motion vector difference comprises: A step of performing entropy decoding using context information on the bitstream to obtain the first bin of the distance index of the merge motion vector difference; and A video decoding method, characterized by comprising a step of performing entropy decoding through a bypass mode on the bitstream to obtain the remaining bins of the distance index of the merge motion vector difference.

3. In paragraph 1, A video decoding method, characterized in that the maximum number of candidates allowed for selection by the above merge candidate information is less than the maximum number of candidates included in the above merge candidate list.

4. In paragraph 1, A video decoding method characterized in that the merge candidate information, which is 1 bit of information, is obtained through entropy decoding that applies the one context information to the bitstream.

5. In paragraph 1, A video decoding method, characterized in that the number of context information required to obtain a general merge index pointing to one candidate among the merge candidate lists when prediction is performed in the above merge mode is the same as the number of context information required to obtain the merge candidate information.

6. An inter prediction information acquisition unit that acquires merge difference mode information indicating whether to use the motion vector determined from the merge candidate list of the current block and the merge motion vector difference, and if the merge motion vector difference is used according to the merge difference mode information, acquires merge candidate information from a bitstream; An inter prediction performing unit that generates a merge candidate list including neighboring blocks referenced for predicting a motion vector of the current block in a skip mode or a merge mode, determines a base motion vector from one candidate determined based on the merge candidate information among the merge candidate list, determines the merge motion vector difference using a distance index of the merge motion vector difference of the current block and a direction index of the merge motion vector difference, and determines a motion vector of the current block using the base motion vector and the merge motion vector difference; and A video decoding device characterized by including a restoration unit that restores the current block using the motion vector.

7. In the 6th paragraph, the inter prediction information acquisition unit, A video decoding device characterized in that the first bin of the distance index of the merge motion vector difference is obtained by performing entropy decoding using context information on the bitstream, and the remaining bins of the distance index of the merge motion vector difference are obtained by performing entropy decoding through a bypass mode on the bitstream.

8. In paragraph 6, A video decoding device, characterized in that the maximum number of candidates allowed for selection by the above merge candidate information is less than the maximum number of candidates included in the above merge candidate list.

9. In the 6th paragraph, the inter prediction acquisition unit A video decoding method characterized in that the merge candidate information, which is 1 bit of information, is obtained through entropy decoding that applies the one context information to the bitstream.

10. In paragraph 6, A video decoding method, characterized in that the number of context information required to obtain a general merge index pointing to one candidate among the merge candidate lists when prediction is performed in the above merge mode is the same as the number of context information required to obtain the merge candidate information.

11. A step of generating a merge candidate list including neighboring blocks referenced for predicting a motion vector of the current block when inter prediction is performed for the current block in one of skip mode and merge mode; A step of generating merge difference information indicating whether to use the base motion vector and the merge motion vector difference determined from the merge candidate list of the current block; When the above merge motion vector difference is used, a step of generating merge candidate information pointing to a basic motion vector of one of the merge candidate lists; A video encoding method, characterized by comprising a step of generating a distance index of a merge motion vector difference corresponding to a difference between the base motion vector and the motion vector of the current block and a direction index of the merge motion vector difference.

12. In the 11th paragraph, the step of generating the distance index of the merge motion vector difference and the direction index of the merge motion vector difference is: A step of performing entropy encoding using context information for the first bin of the distance index of the above merge motion vector difference; and A video encoding method characterized by comprising a step of performing entropy encoding through a bypass mode on the remaining bins of the distance index of the above merge motion vector difference.

13. An inter prediction performing unit that performs inter prediction on a current block to determine a motion vector of the current block, and generates a merge candidate list including neighboring blocks referenced for predicting the motion vector of the current block when inter prediction is performed on the current block in one of skip mode and merge mode; and A video encoding device characterized by comprising an inter prediction information generating unit that generates merge difference information indicating whether a base motion vector and a merge motion vector difference determined from a merge candidate list of the current block are used, and, when the merge motion vector difference is used, generates merge candidate information indicating one base motion vector from among the merge candidate lists, and generates a distance index of the merge motion vector difference corresponding to a difference between the base motion vector and the motion vector of the current block and a direction index of the merge motion vector difference.

14. In the 13th paragraph, the inter prediction information generation unit, A video encoding device characterized in that entropy encoding using context information is performed on the first bin of the distance index of the merge motion vector difference, and entropy encoding is performed through a bypass mode on the remaining bins of the distance index of the merge motion vector difference.

15. A computer-readable recording medium having recorded thereon a program for implementing the video decryption method of Article 1 on a computer.