Video encoding and decoding method and device
By generating a merge candidate list and obtaining merged motion vector difference mode information, the prediction problem in the motion vector encoding and decoding process is solved, effective encoding and decoding of motion vectors is achieved, and the image encoding efficiency is improved.
Patent Information
- Application Number
- CN202411091144.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2018-12-21
- Filing Date
- 2019-10-10
- Publication Date
- 2024-10-11
AI Technical Summary
In the existing technology, it is difficult to effectively predict and encode motion vectors during the encoding and decoding process of motion vectors, resulting in low encoding efficiency.
This is achieved by generating a merge candidate list including neighboring blocks, obtaining merged motion vector difference mode information, using the merge candidate information to obtain a basic motion vector from the bitstream, and combining the merged motion vector difference of the current block to determine the motion vector of the current block. Efficient encoding and decoding of motion vectors.
Effectively predict and encode motion vectors, improve the efficiency of image encoding and decoding, accurately reconstruct image blocks, and improve video encoding performance.
Smart Images

Figure CN118764642A_ABST
Abstract
Description
[0001] This application is a divisional application of a patent application with an application date of October 10, 2019, application number 201980067243.8, and titled "Method for encoding and decoding a video by using motion vector differential values and a device for encoding and decoding motion information". Technical Field
[0002] The present disclosure relates to the field of encoding and decoding images. More specifically, the present disclosure relates to a method and apparatus for encoding, and a method and apparatus for decoding motion vectors used for encoding and decoding images. Background Art
[0003] In a method of encoding and decoding an image, one picture may be divided into a plurality of blocks, and each block may be prediction-encoded via inter prediction or intra prediction to encode the picture.
[0004] A representative example of inter-frame prediction is motion estimation coding using a method of compressing an image by removing temporal redundancy between pictures. In motion estimation coding, a block of a current picture is predicted by using at least one reference picture. A reference block most similar to the current block can be searched in a specific search range by using a specific evaluation function. The current block is predicted based on the reference block, and a residual block is generated by subtracting a prediction block generated as a result of the prediction from the current block, and then the residual block is encoded. Here, in order to perform prediction more accurately, interpolation is performed on the search range of the reference picture to generate pixels in sub-pixel units smaller than integer pixel units, and inter-frame prediction can be performed based on the pixels in the generated sub-pixel units.
[0005] In codecs such as H.264 Advanced Video Coding (AVC) and High Efficiency Video Coding (HEVC), a motion vector of a previously encoded block adjacent to a current block or a block included in a previously encoded picture is used as a predicted motion vector of the current block to predict the motion vector of the current block. A differential motion vector, which is the difference between the motion vector of the current block and the predicted motion vector, is signaled to a decoder via a specific method. Summary of the invention
[0006] Technical issues
[0007] A technical problem of a method of encoding and decoding a motion vector and an apparatus for encoding and decoding a motion vector according to an embodiment involves effectively predicting a motion vector and encoding and decoding the motion vector.
[0008] Solution to the problem
[0009] A method for decoding a motion vector according to an embodiment of the present disclosure may include: generating a merge candidate list including neighboring blocks, wherein the neighboring blocks are referenced for predicting a motion vector of a current block in a skip mode or a merge mode; obtaining merge difference mode information indicating whether to use a merged motion vector difference and a motion vector determined from the merge candidate list; when the merged motion vector difference is used according to the merge difference mode information, obtaining merge candidate information from a bitstream, and determining a basic motion vector from candidates determined in the merge candidate list based on the merge candidate information; determining the motion vector of the current block by using the basic motion vector and a merged motion vector difference of the current block, wherein the merged motion vector difference of the current block is determined by using a distance index and a direction index of the merged motion vector difference of the current block; and reconstructing the current block by using the motion vector of the current block.
[0010] Disclosure of beneficial effects
[0011] A method of encoding and decoding a motion vector and an apparatus for encoding and decoding motion information according to an embodiment may refer to motion vectors of neighboring blocks to efficiently predict motion vectors, and efficiently provide a list of neighboring blocks suitable for being referenced.
[0012] However, the effects that can be achieved by the method of encoding and decoding motion information and the device for encoding and decoding motion information according to the embodiment are not limited to those described above, and other effects not mentioned can be clearly understood by ordinary technicians in the field from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] A brief description of each figure is provided to provide a better understanding of the drawings referenced herein.
[0014] Figure 1 is a schematic block diagram of an image decoding apparatus according to an embodiment.
[0015] Figure 2 is a flowchart of an image decoding method according to an embodiment.
[0016] Figure 3 A process of determining at least one coding unit by splitting a current coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0017] Figure 4 A process of determining at least one coding unit by splitting a non-square coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0018] Figure 5 A process of splitting a coding unit based on at least one of block shape information and division shape pattern information, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0019] Figure 6 A method of determining a predetermined coding unit from among odd-numbered coding units, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0020] Figure 7 An order in which a plurality of coding units are processed when an image decoding apparatus determines a plurality of coding units by splitting a current coding unit according to an embodiment is illustrated.
[0021] Figure 8 A process of determining that a current coding unit is to be split into an odd number of coding units when coding units may not be processed in a predetermined order, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0022] Fig. 9 A process of determining at least one coding unit by splitting a first coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0023] Fig.10 It is shown that when a second coding unit having a non-square shape determined when the image decoding apparatus splits a first coding unit satisfies a predetermined condition according to an embodiment, shapes into which the second coding unit can be split are limited.
[0024] Fig.11 A process of splitting a square coding unit when division shape pattern information cannot indicate that the square coding unit is split into four square coding units, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0025] Fig.12 It is shown that a processing order among a plurality of coding units according to an embodiment may be changed according to a process of dividing the coding units.
[0026] Fig.13 A process of determining a depth of a coding unit as a shape and a size of a coding unit change when a coding unit is recursively split so that a plurality of coding units are determined according to an embodiment is illustrated.
[0027] Fig.14 Depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.
[0028] Fig.15 It is illustrated that a plurality of coding units are determined based on a plurality of specific data units included in a picture according to an embodiment.
[0029] Fig.16 It is a block diagram of an image encoding and decoding system.
[0030] Fig.17is a block diagram of a video decoding apparatus according to an embodiment.
[0031] Fig.18 is a flowchart of a video decoding method according to an embodiment.
[0032] Fig.19 is a block diagram of a video encoding apparatus according to an embodiment.
[0033] Fig. 20 is a flowchart of a video encoding method according to an embodiment.
[0034] Fig.21 Shows the positions of motion vector candidates according to an embodiment.
[0035] Fig. 22 Motion vector candidates displayed on a coordinate plane are shown.
[0036] Fig.23 The values and meanings of merge candidate information, merge differential distance index, and merge differential direction index according to an embodiment are shown.
[0037] Fig.24 An equation for obtaining a motion vector by using a basic motion vector and a merged motion vector difference according to an embodiment is shown.
[0038] Fig.25 A syntax for obtaining merge difference mode information, merge candidate information, merge difference distance index, and merge difference direction index according to an embodiment is shown.
[0039] Fig.26 A syntax for obtaining merge difference mode information, merge candidate information, merge difference distance index, and merge difference direction index according to another embodiment is shown.
[0040] Fig. 27 is a reference table for determining binarization of merge related information according to another embodiment.
[0041] Fig.28 is a reference table for determining context information for merging related information according to another embodiment.
[0042] Best Mode
[0043] A method for decoding motion information according to an embodiment of the present disclosure may include: generating a merge candidate list including neighboring blocks, wherein the neighboring blocks are referenced for predicting a motion vector of a current block in a skip mode or a merge mode; obtaining merge difference mode information indicating whether to use a merged motion vector difference and a motion vector determined from the merge candidate list; when the merged motion vector difference is used according to the merge difference mode information, obtaining merge candidate information from a bitstream, and determining a basic motion vector from candidates determined in the merge candidate list based on the merge candidate information; determining a motion vector of the current block by using the basic motion vector and a merged motion vector difference of the current block, wherein the merged motion vector difference of the current block is determined by using a distance index and a direction index of the merged motion vector difference of the current block; and reconstructing the current block by using the motion vector of the current block.
[0044] Determining a merged motion vector difference of a current block may include: obtaining a first binary bit of the distance index of the merged motion vector difference of the current block by performing entropy decoding on the bitstream using context information; and obtaining remaining binary bits of the distance index of the merged motion vector difference of the current block by performing entropy decoding on the bitstream in a bypass mode.
[0045] The maximum number of candidates allowed to be selected according to the merge candidate information may be smaller than the maximum number of candidates included in the merge candidate list.
[0046] The merge candidate information as 1-bit information may be obtained through entropy decoding by applying a piece of context information to the bitstream.
[0047] When prediction is performed in the merge mode, the number of pieces of context information required to obtain a general merge index indicating one candidate in the merge candidate list and the number of pieces of context information required to obtain the merge candidate information may be the same.
[0048] According to an embodiment of the present disclosure, a device for decoding motion information includes: an inter-frame prediction information obtainer, configured to: obtain merge difference mode information indicating whether to use a merged motion vector difference and a motion vector determined from a merge candidate list of a current block, and when the merged motion vector difference is used according to the merge difference mode information, obtain the merge candidate information from a bitstream; an inter-frame prediction executor, configured to: generate the merge candidate list including neighboring blocks, wherein the neighboring blocks are referenced for predicting the motion vector of the current block in a skip mode or a merge mode, determine a basic motion vector from the candidates determined in the merge candidate list based on the merge candidate information, determine the merged motion vector difference of the current block by using a distance index and a direction index of the merged motion vector difference of the current block, and determine the motion vector of the current block by using the basic motion vector and the merged motion vector difference of the current block; and a reconstructor, configured to: reconstruct the current block by using the motion vector of the current block.
[0049] The inter-frame prediction information obtainer can also be configured to: obtain the first binary bit of the distance index of the merged motion vector difference of the current block by performing entropy decoding on the bit stream using context information; and obtain the remaining binary bits of the distance index of the merged motion vector difference of the current block by performing entropy decoding on the bit stream in bypass mode.
[0050] The maximum number of candidates allowed to be selected according to the merge candidate information may be smaller than the maximum number of candidates included in the merge candidate list.
[0051] The inter prediction information obtainer may be further configured to obtain the merge candidate information as 1-bit information through entropy decoding by applying one piece of context information to the bitstream.
[0052] When prediction is performed in the merge mode, the number of pieces of context information required to obtain a general merge index indicating one candidate in the merge candidate list and the number of pieces of context information required to obtain the merge candidate information may be the same.
[0053] A video encoding method according to an embodiment of the present disclosure includes: when inter-frame prediction is performed on a current block in one of a skip mode and a merge mode, generating a merge candidate list including neighboring blocks referenced for predicting a motion vector of the current block; generating merge difference mode information indicating whether to use a merged motion vector difference and a basic motion vector determined from the merge candidate list; when using a merged motion vector difference, generating merge candidate information indicating a basic motion vector in the merge candidate list; generating a distance index of the merged motion vector difference corresponding to the difference between the basic motion vector and the motion vector of the current block and a direction index of the merged motion vector difference.
[0054] Generating the distance index and direction index of the merged motion vector difference may include: performing entropy encoding on a first binary bit of the distance index of the merged motion vector difference using context information; and performing entropy encoding on the remaining binary bits of the distance index of the merged motion vector difference in bypass mode.
[0055] A video encoding device according to an embodiment of the present disclosure includes: an inter-frame prediction executor, configured to: determine a motion vector of a current block by performing inter-frame prediction on the current block, and when inter-frame prediction is performed on the current block in one of a skip mode and a merge mode, generate a merge candidate list including neighboring blocks referenced for predicting the motion vector of the current block; and an inter-frame prediction information generator, configured to: generate merge difference mode information indicating whether to use a merged motion vector difference and a basic motion vector determined from the merge candidate list of the current block, and when the merged motion vector difference is used, generate merge candidate information indicating a basic motion vector in the merge candidate list, and generate a distance index and a direction index of the merged motion vector difference corresponding to the difference between the basic motion vector and the motion vector of the current block.
[0056] The inter prediction information generator may be further configured to: perform entropy encoding on a first binary bit of the distance index of the merged motion vector difference using context information; and perform entropy encoding on the remaining binary bits of the distance index of the merged motion vector difference in bypass mode.
[0057] A computer-readable recording medium having recorded thereon a program for implementing a video decoding method according to an embodiment of the present disclosure on a computer.
[0058] A computer-readable recording medium having recorded thereon a program for implementing the video encoding method according to an embodiment of the present disclosure on a computer. DETAILED DESCRIPTION
[0059] Since the present disclosure allows various changes and multiple examples, specific embodiments will be shown in the drawings and will be described in detail in the written description. However, this is not intended to limit the present disclosure to a specific practice mode, and it will be understood that all changes, equivalents and replacement forms that do not depart from the spirit and technical scope of the present disclosure are included in the present disclosure.
[0060] In the description of the embodiment, when it is considered that the specific detailed explanation of the prior art may unnecessarily obscure the main points of the present disclosure, these specific detailed explanations are omitted. In addition, the numbers (e.g., first, second, etc.) used in the description of the specification are only identification codes for distinguishing one element from another element.
[0061] Furthermore, in the present specification, it will be understood that when elements are “connected” or “coupled” to each other, unless specifically stated otherwise, the elements may be directly connected or coupled to each other, but may alternatively be directly connected or coupled to each other with an intermediate component interposed therebetween.
[0062] In this specification, with respect to an element represented as a "unit" or a "module", two or more elements may be combined into one element, or one element may be divided into two or more elements according to the sub-divided functions. In addition, each element described below may perform some or all of the functions performed by another element in addition to performing its own main function, and some of the main functions of each element may be fully performed by another component.
[0063] In addition, in this specification, "image" or "screen" may refer to a still image of a video or a moving image, that is, the video itself.
[0064] In addition, in this specification, "sample" means data assigned to a sample position of an image, that is, data to be processed. For example, a pixel value of an image in a spatial domain or a transform coefficient on a transform domain can be a sample. A unit including at least one such sample can be defined as a block.
[0065] Also, in this specification, a 'current block' may refer to a block of a maximum coding unit, a coding unit, a prediction unit, or a transformation unit to be encoded or decoded of a current image.
[0066] In the present specification, a motion vector in the list 0 direction may mean a motion vector indicating a block in a reference picture included in list 0, and a motion vector in the list 1 direction may mean a motion vector indicating a block in a reference picture included in list 1. In addition, a motion vector in one direction may mean a motion vector indicating a block in a reference picture included in list 0 or list 1, and a motion vector in two directions may mean that a motion vector includes a motion vector in the list 0 direction and a motion vector in the list 1 direction.
[0067] In the following, reference will be made to Figures 1 to 16 The image encoding device and the image decoding device as well as the image encoding method and the image decoding method according to the embodiment are described. Figures 3 to 16 A method for determining a data unit of an image according to an embodiment is described, and reference will be made to Figures 17 to 28 A video encoding / decoding method is described according to an embodiment by extending an inter prediction method by using a probabilistic motion representation method.
[0068] In the following, reference will be made to Figure 1 and Figure 2A method and apparatus for adaptive selection of coding units based on various shapes according to an embodiment of the present disclosure are described.
[0069] Figure 1 is a schematic block diagram of an image decoding apparatus according to an embodiment.
[0070] The image decoding apparatus 100 may include a receiver 110 and a decoder 120. The receiver 110 and the decoder 120 may include at least one processor. In addition, the receiver 110 and the decoder 120 may include a memory storing instructions to be executed by the at least one processor.
[0071] The receiver 110 may receive a bitstream. The bitstream includes information of an image encoded by the image encoding device 1700 described later. In addition, the bitstream may be transmitted from the image encoding device 1700. The image encoding device 1700 and the image decoding device 100 may be connected via wired or wireless connection, and the receiver 110 may receive the bitstream via wired or wireless connection. The receiver 110 may receive the bitstream from a storage medium such as an optical medium or a hard disk. The decoder 120 may reconstruct the image based on the information obtained from the received bitstream. The decoder 120 may obtain syntax elements for reconstructing the image from the bitstream. The decoder 120 may reconstruct the image based on the syntax elements.
[0072] Will refer to Figure 2 The operation of the image decoding apparatus 100 is described in detail.
[0073] Figure 2 is a flowchart of an image decoding method according to an embodiment.
[0074] According to an embodiment of the present disclosure, the receiver 110 receives a bit stream.
[0075] The image decoding apparatus 100 obtains a binary bit string corresponding to a division shape pattern of a coding unit from a bit stream (operation 210). The image decoding apparatus 100 determines a division rule of the coding unit (operation 220). In addition, the image decoding apparatus 100 divides the coding unit into a plurality of coding units based on at least one of the binary bit string corresponding to the division shape pattern and the division rule (operation 230). The image decoding apparatus 100 may determine an allowable first range of the size of the coding unit according to a ratio of a width to a height of the coding unit in order to determine the division rule. The image decoding apparatus 100 may determine an allowable second range of the size of the coding unit according to the division shape pattern of the coding unit in order to determine the division rule.
[0076] Hereinafter, the division of coding units will be described in detail according to an embodiment of the present disclosure.
[0077] First, a picture may be divided into one or more slices or one or more tiles. A slice or a tile may be a sequence of one or more maximum coding units (coding tree units (CTUs)). Conceptually, relative to the maximum coding unit (CTU), there is a maximum coding block (coding tree block (CTB)).
[0078] A maximum coding block (CTB) represents an N×N block (N is an integer) containing N×N samples. Each color component can be divided into one or more maximum coding blocks.
[0079] When the picture includes three sample arrays (sample arrays for Y component, Cr component and Cb component), the maximum coding unit (CTU) contains the maximum coding block of luma samples, two corresponding maximum coding blocks of chroma samples, and a syntax structure for encoding luma samples and chroma samples. When the picture is a monochrome picture, the maximum coding unit includes the maximum coding block of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture encoded in a color plane separated according to color components, the maximum coding unit includes a syntax structure for encoding the picture and the samples of the picture.
[0080] One maximum coding block (CTB) may be divided into M×N coding blocks (M and N are integers) including M×N samples.
[0081] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) includes a coding block of luma samples, two corresponding coding blocks of chroma samples, and a syntax structure for encoding luma samples and chroma samples. When the picture is a monochrome picture, the coding unit includes a coding block of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture encoded in a color plane separated according to color components, the coding unit includes a syntax structure for encoding the picture and the samples of the picture.
[0082] As described above, the maximum coding block and the maximum coding unit are conceptually distinguished from each other, and the coding block and the coding unit are conceptually distinguished from each other. That is, the (maximum) coding unit refers to a data structure including a (maximum) coding block containing corresponding samples and a grammatical structure corresponding to the (maximum) coding block. However, because a person of ordinary skill in the art understands that a (maximum) coding unit or a (maximum) coding block refers to a block of a specific size including a specific number of samples, unless otherwise specified, the maximum coding block and the maximum coding unit or the coding block and the coding unit are mentioned in the following description without distinction.
[0083] The image may be divided into maximum coding units (CTUs). The size of each maximum coding unit may be determined based on information obtained from the bitstream. The shape of each maximum coding unit may be a square shape of the same size. However, the present disclosure is not limited thereto.
[0084] For example, information about the maximum size of the luma coding block may be obtained from the bitstream. For example, the maximum size of the luma coding block indicated by the information about the maximum size of the luma coding block may be one of 4×4, 8×8, 16×16, 32×32, 64×64, 128×128, and 256×256.
[0085] For example, information about the luminance block size difference and the maximum size of the luminance coding block that can be divided into two may be obtained from the bitstream. The information about the luminance block size difference may refer to the size difference between the luminance maximum coding unit and the maximum luminance coding block that can be divided into two. Therefore, when the information about the maximum size of the luminance coding block that can be divided into two obtained from the bitstream and the information about the luminance block size difference are combined with each other, the size of the luminance maximum coding unit may be determined. The size of the chrominance maximum coding unit may be determined by using the size of the luminance maximum coding unit. For example, when the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chrominance block may be half the size of the luminance block, and the size of the chrominance maximum coding unit may be half the size of the luminance maximum coding unit.
[0086] According to an embodiment, since information about the maximum size of a brightness coding block that can be divided into two is obtained from a bitstream, the maximum size of a brightness coding block that can be divided into two can be variably determined. In contrast, the maximum size of a brightness coding block that can be divided into three can be fixed. For example, the maximum size of a brightness coding block that can be divided into three in an I picture can be 32×32, and the maximum size of a brightness coding block that can be divided into three in a P picture or a B picture can be 64×64.
[0087] In addition, the maximum coding unit may be hierarchically divided into coding units based on the division shape pattern information obtained from the bitstream. At least one of information indicating whether to perform four-division, information indicating whether to perform multi-division, division direction information, or division type information may be obtained from the bitstream as the division shape pattern information.
[0088] For example, the information indicating whether to perform four-split may indicate whether the current coding unit is divided into four (QUAD_SPLIT).
[0089] When the current coding unit is not divided into four parts, the information indicating whether to perform multi-split may indicate whether the current coding unit is no longer split (NO_SPLIT) or is divided into two parts / three parts.
[0090] When the current coding unit is two-partitioned or three-partitioned, the split direction information indicates that the current coding unit is split in one of a horizontal direction and a vertical direction.
[0091] When the current coding unit is split in the horizontal direction or the vertical direction, the split type information indicates whether the current coding unit is two-partitioned or three-partitioned.
[0092] The split mode of the current coding unit may be determined according to the split direction information and the split type information. The split mode when the current coding unit is split into two in the horizontal direction may be determined as a horizontal two-split mode (SPLIT_BT_HOR), the split mode when the current coding unit is split into three in the horizontal direction may be determined as a horizontal three-split mode (SPLIT_TT_HOR), the split mode when the current coding unit is split into two in the vertical direction may be determined as a vertical two-split mode (SPLIT_BT_VER), and the split mode when the current coding unit is split into three in the vertical direction may be determined as a vertical three-split mode (SPLIT_TT_VER).
[0093] The image decoding device 100 may obtain the division shape pattern information from a binary bit string from the bit stream. The form of the bit stream received by the image decoding device 100 may include a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. A binary bit (bin) string is information in a binary number. The bin string may include at least one bit. The image decoding device 100 may obtain the division shape pattern information corresponding to the bin string based on the division rule. The image decoding device 100 may determine whether to divide the coding unit into four, whether to not divide the coding unit, the division direction, and the division type based on a bin string.
[0094] The coding unit may be smaller than or equal to the maximum coding unit. For example, since the maximum coding unit is a coding unit having the maximum size, the maximum coding unit is one of the coding units. When the division shape pattern information about the maximum coding unit indicates that division is not performed, the coding unit determined in the maximum coding unit has the same size as the maximum coding unit. When the division shape pattern information about the maximum coding unit indicates that division is performed, the maximum coding unit may be divided into a plurality of coding units. In addition, when the division shape pattern information about the coding unit indicates that division is performed, the coding unit may be divided into smaller coding units. However, the division of the image is not limited thereto, and the maximum coding unit and the coding unit may not be distinguished. Reference will be made to Figures 3 to 16 The division of coding units is described in detail.
[0095] In addition, one or more prediction blocks for prediction may be determined from the coding unit. The prediction block may be the same as or smaller than the coding unit. In addition, one or more transform blocks for transformation may be determined from the coding unit. The transform block may be the same as or smaller than the coding unit.
[0096] The shapes and sizes of the transform block and the prediction block may be unrelated to each other.
[0097] In another embodiment, prediction may be performed by using a coding unit as a prediction unit. Also, transformation may be performed by using a coding unit as a transformation block.
[0098] Will refer to Figures 3 to 16 The division of the coding unit is described in detail. The current block and the neighboring block of the present disclosure may indicate one of the maximum coding unit, the coding unit, the prediction block, and the transformation block. In addition, the current block of 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 adjacent to the current block in space or time. The neighboring block may be located at one of the lower left, left side, upper left, top, upper right, right side, and lower right of the current block.
[0099] Figure 3 A process of determining at least one coding unit by splitting a current coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0100] The block shape may include 4N×4N, 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N. Here, N may be a positive integer. The block shape information is information indicating at least one of a shape, a direction, an aspect ratio, or a size of a coding unit.
[0101] The shape of the coding unit may include a square and a non-square. When the lengths of the width and height of the coding unit are the same (ie, when the block shape of the coding unit is 4N×4N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a square. The image decoding apparatus 100 may determine the shape of the coding unit as a non-square.
[0102] When the width and height of the coding unit are different from each other (that is, when the block shape of the coding unit is 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a non-square shape. When the shape of the coding unit is non-square, the image decoding apparatus 100 may determine the aspect ratio in the block shape information of the coding unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, or 32:1. In addition, the image decoding apparatus 100 may determine whether the coding unit is in the horizontal direction or in the vertical direction based on the length of the width and the length of the height of the coding unit. In addition, the image decoding apparatus 100 may determine the size of the coding unit based on at least one of the length of the width, the length of the height, or the area of the coding unit.
[0103] According to an embodiment of the present disclosure, the image decoding apparatus 100 may determine the shape of a coding unit by using block shape information, and may determine a division method of the coding unit by using division shape pattern information. That is, the coding unit division method indicated by the division shape pattern information may be determined according to the block shape indicated by the block shape information used by the image decoding apparatus 100.
[0104] The image decoding device 100 may obtain the division shape pattern information from the bitstream. However, the embodiment is not limited thereto, and the image decoding device 100 and the image encoding device 1700 may determine the pre-agreed division shape pattern information based on the block shape information. The image decoding device 100 may determine the pre-agreed division shape pattern information for the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine the division shape pattern information for the maximum coding unit to be four divisions. In addition, the image decoding device 100 may determine the division shape pattern information about the minimum coding unit to be "no division". Specifically, the image decoding device 100 may determine the size of the maximum coding unit to be 256×256. The image decoding device 100 may determine the pre-agreed division shape pattern information to be four divisions. Four divisions are division shape patterns in which the width and height of the coding unit are both divided into two. The image decoding device 100 may obtain a coding unit of size 128×128 from a maximum coding unit of size 256×256 based on the division shape pattern information. Also, the image decoding apparatus 100 may determine the size of the minimum coding unit to be 4 × 4. The image decoding apparatus 100 may obtain division shape pattern information indicating “do not perform division” with respect to the minimum coding unit.
[0105] According to an embodiment of the present disclosure, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a square shape. For example, the image decoding apparatus 100 may determine whether to not split the square coding unit, whether to vertically split the square coding unit, whether to horizontally split the square coding unit, or whether to split the square coding unit into four coding units based on the split shape mode information. Figure 3 , when the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may determine not to divide the coding unit 310a having the same size as the current coding unit 300 based on the division shape pattern information indicating that division is not performed, or may determine the coding units 310b, 310c, 310d, 310e, or 310f divided based on the division shape pattern information indicating a specific division method.
[0106] Reference Figure 3 According to an embodiment of the present disclosure, the image decoding apparatus 100 may determine two coding units 310b obtained by dividing the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that division is performed in the vertical direction. The image decoding apparatus 100 may determine two coding units 310c obtained by dividing the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that division is performed in the horizontal direction. The image decoding apparatus 100 may determine four coding units 310d obtained by dividing the current coding unit 300 in the vertical and horizontal directions based on the division shape pattern information indicating that division is performed in the vertical and horizontal directions. According to an embodiment, the image decoding apparatus 100 may determine three coding units 310e obtained by dividing the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that three divisions are performed in the vertical direction. The image decoding apparatus 100 may determine three coding units 310f obtained by dividing the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that three divisions are performed in the horizontal direction. However, the division method of the square coding unit is not limited to the above method, and the division shape pattern information may indicate various methods. A specific splitting method of splitting a square coding unit will be described in detail below in relation to various embodiments of the present disclosure.
[0107] Figure 4 A process of determining at least one coding unit by splitting a non-square coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0108] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a non-square shape. The image decoding apparatus 100 may determine whether to not split the non-square current coding unit or whether to split the non-square current coding unit by using a specific splitting method based on the splitting shape pattern information. Figure 4 , when the block shape information of the current coding unit 400 or 450 indicates a non-square shape, the image decoding apparatus 100 may determine not to split the coding unit 410 or 460 having the same size as the current coding unit 400 or 450 based on the split shape pattern information indicating that splitting is not performed, or determine the coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c split based on the split shape pattern information indicating a specific splitting method. A specific splitting method for splitting a non-square coding unit will be described in detail below in relation to various embodiments.
[0109] According to an embodiment, the image decoding apparatus 100 may determine a splitting method of a coding unit by using splitting shape pattern information, and in this case, the splitting shape pattern information may indicate the number of one or more coding units generated by splitting the coding unit. Figure 4 When the division shape pattern information indicates that the current coding unit 400 or 450 is divided into two coding units, the image decoding device 100 can determine the two coding units 420a and 420b or 470a and 470b included in the current coding unit 400 or 450 by dividing the current coding unit 400 or 450 based on the division shape pattern information.
[0110] According to an embodiment, when the image decoding apparatus 100 splits the non-square current coding unit 400 or 450 based on the split shape pattern information, the image decoding apparatus 100 may split the current coding unit in consideration of the position of the long side of the non-square current coding unit 400 or 450. For example, the image decoding apparatus 100 may determine a plurality of coding units by splitting the long side of the current coding unit 400 or 450 in consideration of the shape of the current coding unit 400 or 450.
[0111] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided (three-divided) into an odd number of blocks, the image decoding apparatus 100 may determine the odd number of coding units included in the current coding unit 400 or 450. For example, when the division shape pattern information indicates that the current coding unit 400 or 450 is divided into three coding units, the image decoding apparatus 100 may divide the current coding unit 400 or 450 into three coding units 430a, 430b, and 430c or 480a, 480b, and 480c.
[0112] According to an embodiment of the present disclosure, the ratio of the width and height of the current coding unit 400 or 450 may be 4:1 or 1:4. When the ratio of the width and the height is 4:1, since the length of the width is longer than the length of the height, the block shape information may be in the horizontal direction. When the ratio of the width and the height is 1:4, since the length of the width is shorter than the length of the height, the block shape information may be in the vertical direction. The image decoding apparatus 100 may determine the current coding unit to be divided into an odd number of blocks based on the division shape mode information. In addition, the image decoding apparatus 100 may determine the division direction of the current coding unit 400 or 450 based on the block shape information of the current coding unit 400 or 450. For example, when the current coding unit 400 is in the vertical direction, the image decoding apparatus 100 may determine the coding units 430a to 430c by dividing the current coding unit 400 in the horizontal direction. In addition, when the current coding unit 450 is in the horizontal direction, the image decoding apparatus 100 may determine the coding units 480a to 480c by dividing the current coding unit 450 in the vertical direction.
[0113] According to an embodiment of the present disclosure, the image decoding apparatus 100 may determine the odd-numbered coding units included in the current coding unit 400 or 450, and the sizes of all the determined coding units may not have the same size. For example, a specific coding unit 430b or 480b among the determined odd-numbered coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have a size different from that of other coding units 430a and 430c or 480a and 480c. That is, the coding unit determined by dividing the current coding unit 400 or 450 may have a plurality of sizes, and in some cases, all the odd-numbered coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have different sizes.
[0114] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of blocks, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and further may impose a specific restriction on at least one of the odd number of coding units generated by dividing the current coding unit 400 or 450. Figure 4, the image decoding apparatus 100 may set a decoding process of a coding unit 430b or 480b located at the center among three coding units 430a, 430b, and 430c or 480a, 480b, and 480c generated when the current coding unit 400 or 450 is split to be different from decoding processes of other coding units 430a and 430c or 480a or 480c. . For example, unlike other coding units 430a and 430c or 480a and 480c, the image decoding apparatus 100 may restrict the coding unit 430b or 480b at the center position from being further split or being split only a preset number of times.
[0115] Figure 5 A process of splitting a coding unit based on at least one of block shape information and division shape pattern information, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0116] According to an embodiment, the image decoding device 100 may determine whether to divide the square first coding unit 500 into coding units or not to divide the square first coding unit 500 based on at least one of the block shape information or the division shape pattern information. According to an embodiment, when the division shape pattern information indicates that the first coding unit 500 is divided in the horizontal direction, the image decoding device 100 may determine the second coding unit 510 by dividing the first coding unit 500 in the horizontal direction. The first coding unit, the second coding unit, and the third coding unit used according to the embodiment of the present disclosure are terms for understanding the relationship before and after the coding unit is divided. For example, the second coding unit may be determined by dividing the first coding unit, and the third coding unit may be determined by dividing the second coding unit. It will be understood that the structures of the first coding unit, the second coding unit, and the third coding unit follow the above description.
[0117] According to an embodiment, the image decoding apparatus 100 may determine whether to split the determined second coding unit 510 into coding units or not to split the determined second coding unit 510 based on the division shape pattern information. Figure 5, the image decoding apparatus 100 may or may not split the non-square second coding unit 510 determined by splitting the first coding unit 500 into one or more third coding units 520a or 520b, 520c, and 520d based on the split shape pattern information. The image decoding apparatus 100 may obtain the split shape pattern information, and may determine a plurality of second coding units (e.g., the second coding unit 510) of various shapes by splitting the first coding unit 500 based on the obtained split shape pattern information, and may split the second coding unit 510 by using the split method of the first coding unit 500 based on the split shape pattern information. According to an embodiment, when the first coding unit 500 is split into the second coding unit 510 based on the split shape pattern information of the first coding unit 500, the second coding unit 510 may also be split into the third coding units 520a or 520b, 520c, and 520d based on the split shape pattern information of the second coding unit 510. That is, the coding unit may be recursively split based on the split shape pattern information of each coding unit. Thus, a square coding unit may be determined by splitting a non-square coding unit, and a non-square coding unit may be determined by recursively splitting a square coding unit.
[0118] Reference Figure 5 , a specific coding unit (e.g., a coding unit at a center position or a square coding unit) among the odd-numbered third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510 may be recursively divided. According to an embodiment, the square third coding unit 520c among the odd-numbered third coding units 520b, 520c, and 520d may be divided into a plurality of fourth coding units in the horizontal direction. A non-square fourth coding unit 530b or 530d among the plurality of fourth coding units 530a, 530b, 530c, and 530d may be divided into a plurality of coding units again. For example, a non-square fourth coding unit 530b or 530d may be divided into an odd-numbered coding unit again. A method that can be used to recursively divide coding units will be described below in relation to various embodiments.
[0119] According to an embodiment, the image decoding device 100 may divide each of the third coding unit 520a or 520b, 520c, and 520d into coding units based on the division shape pattern information. In addition, the image decoding device 100 may determine not to divide the second coding unit 510 based on the division shape pattern information. According to an embodiment, the image decoding device 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The image decoding device 100 may impose specific restrictions on a specific third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding device 100 may limit the third coding unit 520c at the center position of the odd number of third coding units 520b, 520c, and 520d to no longer be divided or divided a set number of times.
[0120] Reference Figure 5 , the image decoding device 100 may limit the third coding unit 520c at the center position among the odd third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to no longer be divided, to be divided by using a specific division method (for example, only divided into four coding units or divided by using the division method of the second coding unit 510), or to be divided only a specific number of times (for example, only divided n times (where n>0)). However, the limitation on the third coding unit 520c at the center position is not limited to the above example, and may include various limitations for decoding the third coding unit 520c at the center position differently from the other third coding units 520b and 520d.
[0121] According to an embodiment of the present disclosure, the image decoding apparatus 100 may obtain split shape pattern information for splitting the current coding unit from a specific position in the current coding unit.
[0122] Figure 6 A method of determining a predetermined coding unit from among odd-numbered coding units, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0123] Reference Figure 6 , the division shape mode information of the current coding unit 600 or 650 may be obtained from a sample at a specific position (e.g., a sample 640 or 690 at a center position) among a plurality of samples included in the current coding unit 600 or 650. However, the specific position in the current coding unit 600 where at least one piece of division shape mode information may be obtained is not limited to Figure 6, and may include various positions (e.g., upper, lower, left, right, upper left, lower left, upper right, and lower right positions) included in the current coding unit 600. The image decoding apparatus 100 may obtain the division shape pattern information from a specific position, and may determine whether to divide the current coding unit into coding units of various shapes and sizes or not to divide the current coding unit.
[0124] According to an embodiment, when the current coding unit is divided into a specific number of coding units, the image decoding apparatus 100 may select one of the coding units. As will be described below in relation to various embodiments, various methods may be used to select one of the plurality of coding units.
[0125] According to an embodiment, the image decoding apparatus 100 may split a current coding unit into a plurality of coding units, and may determine a coding unit at a specific position.
[0126] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a center position among the odd-numbered coding units using information indicating the positions of the odd-numbered coding units. Figure 6 , the image decoding apparatus 100 may determine the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c by dividing the current coding unit 600 or the current coding unit 650. The image decoding apparatus 100 may determine the intermediate coding unit 620b or the intermediate coding unit 660b by using information about the positions of the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c. For example, the image decoding apparatus 100 may determine the coding unit 620b of the center position by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of specific samples included in the coding units 620a, 620b, and 620c. In detail, the image decoding apparatus 100 may determine the coding unit 620b at the center position by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of the upper left samples 630a, 630b, and 630c of the coding units 620a, 620b, and 620c.
[0127] According to an embodiment, the information indicating the positions of the upper left sample points 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture. According to an embodiment, the information indicating the positions of the upper left sample points 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information indicating the width or height of the coding units 620a, 620b, and 620c included in the current coding unit 600, and the width or height may correspond to the information indicating the difference between the coordinates of the coding units 620a, 620b, and 620c in the picture. That is, the image decoding apparatus 100 may determine the coding unit 620b at the center position by directly using the information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture or by using the information about the width or height of the coding unit corresponding to the difference between the coordinates.
[0128] According to an embodiment, information indicating the position of the upper left sample point 630a of the upper coding unit 620a may include coordinates (xa, ya), information indicating the position of the upper left sample point 630b of the middle coding unit 620b may include coordinates (xb, yb), and information indicating the position of the upper left sample point 630c of the lower coding unit 620c may include coordinates (xc, yc). The image decoding apparatus 100 may determine the middle coding unit 620b by using the coordinates of the upper left sample points 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c. For example, when the coordinates of the upper left sample points 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b including the coordinates (xb, yb) of the sample point 630b at the center position may be determined as the coding unit at the center position among the coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. However, the coordinates indicating the positions of the upper left sample points 630a, 630b, and 630c may include coordinates indicating absolute positions in the picture, or coordinates (dxb, dyb) indicating the relative position of the upper left sample point 630b of the middle coding unit 620b relative to the position of the upper left sample point 630a of the upper coding unit 620a and coordinates (dxc, dyc) indicating the relative position of the upper left sample point 630c of the lower coding unit 620c relative to the position of the upper left sample point 630a of the upper coding unit 620a may be used. A method of determining a coding unit at a specific position by using the coordinates of the sample points included in the coding unit as information indicating the positions of the sample points is not limited to the above method, and may include various arithmetic methods capable of using the coordinates of the sample points.
[0129] According to an embodiment, the image decoding apparatus 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c, and may select one of the coding units 620a, 620b, and 620c based on a specific criterion. For example, the image decoding apparatus 100 may select a coding unit 620b having a size different from that of other coding units from among the coding units 620a, 620b, and 620c.
[0130] According to an embodiment, the image decoding apparatus 100 may determine the width or height of each of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya) as information indicating the position of the upper left sample point 630a of the upper coding unit 620a, the coordinates (xb, yb) as information indicating the position of the upper left sample point 630b of the middle coding unit 620b, and the coordinates (xc, yc) as information indicating the position of the upper left sample point 630c of the lower coding unit 620c. The image decoding apparatus 100 may determine the size of each of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 620a, 620b, and 620c. According to an embodiment, the image decoding apparatus 100 may determine the width of the upper coding unit 620a as the width of the current coding unit 600. The image decoding apparatus 100 may determine the height of the upper coding unit 620b as yb-ya. According to an embodiment, the image decoding apparatus 100 may determine the width or height of the lower coding unit 620c by using the width or height of the current coding unit 600 or the width or height of the upper coding unit 620a and the intermediate coding unit 620b. The image decoding apparatus 100 may determine a coding unit having a size different from that of other coding units based on the determined widths and heights of the coding units 620a to 620c. Figure 6 , the image decoding apparatus 100 may determine the intermediate coding unit 620b having a size different from the sizes of the upper coding unit 620a and the lower coding unit 620c as the coding unit at the specific position. However, the above-mentioned method of determining the coding unit having a size different from the sizes of other coding units performed by the image decoding apparatus 100 corresponds only to an example of determining the coding unit at the specific position by using the size of the coding unit determined based on the coordinates of the sample points, and therefore, various methods of determining the coding unit at the specific position by comparing the size of the coding unit determined based on the coordinates of the specific sample points may be used.
[0131] The image decoding apparatus 100 may determine the width or height of each of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd) as information indicating the position of the upper left sample point 670a of the left coding unit 660a, the coordinates (xe, ye) as information indicating the position of the upper left sample point 670b of the middle coding unit 660b, and the coordinates (xf, yf) as information indicating the position of the upper left sample point 670c of the right coding unit 660c. The image decoding apparatus 100 may determine the respective sizes of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.
[0132] According to an embodiment, the image decoding device 100 may determine the width of the left coding unit 660a as xe-xd. The image decoding device 100 may determine the height of the left coding unit 660a as the height of the current coding unit 650. According to an embodiment, the image decoding device 100 may determine the width of the middle coding unit 660b as xf-xe. The image decoding device 100 may determine the height of the middle coding unit 660b as the height of the current coding unit 650. According to an embodiment, the image decoding device 100 may determine the width or height of the right coding unit 660c by using the width or height of the current coding unit 650, or the width or height of the left coding unit 660a and the middle coding unit 660b. The image decoding device 100 may determine a coding unit whose size is different from that of other coding units based on the determined width and height of the coding units 660a to 660c. Refer to Figure 6 , the image decoding apparatus 100 may determine the middle coding unit 660b having a size different from the sizes of the left coding unit 660a and the right coding unit 660c as the coding unit at the specific position. However, the above-mentioned method of determining the coding unit having a size different from the sizes of other coding units, performed by the image decoding apparatus, corresponds only to an example of determining the coding unit at the specific position by using the size of the coding unit determined based on the coordinates of the sample points, and therefore, various methods of determining the coding unit at the specific position by comparing the size of the coding unit determined based on the coordinates of the specific sample points may be used.
[0133] However, the position of the sample considered in determining the position of the coding unit is not limited to the above-mentioned upper left position, and information on arbitrary positions of the samples included in the coding unit may be used.
[0134] According to an embodiment, the image decoding apparatus 100 may select a coding unit at a specific position from an odd number of coding units determined by dividing the current coding unit, taking into account the shape of the current coding unit. For example, when the current coding unit has a non-square shape in which the width is greater than the height, the image decoding apparatus 100 may determine a coding unit at a specific position along the horizontal direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions along the horizontal direction and impose restrictions on the coding unit. When the current coding unit has a non-square shape in which the height is greater than the width, the image decoding apparatus 100 may determine a coding unit at a specific position along the vertical direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions along the vertical direction and may impose restrictions on the coding unit.
[0135] According to an embodiment, the image decoding apparatus 100 may use information indicating respective positions of even-numbered coding units to determine a coding unit at a specific position among the even-numbered coding units. The image decoding apparatus 100 may determine the even-numbered coding units by dividing (dividing) the current coding unit, and may determine the coding unit at the specific position by using information about the positions of the even-numbered coding units. Operations related thereto may be similar to those already described above with respect to Figure 6 The operation of determining a coding unit at a specific position (eg, a center position) among odd-numbered coding units described in detail corresponds to the above, and thus a detailed description thereof is not provided here.
[0136] According to an embodiment, when a non-square current coding unit is split into a plurality of coding units, specific information about a coding unit at a specific position may be used in a split operation to determine a coding unit at a specific position among the plurality of coding units. For example, the image decoding apparatus 100 may use at least one of block shape information or split shape pattern information stored in samples included in an intermediate coding unit to determine a coding unit at a center position among the plurality of coding units determined by splitting the current coding unit in a split operation.
[0137] Reference Figure 6, the image decoding apparatus 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on the division shape pattern information, and may determine the coding unit 620b at the center position among the plurality of coding units 620a, 620b, and 620c. In addition, the image decoding apparatus 100 may determine the coding unit 620b at the center position in consideration of the position where the division shape pattern information is obtained. That is, the division shape pattern information of the current coding unit 600 may be obtained from the sample point 640 at the center position of the current coding unit 600, and when the current coding unit 600 is divided into a plurality of coding units 620a, 620b, and 620c based on the division shape pattern information, the coding unit 620b including the sample point 640 may be determined as the coding unit at the center position. However, information for determining the coding unit at the center position is not limited to the division shape pattern information, and the coding unit at the center position may be determined using various types of information.
[0138] According to an embodiment, specific information for identifying a coding unit at a specific position may be obtained from a specific sample point included in a coding unit to be determined. Figure 6 , the image decoding apparatus 100 may determine a coding unit at a specific position (e.g., a coding unit at a center position of the divided coding units) among a plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, using division shape pattern information obtained from a sample at a specific position in the current coding unit 600 (e.g., a sample at a center position of the divided coding unit). That is, the image decoding apparatus 100 may determine a sample at a specific position by considering a block shape of the current coding unit 600, determine a coding unit 620b including a sample for which specific information (e.g., division shape pattern information) may be obtained from among a plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may impose specific restrictions on the coding unit 620b. Referring to Figure 6 According to an embodiment, in a decoding operation, the image decoding apparatus 100 may determine a sample 640 at a center position of a current coding unit 600 as a sample from which specific information may be obtained, and may impose a specific restriction on a coding unit 620b including the sample 640. However, the position of the sample from which specific information may be obtained is not limited to the above-mentioned position, and may include any position included in the coding unit 620b to be determined as a sample for restriction.
[0139] According to an embodiment, the position of the sample at which specific information can be obtained may be determined based on the shape of the current coding unit 600. According to an embodiment, the block shape information may indicate whether the current coding unit has a square shape or a non-square shape, and the position of the sample at which specific information can be obtained may be determined based on the shape. For example, the image decoding apparatus 100 may determine a sample located on a boundary for dividing at least one of the width or the height of the current coding unit in half as a sample at which specific information can be obtained by using at least one of the information about the width of the current coding unit and the information about the height of the current coding unit. As another example, when the block shape information of the current coding unit indicates a non-square shape, the image decoding apparatus 100 may determine one of the samples including the boundary for dividing the long side of the current coding unit in half as a sample at which predetermined information can be obtained.
[0140] According to an embodiment, when the current coding unit is divided into a plurality of coding units, the image decoding device 100 may use the division shape pattern information to determine the coding unit at a specific position in the plurality of coding units. According to an embodiment, the image decoding device 100 may obtain the division shape pattern information from the sample at the specific position in the coding unit, and divide the plurality of coding units generated by dividing the current coding unit by using the division shape pattern information, wherein the division shape pattern information is obtained from the sample at the specific position in each of the plurality of coding units. That is, the coding unit may be recursively divided based on the division shape pattern information obtained from the sample at the specific position in each coding unit. As has been described above with Figure 5 An operation of recursively splitting the coding unit is relatedly described, and thus a detailed description thereof will not be provided here.
[0141] According to an embodiment, the image decoding apparatus 100 may determine one or more coding units by splitting a current coding unit, and may determine an order in which to decode the one or more coding units based on a specific block (for example, the current coding unit).
[0142] Figure 7 An order in which a plurality of coding units are processed when an image decoding apparatus determines a plurality of coding units by splitting a current coding unit according to an embodiment is illustrated.
[0143] According to an embodiment, based on the division shape pattern information, the image decoding device 100 can determine the second coding units 710a and 710b by dividing the first coding unit 700 in the vertical direction, determine the second coding units 730a and 730b by dividing the first coding unit 700 in the horizontal direction, or determine the second coding units 750a to 750d by dividing the first coding unit 700 in the vertical direction and the horizontal direction.
[0144] Reference Figure 7 , the image decoding apparatus 100 may determine to process the second coding units 710a and 710b determined by dividing the first coding unit 700 in the vertical direction in a horizontal direction order 710c. The image decoding apparatus 100 may determine to process the second coding units 730a and 730b determined by dividing the first coding unit 700 in the horizontal direction in a vertical direction order 730c. The image decoding apparatus 100 may determine to process the second coding units 750a to 750d determined by dividing the first coding unit 700 in the vertical and horizontal directions in a specific order (e.g., a raster scan order or a Z scan order 750e) for processing coding units in one row and then processing coding units in the next row.
[0145] According to an embodiment, the image decoding apparatus 100 may recursively divide the coding unit. Figure 7 , the image decoding apparatus 100 may determine a plurality of coding units 710a and 710b, 730a and 730b, or 750a to 750d by dividing the first coding unit 700, and may recursively divide each of the determined plurality of coding units 710a, 710b, 730a and 730b, or 750a to 750d. A division method of the plurality of coding units 710a, 710b, 730a and 730b, or 750a to 750d may correspond to a division method of the first coding unit 700. In this way, each of the plurality of coding units 710a, 710b, 730a and 730b, or 750a to 750d may be independently divided into a plurality of coding units. Referring to Figure 7 , the image decoding apparatus 100 may determine the second coding units 710a and 710b by splitting the first coding unit 700 in a vertical direction, and may determine whether to independently split or not split each of the second coding units 710a and 710b.
[0146] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 720a and 720b by splitting the left second coding unit 710a in a horizontal direction, and may not split the right second coding unit 710b.
[0147] According to an embodiment, the processing order of the coding units may be determined based on the operation of dividing the coding units. In other words, the processing order of the coding units after the division may be determined based on the processing order of the coding units immediately before the division. The image decoding apparatus 100 may determine the processing order of the third coding units 720a and 720b determined by dividing the left second coding unit 710a independently of the right second coding unit 710b. Since the third coding units 720a and 720b are determined by dividing the left second coding unit 710a in the horizontal direction, the third coding units 720a and 720b may be processed in a vertical direction order 720c. Since the left second coding unit 710a and the right second coding unit 710b are processed in a horizontal direction order 710c, the right second coding unit 710b may be processed after the third coding units 720a and 720b included in the left second coding unit 710a are processed in a vertical direction order 720c. The operation of determining the processing order of coding units based on the coding units before splitting is not limited to the above example, and coding units split and determined to be various shapes may be independently processed in a specific order using various methods.
[0148] Figure 8 A process of determining that a current coding unit is to be split into an odd number of coding units when coding units may not be processed in a predetermined order, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0149] According to an embodiment, the image decoding apparatus 100 may determine whether to split the current coding unit into an odd number of coding units based on the obtained division shape pattern information. Figure 8 , the square first coding unit 800 may be divided into non-square second coding units 810a and 810b, and the second coding units 810a and 810b may be independently divided into third coding units 820a and 820b and 820c to 820e. According to an embodiment, the image decoding apparatus 100 may determine a plurality of third coding units 820a and 820b by dividing the left second coding unit 810a in the horizontal direction, and may divide the right second coding unit 810b into an odd number of third coding units 820c to 820e.
[0150] According to an embodiment, the image decoding apparatus 100 may determine whether an arbitrary coding unit is split into an odd number of coding units by determining whether the third coding units 820a and 820b and 820c to 820e can be processed in a specific order. Figure 8, the image decoding apparatus 100 may determine the third coding units 820a, 820b, and 820c to 820e by recursively dividing the first coding unit 800. The image decoding apparatus 100 may determine whether any one of the following coding units is divided into an odd number of coding units based on at least one of the block shape information or the division shape pattern information: the first coding unit 800, the second coding units 810a and 810b, and the third coding units 820a and 820b, and 820c to 820e. For example, the right second coding unit 810b of the second coding units 810a and 810b may be divided into an odd number of third coding units 820c, 820d, and 820e. The processing order of the multiple coding units included in the first coding unit 800 can be a specific order (for example, a zigzag scanning order 830), and the image decoding device 100 can determine whether the third coding units 820c, 820d and 820e determined by dividing the right second coding unit 810b into an odd number of coding units meet the conditions for processing in a specific order.
[0151] According to an embodiment, the image decoding apparatus 100 may determine whether the third coding units 820a and 820b and 820c to 820e included in the first coding unit 800 satisfy a condition for processing in a specific order, and the condition is related to whether at least one of the width or height of the second coding units 810a and 810b is divided in half along the boundary of the third coding units 820a and 820b and 820c to 820e. For example, the third coding units 820a and 820b determined when the height of the left second coding unit 810a of a non-square shape is divided in half may satisfy the condition. However, since the boundary of the third coding units 820c to 820e determined when the right second coding unit 810b is divided into three coding units cannot divide the width or height of the right second coding unit 810b in half, it may be determined that the third coding units 820c to 820e do not satisfy the condition. When the condition is not satisfied as described above, the image decoding apparatus 100 may determine that the scanning order is discontinuous, and may determine that the right second coding unit 810b is divided into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a specific restriction on the coding unit at a specific position in the divided coding unit. The restriction or the specific position has been described above in relation to various embodiments, and therefore a detailed description thereof is not provided here.
[0152] Fig. 9 A process of determining at least one coding unit by splitting a first coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0153] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 900 based on the division shape pattern information obtained by the receiver 110. The square first coding unit 900 may be divided into four square coding units, or may be divided into a plurality of non-square coding units. Fig. 9 , when the division shape pattern information indicates that the first coding unit 900 is divided into non-square coding units, the image decoding apparatus 100 may divide the first coding unit 900 into a plurality of non-square coding units. In detail, when the division shape pattern information indicates that an odd number of coding units is determined by dividing the first coding unit 900 in a horizontal direction or a vertical direction, the image decoding apparatus 100 may divide the square first coding unit 900 into an odd number of coding units (for example, second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in a vertical direction, or second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in a horizontal direction).
[0154] According to an embodiment, the image decoding apparatus 100 may determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit satisfy a condition for processing in a specific order, and the condition is related to whether at least one of the width or height of the first coding unit 900 is divided in half along the boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Fig. 9 , because the boundaries of the second coding units 910a, 910b, and 910c determined by dividing the first coding unit 900 in the vertical direction do not divide the height of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not satisfy the condition for processing in a specific order. In addition, because the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the first coding unit 900 in the horizontal direction do not divide the width of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not satisfy the condition for processing in a predetermined order. When the condition is not satisfied as described above, the image decoding apparatus 100 may determine that the scanning order is not continuous, and may determine that the first coding unit 900 is divided into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a specific restriction on the coding unit at a specific position in the divided coding unit. The restriction or the specific position has been described above in relation to various embodiments, and thus a detailed description thereof is not provided here.
[0155] According to an embodiment, the image decoding apparatus 100 may determine coding units of various shapes by splitting the first coding unit.
[0156] Reference Fig. 9 , the image decoding apparatus 100 may divide the square first coding unit 900 or the non-square first coding unit 930 or 950 into coding units of various shapes.
[0157] Fig.10 It is shown that when a second coding unit having a non-square shape determined when the image decoding apparatus splits a first coding unit satisfies a predetermined condition according to an embodiment, shapes into which the second coding unit can be split are limited.
[0158] According to an embodiment, the image decoding apparatus 100 may determine to divide the square first coding unit 1000 into non-square second coding units 1010a and 1010b, or 1020a and 1020b, based on the division shape pattern information obtained by the receiver 110. The second coding units 1010a and 1010b, or 1020a and 1020b may be independently divided. In this way, the image decoding apparatus 100 may determine to divide each of the second coding units 1010a and 1010b, or 1020a and 1020b into a plurality of coding units or not to divide each of the second coding units 1010a and 1010b, or 1020a and 1020b, based on the division shape pattern information of each of the second coding units 1010a and 1010b, or 1020a and 1020b. According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1012a and 1012b by splitting the non-square left second coding unit 1010a determined by splitting the first coding unit 1000 in the vertical direction in the horizontal direction. However, when the left second coding unit 1010a is split in the horizontal direction, the image decoding apparatus 100 may limit the right second coding unit 1010b to not be split in the horizontal direction in which the left second coding unit 1010a is split. When the third coding units 1014a and 1014b are determined by splitting the right second coding unit 1010b in the same direction, since the left second coding unit 1010a and the right second coding unit 1010b are independently split in the horizontal direction, the third coding units 1012a and 1012b, or 1014a and 1014b may be determined. However, this case has the same effect as the case where the image decoding apparatus 100 divides the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the division shape pattern information, and may be inefficient in terms of image decoding.
[0159] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1022a and 1022b, or 1024a and 1024b, by vertically splitting the non-square second coding unit 1020a or 1020b determined by horizontally splitting the first coding unit 1000. However, when the second coding unit (e.g., the upper second coding unit 1020a) is split in the vertical direction, the image decoding apparatus 100 may limit another second coding unit (e.g., the lower second coding unit 1020b) to not be split in the vertical direction in which the upper second coding unit 1020a is split for the above-mentioned reason.
[0160] Fig.11 A process of splitting a square coding unit when division shape pattern information cannot indicate that the square coding unit is split into four square coding units, performed by an image decoding apparatus according to an embodiment, is illustrated.
[0161] According to an embodiment, the image decoding apparatus 100 may determine the second coding units 1110a and 1110b, or 1120a and 1120b, etc. by dividing the first coding unit 1100 based on the division shape pattern information. The division shape pattern information may include information about various methods of dividing the coding unit, but the information about the various division methods may not include information for dividing the coding unit into four square coding units. According to such division shape pattern information, the image decoding apparatus 100 may not divide the square first coding unit 1100 into four square coding units 1130a, 1130b, 1130c, and 1130d. The image decoding apparatus 100 may determine the non-square second coding units 1110 and 1110b, or 1120a and 1120b, etc. based on the division shape pattern information.
[0162] According to an embodiment, the image decoding apparatus 100 may independently divide the non-square second coding units 1110a and 1110b, or 1120a and 1120b, etc. Each of the second coding units 1110a and 1110b, or 1120a and 1120b, etc. may be recursively divided in a specific order, and the division method may correspond to the method of dividing the first coding unit 1100 based on the division shape pattern information.
[0163] For example, the image decoding apparatus 100 may determine square third coding units 1112a and 1112b by dividing the left second coding unit 1110a in the horizontal direction, and may determine square third coding units 1114a and 1114b by dividing the right second coding unit 1110b in the horizontal direction. In addition, the image decoding apparatus 100 may determine square third coding units 1116a, 1116b, 1116c, and 1116d by dividing both the left second coding unit 1110a and the right second coding unit 1110b in the horizontal direction. In this case, coding units having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 may be determined.
[0164] As another example, the image decoding apparatus 100 may determine the third coding units 1122a and 1122b of the square shape by dividing the upper second coding unit 1120a in the vertical direction, and may determine the third coding units 1124a and 1124b of the square shape by dividing the lower second coding unit 1120b in the vertical direction. In addition, the image decoding apparatus 100 may determine the third coding units 1126a, 1126b, 1126c, and 1126d of the square shape by dividing both the upper second coding unit 1120a and the lower second coding unit 1120b in the vertical direction. In this case, a coding unit having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 may be determined.
[0165] Fig.12 It is shown that a processing order among a plurality of coding units according to an embodiment may be changed according to a process of splitting a coding unit.
[0166] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 1200 based on the division shape mode information. When the block shape indicates a square shape and the division shape mode information indicates that the first coding unit 1200 is divided in at least one of the horizontal direction or the vertical direction, the image decoding apparatus 100 may determine the second coding units 1210a and 1210b, or 1220a and 1220b, etc. by dividing the first coding unit 1200. Fig.12, the non-square second coding units 1210a and 1210b, or 1220a and 1220b determined by dividing the first coding unit 1200 only in the horizontal direction or the vertical direction may be independently divided based on the division shape pattern information of each coding unit. For example, the image decoding device 100 may determine the third coding units 1216a, 1216b, 1216c, and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in the vertical direction in the horizontal direction, and may determine the third coding units 1226a, 1226b, 1226c, and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 in the horizontal direction in the vertical direction. As has been described above, Fig.11 The operation of dividing the second coding units 1210a and 1210b, or 1220a and 1220b, has been described in detail, and thus a detailed description thereof will not be provided here.
[0167] According to an embodiment, the image decoding apparatus 100 may process coding units in a specific order. Figure 7 The operation of processing the encoding units in a predetermined order is described in detail, and thus a detailed description thereof will not be provided here. Fig.12 , the image decoding apparatus 100 may determine four square third coding units 1216a, 1216b, 1216c, 1216d, and 1226a, 1226b, 1226c, and 1226d by dividing the square first coding unit 1200. According to an embodiment, the image decoding apparatus 100 may determine a processing order of the third coding units 1216a, 1216b, 1216c, and 1216d, and 1226a, 1226b, 1226c, and 1226d based on a division method of the first coding unit.
[0168] According to an embodiment, the image decoding device 100 can determine the third coding units 1216a, 1216b, 1216c and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in the vertical direction in the horizontal direction, and can process the third coding units 1216a, 1216b, 1216c and 1216d in the following processing order 1217: first, the third coding units 1216a and 1216c included in the left second coding unit 1210a are processed in the vertical direction, and then the third coding units 1216b and 1216d included in the right second coding unit 1210b are processed in the vertical direction.
[0169] According to an embodiment, the image decoding device 100 can determine the third coding units 1226a, 1226b, 1226c and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 in the horizontal direction in the vertical direction, and can process the third coding units 1226a, 1226b, 1226c and 1226d in the following processing order 1227: first, the third coding units 1226a and 1226b included in the upper second coding unit 1220a are processed in the horizontal direction, and then the third coding units 1226c and 1226d included in the lower second coding unit 1220b are processed in the horizontal direction.
[0170] Reference Fig.12 , square third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d may be determined by dividing the second coding units 1210a and 1210b, and 1220a and 1220b, respectively. Although the second coding units 1210a and 1210b determined by splitting the first coding unit 1200 in the vertical direction are different from the second coding units 1220a and 1220b determined by splitting the first coding unit 1200 in the horizontal direction, the third coding units 1216a, 1216b, 1216c, and 1216d and the third coding units 1226a, 1226b, 1226c, and 1226d split from the second coding units 1210a and 1210b and the second coding units 1220a and 1220b ultimately show the same shape of coding units split from the first coding unit 1200. In this way, by recursively splitting the coding units in different ways based on the split shape pattern information, even if the coding units are ultimately determined to be the same shape, the image decoding apparatus 100 may process a plurality of coding units in different orders.
[0171] Fig.13 A process of determining a depth of a coding unit as a shape and a size of a coding unit change when a coding unit is recursively split so that a plurality of coding units are determined according to an embodiment is illustrated.
[0172] According to an embodiment, the image decoding device 100 may determine the depth of the coding unit based on a specific criterion. For example, the specific criterion may be the length of the long side of the coding unit. When the length of the long side of the coding unit before being divided is 2n (n>0) times the length of the long side of the current coding unit after being divided, the image decoding device 100 may determine that the depth of the current coding unit is increased by n compared to the depth of the coding unit before being divided. In the following description, the coding unit with an increased depth is represented as a coding unit of a lower depth.
[0173] Reference Fig.13 According to an embodiment, the image decoding apparatus 100 may determine a second coding unit 1302 and a third coding unit 1304 of a lower depth by dividing a square first coding unit 1300 based on block shape information indicating a square shape (for example, the block shape information may be represented as "0: SQUARE"). Assuming that the size of the square first coding unit 1300 is 2N×2N, the second coding unit 1302 determined by dividing the width and height of the first coding unit 1300 by 1 / 2 may have a size of N×N. In addition, the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 by 1 / 2 may have a size of N / 2×N / 2. In this case, the width and height of the third coding unit 1304 are 1 / 4 of the width and height of the first coding unit 1300. When the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302 whose width and height are 1 / 2 of the width and height of the first coding unit 1300 may be D+1, and the depth of the third coding unit 1304 whose width and height are 1 / 4 of the width and height of the first coding unit 1300 may be D+2.
[0174] According to an embodiment, the image decoding device 100 can determine the second coding unit 1312 or 1322 and the third coding unit 1314 or 1324 of a lower depth by dividing the non-square first coding unit 1310 or 1320 based on block shape information indicating a non-square shape (for example, the block shape information may be represented as "1: NS_VER" indicating a non-square shape in which the height is longer than the width, or may be represented as "2: NS_HOR" indicating a non-square shape in which the width is longer than the height).
[0175] The image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by dividing at least one of the width or the height of the first coding unit 1310 having a size of N×2N. That is, the image decoding apparatus 100 may determine the second coding unit 1302 having a size of N×N or the second coding unit 1322 having a size of N×N / 2 by dividing the first coding unit 1310 in a horizontal direction, or may determine the second coding unit 1312 having a size of N / 2×N by dividing the first coding unit 1310 in horizontal and vertical directions.
[0176] According to an embodiment, the image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by dividing at least one of the width or the height of the first coding unit 1320 having a size of 2N×N. That is, the image decoding apparatus 100 may determine the second coding unit 1302 having a size of N×N or the second coding unit 1312 having a size of N / 2×N by dividing the first coding unit 1320 in a vertical direction, or may determine the second coding unit 1322 having a size of N×N / 2 by dividing the first coding unit 1320 in horizontal and vertical directions.
[0177] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width or the height of the second coding unit 1302 having a size of N×N. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2, the third coding unit 1314 having a size of N / 4×N / 2, or the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1302 in the vertical direction and the horizontal direction.
[0178] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width or the height of the second coding unit 1312 having a size of N / 2×N. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1312 in a horizontal direction, or may determine the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1312 in a vertical direction and a horizontal direction.
[0179] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width or the height of the second coding unit 1322 having a size of N×N / 2. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1322 in a vertical direction, or may determine the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1322 in vertical and horizontal directions.
[0180] According to an embodiment, the image decoding apparatus 100 may split the square coding unit 1300, 1302, or 1304 in a horizontal direction or a vertical direction. For example, the image decoding apparatus 100 may determine the first coding unit 1310 having a size of N×2N by splitting the first coding unit 1300 having a size of 2N×2N in a vertical direction, or may determine the first coding unit 1320 having a size of 2N×N by splitting the first coding unit 1300 having a size of 2N×2N in a horizontal direction. According to an embodiment, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by splitting the first coding unit 1300 having a size of 2N×2N in a horizontal direction or a vertical direction may be the same as the depth of the first coding unit 1300.
[0181] According to an embodiment, the width and height of the third coding unit 1314 or 1324 may be 1 / 4 of the width and height of the first coding unit 1310 or 1320. When the depth of the first coding unit 1310 or 1320 is D, the depth of the second coding unit 1312 or 1322 whose width and height are 1 / 2 of the width and height of the first coding unit 1310 or 1320 may be D+1, and the depth of the third coding unit 1314 or 1324 whose width and height are 1 / 4 of the width and height of the first coding unit 1310 or 1320 may be D+2.
[0182] Fig.14 Depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.
[0183] According to an embodiment, the image decoding apparatus 100 may determine second coding units of various shapes by dividing the square first coding unit 1400. Fig.14 , the image decoding apparatus 100 may determine the second coding units 1402a and 1402b, the second coding units 1404a and 1404b, and the second coding units 1406a, 1406b, 1406c, and 1406d by dividing the first coding unit 1400 in at least one of the vertical direction and the horizontal direction based on the division shape pattern information. That is, the image decoding apparatus 100 may determine the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information of the first coding unit 1400.
[0184] According to an embodiment, the depths of the second coding units 1402a and 1402b, the second coding units 1404a and 1404b, and the second coding units 1406a, 1406b, 1406c, and 1406d determined based on the division shape pattern information of the square first coding unit 1400 may be determined based on the lengths of their long sides. For example, since the length of the side of the square first coding unit 1400 is equal to the length of the long side of the non-square second coding units 1402a and 1402b and 1404a and 1404b, the first coding unit 1400 and the non-square second coding units 1402a and 1402b and 1404a and 1404b may have the same depth, for example, D. However, when the image decoding device 100 divides the first coding unit 1400 into four square second coding units 1406a, 1406b, 1406c and 1406d based on the division shape pattern information, because the length of the side of the square second coding units 1406a, 1406b, 1406c and 1406d is 1 / 2 of the length of the side of the first coding unit 1400, the depth of the second coding units 1406a, 1406b, 1406c and 1406d can be D+1, which is 1 lower than the depth D of the first coding unit 1400.
[0185] According to an embodiment, the image decoding apparatus 100 may determine a plurality of second coding units 1412a and 1412b and 1414a, 1414b, and 1414c by horizontally dividing the first coding unit 1410 whose height is longer than the width based on the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may determine a plurality of second coding units 1422a and 1422b and 1424a, 1424b, and 1424c by vertically dividing the first coding unit 1420 whose width is longer than the height based on the division shape pattern information.
[0186] According to an embodiment, the depths of the second coding units 1412a and 1412b, and the second coding units 1414a, 1414b, and 1414c, or the second coding units 1422a and 1422b, and the second coding units 1424a, 1424b, and 1424c, determined based on the division shape pattern information of the non-square first coding unit 1410 or 1420, may be determined based on the lengths of their long sides. For example, since the lengths of the sides of the square second coding units 1412a and 1412b are 1 / 2 of the lengths of the long sides of the first coding unit 1410 having a non-square shape having a height longer than a width, the depths of the square second coding units 1412a and 1412b are D+1, which is 1 lower than the depth D of the non-square first coding unit 1410.
[0187] In addition, the image decoding apparatus 100 may divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the division shape pattern information. The odd number of second coding units 1414a, 1414b, and 1414c may include the non-square second coding units 1414a and 1414c and the square second coding unit 1414b. In this case, since the length of the long side of the non-square second coding units 1414a and 1414c and the length of the side of the square second coding unit 1414b are 1 / 2 of the length of the long side of the first coding unit 1410, the depth of the second coding units 1414a, 1414b, and 1414c may be D+1 which is 1 lower than the depth D of the non-square first coding unit 1410. The image decoding apparatus 100 may determine the depths of the coding units split from the first coding unit 1420 having a non-square shape having a width longer than a height by using the above-described method of determining the depths of the coding units split from the first coding unit 1410 .
[0188] According to an embodiment, when the odd-numbered divided coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for identifying the divided coding units based on a size ratio between the coding units. Fig.14 , the width of the coding unit 1414b at the center position among the odd-numbered divided coding units 1414a, 1414b, and 1414c may be equal to the width of the other coding units 1414a and 1414c and its height may be twice the height of the other coding units 1414a and 1414c. That is, in this case, the coding unit 1414b at the center position may include two other coding units 1414a or 1414c. Therefore, when the PID of the coding unit 1414b at the center position is 1 based on the scanning order, the PID of the coding unit 1414c located at a position adjacent to the coding unit 1414b may increase by 2 and may thus be 3. That is, there may be discontinuity in the PID value. According to an embodiment, the image decoding apparatus 100 may determine whether the odd-numbered divided coding units do not have equal sizes based on whether there is discontinuity in the PID for identifying the divided coding units.
[0189] According to an embodiment, the image decoding apparatus 100 may determine whether to use a specific splitting method based on a PID value for identifying a plurality of coding units determined by splitting a current coding unit. Fig.14, the image decoding apparatus 100 may determine even-numbered coding units 1412a and 1412b or odd-numbered coding units 1414a, 1414b, and 1414c by dividing the first coding unit 1410 having a rectangular shape having a height longer than a width. The image decoding apparatus 100 may identify each coding unit using a PID indicating each coding unit. According to an embodiment, the PID may be obtained from a sample at a specific position of each coding unit (e.g., an upper left sample).
[0190] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a specific position among the divided coding units by using a PID for distinguishing coding units. According to an embodiment, when the division shape pattern information of the first coding unit 1410 having a rectangular shape having a height longer than a width indicates that the coding unit is divided into three coding units, the image decoding apparatus 100 may divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The image decoding apparatus 100 may assign a PID to each of the three coding units 1414a, 1414b, and 1414c. The image decoding apparatus 100 may compare the PIDs of the odd-numbered divided coding units to determine a coding unit at a center position among the odd-numbered divided coding units. The image decoding apparatus 100 may determine the coding unit 1414b having a PID corresponding to an intermediate value among the PIDs of the coding units as a coding unit at a center position among the coding units determined by dividing the first coding unit 1410. According to an embodiment, when the divided coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for distinguishing the divided coding units based on a size ratio between the coding units. Fig.14, the width of the coding unit 1414b generated by dividing the first coding unit 1410 may be equal to the width of the other coding units 1414a and 1414c, and the height thereof may be twice the height of the other coding units 1414a and 1414c. In this case, when the PID of the coding unit 1414b at the center position is 1, the PID of the coding unit 1414c located at the adjacent position to the coding unit 1414b may be increased by 2 and thus may be 3. When the PID is not uniformly increased as described above, the image decoding apparatus 100 may determine that the coding unit is divided into a plurality of coding units, wherein the plurality of coding units include coding units having sizes different from sizes of other coding units. According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may divide the current coding unit in such a manner that a coding unit at a specific position (e.g., a coding unit at a center position) among the odd number of coding units has a size different from sizes of other coding units. In this case, the image decoding apparatus 100 may determine the coding units at the center position having different sizes by using the PIDs of the coding units. However, the PID and the size or position of the coding unit at a specific position are not limited to the above examples, and various PIDs and various positions and sizes of the coding unit may be used.
[0191] According to an embodiment, the image decoding apparatus 100 may use a specific data unit in which recursive splitting of a coding unit starts.
[0192] Fig.15 It is illustrated that a plurality of coding units are determined based on a plurality of specific data units included in a picture according to an embodiment.
[0193] According to an embodiment, a specific data unit may be defined as a data unit for recursively dividing a coding unit starting by using division shape pattern information. That is, the specific data unit may correspond to a coding unit for determining a highest depth of a plurality of coding units divided from a current picture. In the following description, for ease of explanation, the specific data unit is referred to as a reference data unit.
[0194] According to an embodiment, the reference data unit may have a specific size and a specific size shape. According to an embodiment, the reference data unit may include M×N samples. Here, M and N may be equal to each other and may be an integer represented as a power of 2. That is, the reference data unit may have a square shape or a non-square shape and may be divided into an integer number of coding units.
[0195] According to an embodiment, the image decoding apparatus 100 may divide the current picture into a plurality of reference data units. According to an embodiment, the image decoding apparatus 100 may divide the plurality of reference data units divided from the current picture by using the division shape pattern information of each reference data unit. The operation of dividing the reference data unit may correspond to the division operation using a quadtree structure.
[0196] According to an embodiment, the image decoding apparatus 100 may predetermine a minimum size allowed for a reference data unit included in the current picture. Therefore, the image decoding apparatus 100 may determine various reference data units having a size equal to or larger than the minimum size, and may determine one or more coding units by using the division shape pattern information with reference to the determined reference data unit.
[0197] Reference Fig.15 , the image decoding apparatus 100 may use a square reference coding unit 1500 or a non-square reference coding unit 1502. According to an embodiment, the shape and size of the reference coding unit may be determined based on various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, a maximum coding unit, etc.) that can include one or more reference coding units.
[0198] According to an embodiment, the receiver 110 of the image decoding apparatus 100 may obtain at least one of reference coding unit shape information and reference coding unit size information for each of various data units from a bitstream. Figure 3 The operation of dividing the square reference coding unit 1500 into one or more coding units is described in relation to the operation of dividing the current coding unit 300, and the above has been described with Figure 4 The operation of splitting the non-square reference coding unit 1502 into one or more coding units is described in relation to the operation of splitting the current coding unit 400 or 450. Therefore, a detailed description thereof is not provided here.
[0199] According to an embodiment, the image decoding apparatus 100 may determine the size and shape of the reference coding unit using a PID for identifying the size and shape of the reference coding unit according to some data units predetermined based on a specific condition. That is, the receiver 110 may obtain only the PID for identifying the size and shape of the reference coding unit for each slice, slice segment, tile, tile group, or maximum coding unit from the bitstream, wherein the slice, slice segment, or maximum coding unit is a data unit (e.g., a data unit having a size equal to or smaller than a slice) among various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, a maximum coding unit, etc.) that satisfies a predetermined condition. The image decoding apparatus 100 may determine the size and shape of the reference data unit for each data unit that satisfies the specific condition by using the PID. When the reference coding unit shape information and the reference coding unit size information are obtained and used from the bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high, and therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the sizes or shapes of the reference coding units corresponding to the PID for identifying the size and shape of the reference coding units may be predetermined. That is, the image decoding apparatus 100 may determine at least one of the sizes or shapes of the reference coding units included in the data unit serving as the unit for obtaining the PID by selecting at least one of the sizes or shapes of the reference coding units predetermined based on the PID.
[0200] According to an embodiment, the image decoding device 100 may use one or more reference coding units included in the maximum coding unit. That is, the maximum coding unit divided from the picture may include one or more reference coding units, and the coding unit may be determined by recursively dividing each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit may be an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be obtained by dividing the maximum coding unit n times based on a quadtree structure. That is, according to various embodiments, the image decoding device 100 may determine the reference coding unit by dividing the maximum coding unit n times based on a quadtree structure, and the reference coding unit may be divided based on at least one of the block shape information and the division shape mode information.
[0201] According to an embodiment, the image decoding device 100 may obtain block shape information indicating the shape of the current coding unit or division shape pattern information indicating the division method of the current coding unit from the bitstream, and may use the obtained information. The division shape pattern information may be included in the bitstream associated with various data units. For example, the image decoding device 100 may use the division shape pattern information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a parallel block header, or a parallel block group header. In addition, the image decoding device 100 may obtain a syntax element corresponding to the block shape information or the division shape pattern information from the bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and may use the obtained syntax element.
[0202] Hereinafter, a method for determining a division rule according to an embodiment of the present disclosure will be described in detail.
[0203] The image decoding apparatus 100 may determine a division rule of an image. The division rule may be predetermined between the image decoding apparatus 100 and the image encoding apparatus 1700. The image decoding apparatus 100 may determine a division rule of an image based on information obtained from a bitstream. The image decoding apparatus 100 may determine a division rule based on information obtained from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, or a tile group header. The image decoding apparatus 100 may determine a division rule differently according to a frame, a slice, a tile, a temporal layer, a maximum coding unit, or a coding unit.
[0204] The image decoding device 100 may determine the division rule based on the block shape of the coding unit. The block shape may include the size, shape, width to height ratio, and direction of the coding unit. The image decoding device 100 may determine the division rule based on the block shape information of the coding unit in advance. However, the present disclosure is not limited to this. The image decoding device 100 may determine the image division rule based on information obtained from the received bit stream.
[0205] The shape of the coding unit may include a square and a non-square. When the lengths of the width and height of the coding unit are the same, the image decoding apparatus 100 may determine the shape of the coding unit as a square. In addition, when the lengths of the width and height of the coding unit are different, the image decoding apparatus 100 may determine the shape of the coding unit as a non-square.
[0206] The size of the coding unit may include various sizes, such as 4×4, 8×4, 4×8, 8×8, 16×4, 16×8, and 256×256. The size of the coding unit may be classified based on the length of the long side, the length of the short side, or the area of the coding unit. The image decoding apparatus 100 may apply the same division rule to the coding units classified into the same group. For example, the image decoding apparatus 100 may classify the coding units having the same long side length as having the same size. In addition, the image decoding apparatus 100 may apply the same division rule to the coding units having the same long side length.
[0207] The ratio of the width and 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, 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 its height. The vertical direction may indicate a case where the length of the width of the coding unit is shorter than the length of its height.
[0208] The image decoding apparatus 100 may adaptively determine the division rule based on the size of the coding unit. The image decoding apparatus 100 may determine the allowable division shape mode differently based on the size of the coding unit. For example, the image decoding apparatus 100 may determine whether to allow division based on the size of the coding unit. The image decoding apparatus 100 may determine the division direction according to the size of the coding unit. The image decoding apparatus 100 may determine the allowable division type according to the size of the coding unit.
[0209] The division rule determined based on the size of the coding unit may be a division rule predetermined in the image decoding apparatus 100. Also, the image decoding apparatus 100 may determine the division rule based on information obtained from a bitstream.
[0210] The image decoding apparatus 100 may adaptively determine a split rule based on a location of a coding unit. The image decoding apparatus 100 may adaptively determine a split rule based on a location of a coding unit in an image.
[0211] In addition, the image decoding apparatus 100 may determine a division rule so that the coding units generated via different division paths do not have the same block shape. However, the present disclosure is not limited thereto, and the coding units generated via different division paths have the same block shape. The coding units generated via different division paths may have different decoding processing orders. As has been mentioned above, Fig.12 The decoding process order is described, so its details are not provided again.
[0212] Fig.16 It is a block diagram of an image encoding and decoding system.
[0213] The encoding end 1610 of the image encoding and decoding system 1600 transmits an encoded bit stream of an image, and the decoding end 1650 outputs a reconstructed image by receiving and decoding the bit stream. Here, the decoding end 1650 may have a configuration similar to that of the image decoding apparatus 100.
[0214] At the encoding end 1610, the prediction encoder 1615 outputs a reference image via inter-frame prediction and intra-frame prediction, and the transformer and quantizer 1620 quantizes the residual data between the reference picture and the current input image into quantized transform coefficients and outputs the quantized transform coefficients. The entropy encoder 1625 transforms the quantized transform coefficients by encoding the quantized transform coefficients, and outputs the quantized transform coefficients as a bit stream. The quantized transform coefficients are reconstructed into data in the spatial domain via the inverse quantizer and inverse transformer 1630, and the data in the spatial domain is output as a reconstructed image via the deblocking filter 1635 and the loop filter 1640. The reconstructed image can be used as a reference image for the next input image via the prediction encoder 1615.
[0215] The encoded image data in the bit stream received by the decoding end 1650 is reconstructed into residual data in the spatial domain via the entropy decoder 1655 and the inverse quantizer and inverse transformer 1660. When the residual data output from the prediction decoder 1675 is combined with the reference image, the image data in the spatial domain is configured, and the deblocking filter 1665 and the loop filter 1670 can output a reconstructed image about the current original image by filtering the image data in the spatial domain. The reconstructed image can be used by the prediction decoder 1675 as a reference image for the next original image.
[0216] The loop filter 1640 of the encoding end 1610 performs loop filtering by using filter information input according to user input or system settings. The filter information used by the loop filter 1640 is output to the entropy encoder 1625 and is sent to the decoding end 1650 together with the encoded image data. The loop filter 1670 of the decoding end 1650 may perform loop filtering based on the filter information input from the decoding end 1650.
[0217] In the following, reference will be made to Figures 17 to 20 A method and apparatus for encoding or decoding a video by extending an inter-frame prediction method by using a probabilistic motion representation method according to an embodiment of the present disclosure are described.
[0218] Fig.17 is a block diagram of a video decoding apparatus according to an embodiment.
[0219] Reference Fig.17 , the video decoding apparatus 1700 according to an embodiment may include an inter prediction information obtainer 1710 , an inter prediction performer 1720 , and a reconstructor 1730 .
[0220] The video decoding apparatus 1700 may 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.
[0221] The video decoding apparatus 1700 according to an embodiment may include a central processor (not shown) for controlling the inter-prediction information obtainer 1710, the inter-prediction performer 1720, and the reconstructor 1730. Alternatively, the inter-prediction information obtainer 1710, the inter-prediction performer 1720, and the reconstructor 1730 may be operated by their own processors (not shown), and the processors may operate systematically with each other to operate the video decoding apparatus 1700. Alternatively, the inter-prediction information obtainer 1710, the inter-prediction performer 1720, and the reconstructor 1730 may be controlled according to the control of an external processor (not shown) of the video decoding apparatus 1700.
[0222] The video decoding apparatus 1700 may include one or more data memories (not shown) storing input / output data of the inter prediction information obtainer 1710, the inter prediction performer 1720, and the reconstructor 1730. The video decoding apparatus 1700 may include a memory controller (not shown) for controlling data input and output of the data memories.
[0223] The video decoding device 1700 can perform image decoding operations including prediction by operating in connection with an internal video decoding processor or an external video decoding processor so as to reconstruct an image via image decoding. The internal video decoding processor of the video decoding device 1700 according to an embodiment can perform basic image decoding operations not only as a separate processor but also as a central processing device or a graphics processing device including an image decoding processing module.
[0224] The video decoding apparatus 1700 may be included in the above-mentioned image decoding apparatus 100. For example, the inter-frame prediction information obtainer 1710 may be included in Figure 1 The inter prediction performer 1720 and the reconstructor 1730 may be included in the receiver 110 of the image decoding apparatus 100 , and the inter prediction performer 1720 and the reconstructor 1730 may be included in the decoder 120 of the image decoding apparatus 100 .
[0225] The inter prediction information obtainer 1710 receives a bitstream generated as a result of encoding an image. The bitstream may include information for determining a motion vector for inter prediction of a current block. The current block is a block generated when an image is divided according to a tree structure, and may correspond to a maximum coding unit, a coding unit, or a transformation unit, for example.
[0226] The inter prediction information obtainer 1710 may determine the current block based on the block shape information and / or the information about the partition shape mode included in at least one of the sequence parameter set, the picture parameter set, the video parameter set, the slice header, and the slice segment header. In addition, the inter prediction information obtainer 1710 may obtain a syntax element corresponding to the block shape information or the information about the partition shape mode from the bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and may determine the current block using the obtained syntax element.
[0227] The bitstream may include information indicating a prediction mode of the current block, and the prediction mode of the current block may include an intra mode and an inter mode. When the prediction mode of the current block is an inter mode, the encoding / decoding method of the motion vector may include at least one of a merge mode, a skip mode, and a merged motion vector difference mode according to the present disclosure. The merged motion vector difference mode may be a mode for determining a predicted motion vector of the current block by applying a motion vector difference distinguished according to a differential distance and a differential direction to one basic motion vector determined based on a merged motion vector candidate.
[0228] According to an embodiment, information related to the merged motion vector difference mode may be obtained from a bitstream. The information related to the merged motion vector difference mode according to an embodiment may include at least one of the following items: information indicating whether the merged motion vector difference mode is applied to the current block (hereinafter referred to as merged difference mode information), information indicating a basic motion vector of the current block (hereinafter referred to as merged candidate information), information indicating a differential distance from the basic motion vector to the motion vector candidate (hereinafter referred to as a differential distance index), and information indicating a differential direction from the basic motion vector to the motion vector candidate (hereinafter referred to as a differential direction index).
[0229] The inter prediction information obtainer 1710 may obtain information about a merge motion vector difference mode from a level corresponding to at least one of a coding unit, a transformation unit, a maximum coding unit, a slice unit, and a picture unit.
[0230] The inter prediction performer 1720 determines a motion vector of a current block based on information included in a bitstream.
[0231] The inter prediction performer 1720 may verify whether the merge motion vector difference mode is applied to the current block based on information included in the bitstream. The information indicating whether the merge motion vector difference mode is applied may include a flag or an index.
[0232] According to an embodiment, when the skip mode or the merge mode is applied to the current block, the inter prediction information obtainer 1710 may extract information indicating whether the merge motion vector difference mode is applied from a bitstream.
[0233] When the merge motion vector difference mode is applied to the current block, motion vector candidates may be set according to variable difference distances and difference directions from a basic motion vector.
[0234] The differential distance is a value determined based on a basic pixel unit (e.g., 1 / 4 pixel unit), and may indicate how many basic pixel units are different. For example, when the differential distance between a basic motion vector and a motion vector is 1, the motion vector and the basic motion vector differ by a pixel distance corresponding to one 1 / 4 pixel unit. The differential distance may have a value corresponding to an integer, a rational number, or an irrational number.
[0235] When the minimum pixel unit that can be indicated by the motion vector of the current block is the same as the basic pixel unit, the inter prediction performer 1720 may determine the motion vector according to a predetermined differential distance.
[0236] However, when the minimum pixel unit that can be indicated by the motion vector of the current block is different from the basic pixel unit, the inter prediction performer 1720 may scale the predetermined differential distance and then determine a motion vector candidate for the basic motion vector based on the scaled differential distance.
[0237] When the motion vector of the current block can indicate pixels corresponding to integer pixel units, 1 / 2 pixel units, 1 / 4 pixel units, and 1 / 8 pixel units, the minimum pixel unit that can be indicated by the motion vector of the current block is the 1 / 8 pixel unit. In addition, when the basic pixel unit is the 1 / 4 pixel unit, the inter prediction performer 1720 may enlarge the differential distance used to determine the motion vector.
[0238] According to an embodiment, the inter prediction performer 1720 may scale the differential distance according to a ratio of a basic pixel unit to a minimum pixel unit that can be indicated by a motion vector of the current block.
[0239] According to an embodiment, when the basic pixel unit is larger than the minimum pixel unit that can be indicated by the motion vector of the current block, the inter prediction performer 1720 may enlarge the differential distance.
[0240] According to an embodiment, a basic motion vector of a current block may be determined from a merge candidate list used in a skip mode and a merge mode. The merge candidate list may include neighboring blocks related to the current block in space and time. Neighboring blocks related to the current block in space and time may include blocks decoded before the current block. Therefore, a basic motion vector according to an embodiment may be determined based on motion vectors of neighboring blocks determined from the merge candidate list.
[0241] The neighboring blocks spatially related to the current block may include, for example, a block located on the left side of the current block and a block located on the top of the current block, but are not limited thereto. In addition, the neighboring blocks temporally related to the current block may include, for example, a block located at the same point as the current block among blocks included in a reference picture different from a current picture including the current block and a block spatially adjacent to the block at the same point.
[0242] According to an embodiment, the inter prediction performer 1720 may determine a motion vector of a neighboring block related to the current block as a basic motion vector. The inter prediction performer 1720 may determine the basic motion vector in the merge candidate list by using merge candidate information obtained from a bitstream.
[0243] The merge candidate information according to an embodiment may indicate up to the second candidate in the merge candidate list.
[0244] Alternatively, the inter prediction performer 1720 may modify a motion vector of a neighboring block related to the current block, and determine the modified motion vector as a basic motion vector. According to an embodiment, the inter prediction performer 1720 may determine the basic motion vector in the same manner as a method of determining a candidate list of motion vector predictors in an advanced motion vector prediction (AMVP) mode of the high efficiency video coding (HEVC) standard.
[0245] According to an embodiment, the inter prediction performer 1720 may determine a zero motion vector having a component of 0 as a basic motion vector.
[0246] The merge candidate information of the current block according to an embodiment may be encoded via a fixed length coding (FLC) method, a unary coding method, or a truncated unary coding method and then included in the bitstream. For example, when the merge candidate information is decoded via the FLC method, the cMax value may be 1.
[0247] When the basic motion vector of the current block is determined, the inter prediction performer 1720 may determine a motion vector by applying the basic motion vector to the merged motion vector difference.
[0248] The inter prediction information obtainer 1710 may obtain information indicating at least one of a differential distance index and a differential direction index from a bitstream, and the inter prediction performer 1720 may determine a merged 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 may be determined from the basic motion vector.
[0249] The inter prediction information obtainer 1710 according to an embodiment may decode the differential distance index via a truncated unary encoding method, and at this time, the cMax value may be 7 and the cRiceParam value may be 0. The inter prediction information obtainer 1710 according to an embodiment may decode the differential direction index via an FLC method, and at this time, the cMax value may be 3 and the cRiceParam value may be 0.
[0250] The inter prediction performer 1720 according to an embodiment may scale the differential distance verified from the bitstream according to the ratio of the basic pixel unit to the minimum pixel unit that can be indicated by the motion vector of the current block. When the basic pixel unit (e.g., 1 / 4 pixel unit) is larger than the minimum pixel unit (e.g., 1 / 8 pixel unit) that can be indicated by the motion vector of the current block, the inter prediction performer 1720 may enlarge the differential distance verified from the bitstream.
[0251] The scaled differential distance may indicate how many minimum pixel units are different. For example, when the minimum pixel unit that can be indicated by the motion vector of the current block is a 1 / 8 pixel unit and the scaled differential distance is 2, the inter prediction performer 1720 may determine a motion vector that differs from the basic motion vector by a pixel distance corresponding to two 1 / 8 pixel units.
[0252] As described above, the differential distance predetermined based on the basic pixel unit is used to determine the motion vector of the current block based on the basic motion vector determined from the merge candidate list, and because information indicating the differential distance based on the basic pixel unit is transmitted by signal via the bitstream, the inter-frame prediction executor 1720 having the accuracy capable of indicating the minimum pixel unit different from the basic pixel unit scales the differential distance transmitted by signal via the bitstream according to the minimum pixel unit.
[0253] The differential distance determined based on the basic pixel unit and the differential distance scaled based on the minimum pixel unit may be the same with respect to the pixel distance.
[0254] According to an embodiment, information indicating a minimum pixel unit that can be indicated by a motion vector of a current block may be included in a bitstream. The inter prediction information obtainer 1710 may obtain information indicating a minimum pixel unit from a bitstream corresponding to at least one level of a block, a slice, and a picture.
[0255] At least one of a differential distance index and a differential direction index for determining a motion vector of a current block may 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.
[0256] The inter prediction information obtainer 1710 according to an embodiment may obtain some binary bits in the differential distance index by performing entropy decoding using context information (context variable), and may obtain the remaining binary bits by performing entropy decoding in a bypass mode.
[0257] By performing entropy decoding on the bitstream in a context-adaptive binary arithmetic coding (CABAC) manner, each binary bit of the syntax element can be extracted, and context information can be used for each binary bit. Without using context information, decoding in bypass mode, probability-based entropy decoding can be performed with equal probability (0.5). For entropy decoding of the current binary bit, it is determined whether to use context information and which context information to use.
[0258] The inter-frame prediction information obtainer 1710 according to an embodiment may perform entropy decoding on the bitstream using context information and obtain the first binary bit of the distance index of the merged motion vector difference. In addition, the inter-frame prediction information obtainer 1710 may obtain the remaining binary bits of the distance index of the merged motion vector difference by performing entropy decoding on the bitstream in bypass mode.
[0259] The inter prediction information obtainer 1710 according to an embodiment may perform entropy decoding on a bitstream in a bypass mode to obtain binary bits of two bits indicating a differential direction index.
[0260] The inter prediction information obtainer 1710 may obtain information indicating a residual motion vector from a bitstream at a transform unit level, a coding unit level, a maximum coding unit level, a slice level, or a picture level.
[0261] The following will refer to Fig.21 Motion vector candidates that can be determined from a base motion vector in a merge motion vector difference mode according to an embodiment are described.
[0262] Fig.21 Shows the positions of motion vector candidates according to an embodiment.
[0263] The inter prediction performer 1720 according to an embodiment may determine the motion vector of the current block by applying the merged motion vector difference to the basic motion vector. According to an embodiment, when the prediction direction of the current block is bidirectional, the merged motion vector difference may be included in the bitstream only for one direction. For example, information indicating the merged motion vector difference may be included in the bitstream only for one direction of either the list 0 direction or the list 1 direction.
[0264] Fig.21 Motion vectors that may be determined in merged motion vector difference mode in bi-directional prediction are shown.
[0265] A basic motion vector 2125 in the L0 direction and a basic motion vector 2135 in the L1 direction of the current block 2110 of the current picture 2100 are determined from the merge candidate list. The basic motion vector 2125 in the L0 direction indicates the position of the dotted shape in the L0 reference picture 2120, and the basic motion vector 2135 in the L1 direction indicates the position of the dotted shape in the L1 reference picture 2130.
[0266] However, in the merge motion vector difference mode, the motion vector difference may be applied to each of the basic motion vector 2135 and the basic motion vector 2125 in the L1 direction based on the differential direction index and the differential distance index.
[0267] For example, it may be determined whether the distance between the basic motion vector and the motion vector candidate is s, 2s, 3s, etc. according to the differential distance index. When the differential distance index indicates s, the motion vector candidate generated as a result of applying the motion vector difference to the basic motion vector may indicate the position of the black circle in the L0 reference picture 2120 and the L1 reference picture 2130. When the differential distance index indicates 2s, the motion vector candidate generated as a result of applying the motion vector difference to the basic motion vector may indicate the position of the white circle in the L0 reference picture 2120 and the L1 reference picture 2130.
[0268] For example, whether the direction between the basic motion vector and the motion vector candidate is + or - in the x-axis direction and the y-axis direction may be determined according to the differential direction index. In particular, the differential direction index may indicate one of (+, 0), (-, 0), (0, +), and (0, -) in the (x, y)-axis direction.
[0269] Therefore, a motion vector indicating one position of the L0 reference picture 2120 and the L1 reference picture 2130 may be determined by combining the differential distance index and the differential direction index.
[0270] In the following, reference will be made to Fig. 22 A method of determining motion vector candidates that can be determined from a base motion vector is described. Fig. 22 is a diagram showing motion vector candidates displayed on a coordinate plane, and shows motion vector candidates determined according to a differential distance determined in advance based on a basic pixel unit corresponding to a 1 / 4 pixel unit.
[0271] Reference Fig. 22 , the inter prediction performer 1720 may determine a candidate positioned according to a specific shape for configuring a motion vector candidate. The specific shape may be similar to a polygon such as a rhombus, a rectangle, or a circle.
[0272] The inter prediction executor 1720 may determine a candidate in a uniform differential distance from a point corresponding to a basic motion vector as a motion vector candidate. The inter prediction executor 1720 may determine a motion vector candidate in a first differential distance from a preset point, determine a motion vector candidate in a second differential distance from a preset point, and determine a motion vector candidate in an nth differential distance from a preset point. The differential distance may be determined according to a user's definition. Alternatively, the inter prediction executor 1720 may directly determine the differential distance based on information related to a current block, a temporal layer, or a group of pictures (GOP), or obtain information indicating a differential distance for determining a motion vector candidate via a bitstream.
[0273] The inter prediction performer 1720 may determine a differential distance for determining a motion vector candidate of the current block according to a differential distance determined in a higher level than a level corresponding to the current block.
[0274] The number of motion vector candidates may be determined separately for each differential distance.The inter prediction performer 1720 may determine the number of motion vector candidates for each differential distance of the current block according to information about the number determined in a higher level than the level corresponding to the current block.
[0275] Fig. 22 The case where the number of motion vector candidates in each differential distance is 4 is shown. Fig. 22 In , there are 3 differential distances, but the number of differential distances is not limited to 3.
[0276] Reference Fig. 22 , the inter prediction performer 1720 may determine motion vector candidates having a diamond shape distribution based on the basic motion vector (x, y) 2201 .
[0277] The inter prediction performer 1720 may determine motion vector candidates (x+1, y) 2202 , (x−1, y) 2203 , (x, y+1) 2204 , and (x, y−1) 2205 whose differential distance from the basic motion vector (x, y) 2201 is 1.
[0278] The inter prediction performer 1720 may determine motion vector candidates (x+2, y) 2206 , (x−2, y) 2207 , (x, y+2) 2208 , and (x, y−2) 2209 whose differential distance from the basic motion vector (x, y) 2201 is 2.
[0279] The inter prediction performer 1720 may determine motion vector candidates (x+4, y) 2210 , (x−4, y) 2211 , (x, y+4) 2212 , and (x, y−4) 2213 whose differential distance from the basic motion vector (x, y) 2201 is 4.
[0280] According to an embodiment, the inter-frame prediction performer 1720 may determine motion vector candidates located at different differential distances for each basic motion vector. For example, from a plurality of basic motion vectors, a motion vector candidate with a differential distance of 1 may be determined for the first basic motion vector, and a motion vector candidate with a differential distance of 2 may be determined for the second basic motion vector. Alternatively, for example, a motion vector candidate with a differential distance of 1 and a motion vector candidate with a differential distance of 2 may be determined for the first basic motion vector, and a motion vector candidate with a differential distance of 4 and a motion vector candidate with a differential distance of 8 may be determined for the second basic motion vector.
[0281] When different differential distances are mapped to a basic motion vector in a 1:1 manner, the inter-frame prediction information obtainer 1710 may obtain 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 motion vector of the current block and the basic motion vector of the current block.
[0282] As described above, the differential distance used to determine the motion vector candidates may be determined based on the basic pixel unit, and when the minimum pixel unit that can be indicated by the motion vector of the current block is different from the basic pixel unit, the inter-frame prediction executor 1720 may scale the preset differential distance used to configure the candidate group for each basic motion vector.
[0283] When the motion vector of the current block can indicate pixels corresponding to integer pixel units, 1 / 2 pixel units, 1 / 4 pixel units, and 1 / 8 pixel units, the minimum pixel unit that can be indicated by the motion vector of the current block is a 1 / 8 pixel unit. In addition, when the basic pixel unit is a 1 / 4 pixel unit, the inter prediction executor 1720 may enlarge the differential distance. According to an embodiment, the inter prediction executor 1720 may enlarge the differential distance according to the ratio of the basic pixel unit to the minimum pixel unit that can be indicated by the motion vector of the current block. When the minimum pixel unit that can be indicated by the motion vector of the current block is an m pixel unit, the basic pixel unit is an n pixel unit, and the differential distance is k, the inter prediction executor 1720 may enlarge the differential distance k by k×n / m.
[0284] The inter prediction information obtainer 1710 according to an embodiment may determine the prediction mode of the current block to be one of the skip mode and the merge mode. In the skip mode or the merge mode, the inter prediction performer 1720 according to an embodiment may generate a merge candidate list including neighboring blocks referenced for predicting the motion vector of the current block in the skip mode or the merge mode.
[0285] In skip mode or merge mode, the inter-frame prediction information obtainer 1710 may obtain merge difference mode information indicating whether to use a merged motion vector difference and a motion vector determined from a merge candidate list of a current block. When the merged motion vector difference is used according to the merge difference mode information, prediction may be performed according to a merged motion vector difference mode using the merged motion vector difference and a motion vector determined from a merge candidate list of the current block. When the merged motion vector difference is used according to the merge difference mode information, the inter-frame prediction information obtainer 1710 may obtain merge candidate information from a bitstream. The inter-frame prediction executor 1720 according to an embodiment may determine a basic motion vector according to a candidate determined in a merge candidate list based on the merge candidate information. The inter-frame prediction executor 1720 may determine the merged motion vector difference by using a distance index of the merged motion vector difference of the current block and a direction index of the merged motion vector difference, and may determine the motion vector of the current block by using the basic motion vector and the merged motion vector difference.
[0286] The reconstructor 1730 according to an embodiment may reconstruct the current block by using the motion vector of the current block. The reconstructor 1730 may determine a reference block in a reference picture by using the motion vector of the current block, and determine a prediction sample corresponding to the current block from reference samples included in the reference block.
[0287] When the prediction mode of the current block according to an embodiment is a merge mode and a merge motion vector difference mode is selected, the inter prediction executor 1720 may determine a basic motion vector of the current block from the merge candidate list and determine the motion vector of the current block by using the basic motion vector and the merge motion vector difference. When the prediction mode of the current block is a merge mode, the video decoding apparatus 1700 may parse the transform coefficient of the current block from the bitstream and obtain a residual sample by performing inverse quantization and inverse transformation on the transform coefficient. The reconstructor 1730 may determine a reconstructed sample of the current block by combining the prediction sample of the current block and the residual sample of the current block.
[0288] When the prediction mode of the current block according to an embodiment is a skip mode and the merged motion vector difference mode is selected, the inter-frame prediction executor 1720 can determine the motion vector of the current block by using the merged motion vector difference and the basic motion vector determined from the merge candidate list. However, because the prediction mode of the current block is the skip mode, the video decoding device 1700 does not parse the transform coefficient of the current block from the bitstream, and therefore cannot obtain the residual sample. In the skip mode, in the absence of the residual sample, the reconstructor 1730 can determine the prediction sample of the current block as the reconstructed sample of the current block.
[0289] In the following, reference will be made to Fig.18 A video decoding method for performing a merged motion vector difference mode in a skip mode or a merge mode to perform inter-frame prediction by obtaining prediction information is described.
[0290] Fig.18 is a flowchart of a video decoding method according to an embodiment.
[0291] In operation 1810 , when the prediction mode of the current block is determined to be the skip mode or the merge mode, the inter prediction performer 1720 may generate a merge candidate list including neighboring blocks referenced for prediction of a motion vector of the current block.
[0292] In operation 1820, the inter prediction information obtainer 1710 may obtain merge difference mode information indicating whether to use a merge motion vector difference and a motion vector determined from a merge candidate list of the current block. In other words, the merge difference mode information indicates whether a merge motion vector difference mode is applied when the current block is in a skip mode or a merge mode.
[0293] The inter prediction information obtainer 1710 may perform entropy decoding using context information to obtain merge difference mode information in the skip mode or the merge mode.
[0294] When the merge difference mode information is obtained, operation 1830 is performed.
[0295] In operation 1830, when the merge motion vector difference is used according to the merge difference mode information, the inter prediction information obtainer 1710 may obtain merge candidate information from the bitstream. The merge candidate information indicates one candidate in the merge candidate list. The inter prediction information obtainer 1710 may determine a base motion vector according to one candidate determined from the merge candidate list based on the merge candidate information.
[0296] The inter prediction performer 1720 may determine whether the merge motion vector difference mode is selected for the current block based on the merge difference mode information obtained in the skip mode or the merge mode. When the merge motion vector difference mode is selected for the current block, that is, when the merge motion vector difference and the motion vector determined from the merge candidate list of the current block are used, the inter prediction information obtainer 1710 may obtain the merge candidate information from the bitstream.
[0297] The merge candidate information is 1-bit information. In addition, the merge candidate information can be obtained by using a piece of context information for the first binary bit of the merge candidate information. The inter-frame prediction information obtainer 1710 can perform entropy decoding using the context information in the skip mode or the merge mode to obtain the merge candidate information.
[0298] When the merge motion vector difference mode is selected in the skip mode or merge mode, the maximum number of candidates allowed to be selected through the merge candidate information may be less than the maximum number of candidates included in the merge candidate list. For example, the merge candidate information is a 1-bit flag, so the merge candidate information may indicate one of the maximum two candidates in the merge candidate list.
[0299] According to an embodiment, when prediction is performed in merge mode, the number of pieces of context information required to obtain a general merge index indicating one candidate in a merge candidate list and the number of pieces of context information required to obtain merge candidate information may be the same.
[0300] In operation 1840, the inter prediction performer 1720 may determine a merged motion vector difference of the current block by using a distance index of the merged motion vector difference of the current block and a direction index of the merged motion vector difference, and determine a motion vector of the current block by using a basic motion vector and the merged motion vector difference.
[0301] The inter-frame prediction information obtainer 1710 may obtain two binary bits indicating the direction index of the merged motion vector difference by performing entropy decoding on the bitstream in the bypass mode. The inter-frame prediction information obtainer 1710 may obtain the first binary bit indicating the distance index of the merged motion vector difference by performing entropy decoding on the bitstream using the context information, and obtain the remaining binary bits indicating the distance index of the merged motion vector difference by performing entropy decoding in the bypass mode.
[0302] In operation 1850, the reconstructor 1730 according to an embodiment may reconstruct the current block by using the motion vector of the current block. The reconstructor 1730 may determine a reference block in a reference picture by using the motion vector of the current block, and determine a prediction sample corresponding to the current block from the reference samples included in the reference block. The reconstructor 1730 may determine the reconstructed sample of the current block by adding the prediction sample of the current block to the residual sample of the current block in a prediction mode other than the skip mode. When there is no residual sample in the skip mode, the reconstructed sample of the current block may be determined using only the prediction sample of the current block.
[0303] In a general motion vector prediction mode (AMVP or advanced temporal motion vector prediction (ATMVP)) that is neither a skip mode nor a merge mode, the video decoding apparatus 1700 obtains a motion vector predictor index and a motion vector difference. The video decoding apparatus 1700 may determine a motion vector predictor indicated by a motion vector predictor index in a motion vector predictor list, and determine a motion vector by combining the motion vector predictor and the motion vector difference information.
[0304] Compared to the general motion vector prediction mode, the skip mode and merge mode do not use motion vector differences. However, when the merged motion vector difference mode is selected in the skip mode or merge mode, the merged motion vector difference is used. Compared with the motion vector difference in the general motion vector prediction mode, the merged motion vector difference in the merged motion vector difference mode is concisely represented.
[0305] For example, the information required to represent a general 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.
[0306] On the other hand, the information required to represent the merged motion vector difference in the L0 prediction direction or the L1 prediction direction is only the differential direction information and the differential distance information. Therefore, since the merged motion vector difference can be represented by using only the differential direction information and the differential distance index, the amount of bits required to signal the merged motion vector difference can be very low compared to the amount of bits required to signal a general motion vector difference.
[0307] In the following, reference will be made to Fig.19 A video encoding apparatus that performs inter-frame prediction by selecting a merge motion vector difference mode in a skip mode or a merge mode is described.
[0308] Fig.19 is a block diagram of a video encoding apparatus according to an embodiment.
[0309] Reference Fig.19 , the video encoding apparatus 1900 according to an embodiment may include an inter prediction performer 1910 and an inter prediction information generator 1920 .
[0310] The video encoding apparatus 1900 may encode motion information determined by performing inter prediction and output the encoded motion information in the form of a bitstream.
[0311] The video encoding apparatus 1900 according to an embodiment may include a central processor (not shown) for controlling the inter prediction performer 1910 and the inter prediction information generator 1920. Alternatively, the inter prediction performer 1910 and the inter prediction information generator 1920 may be operated by their own processors (not shown), and the processors may operate systematically with each other to operate the video encoding apparatus 1900. Alternatively, the inter prediction performer 1910 and the inter prediction information generator 1920 may be controlled according to the control of an external processor (not shown) of the video encoding apparatus 1900.
[0312] The video encoding apparatus 1900 may include one or more data memories (not shown) storing input / output data of the inter prediction performer 1910 and the inter prediction information generator 1920. The video encoding apparatus 1900 may include a memory controller (not shown) for controlling data input and output of the data memories.
[0313] The video encoding device 1900 can perform image encoding operations including prediction by operating in connection with an internal video encoding processor or an external video encoding processor to encode an image. The internal video encoding processor of the video encoding device 1900 according to the embodiment can perform basic image encoding operations not only as a separate processor but also as a central processing device or a graphics processing device including an image encoding processing module.
[0314] The inter prediction performer 1910 according to an embodiment may determine a motion vector of a current block by performing inter prediction on the current block.
[0315] When inter prediction is performed on a current block in one of a skip mode and a merge mode, the inter prediction information generator 1920 according to an embodiment may generate a merge candidate list including neighboring blocks referenced for prediction encoding of a motion vector of the current block.
[0316] The inter prediction information generator 1920 according to an embodiment may determine whether to use a basic motion vector and a merge motion vector difference determined from a merge candidate list of a current block in skip mode or merge mode. When the merge motion vector difference is used, the inter prediction information generator 1920 may generate merge candidate information and perform entropy encoding on a bit string of the merge candidate information. The merge candidate information indicates a basic motion vector in the merge candidate list.
[0317] The inter prediction information generator 1920 may generate a distance index of a merged motion vector difference corresponding to a difference between a basic motion vector and a motion vector of a current block and a direction index of the merged motion vector difference. The inter prediction information generator 1920 may perform entropy encoding on a bit string of the distance index of the merged motion vector difference and perform entropy encoding on a direction index of the merged motion vector difference.
[0318] In the following, reference will be made to Fig. 20 A process in which the video encoding apparatus 1900 performs inter prediction by selecting a merge motion vector difference mode in the skip mode or the merge mode is described.
[0319] Fig. 20 is a flowchart of a video encoding method according to an embodiment.
[0320] In operation 2010, when inter prediction is performed on a current block in one of a skip mode and a merge mode, the inter prediction performer 1910 may generate a merge candidate list including neighboring blocks referenced for predicting a motion vector of the current block. In operation 2020, the inter prediction information generator 1920 may generate merge difference mode information indicating whether to use a base motion vector and a merge motion vector difference determined from the merge candidate list of the current block.
[0321] In operation 2030, when a merge motion vector difference is used, the inter prediction information generator 1920 may generate merge candidate information indicating one basic motion vector from the merge candidate list. The inter prediction information generator 1920 may perform entropy encoding on a bit string of the merge candidate information by using one piece of context information.
[0322] In operation 2040, the inter prediction information generator 1920 may generate a distance index of a merged motion vector difference corresponding to a difference between a base motion vector and a motion vector of the current block and a direction index of the merged motion vector difference.
[0323] The inter prediction performer 1910 according to an embodiment may determine a motion vector of a current block indicating a reference block in a reference picture.
[0324] According to an embodiment, the inter prediction performer 1910 may determine the prediction mode of the motion vector of the current block to be one of the skip mode and the merge mode. The inter prediction information generator 1920 may generate skip mode information indicating whether the prediction mode of the current block is the skip mode and merge mode information indicating whether the prediction mode is the merge mode.
[0325] When the prediction mode of the current block is the skip mode or the merge mode, the inter prediction information generator 1920 may determine whether the motion vector of the current block is predicted in a merged motion vector difference mode using a basic motion vector determined from a merge candidate list of the current block and a merged motion vector difference. The inter prediction information generator 1920 may generate merged difference mode information indicating whether the motion vector is predicted in the merged motion vector difference mode.
[0326] When predicting motion information according to the merge motion vector difference mode, the inter prediction information generator 1920 according to an embodiment may determine merge candidate information indicating a base motion vector in the merge candidate list. The inter prediction information generator 1920 may perform entropy encoding by applying a piece of context information to the merge candidate information to encode the merge candidate information indicating one candidate in the merge candidate list.
[0327] According to an embodiment, the number of candidates from the merge candidate list that can be indicated by the merge candidate information is at most 2, and thus the merge candidate information can be 1-bit information.
[0328] The inter prediction information generator 1920 may determine a merged motion vector difference between a motion vector of a current block and a basic motion vector, and generate a distance index of the merged motion vector difference of the current block and a direction index of the merged motion vector difference.
[0329] When the prediction mode of the current block according to an embodiment is a merge mode and a merge motion vector difference mode is selected, the inter-frame prediction information generator 1920 may generate merge candidate information indicating a basic motion vector of the current block from a merge candidate list, and generate differential distance information and differential direction information indicating a merged motion vector difference between the motion vector of the current block and the basic motion vector.
[0330] When the prediction mode of the current block is the merge mode, the video encoding apparatus 1900 may determine the sample of the reference block indicated by the motion vector of the current block as the prediction sample of the current block. The video encoding apparatus 1900 may determine the residual sample as the difference between the original sample and the prediction sample of the current block. The video encoding apparatus 1900 may encode the transform coefficient generated by performing transform and quantization on the residual sample of the current block.
[0331] According to an embodiment, when the prediction mode of the current block is the skip mode, the current block is encoded using only the prediction samples of the current block, so the video encoding apparatus 1900 does not encode the residual samples of the current block. Even when the prediction mode of the current block according to an embodiment is the skip mode and the merge motion vector difference mode is selected, the inter-frame prediction information generator 1920 may encode the merge difference mode information, the merge candidate information, the differential distance information, and the differential direction information without encoding the residual samples.
[0332] When encoding a motion vector in the merge motion vector difference mode, the inter prediction information generator 1920 may perform entropy encoding by applying a piece of context information to the merge candidate information. The merge candidate information indicates a candidate in the merge candidate list. The merge candidate information according to an embodiment is 1-bit information, and thus the merge candidate information may be obtained by using a piece of context information for the first binary bit.
[0333] According to an embodiment, when prediction is performed in merge mode, the number of pieces of context information required to obtain a general merge index indicating one candidate in a merge candidate list and the number of pieces of context information required to obtain merge candidate information may be the same.
[0334] The inter prediction information generator 1920 may perform entropy encoding on a distance index of a merged motion vector difference and a direction index of a merged motion vector difference of a current block.
[0335] The inter prediction information generator 1920 according to an embodiment may perform entropy encoding on two binary bits indicating the direction index of the merged motion vector difference in bypass mode, respectively. The inter prediction information generator 1920 may perform entropy encoding on the first binary bit indicating the distance index of the merged motion vector difference by using context information, and perform entropy encoding on the remaining binary bits indicating the distance index of the merged motion vector difference in bypass mode, respectively.
[0336] Fig.23 The values and meanings of merge candidate information, merge differential distance index, and merge differential direction index according to an embodiment are shown.
[0337] The merged difference distance index indicates the distance index of the merged motion vector difference. The merged difference direction index indicates the direction index of the merged motion vector difference.
[0338] The video decoding apparatus 1700 may determine a motion vector of a current block based on the merge candidate information, the merge differential distance index, and the merge differential direction index.
[0339] Fig.23 Table 2600 shows merge candidate information and motion vector candidates corresponding thereto according to an embodiment. The merge candidate list according to an embodiment includes four motion vector candidates (a first MV candidate, a second MV candidate, a third MV candidate, and a fourth MV candidate), and the merge candidate information can be displayed with an index (0, 1, 2, or 3) indicating one of them.
[0340] In the merge motion vector difference mode, one motion vector candidate indicated by the merge candidate information in the merge candidate list may be determined as a basic motion vector.
[0341] exist Fig.23 In Table 2610, the merged differential distance index according to the embodiment is an integer between 0 and 7, and each index may be binarized according to the truncated unary encoding method. The merged differential distance index may indicate 2 N One of, where N is 0 to 7. The merged differential distance is determined based on a basic pixel unit, and when the basic pixel unit is 1 / 4, the merged motion vector differential distance corresponding to the merged differential distance index 0 may represent a 1 / 4 pixel distance, and the merged motion vector differential distance corresponding to the merged differential distance index 1 may represent a 1 / 2 pixel distance. The merged motion vector differential distance corresponding to the merged differential distance index 7 may represent a 32 pixel distance.
[0342] As described above, when the minimum pixel unit that can be indicated by the motion vector of the current block is smaller than the basic pixel unit, the merged motion vector differential distance may be scaled according to the ratio of the minimum pixel unit to the basic pixel unit. For example, when the basic pixel unit is a 1 / 4 pixel unit and the minimum pixel unit is a 1 / 8 pixel unit, and when the index indicating the merged motion vector differential distance obtained from the bitstream is 0, the merged motion vector differential distance 1 corresponding to the index 0 may be amplified to 2.
[0343] In addition, in Table 2620, the merged motion vector differential direction index of binary string 00 represents a motion vector candidate that changes along the + direction of the X-axis based on the basic motion vector, and the merged motion vector differential direction index of binary string 11 represents a motion vector candidate that changes along the - direction of the Y-axis based on the basic motion vector.
[0344] Fig.23 The merge candidate information, merge differential distance index, and merge differential direction index are merely examples, and the indexes available in the merge motion vector difference mode proposed in the present disclosure are not limited thereto.
[0345] For example, the number of candidates selectable from the merge candidate list in the merge motion vector difference mode may be limited to 2, and the merge candidate information may be a 1-bit index.
[0346] Fig.24 An equation for obtaining a motion vector by using a basic motion vector and a merged motion vector difference according to an embodiment is shown.
[0347] 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 component and the vertical component 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.
[0348] mxLXN[m] represents the basic motion vector indicated by the merge candidate information in the merge candidate list. m represents one of the horizontal direction component and the vertical direction component of the basic motion vector mvLXN. mvLXN[0] represents the horizontal direction component of the basic motion vector mvLXN, and mvLXN[1] represents the vertical direction component of the basic motion vector mvLXN.
[0349] refineMxLX[l] represents the merged motion vector difference. l represents one of the horizontal component and the vertical component of the merged motion vector difference refineMxLX. refineMxLX[0] represents the merged horizontal component of the motion vector difference refineMxLX, and refineMxLX[1] represents the merged vertical component of the motion vector difference refineMxLX.
[0350] In mvLX, mxLXN, and refineMxLX, LX represents one of the L0 prediction direction and the L1 prediction direction. Therefore, mvL0, mxL0N, and refineMxL0 represent the motion vector, basic motion vector, and merged motion vector difference in the L0 prediction direction, while mvL1, mxL1N, and refineMxL1 represent the motion vector, basic motion vector, and merged motion vector difference in the L1 prediction direction.
[0351] The video decoding apparatus 1700 according to an embodiment obtains merge candidate information from a bitstream, and determines a horizontal direction component mxLXN[0] of a basic motion vector and a vertical direction component mxLXN[1] of a basic motion vector indicated by the merge candidate information from a merge candidate list.
[0352] The video decoding device 1700 according to an embodiment obtains a merged differential direction index and a merged differential distance index from a bit stream, and determines the horizontal direction component refineMxLX[0] of the merged motion vector difference and the vertical direction component refineMxLX[1] of the merged motion vector difference by using the merged differential direction index and the merged differential distance index.
[0353] The video decoding apparatus 1700 according to an embodiment may obtain the horizontal direction component mvLX[0][0][0] of the motion vector of the current block by adding the horizontal direction component mxLXN[0] of the basic motion vector to the horizontal direction component refineMxLX[0] of the merged motion vector difference, and obtain the vertical direction component mvLX[0][0][1] of the motion vector of the current block by adding the vertical direction component mxLXN[1] of the basic motion vector to the vertical direction component refineMxLX[1] of the merged motion vector difference.
[0354] Fig.25 A syntax for obtaining merge difference mode information, merge candidate information, merge difference distance index, and merge difference direction index according to an embodiment is shown.
[0355] The video decoding device 1700 according to an embodiment may obtain a syntax element cu_skip_flag indicating whether the current block is predicted in skip mode from the coding_unit syntax of the bitstream. When the current block is predicted in skip mode (if (cu_skip_flag)), the video decoding device 1700 may obtain a syntax element umve_flag indicating whether the current block is predicted in merged motion vector difference mode. When umve_flag is 1, the video decoding device 1700 may call the umve_idx_coding syntax. The video decoding device 1700 may obtain a syntax element base_mv_idx corresponding to merge candidate information, a syntax element distance_idx corresponding to a distance index of a merged motion vector difference, and a syntax element direction_idx corresponding to a direction index of a merged motion vector difference from the umv_idx_coding syntax of the bitstream.
[0356] When the current block is not predicted in skip mode (when cu_skip_flag is not 0), the video decoding apparatus 1700 may obtain a syntax element merge_flag indicating whether the current block is predicted in merge mode. When the current block is predicted in merge mode (if (merge_flag)), a syntax element umve_flag indicating whether the current block is predicted in merge motion vector difference mode may be obtained. When umve_flag is 1, the video decoding apparatus 1700 may call the umve_idx_coding syntax. The video decoding apparatus 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 umv_idx_coding syntax of the bitstream.
[0357] Therefore, the video decoding apparatus 1700 may obtain a syntax element umve_flag indicating whether the current block is predicted in merged motion vector difference mode in skip mode and merge mode. Even when umve_flag of skip mode and umve_flag of merge mode are obtained separately, both umve_flags may be obtained through entropy decoding using the same context information.
[0358] In addition, the video decoding apparatus 1700 may obtain merge candidate information base_mv_idx in the skip mode and the merge mode. Even when base_mv_idx of the skip mode and base_mv_idx of the merge mode are obtained separately, the two base_mv_idxs may be obtained through entropy decoding using the same context information.
[0359] Fig.26 A syntax for obtaining merge difference mode information, merge candidate information, merge difference distance index, and merge difference direction index according to another embodiment is shown.
[0360] According to another embodiment, the video decoding device 1700 may obtain a syntax element regular_merge_flag indicating whether the current block is predicted in the merge mode from the merge_data syntax of the bitstream. When the current block is predicted in the merge mode (if (regular_merge_flag==1)), the video decoding device 1700 may obtain a syntax element mmvd_merge_flag indicating whether the current block is predicted in the merge motion vector difference mode. When the current block is predicted in the merge motion vector difference mode (if (mmvd_merge_flag==1)), the video decoding device 1700 may obtain a syntax element mmvd_cand_flag corresponding to the merge candidate information, a syntax element mmvd_distance_idx corresponding to the distance index of the merge motion vector difference, and a syntax element mmvd_direction_idx corresponding to the direction index of the merge motion vector difference.
[0361] Even when the current block is predicted in the skip mode, the video decoding apparatus 1700 may implicitly regard regular_merge_flag as 1. Therefore, when the current block is predicted in the skip mode, the video decoding apparatus 1700 may obtain a syntax element mmvd_merge_flag indicating whether the current block is predicted in the merge motion vector difference mode, and when the current block is predicted in the merge motion vector difference mode (if (mmvd_merge_flag==1)), the video decoding apparatus 1700 may obtain a syntax element mmvd_cand_flag corresponding to the merge candidate information, a syntax element mmvd_distance_idx corresponding to the distance index of the merge motion vector difference, and a syntax element mmvd_direction_idx corresponding to the direction index of the merge motion vector difference.
[0362] According to the merge_data syntax, the video decoding apparatus 1700 may analyze information related to the merge motion vector difference mode (whether the current block is predicted in 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) via the same syntax elements mmvd_merge_flag, mmvd_cand_flag, mmvd_distance_idx, and mmvd_direction_idx in the skip mode and the merge mode. However, since the prediction mode of the current block cannot be the skip mode and the merge mode at the same time, mmvd_merge_flag, mmvd_cand_flag, mmvd_distance_idx, and mmvd_direction_idx of the skip mode and mmvd_distance_idx, mmvd_direction_idx, mmvd_distance_idx, and mmvd_direction_idx of the merge mode cannot be obtained at the same time, and the information related to the merge motion vector difference mode in the skip mode and the information related to the merge motion vector difference mode in the merge mode may be interpreted as separate information.
[0363] The video decoding apparatus 1700 obtains a syntax element mmvd_merge_flag indicating whether a current block is predicted in a merge motion vector difference mode in each of a skip mode and a merge mode, but may obtain mmvd_merge_flag through entropy decoding using a piece of context information.
[0364] In addition, the video decoding apparatus 1700 may obtain merge candidate information mmvd_cand_flag in the skip mode and the merge mode. Even when mmvd_cand_flag of the skip mode and mmvd_cand_flag of the merge mode are obtained separately, both mmvd_cand_flags may be obtained through entropy decoding using the same context information.
[0365] Fig. 27 is a reference table for determining binarization of merge related information according to another embodiment.
[0366] For example, the binarization method of the syntax element mmvd_merge_flag indicating prediction in the merge motion vector difference mode is fixed length (FL) binarization, and at this time, the cMax parameter value is 1. The binarization of mmvd_cand_flag corresponding to the merge candidate information is also FL binarization, and at this time, the cMax parameter value may be 1.
[0367] The binarization of the syntax element mmvd_distance_idx corresponding to the distance index of the merged motion vector difference is truncated Rice (TR) binarization, and at this time, the cMax parameter value may be 7 and the cRiceParam value may be 0. The binarization of the syntax element mmvd_direction_idx corresponding to the direction index of the merged motion vector difference is FL binarization, and at this time, the cMax parameter value may be 3.
[0368] Fig.28 is a reference table for determining context information for merging related information according to another embodiment.
[0369] Fig.28 The reference table shows the context information required to perform entropy decoding for each binary bit index of each syntax element.
[0370] For example, the context information required to decode the binary index 0 (i.e., the first binary) of the syntax element mmvd_merge_flag indicating the prediction in the merge motion vector difference mode is 0. Since mmvd_merge_flag is 1-bit information, the context information (na) for the binary bits other than the binary index 0 is not defined. Therefore, the number of pieces of context information required to perform entropy decoding on the syntax element mmvd_merge_flag indicating whether the video decoding apparatus 1700 performs prediction in the merge motion vector difference mode (i.e., on the merge difference mode information) may be 1.
[0371] In addition, when prediction is performed in merge mode, the video decoding apparatus 1700 may obtain information indicating one motion vector candidate from the merge candidate list from the bitstream. The video decoding apparatus 1700 may obtain a syntax element merge_idx corresponding to the information indicating the motion vector candidate from the merge candidate list via entropy decoding. The context information required to decode the binary index 0 (i.e., the first binary bit) of merge_idx may be 0. The remaining binary bits of merge_idx may be decoded in bypass mode.
[0372] Therefore, the number of pieces of context information required to obtain information indicating whether the video decoding apparatus 1700 performs prediction in the merge motion vector difference mode and information indicating a motion vector candidate from the merge candidate list may be the same, ie, one.
[0373] A piece of context information is needed to obtain the first bit of the syntax element mmvd_distance_idx corresponding to the distance index of the merged motion vector difference, and the remaining bits can be decoded in bypass mode without context information. The syntax element mmvd_direction_idx corresponding to the direction index of the merged motion vector difference can be decoded in bypass mode without context information.
[0374] Hereinafter, a method in which the video decoding apparatus 1700 and the video encoding apparatus 1900 configure a merge candidate list in a merge motion vector difference mode according to another embodiment will be described.
[0375] The existing method for configuring the merge candidate list compares the motion vectors of the neighboring blocks that can be included in the merge candidate list, and removes the same motion vector as the motion vector already in the merge candidate list. However, when configuring a candidate list for merging only the motion vector difference mode (hereinafter, referred to as the merge difference mode candidate list), a candidate of a wider search range can be searched by applying a method different from the merge candidate list in the general merge mode.
[0376] Generally, there is a pruning process of candidates when configuring a merge difference mode candidate list, but when the pruning process is partially performed on some candidates, there may be overlapping candidates between basic motion vector candidates.
[0377] Therefore, when two or more basic motion vector candidates are used, pruning processing may be added so that the basic motion vectors do not overlap. When there are two or more basic motion vector candidates and the two motion vectors are identified as the same, one candidate that does not overlap in the merge candidate list may be added as a second motion vector candidate.
[0378] Furthermore, after first signaling the motion vector resolution, only the motion vector difference values +1 and -1 may be signaled additionally.Here, both the offset (distance) and the sign (direction) of the same motion vector difference may be applied in both the x-direction and the y-direction.
[0379] As another example, separate motion vector difference offsets and signs may be applied in the x-direction and the y-direction.
[0380] The motion vector resolution information according to an exemplary embodiment may match the resolution information used to predict the motion vector difference in the AMVP mode.
[0381] When a motion vector is not detected from a neighboring block when deriving a basic motion vector candidate in the merge motion vector difference mode, a zero motion vector (0, 0) may be used as a basic motion vector candidate, or a specific motion vector value may be used as a default value.
[0382] When configuring a merge difference mode candidate list in merge motion vector difference mode, information about an existing merge candidate list may be used, or a candidate may be newly configured and used. The total number of merge candidates belonging to the merge difference mode candidate list is determined to be N (N: an integer such as 1, 2, 3, etc.).
[0383] The merge difference mode candidate list may include the following items.
[0384] i) The first candidate in the general merge candidate list
[0385] ii) Modified candidates obtained by modifying the candidates in the merged difference pattern candidate list
[0386] ii-1) A modified candidate may be generated by applying a specific offset to a motion vector of a merged difference mode candidate list. The offset may be determined based on information accumulated in a frame (e.g., based on a historical motion vector). The accumulated information may be determined by referring to an offset of a merged motion vector difference of a neighboring block. The offset may be determined from information obtained at a high level such as a slice or a picture.
[0387] ii-2) The reference picture index of the merge difference mode candidate list may be modified and used. The reference picture index may be determined based on information accumulated in the frame. The accumulated information may be determined based on the reference picture index of the neighboring block. The accumulated information may be obtained at a high level such as a slice or a picture. Here, the motion vector may be used by scaling the motion vector according to the modified reference picture index or may be used without scaling the motion vector.
[0388] iii) Candidates included in the candidate list in ATMVP may be used.
[0389] iii-1) Only the representative temporal motion vector predictor (TMVP) at the center position (x0, y0) can be used as a candidate for the merge difference mode candidate list. Here, the center position (x0, y0) is as follows.
[0390] x0=x+(block width / 2),
[0391] y0=y+(block height / 2), where x and y are at the upper left position of the block.
[0392] iii-2) TMVPs of all sub-blocks used in AMVP may also be used as candidates for the merge difference mode candidate list.
[0393] iii-3) When iii-1) and iii-2), the candidate having the reference picture closest to the current picture may be selected first.
[0394] iii-4) When iii-1) and iii-2), a candidate using a reference picture most referenced among neighboring blocks may be selected first.
[0395] iv) Candidates of another merge candidate list may be used. Alternatively, candidates included in an affine merge candidate list derived from neighboring blocks may be used in the merge difference mode candidate list.
[0396] v) The merge difference mode candidate list may be configured by performing a pruning process on candidates of the general merge candidate list to generate a maximum number of candidates that may be included in the merge difference mode candidate list.
[0397] Hereinafter, a pruning process of the merge difference pattern candidate list will be described.
[0398] According to an embodiment, when a candidate among the candidates to be included in the merge difference mode candidate list does not differ from the motion vector by a specific size N or more, the candidate is considered to be a similar motion vector and is removed. Here, the motion vectors of the candidates may be compared by adjusting the reference picture indexes of the candidates to be the same. Therefore, the two motion vectors to be compared may be moved to the position of the same reference picture index and then compared.
[0399] The pruning process may be performed as follows to prevent the use of a motion vector similar to a basic motion vector predictor used as a merged motion vector difference mode. When the coordinates of the pre-inserted motion vector predictor are on the x-axis based on the motion vector inserted into the merged difference mode candidate list, the candidates in the next order on the x-axis are not inserted into the merged difference mode candidate list. Similarly, when the pre-inserted predictor is on the y-axis, the candidates in the next order on the y-axis are not inserted. Here, the information on the x-axis or y-axis may be a motion vector represented with an accuracy of 1 / 16 (or 1 / 4). As another example, the information on the x-axis or y-axis may be the x and y coordinates after a predetermined N-pixel rounding is performed in the merged motion vector difference mode. This is to identify the general directionality of the current motion vector, rather than identifying fine values (such as noise) of the coordinates on the x-axis or y-axis.
[0400] According to another embodiment, since the candidates pre-pruned in the specific candidate list are used according to a specific condition, the video decoding apparatus 1700 and the video encoding apparatus 1900 can immediately use the specific candidate list without a separate pruning process. In other words, up to N candidates among the candidates of the general merge candidate list can be selected for the merge difference mode candidate list.
[0401] Hereinafter, various embodiments of a video decoding apparatus 1700 and a video encoding apparatus 1900 for pruning a base motion vector in a merge motion vector difference mode according to another embodiment will be described.
[0402] As described above, the merge motion vector difference mode according to an embodiment includes the first N candidates of the general merge candidate list used in the merge mode or the skip mode. The candidate selected from the general merge candidate list is a basic motion vector, and the offset (distance) of the merge motion vector difference can be added to the basic motion vector in one of the x direction and the y direction.
[0403] When the x-coordinate value or y-coordinate value of the basic motion vector is the same, the candidates according to the merged motion vector difference may overlap. Therefore, the candidates according to the merged motion vector difference may be less uniformly distributed in the spatial domain. Therefore, it may be necessary to prune the candidates for the merged motion vector difference mode so that the candidates according to the merged motion vector difference are further evenly distributed. In this regard, it can be determined whether to exclude the newly added basic motion vector from the existing candidates and add the motion vector difference between the existing candidates and the newly added basic motion vector to the merged difference mode candidate list. When the motion vector difference has a value of 0 on the x-axis or the y-axis in at least one of the L0 prediction direction and the L1 prediction direction, the motion vector difference can be added to the merged difference mode candidate list.
[0404] Hereinafter, various embodiments of a method in which the video decoding apparatus 1700 and the video encoding apparatus 1900 derive a merge difference mode candidate list according to another embodiment will be described.
[0405] When the merge difference mode candidate list uses the method of configuring a general merge candidate list, the list configuration process can be ended immediately after a maximum of N candidates are ensured for the merge difference mode candidate list.
[0406] When there is a merge type other than the general merge mode, candidates included in the candidate list of the corresponding merge type may not be included in the merge difference mode candidate list.
[0407] Hereinafter, a merged motion vector difference mode in unidirectional prediction performed by the video decoding apparatus 1700 and the video encoding apparatus 1900 according to another embodiment will be described.
[0408] According to an embodiment, the operation method of the merged motion vector difference mode may vary according to a motion vector predictor determined by a basic motion vector (hereinafter referred to as a basic motion vector predictor). In unidirectional prediction, when difference information derived from a distance index and a direction index of the merged motion vector difference is added to the basic motion vector predictor, the motion vector information may be reconfigured.
[0409] According to another embodiment, when the basic motion vector predictor is unidirectionally predicted, another predictor may be generated and used. This method may show high performance in the case of P slices and low-delay B. In the case of unidirectional prediction, the following method may indicate whether to use two or more predictors by additionally signaling 1 bit.
[0410] A method of generating two or more predictors in unidirectional prediction in merged motion vector difference mode is as follows.
[0411] i) A first predictor may be generated by using a motion vector and a reference picture index of a basic motion vector predictor. A second predictor may be generated by using a reference index of the basic motion vector predictor and a new motion vector generated by adding merged motion vector difference information (distance index and direction index) based on the motion vector.
[0412] ii) is the same process as i), but an additional reference picture index may be received together with the merged motion vector difference information when generating the second predictor, and the motion vector of the basic motion vector predictor may be scaled according to the distance from the reference picture indicated by the received reference picture index. The second predictor may be generated by using a motion vector newly generated by adding the scaled merged motion vector difference information based on the scaled motion vector.
[0413] iii) During the processing of ii), a motion vector is pre-generated by adding merged motion vector difference information to the motion vector of a basic motion vector predictor before scaling based on a reference picture index, and the pre-generated motion vector may be used after scaling the pre-generated motion vector according to a distance from a reference picture indicated by an additionally received reference picture index or an implicit reference picture index.
[0414] Hereinafter, a context model of information used by the video decoding apparatus 1700 and the video encoding apparatus 1900 in a merge motion vector difference mode according to another embodiment will be described.
[0415] First, various embodiments of a context model that incorporates difference information are as follows.
[0416] The merge difference information according to the embodiment 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 distinguishably, and the context model may also be encoded separately. As another example, the skip mv difference information and the merge mv difference information may not be distinguished by a separate flag, but may be encoded in one context model.
[0417] When the context model is used for entropy decoding of merged difference information, different numbers of context models may be determined according to the number of neighboring blocks.
[0418] For example, when the adjacent blocks are the left block and the upper block, a total of three possible situations may occur. There is a situation where there is no block using the merged motion vector difference mode among the adjacent blocks, a situation where one block is encoded in the merged motion vector difference mode, and a situation where both blocks are encoded in the merged motion vector difference mode.
[0419] In three cases, one or more context models may be used for entropy decoding of merged difference information, and embodiments thereof are as follows.
[0420] First, two context models can be used. When all neighboring blocks do not use the merged motion vector difference mode, the first context model can be used. When at least one of the neighboring blocks uses the merged motion vector difference mode, the second context model can be used.
[0421] The case where three context models are used for entropy decoding of merged difference information is used as the following embodiment. When all neighboring blocks do not use the merged motion vector difference mode, the first context model can be used, when one of the neighboring blocks uses the merged motion vector difference mode, the second context model can be used, and when two of the neighboring blocks use the merged motion vector difference mode, the third context model can be used.
[0422] According to an embodiment, context information for entropy decoding of merge candidate information may be determined as follows. For example, a context model may be applied only when decoding the first binary bit of the merge candidate information. Alternatively, the merge candidate information may be decoded by using the same context model as the context model used to decode a general merge index indicating a candidate included in the merge candidate list in a general merge mode.
[0423] According to an embodiment, the context model may be used to decode only the first binary bit of the distance index of the merged motion vector difference. The context model is not applied to decode the remaining binary bits of the distance index of the merged motion vector difference.
[0424] According to an embodiment, one of the binary bits of the direction index of the merged motion vector difference may indicate the x-axis direction or the y-axis direction, and the context model may be applied to decode the corresponding binary bit. Another of the binary bits may include a cross shape or an X shape, and the context model may be applied to decode the corresponding binary bit.
[0425] In the following, a method of representing motion vector differences at various resolutions in a merged motion vector difference mode is proposed.
[0426] In the merge motion vector difference mode, various motion vector resolutions can be applied, and a method of applying them will be described. However, first, a method of encoding a basic motion vector type will be described.
[0427] Information about existing motion vector types including motion vector difference types is represented by distinguishing information between x-coordinates and y-coordinates. The x-coordinate is described as an example. In the existing method, the sign information (+ or -) corresponding to the direction of motion is transmitted with a signal. In addition, the amplitude of how far away the direction of motion is on the axis is transmitted with a signal. In addition, because there is a high probability of occurrence of 0 and 1, a bit indicating 0 or not 0 is also transmitted with a signal, or a bit indicating 1 or not 1 is transmitted with a signal, and a context model can be applied to each bit.
[0428] According to another embodiment, the video decoding apparatus 1700 and the video encoding apparatus 1900 may transmit a distance index of a motion vector difference instead of a magnitude of a motion vector in a merged motion vector difference mode. In addition, instead of transmitting sign information indicating a direction of a motion vector, a direction index of a merged motion vector difference may be transmitted in a merged motion vector difference mode.
[0429] The direction index of the motion vector difference may be represented based on the resolution of the motion vector used in the video codec installed on the video decoding device 1700 and the video encoding device 1900. For example, in the VVC codec, the motion vector is used internally in 1 / 6 pixel units. However, the resolution indicating the motion vector is represented in 1 / 4. Therefore, when the distance index of the merged motion vector difference mode is 1, the offset of the motion vector is represented in a resolution of 1 / 4. When the distance index of the merged motion vector difference mode is 2, the offset of the motion vector is represented in a resolution of 1 / 2. Multiple motion vector resolutions may be represented by distance indices, and the direction of the motion vector may be represented by the direction index of the merged motion vector difference.
[0430] The merged motion vector difference may be added to the motion vector predictor corresponding to the base motion vector selected from the merge candidate list. Because the distance index represents the resolution of the motion vector, the motion vector predictor needs to be rounded to the same resolution so that the resolution of the final motion vector matches the resolution of the distance index.
[0431] Prediction factor (rounded value in distance index information) + merged motion vector difference (distance index × preset resolution) × direction index
[0432] The resolution of the merged motion vector difference can also be applied to the inter-frame prediction mode used by the current motion vector. The concept of motion vector resolution indexed by the distance of the merged motion vector difference can be applied to the motion vector prediction factor of the inter-frame prediction mode (such as the skip mode, merge mode, affine skip mode, affine merge mode, inter / intra combination mode, generalized B mode, triangle partition mode, AMVP mode, adaptive motion vector resolution (AMVR) mode or affine AMVP mode that can be used in the current video codec). In addition, the concept of motion vector resolution indexed by the distance of the merged motion vector difference can be applied to the motion vector difference component (including the Nth residual component, such as the first residual component, the second residual component, etc.) in each inter-frame prediction mode. Therefore, the various indexes used in each inter-frame prediction mode can be interpreted and used as the corresponding motion vector resolution.
[0433] As another example, because the distance index of the merged motion vector difference may be interpreted as resolution information of the motion vector, the distance index may not be used for two or more inter prediction modes.
[0434] The distance index may be signaled as the representation information of multiple motion vector resolutions after the syntax element pred_mode_flag for indicating the inter prediction mode. When decoded in the inter prediction mode (pred_mode_flag == MODE_INTER), the motion vector resolution according to the distance index may be applied to the motion vector to be decoded in all prediction modes applied thereafter.
[0435] The motion vector resolution according to the distance index is a resolution applicable to all prediction modes currently used, and can be immediately applied to the AMVR mode proposed in the current VVC. In other words, information indicating the motion vector resolution of the AMVR can be represented in the proposed distance index. Therefore, the distance index of the merged motion vector difference mode can be used without separately signaling information for the motion vector resolution in the AMVR mode, and the resolution of the motion vector corresponding to the distance index can be applied to the motion vector predictor and the motion vector difference corresponding to the basic motion vector.
[0436] The distance index of the merged motion vector difference mode may be used to control multiple resolutions applied to encoding and decoding of the motion vector. Here, since information of multiple suitable resolutions may vary according to characteristics of an image, a resolution list including multiple resolutions may be required.
[0437] For example, a list of resolutions in sub-pixel units and a list of resolutions equal to or greater than integer pixel units are needed.
[0438] Sub-pixel unit resolution list: index 0 (corresponding to 1 / 16 pixel unit), index 1 (1 / 8 pixel unit), index 2 (1 / 4 pixel unit), index 3 (1 / 2 pixel unit)
[0439] List of resolutions in integer pixel units: index 0 (corresponding to 1 pixel unit), index 1 (2 pixel units), index 2 (4 pixel units), index 3 (8 pixel units), index 4 (16 pixel units), etc.
[0440] The list information indicating the used list in the resolution list is identically applied to the video decoding apparatus 1700 and the video encoding apparatus 1900, and may be signaled in a high level (slice header level or picture level). Alternatively, the list information may be signaled in a coding unit level (a level where pred_mode_flag is signaled). Alternatively, the video decoding apparatus 1700 and the video encoding apparatus 1900 may implicitly use one list.
[0441] Alternatively, when list information is signaled in a slice level or a tile level, separate list information may be signaled for each temporal layer, or an implicitly predetermined resolution may be used.
[0442] As another example, a motion vector candidate that can be a basic motion vector of a merged motion vector difference mode may be determined as a representative candidate among subblock motion vector candidates used in ATMVP, etc. For example, a motion vector of a subblock corresponding to a center position or a motion vector of a subblock corresponding to an upper left position of the subblock motion vector candidate may be determined as a representative candidate.
[0443] As another example, a subblock candidate that may be a base motion vector of a merged motion vector difference mode may be excluded from the motion vector candidates. Thus, the computational complexity may be reduced.
[0444] Hereinafter, whether to use the ATMVP merge candidate when determining a basic motion vector in the merge motion vector difference mode will be described.
[0445] First, a base motion vector in a merge motion vector difference mode according to an embodiment is determined from a merge candidate list used in the merge mode. In a merge motion vector difference mode according to another embodiment, a base motion vector may be selected not only from the merge candidate list but also from an ATMVP candidate. Information indicating whether a motion vector is predicted by using an ATMVP candidate in the merge motion vector difference mode may be signaled at a slice level or a higher level (picture, sequence, sequence parameter set (SPS), or picture parameter set (PPS)).
[0446] When the ATMVP candidate is also available in the merged motion vector difference mode, it is necessary to generate all candidates of the merged candidate list and the ATMVP candidate list. However, when the ATMVP candidate is not available, the video decoding device 1700 does not need to access the memory for ATMVP and does not need to access the memory in the time direction to configure the ATMVP candidate list, which can achieve high efficiency in terms of memory access.
[0447] The motion vector prediction mode in which the video decoding apparatus 1700 adjusts and uses a relatively inaccurate motion vector as another fine motion vector without completely or partially signaling information related to the motion vector will be collectively referred to as a decoder-side motion vector derivation technique. A method of combining a merged motion vector difference mode with a bidirectional optical flow (BIO) mode and a DMVR mode will be described as a representative decoder-side motion vector derivation technique.
[0448] Hereinafter, a method of combining the merged motion vector difference mode and the BIO technique will be described.
[0449] When the merged motion vector difference mode is applied to bidirectional prediction, prediction blocks in both directions (L0 direction and L1 direction) are used. In the inter-frame prediction technology, there is a BIO technology that generates one prediction block whenever there is a prediction block in both directions. The BIO technology is a technology that determines an optical motion vector by using a motion vector when there is a reference block in both directions, and derives one reference block by applying the optical motion vector to each pixel of the reference block in both directions.
[0450] In the merged motion vector difference mode, there may be a case where one reference block is generated and used together with reference blocks in both directions. Here, the BIO mode may be implicitly applied or not applied when the reference block is ensured without separately signaling information for determining the application of the BIO mode.
[0451] However, according to an embodiment, the BIO mode may be used only in a specific case where the merge motion vector difference mode is applied.
[0452] In the merge motion vector difference mode, various points are searched based on the motion vectors included in the merge candidate list. Here, the search points may be grouped according to the distance from the center. The groups may be distinguished according to the distance index.
[0453] According to an embodiment, the BIO mode may be configured to operate only when the distance index is equal to or less than a predetermined N in the merged motion vector difference mode. The BIO mode is a post-processing mode type of the prediction block, and improves the encoding efficiency by correcting pixels in fine units. This is because when the optical flow of the motion vector is stable, that is, when the motion vector is not large, it is necessary to further finely correct the pixels.
[0454] When the video decoding device 1700 according to the embodiment operates in the merged motion vector difference mode, the large distance index indicates that the reference block is obtained by predicting a motion vector with large motion. Here, even when the BIO mode is applied, it may be difficult to achieve high coding efficiency. Therefore, the coding efficiency can be improved by additionally applying the BIO mode only when the distance index is equal to or less than a specific size.
[0455] For example, when the BIO mode is applied only when the distance index is equal to or less than a preset N, when N is 0, the BIO mode can be applied only at the search point with a distance index of 0, and when N is 1, the BIO mode can be applied only at the search point with a distance index of 0 or 1.
[0456] The BIO mode is a method of correcting the current pixel in consideration of the consistency of motion between reference frames present at different positions in time. Whether the BIO mode is applied to the motion vector can be determined based on the motion vector in the bidirectional prediction provided first. This is because, among the motion vectors of the neighboring blocks, there may be a motion vector that represents the accurate motion of the object, but sometimes there may be a motion vector that is determined only for coding efficiency.
[0457] Therefore, when motion vectors in both directions do not follow optical consistency, even when separate refinement is applied, only complexity is increased and no coding efficiency is achieved, so the BIO mode may be applied to optical consistency.
[0458] Therefore, by using the following two conditions, the complexity can be greatly reduced while maintaining coding efficiency.
[0459] MV_L: Movement information in the L direction
[0460] (For example, MV_0: motion vector in the L0 direction, MV_1: motion vector in the L1 direction)
[0461] MV_L.x, MV_L.y: x-coordinate and y-coordinate in the L direction respectively
[0462] (For example, MV_0.x is the x coordinate of the motion vector in the L0 direction)
[0463] OPT_x, OPT_y: motion vectors generated assuming optical consistency
[0464] For example, when MV_0.x is -10, the optimal x coordinate over another reference frame at the same distance away from the current frame is called OPT_x, and the sign opposite to that of MV_0.x is determined to be 10. When the distance from the current frame is different, scaling may be performed.
[0465] Condition 1: MV_0.x × MV_1.x > 0
[0466] Condition 2: ABS(OPT_x-MV_1.x)>N (here, the real number N is a preset threshold)
[0467] The above two conditions can be used alone or in combination. The two conditions can be mixed as follows.
[0468] (Assuming the distance from the center to both reference frames is the same)
[0469] OPT_x=-1×MV_0.x
[0470] OPT_y=-1×MV_0.y
[0471] if ((ABS(OPT_x-MV_1.x)>N)&&(MV_0.x×MV_1.x>0)||
[0472] (ABS(OPT_y-MV_1.y)>N)&&(MV_0.y×MV_1.y>0)), then close BIO
[0473] In other words, when the distance between the x coordinate in the motion vector in the L1 direction and the optimal x coordinate is greater than N and the sign of the x coordinate in the motion vector in the L1 direction is the same as the sign of the x coordinate in the motion vector in the L0 direction, the BIO mode may not be applied. Similarly, when the distance between the y coordinate in the motion vector in the L1 direction and the optimal y coordinate is greater than N and the sign of the y coordinate in the motion vector in the L1 direction is the same as the sign of the y coordinate in the motion vector in the L0 direction, the BIO mode may not be applied.
[0474] On the other hand, BIO can be applied when the distance between the x-coordinate in the motion vector in the L1 direction and the optimal x-coordinate is not greater than N, the sign of the x-coordinate in the motion vector in the L1 direction is different from the sign of the x-coordinate in the motion vector in the L0 direction, the distance between the y-coordinate in the motion vector in the L1 direction and the optimal y-coordinate is not greater than N, or the sign of the y-coordinate in the motion vector in the L1 direction is different from the sign of the y-coordinate in the motion vector in the L0 direction.
[0475] Hereinafter, a method of combining the merged motion vector difference mode and the decoder side MV derivation (DMVR) method will be described.
[0476] The DMVR technique is a method in which, since two reference blocks are determined by using motion vectors in both directions, a virtual original block is generated by using the two reference blocks and a new motion vector is generated by using the virtual original block. During this process, since the video decoding apparatus 1700 and the video encoding apparatus 1900 operate in the same manner, additional information does not need to be transmitted by signal. Therefore, the DMVR mode may be implicitly applied or not applied without having to transmit separate information for indicating the use of the DMVR mode by signal.
[0477] However, the video decoding apparatus 1700 and the video encoding apparatus 1900 according to an embodiment propose a method of applying the DMVR mode in a specific case and when the merged motion vector difference mode is applied.
[0478] According to an embodiment, the DMVR mode may be configured to operate in the merged motion vector difference mode only when the distance index is equal to or less than a predetermined N. The DMVR mode is a post-processing mode type of a prediction block, and improves encoding efficiency by correcting pixels in fine units. This means that when the motion vector is stable, that is, when the motion according to the motion vector is not large, it is necessary to further finely correct the pixels.
[0479] When the video decoding device 1700 according to the embodiment operates in the merged motion vector difference mode, a large distance index indicates that a reference block is obtained by predicting a motion vector with a large motion. Here, even when the DMVR mode is applied, it may be difficult to achieve high encoding efficiency. Therefore, the encoding efficiency can be improved by additionally applying the DMVR mode only when the distance index is equal to or less than a specific size.
[0480] For example, when the DMVR mode is applied only when the distance index is equal to or less than a preset N, when N is 0, the DMVR mode can be applied only at the search point with a distance index of 0, and when N is 1, the DMVR mode can be applied only at the search point with a distance index of 0 or 1.
[0481] The DMVR mode is a method of correcting a current pixel by considering the similarity of blocks between reference frames that exist at different positions in time. Whether to apply the DMVR mode to a motion vector may be determined based on a motion vector in a bidirectional prediction that is first provided. This is because, among the motion vectors of neighboring blocks, there may be a motion vector that represents the accurate motion of an object, but sometimes there may be a motion vector that is determined only for coding efficiency.
[0482] Therefore, the DMVR mode can be applied when the bidirectional motion vectors follow a certain degree of consistency.
[0483] Therefore, by using the following two conditions, the complexity can be greatly reduced while maintaining coding efficiency.
[0484] MV_L: Movement information in the L direction
[0485] (For example, MV_0: motion vector in the L0 direction, MV_1: motion vector in the L1 direction)
[0486] MV_L.x, MV_L.y: x-coordinate and y-coordinate in the L direction respectively
[0487] (For example, MV_0.x is the x coordinate of the motion vector in the L0 direction)
[0488] OPT_x, OPT_y: Motion vectors generated assuming optical consistency
[0489] For example, when MV_0.x is -10, the optimal x coordinate over another reference frame at the same distance away from the current frame is called OPT_x, and the sign opposite to that of MV_0.x is determined to be 10. When the distance from the current frame is different, scaling may be performed.
[0490] Condition 1: MV_0.x × MV_1.x > 0
[0491] Condition 2: ABS(OPT_x-MV_1.x)>N (here, the real number N is a preset threshold)
[0492] The above two conditions can be used alone or in combination. The two conditions can be mixed as follows.
[0493] (Assuming the distance from the center to both reference frames is the same)
[0494] OPT_x=-1×MV_0.x
[0495] OPT_y=-1×MV_0.y
[0496] if ((ABS(OPT_x-MV_1.x)>N)&&(MV_0.x*MV_1.x>0)||
[0497] (ABS(OPT_y-MV_1.y)>N)&&(MV_0.y*MV_1.y>0)), then turn off DMVR
[0498] In other words, when the distance between the x-coordinate in the motion vector in the L1 direction and the optimal x-coordinate is greater than N and the sign of the x-coordinate in the motion vector in the L1 direction is the same as the sign of the x-coordinate in the motion vector in the L0 direction, the DMVR mode may not be applied. Similarly, when the distance between the y-coordinate in the motion vector in the L1 direction and the optimal y-coordinate is greater than N and the sign of the y-coordinate in the motion vector in the L1 direction is the same as the sign of the y-coordinate in the motion vector in the L0 direction, the DMVR mode may not be applied.
[0499] On the other hand, DMVR can be applied when the distance between the x-coordinate in the motion vector in the L1 direction and the optimal x-coordinate is not greater than N, the sign of the x-coordinate in the motion vector in the L1 direction is different from the sign of the x-coordinate in the motion vector in the L0 direction, the distance between the y-coordinate in the motion vector in the L1 direction and the optimal y-coordinate is not greater than N, or the sign of the y-coordinate in the motion vector in the L1 direction is different from the sign of the y-coordinate in the motion vector in the L0 direction.
[0500] Hereinafter, a method of combining a merge motion vector difference mode with a deblocking filter according to an embodiment will be described.
[0501] A variable boundary strength (bs) for defining the strength of a deblocking filter to be applied to a boundary between two blocks may be determined based on the motion vector of each block. Hereinafter, it will be described how to determine the filtering strength of a deblocking filter using motion vector difference information decoded according to a merged motion vector difference mode when a motion vector is predicted based on a merged motion vector difference mode.
[0502] When the merge motion vector difference mode is not applied to a subblock, deblocking filtering may be performed on the subblock like a block encoded in a general skip mode or a general merge mode.
[0503] The video decoding apparatus 1700 according to an embodiment may also apply a merged motion vector difference mode to a sub-block. Since each basic motion vector (motion vector predictor) is determined in units of sub-blocks, another motion vector may be predicted for each sub-block. The motion vectors of all or some sub-blocks may be corrected by using the distance index and the direction index of the merged motion vector difference mode. The intensity of deblocking filtering may be determined in consideration of the motion vector of the sub-block, and deblocking filtering may be performed on the boundary of the sub-block.
[0504] The deblocking filtering method may be encoded in the same manner as when different coding units have different motion vectors.
[0505] Prediction may be performed on each subblock determined by dividing the coding unit in a predetermined rule. The predetermined rule may be a division of a minimum unit determined in a slice level or agreed upon in advance by an encoder / decoder. A motion vector of each subblock may be determined according to the determined process. Hereinafter, various embodiments for determining a motion vector of each coding unit by using a subblock will be described.
[0506] i) The size and shape of the sub-blocks of the block may be identified by signaling a specific bit in a skip mode, a merge mode, a merged motion vector difference mode in a skip mode, or a merged motion vector difference mode in a merge mode. For example, when the bit indicating the division is 0, the corresponding block is not divided into sub-blocks. When the bit indicating the division is 1, the corresponding block is divided into sub-blocks. When the method of dividing into sub-blocks is a method implicitly agreed upon by the video encoding device 1900 and the video decoding device 1700, additional information is no longer signaled. As another example, information indicating whether the block is divided into sub-blocks horizontally or vertically may be signaled after the bit indicating the division.
[0507] ii) Information about a method of deriving a motion vector of a sub-block when a block is divided into sub-blocks may also be signaled. When the information about the method of deriving a motion vector of a sub-block is 0, a temporal motion vector predictor may be derived and used to determine the motion vector of the sub-block, or when the information about the method is 0, the motion vector of the sub-block may be additionally signaled.
[0508] iii) For the information about the motion vector transmitted by the signal, candidate information indicating one of the MVP lists, prediction direction information, reference picture index, absolute value information of the motion vector difference, and sign information of the motion vector difference may be transmitted by the signal in the same manner as the motion vector information of the AMVP mode of the VVC standard. Optionally, the motion vector of the sub-block may be transmitted by the signal using the motion information of the merged motion vector difference mode (merged candidate information, and distance index and direction index of the merged motion vector difference). In addition, the motion vector difference information related to the merged motion vector mode of the sub-block may be shared as the motion vector difference information of another sub-block. For the subsequent continuous blocks, the distance index, the direction index, or both the distance index and the direction index may be transmitted by the signal, and the motion vector difference information overlapping between the sub-blocks may not be sent.
[0509] Hereinafter, an embodiment in which a merged motion vector difference mode is used in a deblocking filtering process will be described.
[0510] For example, a block decoded in a merge motion vector difference mode in the skip mode and a block decoded in a merge motion vector difference mode in the merge mode may be determined as separate blocks, and deblocking filtering may be performed on a boundary between the blocks.
[0511] As another example, a deblocking filtering method for a block decoded in a general skip mode or a block decoded in a general merge mode may not be performed on a block decoded in a merge motion vector difference mode in a skip mode and a block decoded in a merge mode. A deblocking filtering method applied to a block decoded in an AMVP mode in which a residual block is generated may be applied to a block decoded in a merge motion vector difference mode in a skip mode and a block decoded in a merge mode.
[0512] As another example, a deblocking filtering method for a block decoded in a general skip mode or a block decoded in a general merge mode may be performed on a block decoded in a merge motion vector difference mode in a skip mode. A deblocking filtering method applied to a block decoded in an AMVP mode accompanied by a residual block may be applied to a block decoded in a merge motion vector difference mode in a merge mode.
[0513] As another example, when the motion vectors between blocks are different in AMVP mode, the strength bs of the deblocking filter may be determined based on the difference between the motion vectors. The motion vector difference between blocks decoded in the merged motion vector difference mode or the motion vector difference between a block decoded in the merged motion vector difference mode and a block decoded in the AMVP mode may use a distance index or a direction index of the merged motion vector difference. The basic motion vector and the distance index and direction index of the merged motion vector difference may be obtained for the block decoded in the merged motion vector difference mode. Therefore, since the basic motion vectors of the two blocks may be the same, the difference between the motion vectors of the two blocks may be determined using only the distance index of the merged motion vector difference. Therefore, the strength of the deblocking filter for the boundary between the two blocks may be determined by using only the distance index of the merged motion vector difference.
[0514] However, when decoding is not performed in the merged motion vector difference mode, merged motion vector difference information corresponding to the current motion vector may be generated, and the intensity of deblocking filtering may be determined by using a distance index of the generated merged motion vector difference.
[0515] In addition, the above-described embodiments of the present disclosure may be written as a computer-executable program that can be stored in a medium.
[0516] The medium can store computer executable programs continuously, or temporarily store computer executable programs or instructions for execution or downloading. In addition, the medium can be any of a variety of recording media or storage media combined with single or multiple pieces of hardware, and the medium is not limited to media directly connected to the computer system, but can be distributed on a network. Examples of media include magnetic media (such as hard disks, floppy disks, and tapes) configured to store program instructions, optical recording media (such as CD-ROMs and DVDs), magneto-optical media (such as optical floppy disks), and ROM, RAM, and flash memory. Other examples of media include recording media and storage media managed by application stores that publish applications or by websites, servers, etc. that provide or publish various other types of software.
[0517] Although one or more embodiments of the present disclosure have been described with reference to the drawings, people skilled in the art will understand that various changes in form and details may be made therein without departing from the spirit and scope defined by the following claims.
Claims
1. A video decoding method, include: Obtaining merge difference mode information, wherein the merge difference mode information indicates whether a merge motion vector difference is used for a motion vector of a candidate block determined from a merge candidate list to predict a motion vector of a current block; When a merge motion vector difference is used according to the merge difference mode information, merge candidate information is obtained from a bitstream, and a basic motion vector is determined from a motion vector of a candidate block determined among candidate blocks included in the merge candidate list based on the merge candidate information; determining a motion vector of the current block by using the basic motion vector and a merged motion vector difference of the current block, wherein the merged motion vector difference of the current block is determined by using a distance index and a direction index of the merged motion vector difference of the current block; and Reconstruct the current block by using the motion vector of the current block, The first binary bit of the distance index of the merged motion vector difference is obtained by performing entropy decoding using the first context information on the bitstream, and the remaining binary bits of the distance index of the merged motion vector difference are obtained by performing entropy decoding in bypass mode on the bitstream, The merge candidate information is obtained by entropy decoding using the second context information.
2. A video encoding method, include: generating merge difference mode information, wherein the merge difference mode information indicates whether a merge motion vector difference is used for a motion vector of a candidate block determined from a merge candidate list to predict a motion vector of a current block; When a merge motion vector difference is used, generating merge candidate information indicating one basic motion vector from a motion vector of the determined candidate block among the candidate blocks included in the merge candidate list; and generating a distance index of a merged motion vector difference corresponding to a difference between the basic motion vector and the motion vector of the current block and a direction index of the merged motion vector difference, wherein entropy coding using first context information is performed on a first binary bit of the distance index of the merged motion vector difference, and entropy coding in bypass mode is performed on the remaining binary bits of the distance index of the merged motion vector difference, Wherein, entropy coding using second context information is performed on the merge candidate information.
3. A method of storing a bit stream in a computer readable recording memory, in, The bit stream is generated by the video encoding method of claim 2.
