Method and apparatus for encoding motion vector differential, and method and apparatus for decoding motion vector differential
By obtaining the sequence merging mode information from the bit stream and reconstructing the motion vector difference, the problem of low encoding and decoding efficiency of motion vector difference in inter prediction mode is solved, and more efficient image encoding and decoding is achieved.
Patent Information
- Application Number
- CN202410980222.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-01-14
- Filing Date
- 2019-12-30
- Publication Date
- 2024-09-24
AI Technical Summary
Existing image coding and decoding methods are difficult to effectively code and decode motion vector differences in inter-frame prediction mode, resulting in low coding efficiency.
By obtaining the sequence merging mode information from the bit stream, it is determined whether to apply the sequence mode of the motion vector difference, and the motion vector is reconstructed according to the distance and direction of the motion vector difference, thereby achieving efficient encoding and decoding of the motion vector difference.
The efficiency of motion vector difference encoding and decoding in inter-frame mode is improved, and the accuracy and efficiency of image encoding and decoding are enhanced.
Smart Images

Figure CN118694933A_ABST
Abstract
Description
[0001] This application is a divisional application of a patent application with an application date of December 30, 2019, application number 201980092641.5, and invention name “Method and device for encoding motion vector difference and method and device for decoding motion vector difference”. Technical Field
[0002] The present disclosure relates to the field of image encoding and decoding. Specifically, the present disclosure relates to a method and device for encoding a motion vector used for encoding and decoding an image, and a method and device for decoding a motion vector. Background Art
[0003] In a method of encoding and decoding an image, one picture may be divided into blocks to encode the image, and each block may be prediction-encoded via inter prediction or intra prediction.
[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 within a predetermined search range by using a predetermined 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 prediction result from the current block, and then the residual block is encoded. In this regard, in order to further accurately perform prediction, interpolation is performed on the search range of the reference picture so as 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 standards such as H.264 Advanced Video Coding (AVC) and High Efficiency Video Coding (HEVC), a motion vector of a pre-encoded block adjacent to one or more current blocks included in a pre-encoded picture is used as a predicted motion vector of the current block in order to predict the motion vector of the current block. A differential motion vector, which is a difference between the motion vector of the current block and the predicted motion vector, is signaled to a decoder via a predetermined method. Summary of the invention
[0006] Technical issues
[0007] According to the embodiment, an encoding method and an encoding apparatus regarding a motion vector difference and a decoding method and a decoding apparatus regarding a motion vector difference effectively encode and decode a motion vector difference used in various tools applied to an inter mode.
[0008] Solution to the problem
[0009] According to an embodiment of the present disclosure, a video decoding method may include: obtaining sequence merge mode (sequence MMVD) information with motion vector difference from a sequence parameter set, wherein the sequence MMVD information indicates whether the MMVD mode is applied to a current sequence; when the MMVD mode is applicable according to the sequence MMVD information, obtaining first MMVD information indicating whether the MMVD mode is applied to a current block included in the current sequence in a first inter-frame prediction mode from a bitstream; when the MMVD mode is applicable to the first inter-frame prediction mode according to the first MMVD information, reconstructing a motion vector of the current block to be used in the first inter-frame prediction mode by using a distance of the motion vector difference and a direction of the motion vector difference obtained from the bitstream; and reconstructing the current block by using the motion vector of the current block.
[0010] Disclosure of beneficial effects
[0011] According to an embodiment, there are provided a method and a device for encoding motion vector differences and a method and a device for decoding motion information differences, which determine whether to use motion vector differences in a high-level syntax at the level of each sequence, picture, or block unit so as to efficiently encode motion vector differences used in various tools applied to inter-frame modes.
[0012] However, according to an embodiment, the effects that can be achieved by the method of encoding and decoding motion information and the device for encoding and decoding motion information are not limited to those mentioned above, and a person of ordinary skill in the art will clearly understand other unstated effects in view of 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 5A 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, performed by an image decoding apparatus when coding units cannot be processed in a predetermined order, 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 according to an embodiment, when a non-square-shaped second coding unit determined by an image decoding apparatus splitting a first coding unit satisfies a predetermined condition, shapes into which the second coding unit may be split are restricted.
[0024] Fig.11 A process of splitting a square coding unit performed by an image decoding apparatus when division shape pattern information indicates that the square coding unit is not to be split into four square coding units according to an embodiment is illustrated.
[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 a coding unit.
[0026] Fig.13 A process of determining a depth of a coding unit when a shape and a size of a coding unit are changed when a coding unit is recursively split to determine a plurality of coding units according to an embodiment is illustrated.
[0027] Fig.14 Depth that may be determined based on the shape and size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.
[0028] Fig.15 It is shown that a plurality of coding units are determined based on a plurality of predetermined data units included in a picture according to an embodiment.
[0029] Fig.16It is a block diagram of an image encoding and decoding system.
[0030] Fig.17 is a detailed 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 is a diagram showing motion vector candidates displayed on a coordinate plane.
[0036] Fig.23 The values and meanings of the merge index, the distance index of the merge difference, and the direction index of the merge difference according to an embodiment are shown.
[0037] Fig.24 An equation for obtaining a motion vector by using a base motion vector and a merged motion vector difference according to an embodiment is shown.
[0038] Fig.25 An equation for adjusting the precision of a motion vector predictor or a base motion vector when the precision of the distance index of the merged difference is 64 according to an embodiment is shown.
[0039] Fig.26 An equation for adjusting the precision of a motion vector predictor or base motion vector when the precision of the distance index of the merged difference is 16 according to an embodiment is shown.
[0040] Fig. 27 A reference table for determining binarization of a plurality of pieces of merge-related information according to an embodiment is shown.
[0041] Fig.28 A comparison table of binary strings indexed by distance of 8 merged differences according to various binarizations is shown.
[0042] Fig.29 An embodiment of k-th order Exponential Golomb binarization is shown.
[0043] Fig.30 A comparison table of binary strings indexed by distance of 6 merged differences according to various binarizations is shown.
[0044] Fig.31A binary string generated by changing the binarization according to a distance index group of the merged difference according to an embodiment is shown.
[0045] Fig.32 Codewords for the case of 8 merged difference distance indices according to an embodiment are shown.
[0046] Fig.33 Codewords for the case of 6 merged difference distance indexes according to an embodiment are shown.
[0047] Fig.34 Illustration of triangle partitions available in triangle partition prediction mode according to an embodiment.
[0048] Fig.35 A prediction block determined by using triangle partitioning in triangle partitioning prediction mode according to an embodiment is shown.
[0049] Fig.36 A flowchart of a video decoding method according to another embodiment is shown.
[0050] Fig.37 A flowchart of a video encoding method according to another embodiment is shown. DETAILED DESCRIPTION
[0051] According to an embodiment of the present disclosure, a video decoding method may include: obtaining sequence merge mode (sequence MMVD) information with motion vector difference from a sequence parameter set, wherein the sequence MMVD information indicates whether the MMVD mode is applicable to the current sequence; when the MMVD mode is applicable according to the sequence MMVD information, obtaining first MMVD information from a bitstream whether the MMVD mode is applied to a current block included in the current sequence in a first inter-frame prediction mode; when the MMVD mode is applicable in the first inter-frame prediction mode according to the first MMVD information, reconstructing a motion vector of the current block to be used in the first inter-frame prediction mode by using a distance of the motion vector difference and a direction of the motion vector difference obtained from the bitstream; and reconstructing the current block by using the motion vector of the current block.
[0052] According to an embodiment, the step of obtaining first MMVD information from a bitstream may include: when the MMVD mode is applicable according to the sequence MMVD information, obtaining sub-pixel MMVD information indicating whether motion vector differences in integer pixel units or sub-pixel units are used in the current sequence; and when the MMVD mode is applicable according to the sequence MMVD information, obtaining MMVD information indicating whether the MMVD mode is used for a current block included in the current sequence, and the step of reconstructing the motion vector of the current block may include: when the MMVD mode is used for the current block according to the MMVD information, reconstructing the distance of the motion vector difference in integer pixel units or sub-pixel units according to the distance index of the motion vector difference of the current block obtained from the bitstream according to the sub-pixel MMVD information; and determining the motion vector of the current block by using the distance of the motion vector difference.
[0053] According to an embodiment, the step of reconstructing the distance of the motion vector difference of integer pixel units or sub-pixel units according to the distance index of the motion vector difference of the current block may include: when the MMVD mode is used for the current block according to the MMVD information and the motion vector difference of integer pixel units is used according to the sub-pixel MMVD information, reconstructing the distance of the motion vector difference of integer pixel units according to the distance index of the motion vector difference of the current block obtained from the bitstream; and when the MMVD mode is used for the current block according to the MMVD information and the motion vector difference of sub-pixel units is used according to the sub-pixel MMVD information, reconstructing the distance of the motion vector difference of sub-pixel units according to the distance index of the motion vector difference of the current block obtained from the bitstream.
[0054] According to an embodiment, the step of reconstructing the motion vector of the current block may include: obtaining information indicating a direction index of a base motion vector of the current block and a motion vector difference of the current block from a bitstream; determining the motion vector difference of the current block by using a distance index of the motion vector difference of the current block and a direction index of the motion vector difference; determining the base motion vector of the current block by using information indicating the base motion vector of the current block; and determining the motion vector of the current block by using the base motion vector and the motion vector difference of the current block.
[0055] According to an embodiment, when the MMVD mode is not applicable in the current sequence according to the sequence MMVD information, a motion vector difference of an integer pixel unit and a motion vector difference of a sub-pixel unit may be unavailable in the current sequence and the current block.
[0056] According to an embodiment, the step of determining the motion vector of the current block may include: when the distance of the reconstructed motion vector difference is an integer pixel unit, rounding the x-component value and the y-component value of the base motion vector of the current block to an integer pixel unit, and reconstructing the motion vector of the integer pixel unit by using the x-component value and the y-component value of the base motion vector rounded to the integer pixel unit; and when the distance of the reconstructed motion vector difference is a sub-pixel unit, reconstructing the motion vector of the sub-pixel unit by using the distance of the motion vector difference of the sub-pixel unit and the x-component value and the y-component value of the base motion vector rounded to the sub-pixel unit.
[0057] According to an embodiment of the present invention, a video decoding device may include: a syntax element obtainer, configured to obtain sequence merge mode with motion vector difference (sequence MMVD) information from a sequence parameter set, wherein the sequence MMVD information indicates whether the MMVD mode is applicable to a current sequence, and when the MMVD mode is applicable according to the sequence MMVD information, obtain first MMVD information indicating whether the MMVD mode is applied to a current block included in the current sequence in a first inter-frame prediction mode from a bitstream; and a decoder, configured to, when the MMVD mode is applicable in the first inter-frame prediction mode according to the first MMVD information, reconstruct a motion vector of a current block to be used in the first inter-frame prediction mode by using a distance of a motion vector difference and a direction of a motion vector difference obtained from a bitstream, and reconstruct the current block by using the motion vector of the current block.
[0058] According to an embodiment, the syntax element obtainer may be configured to: when the MMVD mode is applicable according to the sequence MMVD information, obtain sub-pixel MMVD information indicating whether the motion vector difference of integer pixel units or sub-pixel units is used in the current sequence, and when the MMVD mode is applicable according to the sequence MMVD information, obtain MMVD information indicating whether the MMVD mode is used for the current block included in the current sequence, and the decoder may be configured to: when the MMVD mode is used for the current block according to the MMVD information, reconstruct the distance of the motion vector difference of integer pixel units or sub-pixel units according to the distance index of the motion vector difference of the current block obtained from the bitstream according to the sub-pixel MMVD information, and determine the motion vector of the current block by using the distance of the motion vector difference.
[0059] According to an embodiment of the present disclosure, a video encoding method may include: encoding sequence merge mode (sequence MMVD) information with motion vector difference, wherein the sequence MMVD information indicates whether the MMVD mode is applicable to a current sequence; when the MMVD mode is applicable to the current sequence, encoding first MMVD information indicating whether the MMVD mode is used for a current block included in the current sequence in a first inter-frame prediction mode; and when the MMVD mode is applied in the first inter-frame prediction mode, encoding a distance index of the motion vector difference of the current block and a direction index of the motion vector difference.
[0060] According to an embodiment, the video encoding method may further include: when the MMVD mode is applicable in the current sequence, encoding sub-pixel MMVD information indicating whether the motion vector difference of integer pixel units or sub-pixel units is used in the current sequence; and when the MMVD mode is applicable, encoding MMVD information indicating whether the MMVD mode is used for the current block included in the current sequence, and the step of encoding the distance index of the motion vector difference of the current block and the direction index of the motion vector difference may include: when the MMVD mode is used for the current block, encoding the distance index of the motion vector difference of the current block determined according to the distance of the motion vector difference of integer pixel units or sub-pixel units.
[0061] According to an embodiment, the step of encoding the distance index of the motion vector difference of the current block may include: when the MMVD mode is used for the current block and the motion vector difference of integer pixel units is used, determining the distance index of the motion vector difference of the current block based on the motion vector difference of integer pixel units; and when the MMVD mode is used for the current block and the motion vector difference of sub-pixel units is used, determining the distance index of the motion vector difference of the current block based on the motion vector difference of sub-pixel units.
[0062] The step of encoding the distance index of the motion vector difference of the current block may include: when encoding the distance of the motion vector difference in integer pixel units, rounding the x-component value and the y-component value of the base motion vector of the current block to integer pixel units, determining the distance of the motion vector difference in integer pixel units by using the x-component value and the y-component value of the base motion vector rounded to integer pixel units, and encoding the distance index corresponding to the distance of the motion vector difference in integer pixel units; and when encoding the distance of the motion vector difference in sub-pixel units, rounding the x-component value and the y-component value of the base motion vector of the current block to sub-pixel units, determining the distance of the motion vector difference in sub-pixel units by using the x-component value and the y-component value of the base motion vector rounded to sub-pixel units, and encoding the distance index corresponding to the distance of the motion vector difference in sub-pixel units.
[0063] According to an embodiment of the present disclosure, a video decoding method may include: obtaining sequence merge mode (sequence MMVD) information with motion vector difference from a bitstream, wherein the sequence MMVD information indicates whether a triangle partition prediction mode is enabled for a current block; obtaining second information indicating whether an intra / inter combination prediction mode is enabled for the current block from the bitstream; when the triangle partition prediction mode is enabled for the current block according to the sequence MMVD information, determining whether the triangle partition prediction mode is applied to the current block based on the height and width of the current block; and when the triangle partition prediction mode is enabled for the current block according to the sequence MMVD information and the intra / inter combination prediction mode is enabled for the current block according to the second information, determining whether the intra / inter combination prediction mode is applied to the current block based on the height and width of the current block.
[0064] According to an embodiment, the step of determining whether to apply the triangle partition prediction mode to the current block based on the height and width of the current block may include: when the product of the height and the width of the current block is less than 64, the height of the current block is equal to or greater than the maximum size of the coding unit, or the width of the current block is equal to or greater than the maximum size of the coding unit, determining that the triangle partition prediction mode cannot be applied to the current block.
[0065] According to an embodiment, the step of determining whether to apply the intra / inter combination prediction mode to the current block based on the height and width of the current block may include: when the product of the height and width of the current block is less than 64, the height of the current block is equal to or greater than the maximum size of the coding unit, or the width of the current block is equal to or greater than the maximum size of the coding unit, determining that the intra / inter combination prediction mode cannot be applied to the current block.
[0066] According to an embodiment of the present disclosure, there is provided a computer-readable recording medium having recorded thereon a program for implementing a video decoding method on a computer.
[0067] According to an embodiment of the present disclosure, there is provided a computer-readable recording medium having recorded thereon a program for implementing a video encoding method on a computer.
[0068] Public method
[0069] Since the present disclosure allows various changes and many embodiments, specific embodiments will be shown in the drawings and described in detail in the written description. However, this is not intended to limit the present disclosure to a specific mode of practice, and it will be understood that all changes, equivalents and substitutions that do not depart from the spirit and technical scope of the various embodiments are included in the present disclosure.
[0070] In the description of the embodiment, when it is considered that the detailed explanation of the related art may unnecessarily obscure the essence of the present disclosure, the detailed explanation of the related art is omitted. In addition, the numbers (e.g., first, second, etc.) used in the description of the specification are merely identifiers for distinguishing one element from another.
[0071] Furthermore, in the present specification, it will be understood that when elements are “connected” or “coupled” to each other, the elements may be directly connected or coupled to each other, but may optionally be connected or coupled to each other through intermediate elements between the elements, unless otherwise specified.
[0072] 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 subdivided functions. In addition, each element described below may additionally perform some or all of the functions performed by another element in addition to its own main function, and some of the main functions of each element may be completely performed by another element.
[0073] Furthermore, in this specification, an “image” or a “screen” may refer to a still image or a moving image of a video, that is, the video itself.
[0074] In addition, in this specification, "sample" means data assigned to a sampling position of an image, that is, data to be processed. For example, a pixel value of an image in a spatial domain and a transform coefficient on a transform domain may be a sample. A unit including at least one such sample may be defined as a block.
[0075] Also, in the specification, a 'current block' may mean a block of a maximum coding unit, a coding unit, a prediction unit, or a transformation unit of a current image to be encoded or decoded.
[0076] In the present specification, a motion vector in a direction of list 0 may mean a motion vector used to indicate a block in a reference picture included in list 0, and a motion vector in a direction of list 1 may mean a motion vector used to indicate a block in a reference picture included in list 1. In addition, a unidirectional motion vector may mean a motion vector used to indicate a block in a reference picture included in list 0 or list 1, and a bidirectional motion vector may mean that a motion vector includes a motion vector in a direction of list 0 and a motion vector in a direction of list 1.
[0077] 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 37A video encoding / decoding method using merge mode with motion vector difference (MMVD) is described.
[0078] In the following, reference is made to Figure 1 and Figure 2 , a method and apparatus for adaptive selection of coding units based on various shapes according to an embodiment of the present disclosure will be described.
[0079] Figure 1 is a schematic block diagram of an image decoding apparatus according to an embodiment.
[0080] 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.
[0081] The receiver 110 may receive a bitstream. The bitstream includes information of an image encoded by the image encoding device 2200 to be described below. In addition, the bitstream may be transmitted from the image encoding device 2200. The image encoding device 2200 and the image decoding device 100 may be connected by wire or wirelessly, and the receiver 110 may receive the bitstream by wire or wirelessly. 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 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.
[0082] Will refer to Figure 2 The operation of the image decoding apparatus 100 is described in detail.
[0083] Figure 2 is a flowchart of an image decoding method according to an embodiment.
[0084] According to an embodiment of the present disclosure, the receiver 110 receives a bit stream.
[0085] 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 the aspect ratio 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.
[0086] Hereinafter, the division of coding units will be described in detail according to an embodiment of the present disclosure.
[0087] 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)). There is a maximum coding block (coding tree block (CTB)) conceptually comparable to the maximum coding unit (CTU).
[0088] A maximum coding block (CTB) represents an N×N block including N×N samples (where N is an integer). Each color component may be divided into one or more maximum coding blocks.
[0089] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), the maximum coding unit (CTU) includes a maximum coding block of luma samples, two corresponding maximum coding blocks of chroma samples, and a syntax structure for encoding luma samples and chroma samples. When the picture is a monochrome picture, the maximum coding unit includes a maximum coding block of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture 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.
[0090] One maximum coding block (CTB) may be divided into M×N coding blocks including M×N samples (M and N are integers).
[0091] 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 coded 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.
[0092] As described above, the maximum coding block and the maximum coding unit are conceptually distinguished from each other, and the coding block and the coding unit are conceptually distinguished from each other. That is, the (maximum) coding unit refers to a data structure including a (maximum) coding block containing corresponding samples and a syntax element 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 predetermined size including a predetermined number of samples, unless otherwise described, the maximum coding block and the maximum coding unit or the coding block and the coding unit are mentioned in the following description without distinction.
[0093] The image may be divided into maximum coding units (CTUs). The size of each maximum coding unit may be determined based on information obtained from the bitstream. The shape of each maximum coding unit may be a square shape of the same size. However, the embodiment is not limited thereto.
[0094] 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.
[0095] 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.
[0096] 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.
[0097] In addition, the maximum coding unit may be hierarchically split into coding units based on the split shape pattern information obtained from the bitstream. At least one of information indicating whether to perform four-partitioning, information indicating whether to perform multi-partitioning, split direction information, and split type information may be obtained from the bitstream as the split shape pattern information.
[0098] For example, the information indicating whether to perform four-division may indicate whether the current coding unit is to be four-divided (QUAD_SPLIT) or not to be four-divided.
[0099] When the current coding unit is not divided into four parts, the information indicating whether multi-split is performed may indicate whether the current coding unit is no longer split (NO_SPLIT) or is divided into two parts / three parts.
[0100] When the current coding unit is two-partitioned or three-partitioned, the split direction information indicates that the current coding unit is split in one direction of a horizontal direction and a vertical direction.
[0101] When the current coding unit is split in the horizontal direction or the vertical direction, the split type information indicates whether the current coding unit is split into two or three.
[0102] 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).
[0103] 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. The binary bit string is information of a binary number. The binary bit string may include at least one bit. The image decoding device 100 may obtain the division shape pattern information corresponding to the binary bit string based on the division rule. The image decoding device 100 may determine whether to divide the coding unit into four, whether to not divide the coding unit, the division direction, and the division type based on a binary bit string.
[0104] 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 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.
[0105] In addition, one or more prediction blocks for prediction may be determined from the coding unit. The prediction block may be equal to or smaller than the coding unit. In addition, one or more transform blocks for transformation may be determined from the coding unit. The transform block may be equal to or smaller than the coding unit.
[0106] The shapes and sizes of the transform block and the prediction block may be unrelated to each other.
[0107] In another embodiment, prediction may be performed by using a coding unit as a prediction unit. In addition, transformation may be performed by using a coding unit as a transformation block.
[0108] 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, upper, upper right, right side, and lower right side of the current block.
[0109] 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.
[0110] 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.
[0111] The shape of the coding unit may include a square and a non-square. When the width length and height length of the coding unit are the same (that is, when the block shape of the coding unit is 4N×4N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a square. The image decoding apparatus 100 may determine the shape of the coding unit as a non-square.
[0112] 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, and 32:1. In addition, the image decoding apparatus 100 may determine whether the coding unit is in the horizontal direction or in the vertical direction based on the width length and height length of the coding unit. In addition, the image decoding apparatus 100 may determine the size of the coding unit based on at least one of the width length, height length, or area of the coding unit.
[0113] According to an embodiment, the image decoding apparatus 100 may determine the shape of the coding unit by using the block shape information, and may determine the division method of the coding unit by using the division shape pattern information. That is, the coding unit division method indicated by the division shape pattern information may be determined based on the block shape indicated by the block shape information used by the image decoding apparatus 100.
[0114] 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 2200 may determine the pre-agreed division shape pattern information based on the block shape information. The image decoding device 100 may determine the pre-agreed division shape pattern information for the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine the division shape pattern information for the maximum coding unit as four divisions. In addition, the image decoding device 100 may determine the division shape pattern information about the minimum coding unit as "no division is performed". 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 equal parts. The image decoding device 100 may obtain a coding unit of a size of 128×128 from a maximum coding unit of a size of 256×256 based on the division shape pattern information. In addition, the image decoding device 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” for a minimum coding unit.
[0115] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a square shape. For example, the image decoding apparatus 100 may determine whether to not split the square coding unit, whether to vertically split the square coding unit, whether to horizontally split the square coding unit, or whether to split the square coding unit into four coding units based on the split shape mode information. Figure 3 , when the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may not 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 unit 310b, 310c, 310d, 310e or 310f divided based on the division shape pattern information indicating a predetermined division method.
[0116] Reference Figure 3 According to an embodiment, 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 predetermined division method for dividing a square coding unit will be described in detail below with respect to various embodiments.
[0117] 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.
[0118] 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 predetermined 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 a coding unit 410 or 460 having the same size as the current coding unit 400 or 450 based on the division shape pattern information indicating that division is not performed, or may determine coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c divided based on the division shape pattern information indicating a predetermined division method. A predetermined division method for dividing a non-square coding unit will be described in detail below with respect to various embodiments.
[0119] 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.
[0120] 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 current coding unit 400 or 450 in a direction in which the long side of the current coding unit 400 or 450 is split in consideration of the shape of the current coding unit 400 or 450.
[0121] 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.
[0122] According to an embodiment, the aspect ratio of the current coding unit 400 or 450 may be 4:1 or 1:4. When the aspect ratio is 4:1, since the width length is longer than the height length, the block shape information may indicate the horizontal direction. When the aspect ratio is 1:4, since the width length is shorter than the height length, the block shape information may indicate 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, 430b, and 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, 480b, and 480c by dividing the current coding unit 450 in the vertical direction.
[0123] According to an embodiment, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and not all determined coding units may have the same size. For example, a predetermined coding unit 430b or 480b among the determined odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have a size different from that of other coding units 430a and 430c or 480a and 480c. That is, the coding unit determined by dividing the current coding unit 400 or 450 may have a plurality of sizes, and in some cases, all odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have different sizes.
[0124] 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 apply a predetermined restriction to at least one of the odd number of coding units generated by dividing the current coding unit 400 or 450. Figure 4, the image decoding apparatus 100 may set a decoding process for a coding unit 430b or 480b to be different from a decoding process of other coding units 430a and 430c or 480a and 480c, wherein the coding unit 430b or 480b is located at the center of three coding units 430a, 430b, and 430c or 480a, 480b, and 480c generated by dividing the current coding unit 400 or 450. For example, unlike other coding units 430a and 430c or 480a and 480c, the image decoding apparatus 100 may restrict the coding unit 430b or 480b at the center position from being further divided or being divided only a predetermined number of times.
[0125] 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.
[0126] According to an embodiment, the image decoding apparatus 100 may determine whether to divide the square first coding unit 500 into coding units or not to divide the square first coding unit 500 based on at least one of the block shape information and the division shape mode information. According to an embodiment, when the division shape mode information indicates that the first coding unit 500 is divided in the horizontal direction, the image decoding apparatus 100 may determine the second coding unit 510 by dividing the first coding unit 500 in the horizontal direction. The first coding unit, the second coding unit, and the third coding unit used according to the embodiment are terms for understanding the relationship before and after the coding unit is divided. For example, the second coding unit may be determined by dividing the first coding unit, and the third coding unit may be determined by dividing the second coding unit. It will be understood that the relationship between the first coding unit, the second coding unit, and the third coding unit follows the above description.
[0127] According to an embodiment, the image decoding apparatus 100 may determine whether to split the determined second coding unit 510 into coding units or not to split the determined second coding unit 510 based on the division shape pattern information. Figure 5, the image decoding apparatus 100 may split the non-square second coding unit 510 determined by splitting the first coding unit 500 into one or more third coding units 520a, 520b, 520c, and 520d based on at least one of the split shape pattern information and the block shape information, or may not split the non-square second coding unit 510. The image decoding apparatus 100 may obtain the split shape pattern information, and may obtain a plurality of second coding units (for example, 510) of various shapes by splitting the first coding unit 500 based on the obtained split shape pattern information, and may split the second coding unit 510 by using the split method of the first coding unit 500 based on the split shape pattern information. According to an embodiment, when the first coding unit 500 is split into the second coding unit 510 based on the split shape pattern information of the first coding unit 500, the second coding unit 510 may also be split into the third coding units (for example, 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.
[0128] Reference Figure 5 , a predetermined coding unit (e.g., a coding unit at a center position or a square coding unit) among the odd-numbered third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510 may be recursively divided. According to an embodiment, a square third coding unit 520c among the odd-numbered third coding units 520b, 520c, and 520d may be divided into a plurality of fourth coding units in the horizontal direction. A non-square fourth coding unit 530b or 530d among the plurality of fourth coding units 530a, 530b, 530c, and 530d may be divided into a plurality of coding units again. For example, a non-square fourth coding unit 530b or 530d may be divided into an odd-numbered coding unit again. A method that can be used to recursively divide coding units will be described below with respect to various embodiments.
[0129] 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 a predetermined restriction on a predetermined 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 among the odd number of third coding units 520b, 520c, and 520d to no longer be divided or divided a set number of times.
[0130] Reference Figure 5 , the image decoding apparatus 100 may limit the third coding unit 520c at the center position among the odd number of 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 predetermined division method (e.g., 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 predetermined number of times (e.g., 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.
[0131] According to an embodiment, the image decoding apparatus 100 may obtain split shape pattern information for splitting the current coding unit from a predetermined position in the current coding unit.
[0132] 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.
[0133] Reference Figure 6 , the division shape mode information of the current coding unit 600 or 650 may be obtained from a sample at a predetermined 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 predetermined position in the current coding unit 600 where the division shape mode information may be obtained is not limited to Figure 6, and may include various positions (e.g., top, bottom, left, right, top left, bottom left, top right, bottom right, etc.) included in the current coding unit 600. The image decoding apparatus 100 may obtain the division shape pattern information from a predetermined 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.
[0134] According to an embodiment, when the current coding unit is divided into a predetermined number of coding units, the image decoding apparatus 100 may select one of the coding units. As will be described below with respect to various embodiments, various methods may be used to select one of the plurality of coding units.
[0135] 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 predetermined position.
[0136] 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 predetermined 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.
[0137] 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.
[0138] 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 center 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 intermediate 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. The method of determining the coding unit at a predetermined 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.
[0139] 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 predetermined 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.
[0140] 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 620a as yb-ya. According to an embodiment, the image decoding apparatus 100 may determine the width of the intermediate coding unit 620b as the width of the current coding unit 600. The image decoding apparatus 100 may determine the height of the intermediate coding unit 620b as yc-yb. According to an embodiment, the image decoding apparatus 100 may determine the width or height of the lower coding unit 620c by using the width or height of the current coding unit 600 or the width or height of the upper coding unit 620a and the intermediate coding unit 620b. The image decoding apparatus 100 may determine a coding unit having a size different from sizes of other coding units based on the determined width and height of the coding units 620a, 620b, and 620c. Referring to Figure 6 , the image decoding apparatus 100 may determine the middle 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 predetermined 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 predetermined 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 predetermined position by comparing the size of the coding unit determined based on the coordinates of the predetermined sample points may be used.
[0141] The image decoding apparatus 100 may determine the width or height of each of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd) as information indicating the position of the upper left sample point 670a of the left coding unit 660a, the coordinates (xe, ye) as information indicating the position of the upper left sample point 670b of the middle coding unit 660b, and the coordinates (xf, yf) as information indicating the position of the upper left sample point 670c of the right coding unit 660c. The image decoding apparatus 100 may determine the size of each of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.
[0142] 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, 660b, and 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 predetermined 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 predetermined 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 predetermined position by comparing the size of the coding unit determined based on the coordinates of the predetermined sample points may be used.
[0143] 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.
[0144] According to an embodiment, the image decoding apparatus 100 may select a coding unit at a predetermined 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 predetermined position along the horizontal direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions along the horizontal direction and may impose restrictions on the coding unit. When the current coding unit has a non-square shape in which the height is greater than the width, the image decoding apparatus 100 may determine a coding unit at a predetermined 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.
[0145] 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 predetermined 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 predetermined position by using information about the positions of the even-numbered coding units. The operations related thereto may be the same as those already described above with respect to Figure 6 The operation of determining a coding unit at a predetermined position (eg, a center position) among odd-numbered coding units corresponds to the operation described in detail, and thus a detailed description thereof is not provided here.
[0146] According to an embodiment, when a non-square current coding unit is split into a plurality of coding units, a coding unit at a predetermined position among the plurality of coding units may be determined using predetermined information about the coding unit at a predetermined position in a split operation. For example, the image decoding apparatus 100 may determine a coding unit at a center position among the plurality of coding units determined by splitting the current coding unit using at least one of block shape information and split shape pattern information stored in samples included in an intermediate coding unit in a split operation.
[0147] 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.
[0148] According to an embodiment, predetermined information for identifying a coding unit at a predetermined position may be obtained from a predetermined sample point included in a coding unit to be determined. Figure 6 , the image decoding apparatus 100 may use the division shape pattern information obtained from the sample at the predetermined position in the current coding unit 600 (for example, the sample at the center position of the current coding unit 600) to determine the coding unit at the predetermined position (for example, the coding unit at the center position of the divided multiple coding units) among the multiple coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. That is, the image decoding apparatus 100 may determine the sample at the predetermined position by considering the block shape of the current coding unit 600, may determine the coding unit 620b including the sample for which the predetermined information (for example, the division shape pattern information) may be obtained from the multiple coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may impose a predetermined restriction 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 predetermined information may be obtained, and may impose a predetermined restriction on a coding unit 620b including the sample 640. However, the position of the sample from which the predetermined 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.
[0149] According to an embodiment, the position of the sample at which the predetermined 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 the predetermined specific information can be determined based on the shape. For example, the image decoding device 100 may determine a sample located on a boundary for dividing at least one of the width and the height of the current coding unit in half as a sample at which the predetermined 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 device 100 may determine one of the samples including the boundary dividing the long side of the current coding unit in half as a sample at which the predetermined information can be obtained.
[0150] According to an embodiment, when a current coding unit is divided into a plurality of coding units, the image decoding device 100 may use division shape pattern information to determine a coding unit at a predetermined position in the plurality of coding units. According to an embodiment, the image decoding device 100 may obtain division shape pattern information from a sample at a predetermined position in the coding unit, and may divide a plurality of coding units generated by dividing the current coding unit by using the division shape pattern information, wherein the division shape pattern information is obtained from a sample at a predetermined position in each of the plurality of coding units. That is, the coding unit may be recursively divided based on the division shape pattern information, wherein the division shape pattern information is obtained from a sample at a predetermined position in each coding unit. As has been described above, Figure 5 An operation of recursively splitting the coding unit is described, and thus a detailed description thereof will not be provided here.
[0151] 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 predetermined block (for example, the current coding unit).
[0152] 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.
[0153] 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 a vertical direction, determine the second coding units 730a and 730b by dividing the first coding unit 700 in a horizontal direction, or determine the second coding units 750a, 750b, 750c and 750d by dividing the first coding unit 700 in vertical and horizontal directions.
[0154] 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 the second coding units 750a, 750b, 750c, and 750d determined by dividing the first coding unit 700 in the vertical direction and in the horizontal direction according to a predetermined order (for example, in a raster scan order or a zigzag scan order 750e), wherein the coding units in one row are processed and then the coding units in the next row are processed.
[0155] 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, 750b, 750c, and 750d by dividing the first coding unit 700, and may recursively divide each of the determined plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. A division method of the plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d may correspond to a division method of the first coding unit 700. Therefore, each of the plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d may be independently divided into a plurality of coding units. Referring to Figure 7 , the image decoding apparatus 100 may determine the second coding units 710a and 710b by splitting the first coding unit 700 in a vertical direction, and may determine whether to independently split or not split each of the second coding units 710a and 710b.
[0156] 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.
[0157] 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 device 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. In addition, 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 predetermined order using various methods.
[0158] Figure 8 A process of determining that a current coding unit is to be split into an odd number of coding units, performed by an image decoding apparatus, is illustrated when coding units cannot be processed in a predetermined order according to an embodiment.
[0159] According to an embodiment, the image decoding apparatus 100 may determine that the current coding unit is to be split into an odd number of coding units based on the obtained split 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, 820d, and 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, 820d, and 820e.
[0160] According to an embodiment, the image decoding apparatus 100 may determine whether any coding unit is split into an odd number of coding units by determining whether the third coding units 820a and 820b and 820c, 820d, and 820e can be processed in a predetermined order. Figure 8 , the image decoding apparatus 100 may determine the third coding units 820a and 820b and 820c, 820d, and 820e by recursively dividing the first coding unit 800. The image decoding apparatus 100 may determine whether any one of the following coding units is divided into an odd number of coding units based on at least one of the block shape information and the division shape mode information: the first coding unit 800, the second coding units 810a and 810b, the third coding units 820a and 820b, and 820c, 820d, and 820e. For example, the coding unit located on the right side of the second coding units 810a and 810b may be divided into an odd number of third coding units 820c, 820d, and 820e. The processing order of the multiple coding units included in the first coding unit 800 can be a predetermined 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 the predetermined order.
[0161] According to an embodiment, the image decoding apparatus 100 may determine whether the third coding units 820a and 820b and 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition for processing in a predetermined order, and the condition is related to whether at least one of the width and height of the second coding units 810a and 810b will be divided in half along the boundary of the third coding units 820a and 820b and 820c, 820d, and 820e. For example, the third coding units 820a and 820b determined when the height of the left second coding unit 810a of a non-square shape is divided in half may satisfy the condition. Because the boundaries of the third coding units 820c, 820d, and 820e determined when the right second coding unit 810b is divided into three coding units fail to divide the width or height of the right second coding unit 810b in half, it may be determined that the third coding units 820c, 820d, and 820e do not satisfy the condition. When the condition is not satisfied as described above, the image decoding apparatus 100 may determine that the scanning order is discontinuous, and may determine that the right second coding unit 810b is to be 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 predetermined restriction on the coding unit at a predetermined position in the divided coding units. The restriction or the predetermined position has been described above with respect to various embodiments, and therefore a detailed description thereof will not be provided here.
[0162] 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.
[0163] 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 first coding unit has a square shape and the division shape pattern information indicates that the first coding unit 900 is divided into non-square coding units, the image decoding apparatus 100 may divide the first coding unit 900 into a plurality of non-square coding units. In detail, when the division shape pattern information indicates that an odd number of coding units is determined by dividing the first coding unit 900 in a horizontal direction or a vertical direction, the image decoding apparatus 100 may divide the square first coding unit 900 into an odd number of coding units (for example, second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in a vertical direction, or second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in a horizontal direction).
[0164] According to an embodiment, the image decoding apparatus 100 may determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition for processing in a predetermined order, and the condition is related to whether at least one of the width and height of the first coding unit 900 will be divided in half along the boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Fig. 9, because the boundaries of the second coding units 910a, 910b, and 910c determined by dividing the first coding unit 900 in the vertical direction do not divide the width of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not satisfy the condition for processing in a predetermined order. In addition, because the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the first coding unit 900 in the horizontal direction do not divide the height of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not satisfy the condition for processing in a 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 to be 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 predetermined restriction on the coding unit at a predetermined position in the divided coding unit. The restriction or the predetermined position has been described above with respect to various embodiments, and thus a detailed description thereof will not be provided here.
[0165] According to an embodiment, the image decoding apparatus 100 may determine coding units of various shapes by splitting the first coding unit.
[0166] 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.
[0167] Fig.10 It is shown that according to an embodiment, when a second coding unit having a non-square shape determined by splitting a first coding unit by an image decoding apparatus satisfies a predetermined condition, shapes into which the second coding unit may be split are restricted.
[0168] 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 ratio 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 image decoding.
[0169] 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.
[0170] Fig.11A process of splitting a square coding unit performed by an image decoding apparatus when division shape pattern information indicates that the square coding unit is not to be split into four square coding units according to an embodiment is illustrated.
[0171] 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 1110a and 1110b, or 1120a and 1120b, etc. based on the division shape pattern information.
[0172] 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 predetermined order, and the division method may correspond to the method of dividing the first coding unit 1100 based on the division shape pattern information.
[0173] 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.
[0174] 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.
[0175] 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 a coding unit.
[0176] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 1200 based on the division shape pattern information. When the block shape indicates a square shape and the division shape pattern information indicates that the first coding unit 1200 is divided in at least one of the horizontal direction and 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 An operation of dividing the second coding units 1210a and 1210b, or 1220a and 1220b is described, and thus a detailed description thereof will not be provided here.
[0177] According to an embodiment, the image decoding apparatus 100 may process the coding units in a predetermined order. Figure 7The operation of processing the encoding units in a predetermined order is described, 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, and 1216d and 1226a, 1226b, 1226c, and 1226d by dividing the square first coding unit 1200. According to an embodiment, the image decoding apparatus 100 may determine a processing order of the third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d based on a division shape of dividing the first coding unit 1200.
[0178] 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.
[0179] 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.
[0180] 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.
[0181] 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 to determine a plurality of coding units according to an embodiment is illustrated.
[0182] According to an embodiment, the image decoding device 100 may determine the depth of the coding unit based on a predetermined criterion. For example, the predetermined 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, a coding unit with an increased depth is represented as a coding unit of a lower depth.
[0183] Reference Fig.13According 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 into 1 / 2 may have a size of N×N. In addition, the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 into 1 / 2 may have a size of N / 2×N / 2. In this case, the width and height of the third coding unit 1304 are 1 / 4 of the width and height of the first coding unit 1300. When the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302 whose width and height are 1 / 2 of the width and height of the first coding unit 1300 may be D+1, and the depth of the third coding unit 1304 whose width and height are 1 / 4 of the width and height of the first coding unit 1300 may be D+2.
[0184] According to an embodiment, the image decoding device 100 can determine the second coding unit 1312 or 1322 of the lower depth, and the third coding unit 1314 or 1324 by dividing the non-square first coding unit 1310 or 1320 based on block shape information indicating a non-square shape (for example, the block shape information 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).
[0185] The image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by splitting at least one of the width and the height of the first coding unit 1310 having a size of N×2N. That is, the image decoding apparatus 100 may determine the second coding unit 1302 having a size of N×N or the second coding unit 1322 having a size of N×N / 2 by splitting the first coding unit 1310 in a horizontal direction, or may determine the second coding unit 1312 having a size of N / 2×N by splitting the first coding unit 1310 in horizontal and vertical directions.
[0186] According to an embodiment, the image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by dividing at least one of the width and the height of the first coding unit 1320 having a size of 2N×N. That is, the image decoding apparatus 100 may determine the second coding unit 1302 having a size of N×N or the second coding unit 1312 having a size of N / 2×N by dividing the first coding unit 1320 in a vertical direction, or may determine the second coding unit 1322 having a size of N×N / 2 by dividing the first coding unit 1320 in horizontal and vertical directions.
[0187] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1302 having a size of N×N. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2, the third coding unit 1314 having a size of N / 4×N / 2, or the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1302 in the vertical direction and the horizontal direction.
[0188] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1312 having a size of N / 2×N. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1312 in a horizontal direction, or may determine the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1312 in a vertical direction and a horizontal direction.
[0189] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1322 having a size of N×N / 2. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1322 in a vertical direction, or may determine the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1322 in a vertical direction and a horizontal direction.
[0190] 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 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.
[0191] 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.
[0192] Fig.14 Depth that may be determined based on the shape and size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.
[0193] 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.
[0194] According to an embodiment, the depths of the second coding units 1402a and 1402b, the second coding units 1404a and 1404b, and the second coding units 1406a, 1406b, 1406c, and 1406d determined based on the division shape pattern information of the square first coding unit 1400 may be determined based on the lengths of their long sides. For example, since the length of the side of the square first coding unit 1400 is equal to the length of the long side of the non-square second coding units 1402a and 1402b and 1404a and 1404b, the first coding unit 1400 and the non-square second coding units 1402a and 1402b and 1404a and 1404b may have the same depth, for example, D. However, when the image decoding device 100 divides the first coding unit 1400 into four square second coding units 1406a, 1406b, 1406c and 1406d based on the division shape pattern information, because the length of the side of the square second coding units 1406a, 1406b, 1406c and 1406d is 1 / 2 of the length of the side of the first coding unit 1400, the depth of the second coding units 1406a, 1406b, 1406c and 1406d can be D+1 which is 1 deeper than the depth D of the first coding unit 1400.
[0195] 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.
[0196] According to an embodiment, the depth of the second coding units 1412a and 1412b and 1414a, 1414b and 1414c, or 1422a and 1422b and 1424a, 1424b and 1424c determined based on the division shape pattern information of the non-square first coding unit 1410 or 1420 may be determined based on the length of their long sides. For example, since the length of the side of the square second coding units 1412a and 1412b is 1 / 2 of the length of the long side of the first coding unit 1410 having a non-square shape whose height is longer than the width, the depth of the square second coding units 1412a and 1412b is D+1 which is 1 deeper than the depth D of the non-square first coding unit 1410.
[0197] In addition, the image decoding apparatus 100 may divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the division shape pattern information. The odd number of second coding units 1414a, 1414b, and 1414c may include the non-square second coding units 1414a and 1414c and the square second coding unit 1414b. In this case, since the length of the long side of the non-square second coding units 1414a and 1414c and the length of the side of the square second coding unit 1414b are 1 / 2 of the length of the long side of the first coding unit 1410, the depth of the second coding units 1414a, 1414b, and 1414c may be D+1 which is 1 deeper than the depth D of the non-square first coding unit 1410. The image decoding apparatus 100 may determine the depths of coding units split from the first coding unit 1420 having a non-square shape having a width longer than a height by using the above-described method of determining the depths of coding units split from the first coding unit 1410 .
[0198] 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.
[0199] 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 whose height is longer than its width. The image decoding apparatus 100 may use a PID indicating a corresponding coding unit in order to identify the corresponding coding unit. According to an embodiment, the PID may be obtained from a sample at a predetermined position of each coding unit (e.g., an upper left sample).
[0200] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a predetermined 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 coding units. The image decoding apparatus 100 may determine the coding unit 1414b corresponding to the PID and the intermediate value among the PIDs of the coding units as the coding unit at the center position among the coding units determined by dividing the first coding unit 1410. According to an embodiment, when the divided coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for distinguishing the divided coding units based on a size ratio between the coding units. 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 increase 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 those of the 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 predetermined position (e.g., a coding unit at a center position) among the odd number of coding units has a size different from that of the other coding units. In this case, the image decoding apparatus 100 may determine the coding units at the center position having different sizes by using the PIDs of the coding units. However, the PID of the coding unit at the predetermined position and the size or position are not limited to the above-mentioned examples, and various PIDs and various positions and sizes of the coding unit may be used.
[0201] According to an embodiment, the image decoding apparatus 100 may use a predetermined data unit in which the coding unit is recursively split.
[0202] Fig.15 It is illustrated that a plurality of coding units are determined based on a plurality of predetermined data units included in a picture according to an embodiment.
[0203] According to an embodiment, a predetermined 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 predetermined 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, a predetermined data unit is referred to as a reference data unit.
[0204] According to an embodiment, the reference data unit may have a predetermined size and a predetermined shape. According to an embodiment, the reference coding 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.
[0205] 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.
[0206] 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.
[0207] 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.
[0208] 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 current coding unit 300 describes the operation of dividing the square reference coding unit 1500 into one or more coding units, and the above has been combined with Figure 4 The operation of splitting the current coding unit 400 or 450 describes an operation of splitting the non-square reference coding unit 1502 into one or more coding units. Therefore, a detailed description thereof will not be provided here.
[0209] 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 a 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 a bitstream, wherein the slice, slice segment, tile, tile group, or maximum coding unit is a data unit (e.g., a data unit having a size equal to or smaller than a slice) among various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, a maximum coding unit, etc.) that satisfies a predetermined condition. The image decoding apparatus 100 may determine the size and shape of the reference coding unit for each data unit that satisfies the predetermined condition by using a PID. When the reference coding unit shape information and the reference coding unit size information are obtained and used from a bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high, and therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the sizes and shapes of the reference coding units corresponding to the PID for identifying the sizes and shapes of the reference coding units may be predetermined. That is, the image decoding apparatus 100 may determine at least one of the sizes and shapes of the reference coding units included in the data unit serving as the unit for obtaining the PID by selecting at least one of the sizes and shapes of the reference coding units predetermined based on the PID.
[0210] 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.
[0211] 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.
[0212] Hereinafter, a method for determining a division rule according to an embodiment of the present disclosure will be described in detail.
[0213] 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 2200. The image decoding apparatus 100 may determine a division rule of an image based on information obtained from a bitstream. The image decoding apparatus 100 may determine a division rule based on information obtained from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a parallel block header, and a parallel block group header. The image decoding apparatus 100 may determine a division rule differently according to a frame, a slice, a parallel block, a temporal layer, a maximum coding unit, or a coding unit.
[0214] The image decoding device 100 may determine the division rule based on the block shape of the coding unit. The block shape may include the size, shape, aspect ratio, and direction of the coding unit. The image decoding device 100 may predetermine the division rule based on the block shape of the coding unit. However, the embodiment is not limited thereto. The image decoding device 100 may determine the division rule based on information obtained from the received bit stream.
[0215] The shape of the coding unit may include a square and a non-square. When the width length and height length of the coding unit are the same, the image decoding apparatus 100 may determine that the shape of the coding unit is a square. In addition, when the width length and height length of the coding unit are different, the image decoding apparatus 100 may determine that the shape of the coding unit is a non-square.
[0216] The size of the coding unit may include various sizes such as 4×4, 8×4, 4×8, 8×8, 16×4, 16×8, ... and up to 256×256. The size of the coding unit may be classified based on the length of the long side, the length of the short side, or the area of the coding unit. The image decoding device 100 may apply the same division rule to the coding units classified into the same group. For example, the image decoding device 100 may classify the coding units having the same long side length as having the same size. In addition, the image decoding device 100 may apply the same division rule to the coding units having the same long side length.
[0217] The aspect ratio of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, 1:32, etc. In addition, the direction of the coding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate a case where the width length of the coding unit is longer than the height length of the coding unit. The vertical direction may indicate a case where the width length of the coding unit is shorter than the height length of the coding unit.
[0218] 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.
[0219] 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.
[0220] 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.
[0221] In addition, the image decoding apparatus 100 may determine a division rule so that the coding units generated via different division paths do not have the same block shape. However, the embodiment is not limited thereto, and the coding units generated via different division paths have the same block shape. The coding units generated via different division paths may have different decoding processing orders. Fig.12 The decoding process order is described, so its details are not provided again.
[0222] Fig.16 It is a block diagram of an image encoding and decoding system.
[0223] 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 similar configuration to the image decoding apparatus 100.
[0224] 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 transformed 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.
[0225] The encoded image data in the bit stream received by the decoding end 1650 is reconstructed as residual data in the spatial domain via the entropy decoder 1655 and the inverse quantizer and inverse transformer 1660. When the reference image and the residual data output from the prediction decoder 1675 are combined, 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 performing filtering on 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.
[0226] The loop filter 1640 of the encoding end 1610 performs loop filtering by using filter information input according to user input or system setting. 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.
[0227] In the following, reference Figures 17 to 20 , a method and apparatus for encoding or decoding a video by utilizing a motion vector difference extended merge mode according to an embodiment disclosed in this specification will now be described.
[0228] Fig.17 is a block diagram of a video decoding apparatus according to an embodiment.
[0229] Reference Fig.17 , the video decoding apparatus 1700 according to an embodiment may include a syntax element obtainer 1710 and a decoder 1720.
[0230] The video decoding apparatus 1700 may obtain a bitstream generated as a result of encoding an image, and may decode motion information for inter prediction based on information included in the bitstream.
[0231] The video decoding apparatus 1700 according to an embodiment may include a central processor (not shown) for controlling the syntax element obtainer 1710 and the decoder 1720. Alternatively, the syntax element obtainer 1710 and the decoder 1720 may be operated by their own processors (not shown), and the processors may systematically operate with each other to operate the video decoding apparatus 1700. Alternatively, the syntax element obtainer 1710 and the decoder 1720 may be controlled according to the control of an external processor (not shown) of the video decoding apparatus 1700.
[0232] The video decoding apparatus 1700 may include one or more data memories (not shown) storing input / output data of the syntax element obtainer 1710 and the decoder 1720. The video decoding apparatus 1700 may include a memory controller (not shown) for controlling data input and output to and from the data memory.
[0233] The video decoding device 1700 may perform an image decoding operation including prediction by operating in association 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 may perform basic image decoding operations in a manner that not only a separate processor but also an image decoding processing module included in a central processing device or a graphics processing device also performs basic image decoding operations.
[0234] The video decoding apparatus 1700 may be included in the above-mentioned image decoding apparatus 100. For example, the syntax element obtainer 1710 may be included in Figure 1 The syntax element obtainer 1710 and the decoder 1720 may be included in the receiver 110 of the image decoding apparatus 100, and the syntax element obtainer 1710 and the decoder 1720 may be included in the decoder 120 of the image decoding apparatus 100.
[0235] The syntax element 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 the 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.
[0236] The syntax element obtainer 1710 may determine the current block based on the block shape information and / or the information about the partition shape mode contained 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 syntax element 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.
[0237] 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 scheme of the motion vector may include at least one of a merge mode, a skip mode, and an MMVD mode. In the merge mode or the skip mode, a merge candidate list including motion vector candidates is used, and one motion vector candidate indicated by a merge index among the motion vector candidates may be determined as a merged motion vector candidate. The MMVD mode represents a merge mode with a motion vector difference, and may be a mode of determining a predicted motion vector of the current block by applying a motion vector difference differentiated according to a distance of the difference and a direction of the distance to a base motion vector determined from the motion vector candidates.
[0238] According to an embodiment, information related to the MMVD mode may be obtained from a bitstream. The information related to the MMVD mode according to an embodiment may include at least one of information indicating whether the MMVD mode is used for the current block (hereinafter referred to as MMVD information), information indicating a base motion vector of the current block (hereinafter referred to as a merge index), information indicating a distance of a difference from the base motion vector to a motion vector candidate (hereinafter referred to as a difference distance index), and information indicating a direction of a difference from the base motion vector to the motion vector candidate (hereinafter referred to as a difference direction index).
[0239] The syntax element obtainer 1710 may obtain information related to the MMVD mode in the form of a syntax element from a syntax corresponding to at least one of a coding unit, a transform unit, a maximum coding unit, a slice unit, and a picture unit.
[0240] The video decoding apparatus 1700 may receive a syntax in the form of a bitstream, may obtain a syntax element from the syntax by performing entropy decoding, and may interpret various information indicated by each syntax element. Therefore, it can be understood that the syntax element obtainer 1710 obtains various information (syntax elements) from the bitstream (syntax).
[0241] The decoder 1720 may verify whether the MMVD mode is used for the current block based on the MMVD information obtained from the bitstream. The information indicating whether the MMVD mode is applied may include a flag or an index.
[0242] According to an embodiment, the MMVD mode may be applied to various tools available in the inter prediction mode. Therefore, the video decoding apparatus 1700 needs to determine whether to apply the MMVD mode to each tool of the inter prediction mode.
[0243] For example, in the first scheme, it may be determined whether the MMVD mode is applied to each tool only.
[0244] As another example, in the second scheme, after first determining whether to apply the MMVD mode to all tools, if applicable, it is determined whether to apply the MMVD mode to each tool. When the MMVD mode is not applied to all tools, it is not necessary to determine whether to apply the MMVD mode to each tool.
[0245] In order to determine whether to apply the MMVD mode, the video decoding apparatus 1700 according to an embodiment may obtain a syntax element including information such as a flag from a bitstream. Therefore, in the first scheme, even when the MMVD mode is not applied to various tools, the video decoding apparatus 1700 must obtain a flag for determining that the MMVD mode is not applied to each of the various tools from the bitstream.
[0246] However, according to the second scheme, the video decoding device 1700 may first obtain a flag indicating whether the MMVD mode is enabled for various tools from the bitstream. When the MMVD mode is applicable, based on the flag, the video decoding device 1700 may obtain a flag for each tool to determine whether the MMVD mode is applied. When the MMVD mode is not applicable, based on the flag indicating whether the MMVD mode is enabled for various tools, the video decoding device 1700 does not need to additionally obtain a flag indicating whether the MMVD mode is applied to each tool, thereby improving decoding efficiency.
[0247] Hereinafter, an embodiment will now be described in which, for each sequence and according to the second scheme, the video decoding apparatus 1700 first determines whether the MMVD mode is applicable, and if applicable, determines whether to apply the MMVD mode to a specific tool.
[0248] The syntax element obtainer 1710 according to an embodiment may obtain sequence MMVD information indicating whether the MMVD mode is applicable to the current sequence from the sequence parameter set. The MMVD mode in the sequence is collectively referred to as: in various inter-frame prediction modes performed at a data level equal to or less than the sequence, the prediction mode of the motion vector is adjusted by using the distance index and the direction index of the motion vector that are signaled separately from the motion vector. When the MMVD mode is applicable according to the sequence MMVD information, the syntax element obtainer 1710 according to an embodiment may further obtain, for a current block included in the current sequence, first MMVD information indicating whether the MMVD mode is applied to the first inter-frame prediction mode and second MMVD information indicating whether the MMVD mode is applied to the second inter-frame prediction mode. When the MMVD mode is applied to the first inter-frame prediction mode according to the first MMVD information, the decoder 1720 may reconstruct the motion vector according to the MMVD mode in the first inter-frame prediction mode, and when the MMVD mode is applied to the second inter-frame prediction mode according to the second MMVD information, the decoder 1720 may reconstruct the motion vector according to the MMVD mode in the second inter-frame prediction mode. However, when the MMVD mode is not applicable according to the sequence MMVD information, the syntax element obtainer 1710 according to an embodiment does not need to obtain the first MMVD information and the second MMVD information from the bitstream.
[0249] In a specific example, the syntax element obtainer 1710 may obtain sequence MMVD information indicating whether the MMVD mode is applicable to the current sequence from the sequence parameter set. When the MMVD mode is applicable according to the sequence MMVD information, the syntax element obtainer 1710 according to an embodiment may obtain sequence sub-pixel MMVD information indicating whether a motion vector difference of an integer pixel unit or a motion vector difference of a sub-pixel unit is used in the current sequence. When the MMVD mode is applicable according to the sequence MMVD information, the syntax element obtainer 1710 according to an embodiment may obtain MMVD information indicating whether the MMVD mode is used for a current block included in the current sequence.
[0250] When the MMVD mode is used for the current block according to the MMVD information, the decoder 1720 may reconstruct the distance of the motion vector difference of the integer pixel unit or the sub-pixel unit according to the MMVD information. The distance of the motion vector difference comes from the distance index of the motion vector difference of the current block obtained from the bitstream. The syntax element obtainer 1710 according to an embodiment may determine the motion vector of the current block by using the distance of the motion vector difference, and may reconstruct the current block by using the motion vector of the current block.
[0251] In addition, when the skip mode or the merge mode is used for the current block, the syntax element obtainer 1710 may extract MMVD information indicating whether the MMVD mode is applied from the bitstream.
[0252] When the MMVD mode is used for the current block, the motion vector candidates may be set according to a variable distance of a difference from a base motion vector and a variable direction of the difference.
[0253] The difference distance is a value determined based on a basic pixel unit (e.g., a 1 / 4 pixel unit), and may indicate a difference represented by a basic pixel unit. For example, when the difference distance between a base motion vector and a motion vector is 1, the motion vector and the base motion vector differ by a pixel distance corresponding to a 1 / 4 pixel unit. The difference distance may have a value corresponding to an integer, a rational number, or an irrational number.
[0254] 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 decoder 1720 may determine the motion vector according to a predetermined distance of the difference.
[0255] 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 decoder 1720 may scale a predetermined distance of the difference and then determine a motion vector candidate for a base motion vector based on the scaled distance of the difference.
[0256] 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 decoder 1720 can enlarge the distance of the difference to determine the motion vector.
[0257] According to an embodiment, the decoder 1720 may scale the distance of the difference 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.
[0258] According to an embodiment, when the basic pixel unit is greater than a minimum pixel unit that can be indicated by a motion vector of the current block, the decoder 1720 may enlarge the distance of the difference.
[0259] According to an embodiment, a base 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 spatially and temporally related to the current block. Neighboring blocks spatially and temporally related to the current block may include blocks decoded before the current block. Therefore, a base motion vector according to an embodiment may be determined based on a motion vector of a neighboring block determined from the merge candidate list.
[0260] 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 above 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.
[0261] According to an embodiment, the decoder 1720 may determine the motion vector of the neighboring block related to the current block as the base motion vector. The decoder 1720 may determine the base motion vector in the merge candidate list by using the merge index obtained from the bitstream. The merge index may be referred to as a merge index.
[0262] According to an embodiment, the merge index may indicate the second candidate in the merge candidate list to the greatest extent.
[0263] Optionally, the decoder 1720 may modify the motion vector of the neighboring block related to the current block, and may determine the modified motion vector as the base motion vector. According to an embodiment, the decoder 1720 may determine the base motion vector in the same manner as a method of determining a candidate list of a motion vector predictor in an advanced motion vector prediction (AMVP) mode of the high efficiency video coding (HEVC) standard.
[0264] The merge index 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 may be included in a bitstream. For example, when the merge index is decoded via the FLC method, the cMax value may be 1.
[0265] When the base motion vector of the current block is determined, the decoder 1720 may determine a motion vector by applying the base motion vector to the merged motion vector difference.
[0266] The syntax element obtainer 1710 may obtain information indicating at least one of a distance index of a difference and a direction index of a difference from the bitstream, and the decoder 1720 may determine a merged motion vector difference based on at least one of the distance index of the difference and the direction index of the difference. The motion vector of the current block may be determined from the base motion vector.
[0267] The syntax element obtainer 1710 according to an embodiment may decode the distance index of the difference via a truncated unary encoding method, and at this time the cMax value may be 7 and the cRiceParam value may be 0. The syntax element obtainer 1710 according to an embodiment may decode the direction index of the difference via an FLC method, and at this time the cMax value may be 3 and the cRiceParam value may be 0.
[0268] The decoder 1720 according to an embodiment may scale the distance of the difference 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 decoder 1720 may amplify the distance of the difference verified from the bitstream.
[0269] The scaled difference distance may indicate a difference represented by a minimum pixel unit. 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 difference distance is 2, the decoder 1720 may determine a motion vector having a difference with the base motion vector corresponding to a pixel distance of two 1 / 8 pixel units.
[0270] As described above, the difference distance predetermined based on the basic pixel unit is used to determine the motion vector of the current block based on the base motion vector determined from the merge candidate list, and because information indicating the difference distance based on the basic pixel unit is sent via a bitstream signal, the decoder 1720 that is capable of indicating the accuracy of the minimum pixel unit (which is different from the accuracy of the basic pixel unit) can scale the difference distance sent via the bitstream signal according to the minimum pixel unit.
[0271] The difference distance determined based on the basic pixel unit and the difference distance scaled based on the minimum pixel unit may be the same with respect to the pixel distance.
[0272] 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 syntax element obtainer 1710 may obtain information indicating a minimum pixel unit from a bitstream corresponding to at least one level among a block, a slice, and a picture.
[0273] At least one of a difference distance index and a difference direction index for determining a motion vector of a current block may be obtained from a bitstream of a transform unit level, a coding unit level, a maximum coding unit level, a slice level, or a picture level.
[0274] The syntax element obtainer 1710 according to an embodiment may obtain some bins in the difference distance index by performing entropy decoding using context information (context variable), and may obtain the remaining bins by performing entropy decoding in a bypass mode.
[0275] 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. Decoding in bypass mode can be performed, where probability-based entropy decoding with equal probability of 0.5 is performed without using context information. For entropy decoding of the current binary bit, it is determined whether to use context information and which context information to use.
[0276] According to an embodiment, the syntax element obtainer 1710 can obtain the first binary bit of the distance index of the merged motion vector difference by performing entropy decoding on the bitstream using context information. In addition, the syntax element obtainer 1710 can obtain other binary bits of the distance index of the merged motion vector difference by performing entropy decoding on the bitstream in bypass mode.
[0277] The syntax element obtainer 1710 according to an embodiment may perform entropy decoding on a bitstream in a bypass mode to obtain two-bit binary bits indicating a direction index of a difference.
[0278] The syntax element obtainer 1710 may obtain information indicating a residual motion vector from a bitstream of a transform unit level, a coding unit level, a maximum coding unit level, a slice level, or a picture level.
[0279] The following will refer to Fig.21 Motion vector candidates that may be determined from a base motion vector in an MMVD mode according to an embodiment are described.
[0280] Fig.21 Shows the positions of motion vector candidates according to an embodiment.
[0281] The decoder 1720 according to an embodiment may determine the motion vector of the current block by applying the merged motion vector difference to the base 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 a bitstream used only for one direction. For example, information indicating the merged motion vector difference may be included in a bitstream used only for either one direction of the list 0 direction or the list 1 direction.
[0282] Fig.21 Motion vectors that can be determined in bi-directional prediction in MMVD mode are shown.
[0283] A base motion vector 2125 in the L0 direction and a base motion vector 2135 in the L1 direction of the current block 2110 of the current picture 2100 are determined in the merge candidate list. The base motion vector 2125 in the L0 direction indicates the position of the dotted shape in the L0 reference picture 2120, and the base motion vector 2135 in the L1 direction indicates the position of the dotted shape in the L1 reference picture 2130.
[0284] However, in the MMVD mode, a motion vector difference may be applied to each of the base motion vector 2125 and the base motion vector 2135 in the L1 direction based on a direction index of the difference and a distance index of the difference.
[0285] For example, it may be determined whether the distance between the base motion vector and the motion vector candidate is s, 2s, 3s, etc., according to the distance index of the difference. When the distance index of the difference indicates s, the motion vector candidate generated as a result of applying the motion vector difference to the base motion vector may indicate the position of the black circle in the L0 reference picture 2120 and the L1 reference picture 2130. When the distance index of the difference indicates 2s, the motion vector candidate generated as a result of applying the motion vector difference to the base motion vector may indicate the position of the white circle in the L0 reference picture 2120 and the L1 reference picture 2130.
[0286] For example, according to the direction index of the difference, it can be determined whether the direction between the base motion vector and the motion vector candidate is + or - in the x and y axis directions. In particular, the direction index of the difference can indicate one of (+, 0), (-, 0), (0, +) and (0, -) in the (x, y) axis direction.
[0287] 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 difference distance index and the difference direction index.
[0288] In the following, reference is made to Fig. 22 , a method of determining motion vector candidates that can be determined from a base motion vector will be described. Fig. 22 is a diagram showing motion vector candidates displayed on a coordinate plane, and shows motion vector candidates determined according to a distance based on a difference determined in advance in a basic pixel unit corresponding to a 1 / 4 pixel unit.
[0289] Reference Fig. 22 , the decoder 1720 may determine the position of the candidate according to a predetermined shape of the configured motion vector candidate. The predetermined shape may be similar to a polygon (such as a rhombus, a rectangle, or a circle).
[0290] The decoder 1720 may determine a candidate at the same difference distance from a point corresponding to a base motion vector as a motion vector candidate. The decoder 1720 may determine the distance of the motion vector candidate at the first difference from a preset point, determine the distance of the motion vector candidate at the second difference from a preset point, and may determine the distance of the motion vector candidate at the nth difference from a preset point. The difference distance may be determined according to a user's definition. Alternatively, the decoder 1720 may directly determine the difference distance based on information related to the current block, temporal layer, or picture group (GOP), or obtain information indicating the difference distance via a bitstream for determining a motion vector candidate.
[0291] The decoder 1720 may determine a distance of a difference for determining a motion vector candidate of the current block according to a distance of a difference determined in a higher level than a level corresponding to the current block.
[0292] The number of motion vector candidates may be determined independently for each difference distance.The decoder 1720 may determine the number of motion vector candidates for each difference distance of the current block according to information about the number determined in a higher level than the level corresponding to the current block.
[0293] Fig. 22 The case where the number of motion vector candidates in each difference distance is 4 is shown. Fig. 22 There are 3 difference distances, but the number of difference distances is not limited to 3.
[0294] Reference Fig. 22 , the decoder 1720 can determine a motion vector candidate having a diamond distribution based on the basic motion vector (x, y) 2201.
[0295] The decoder 1720 may determine motion vector candidates (x+1, y) 2202 , (x−1, y) 2203 , (x, y+1) 2204 , and (x, y−1) 2205 whose difference distances from the base motion vector (x, y) 2201 are 1.
[0296] The decoder 1720 may determine motion vector candidates (x+2, y) 2206 , (x−2, y) 2207 , (x, y+2) 2208 , and (x, y−2) 2209 whose difference distance from the base motion vector (x, y) 2201 is 2.
[0297] The decoder 1720 may determine motion vector candidates (x+4, y) 2210 , (x−4, y) 2211 , (x, y+4) 2212 , and (x, y−4) 2213 within a distance of 4 from the base motion vector (x, y) 2201 .
[0298] According to an embodiment, the decoder 1720 may determine motion vector candidates located at different difference distances for each basic motion vector. For example, from among a plurality of basic motion vectors, a motion vector candidate with a difference distance of 1 may be determined for the first basic motion vector, and a motion vector candidate with a difference distance of 2 may be determined for the second basic motion vector. Alternatively, for example, a motion vector candidate with a difference distance of 1 and a motion vector candidate with a difference distance of 2 may be determined for the first basic motion vector, and a motion vector candidate with a difference distance of 4 and a motion vector candidate with a difference distance of 8 may be determined for the second basic motion vector.
[0299] When the distances of different differences are mapped to the base motion vector in a 1:1 manner, the syntax element obtainer 1710 may obtain only information indicating the base motion vector of the current block or information indicating the distance of the difference from the bitstream, and determine the distance for specifying the difference between the motion vector of the current block and the base motion vector of the current block.
[0300] As described above, the difference distance used to determine the motion vector candidates can 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 decoder 1720 can scale the preset difference distance used to configure the candidate group of each basic motion vector.
[0301] 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 decoder 1720 may enlarge the difference distance. According to an embodiment, the decoder 1720 may enlarge the difference 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 difference distance is k, the decoder 1720 may enlarge the difference distance k to k×n / m.
[0302] The syntax element 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 decoder 1720 according to an embodiment may generate a merge candidate list including neighboring blocks referenced when predicting the motion vector of the current block in the skip mode or the merge mode.
[0303] In skip mode or merge mode, the syntax element obtainer 1710 may obtain MMVD information indicating whether to use the motion vector determined from the merge candidate list of the current block and the merged motion vector difference. When the merged motion vector difference is used according to the MMVD information, prediction may be performed according to the MMVD mode using the motion vector determined from the merge candidate list of the current block and the merged motion vector difference. When the merged motion vector difference is used according to the MMVD information, the syntax element obtainer 1710 may obtain a merge index from the bitstream. The decoder 1720 according to an embodiment may determine a base motion vector from one candidate determined based on the merge index in the merge candidate list. The decoder 1720 may determine the merged motion vector difference by using the distance index of the merged motion vector difference of the current block and the direction index of the merged motion vector difference, and may determine the motion vector of the current block by using the base motion vector and the merged motion vector difference.
[0304] The decoder 1720 according to an embodiment may reconstruct the current block by using the motion vector of the current block. The decoder 1720 may determine a reference block in a reference picture by using the motion vector of the current block, and may determine a prediction sample corresponding to the current block from the reference samples included in the reference block.
[0305] When the prediction mode of the current block according to an embodiment is a merge mode and the MMVD mode is selected, the decoder 1720 may determine the base motion vector of the current block from the merge candidate list, and may determine the motion vector of the current block by using the base motion vector and the merged 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 may obtain the residual sample by performing inverse quantization and inverse transformation on the transform coefficient. The decoder 1720 may determine the reconstructed sample of the current block by combining the prediction sample of the current block with the residual sample of the current block.
[0306] When the prediction mode of the current block according to an embodiment is a skip mode and the MMVD mode is selected, the decoder 1720 may determine the motion vector of the current block by using the merged motion vector difference and the base 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 thus does not obtain the residual sample. In the skip mode, the decoder 1720 may determine the prediction sample of the current block as the reconstructed sample of the current block without the residual sample.
[0307] In the following, reference will now be made to Figures 18 to 36 A video decoding method is described including performing inter prediction in MMVD mode.
[0308] Fig.18 A flowchart of a video decoding method according to an embodiment is shown.
[0309] In operation 1810, the syntax element obtainer 1710 may obtain sequence MMVD information indicating whether an MMVD mode is applied to a current sequence from a sequence parameter set.
[0310] In operation 1820 , when the MMVD mode is applicable according to the sequence MMVD information, the syntax element obtainer 1710 may obtain, from the bitstream, first MMVD information indicating whether the MMVD mode is used for the current block included in the current sequence in the first inter prediction mode.
[0311] In operation 1830, when the MMVD mode is applied to the first inter prediction mode according to the first MMVD information, the decoder 1720 may reconstruct a motion vector of the current block to be used in the first inter prediction mode by using a distance of a motion vector difference and a direction of a motion vector difference obtained from a bitstream.
[0312] When a merge motion vector difference is used for the current block according to the MMVD information, the syntax element obtainer 1710 may obtain a merge index from the bitstream. The merge index indicates one candidate in the merge candidate list. The syntax element obtainer 1710 may determine a base motion vector from one candidate determined based on the merge index in the merge candidate list.
[0313] The decoder 1720 may determine whether to select the MMVD mode for the current block based on the obtained MMVD information in the skip mode or the merge mode. When the MMVD mode is selected for the current block, that is, when the motion vector determined from the merge candidate list of the current block and the merged motion vector difference are used, the syntax element obtainer 1710 may obtain a merge index from the bitstream.
[0314] The merge index is 1-bit information. In addition, the merge index may be obtained by using a piece of context information of the first binary bit of the merge index. The syntax element obtainer 1710 may perform entropy decoding using the context information to obtain the merge index in the skip mode or the merge mode.
[0315] When the MMVD mode is selected in the skip mode or merge mode, the maximum number of candidates allowed to be selected according to the merge index may be less than the maximum number of candidates included in the merge candidate list. For example, because the merge index is a 1-bit flag, the merge index may indicate one candidate from a maximum of two candidates in the merge candidate list.
[0316] The syntax element 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 syntax element obtainer 1710 may obtain a 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 may obtain other binary bits indicating the distance index of the merged motion vector difference by performing entropy decoding in the bypass mode.
[0317] In operation 1840 , the decoder 1720 may reconstruct the current block by using the motion vector of the current block.
[0318] The decoder 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 may determine a motion vector of the current block by using a base motion vector and the merged motion vector difference.
[0319] The decoder 1720 may determine a reference block in a reference picture by using a motion vector of the current block, and may determine a prediction sample corresponding to the current block from the prediction samples included in the reference block. The decoder 1720 may add the prediction sample of the current block to the residual sample of the current block to determine the reconstructed sample of the current block in a prediction mode other than the skip mode. When the residual sample is not available as in the skip mode, the reconstructed sample of the current block may be determined only from the prediction sample of the current block.
[0320] 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 motion vector difference information.
[0321] Compared with the general motion vector prediction mode, the skip mode and the merge mode do not use the motion vector difference. However, when the MMVD mode is selected in the skip mode or the merge mode, the merged motion vector difference is used. Compared with the general motion vector prediction mode, the merged motion vector difference in the MMVD mode has the simplicity of expression compared with the motion vector difference.
[0322] 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.
[0323] 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 information of the direction of the difference and the distance index of the difference. Therefore, since the merged motion vector difference can be represented by using only the information of the direction of the difference and the distance index of the difference, the amount of bits required to signal the merged motion vector difference can be significantly reduced compared to the amount of bits required to signal the general motion vector difference.
[0324] Fig.36 A flowchart of a video decoding method according to another embodiment is shown.
[0325] Operation 1810 is similar to the above reference Fig.18 The operations described are the same.
[0326] Operation 1822 and operation 1824 correspond to Fig.18 In operation 1822, when the MMVD mode is applicable according to the sequence MMVD information, the syntax element obtainer 1710 may obtain sub-pixel MMVD information indicating whether motion vector differences of integer pixel units or motion vector differences of sub-pixel units are used in the current sequence. When the MMVD mode is not applicable according to the sequence MMVD information, both the motion vector differences of integer pixel units and the motion vector differences of sub-pixel units are not applicable to the current sequence and the current block.
[0327] In operation 1824, when the MMVD mode is applicable according to the sequence MMVD information, the syntax element obtainer 1710 may obtain MMVD information indicating whether the MMVD mode is used for the current block included in the current sequence. That is, the MMVD information indicates whether the MMVD mode is applied when the current block is in the skip mode or the merge mode.
[0328] The syntax element obtainer 1710 may perform entropy decoding using the context information in order to obtain MMVD information in the skip mode or the merge mode. When the MMVD information is obtained, operation 1832 is performed.
[0329] Operation 1832 is Fig.18 Specific operations of operation 1830.
[0330] In operation 1832, when the MMVD mode is enabled for the current block according to the MMVD information, the decoder 1720 may determine whether to use motion vector differences in integer pixel units or sub-pixel units in the current sequence according to the sub-pixel MMVD information, and may reconstruct the distance of the motion vector differences in integer pixel units or sub-pixel units according to the distance index of the motion vector differences of the current block obtained from the bitstream.
[0331] When the MMVD mode is used for the current block according to the MMVD information and the motion vector difference of integer pixel units is used according to the sub-pixel MMVD information, the decoder 1720 may reconstruct the distance of the motion vector difference of integer pixel units from the distance index of the motion vector difference of the current block.
[0332] Similarly, when the MMVD mode is used for the current block according to the MMVD information and the motion vector difference in sub-pixel units is used according to the sub-pixel MMVD information, the decoder 1720 may reconstruct the distance of the motion vector difference in sub-pixel units from the distance index of the motion vector difference of the current block.
[0333] When the reconstruction distance of the motion vector difference is an integer pixel unit, the decoder 1720 may round the x-component value and the y-component value of the base motion vector of the current block to an integer pixel unit, and may reconstruct the motion vector of the integer pixel unit by using the x-component value and the y-component value of the base motion vector rounded to the integer pixel unit.
[0334] When the reconstruction distance of the motion vector difference is a sub-pixel unit, the decoder 1720 may reconstruct a sub-pixel unit motion vector by using the distance of the sub-pixel unit motion vector difference and an x-component value and a y-component value of a base motion vector rounded to a sub-pixel unit.
[0335] Therefore, when MMVD is applied in the current sequence, based on the sequence MMVD information obtained from the sequence parameter set (SPS), the video decoding apparatus 1700 may additionally obtain sub-pixel MMVD information and MMVD information from the bitstream. However, when MMVD is not applied in the current sequence, based on the sequence MMVD information, the video decoding apparatus 1700 does not need to additionally parse both the sub-pixel MMVD information and the MMVD information from the bitstream. Because the information indicating whether MMVD is applied is obtained in stages according to the syntax level such as SPS, coding unit syntax, etc., the workload of the video decoding apparatus 1700 for decoding syntax elements related to whether MMVD is applied can be reduced.
[0336] This VVC standard allows the resolution of motion vectors in 1 / 4 pixel units, 1 pixel units, or 4 pixel units. In this regard, the accuracy of the motion vector difference (MVD) will be equal to the accuracy of the motion vector predictor or the resolution of the motion vector. In this regard, when the accuracy of integer pixel units is used, the accuracy of the motion vector can be rounded to integer pixel units, thereby increasing the coding efficiency. However, for a resolution of 4 pixel units, rounding of the resolution of 1 pixel unit is performed. By doing so, the interpolation process of sub-pixel units can be reduced, and the accuracy of the motion vector predictor can be retained. When rounding is performed with respect to 4 pixels, the accuracy of the motion vector predictor may deteriorate. Therefore, rounding of 1 pixel unit can be performed on a motion vector predictor whose resolution is determined to be equal to or greater than 1 pixel.
[0337] An algorithm by which motion vectors are stored only in specific pixel units and then reconstructed by shift operations when necessary. In this case, no matter how small the pixel unit to which the motion vector is rounded is, the minimum rounding information must be the resolution of the storage unit.
[0338] In the following, reference will now be made to Fig.19 A video encoding apparatus that performs inter-frame prediction by selecting an MMVD mode in a skip mode or a merge mode is described.
[0339] Fig.19 is a block diagram of a video encoding apparatus according to an embodiment.
[0340] Reference Fig.19 , the video encoding apparatus 1900 according to an embodiment may include an inter prediction performer 1910 and a syntax element encoder 1920 .
[0341] The video encoding apparatus 1900 may encode motion information determined by performing inter-frame prediction, and may output the encoded motion information in the form of a bitstream. The inter-frame prediction performer 1910 may determine various inter-frame prediction information, and the syntax element encoder 1920 may encode the inter-frame prediction information in the form of syntax elements, and may output the bitstream in the form of syntax that is a set of syntax elements for each coding unit or each block.
[0342] 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 syntax element encoder 1920. Alternatively, the inter prediction performer 1910 and the syntax element encoder 1920 may be operated by their own processors (not shown), and the processors may systematically operate with each other to operate the video encoding apparatus 1900. Alternatively, the inter prediction performer 1910 and the syntax element encoder 1920 may be controlled according to the control of an external processor (not shown) of the video encoding apparatus 1900.
[0343] 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 syntax element encoder 1920. The video encoding apparatus 1900 may include a memory controller (not shown) for controlling data input and output of the data memories.
[0344] The video encoding device 1900 may perform an image encoding operation 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 an embodiment may perform basic image encoding operations in a manner in which not only a separate processor but also an image encoding processing module included in a central processing device or a graphics processing device performs basic image encoding operations.
[0345] 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.
[0346] The inter prediction performer 1910 according to an embodiment may generate a merge candidate list including neighboring blocks referenced in predicting a motion vector of a current block when inter prediction is performed on the current block in one of a skip mode and a merge mode.
[0347] The syntax element encoder 1920 according to an embodiment may determine whether to use the base motion vector and the merge motion vector difference determined in the merge candidate list of the current block in the skip mode or the merge mode. When the merge motion vector difference is used, the syntax element encoder 1920 may generate a merge index, and may perform entropy encoding on the bit string of the merge index. The merge index indicates the base motion vector in the merge candidate list.
[0348] The syntax element encoder 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 a current block and a direction index of the merged motion vector difference. The syntax element encoder 1920 may perform entropy encoding on a bit string of the distance index of the merged motion vector difference, and may perform entropy encoding on a direction index of the merged motion vector difference.
[0349] According to an embodiment, the MMVD mode may be applied to various tools available in the inter prediction mode. Therefore, the video encoding apparatus 1900 may encode information indicating whether the MMVD mode is applied to each tool of the inter prediction mode.
[0350] For example, in the first scheme, only information indicating whether the MMVD mode is applied to each tool may be encoded.
[0351] As another example, in the second scheme, information indicating whether the MMVD mode is applied to all tools may be encoded first, and if applicable, information indicating whether the MMVD mode is applied to each tool may be encoded. When the MMVD mode is not applied to all tools, it is not necessary to encode information indicating whether the MMVD mode is applied to each tool.
[0352] In the first scheme, even when the MMVD mode is not applied to all tools, the video encoding apparatus 1900 must encode a flag for determining that the MMVD mode is not applied to each of various tools.
[0353] However, according to the second scheme, when the MMVD mode is not enabled for all tools, the video encoding device 1900 may encode only a flag indicating that the MMVD mode is not applied to all tools, and may not need to additionally encode a flag indicating whether the MMVD mode is applied to each tool, thereby improving encoding efficiency.
[0354] According to the second scheme, the syntax element encoder 1920 may first encode the sequence MMVD information indicating whether the MMVD mode is enabled for the current sequence. When the MMVD mode is applicable to the current sequence, the syntax element encoder 1920 may determine whether to encode the motion vector difference according to the MMVD mode in the first inter-frame prediction mode, and may determine whether to encode the motion vector difference according to the MMVD mode in the second inter-frame prediction mode. Therefore, the syntax element encoder 1920 may additionally encode the first MMVD information indicating whether the MMVD mode is applied in the first inter-frame prediction mode and the second MMVD information indicating whether the MMVD mode is applied in the second inter-frame prediction mode for the current block included in the current sequence. However, when the MMVD mode is not applicable, the syntax element encoder 1920 according to an embodiment may encode only the sequence MMVD information, and may not encode the first MMVD information and the second MMVD information.
[0355] As a specific example of the second scheme, the syntax element encoder 1920 may encode sequence MMVD information indicating whether the MMVD mode is applied to the current sequence. When the MMVD mode is applicable, the syntax element encoder 1920 according to an embodiment may encode sequence sub-pixel MMVD information indicating whether motion vector differences of integer pixel units or motion vector differences of sub-pixel units are used in the current sequence. When the MMVD mode is applicable, the syntax element encoder 1920 according to an embodiment may encode MMVD information indicating whether the MMVD mode is used for a current block included in the current sequence.
[0356] In the following, reference will now be made to Fig. 20 and Fig.37 An embodiment in which the video encoding apparatus 1900 hierarchically encodes sequence MMVD information, sequence sub-pixel MMVD information, and MMVD information according to the second scheme is described.
[0357] Fig. 20 A flowchart of a video encoding method according to an embodiment is shown.
[0358] In operation 2010, the syntax element encoder 1920 may encode sequence MMVD information indicating whether the MMVD mode is applicable to the current sequence.
[0359] In operation 2020, when the MMVD mode is applicable to the current sequence, the syntax element encoder 1920 may encode first MMVD information indicating whether the MMVD mode is used for the current block in the first inter prediction mode.
[0360] In operation 2030 , when the MMVD mode is applied in the first inter prediction mode, the syntax element encoder 1920 may encode a distance index of a motion vector difference and a direction index of a motion vector difference of the current block.
[0361] The inter prediction performer 1910 may generate a merge candidate list including neighboring blocks referenced when predicting a motion vector of a current block when inter prediction is performed on the current block in one of the skip mode and the merge mode. The syntax element encoder 1920 may generate MMVD 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.
[0362] When the merge motion vector difference is used, the syntax element encoder 1920 may generate a merge index indicating one base motion vector in the merge candidate list. The syntax element encoder 1920 may perform entropy encoding on a bit string of the merge index by using one piece of context information.
[0363] The syntax element encoder 1920 may generate a distance index of a merged motion vector difference and a direction index of the merged motion vector difference corresponding to a difference between a base motion vector and a motion vector of the current block.
[0364] The inter prediction performer 1910 according to an embodiment may determine a motion vector of a current block, the motion vector indicating a reference block in a reference picture.
[0365] The inter prediction performer 1910 according to an embodiment 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 syntax element encoder 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.
[0366] When the prediction mode of the current block is skip mode or merge mode, the syntax element encoder 1920 may determine whether to use the merged motion vector difference and the base motion vector determined from the merge candidate list of the current block to predict the motion vector of the current block in MMVD mode. The syntax element encoder 1920 may generate MMVD information indicating whether the motion vector is predicted in MMVD mode.
[0367] When predicting motion information according to the MMVD mode, the syntax element encoder 1920 according to an embodiment may determine a merge index indicating a base motion vector in a merge candidate list. The syntax element encoder 1920 may apply a piece of context information to perform entropy encoding on the merge index to encode a merge index indicating a candidate in the merge candidate list.
[0368] According to an embodiment, the number of candidates that the merge index may indicate in the merge candidate list may be at most 2, and thus the merge index may be 1-bit information.
[0369] The syntax element encoder 1920 may determine a merged motion vector difference between a motion vector of a current block and a base motion vector, and may generate a distance index of the merged motion vector difference of the current block and a direction index of the merged motion vector difference.
[0370] When the prediction mode of the current block according to an embodiment is a merge mode and the MMVD mode is selected, the syntax element encoder 1920 may generate a merge index indicating a base motion vector of the current block from a merge candidate list, and may generate information indicating the distance of a merged motion vector difference between the motion vector of the current block and the base motion vector and information on the direction of the difference.
[0371] 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.
[0372] According to an embodiment, when the prediction mode of the current block is a skip mode, only the current block having the prediction samples of the current block is encoded, 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 a skip mode and the MMVD mode is selected, the syntax element encoder 1920 may encode the MMVD information, the merge index, the information of the distance of the difference, and the information of the direction of the difference without encoding the residual samples.
[0373] When encoding a motion vector in MMVD mode, the syntax element encoder 1920 may perform entropy encoding by applying a piece of context information to a merge index. The merge index indicates a candidate in a merge candidate list. The merge index according to an embodiment is 1-bit information and can therefore be obtained by using a piece of context information for the first binary bit.
[0374] The syntax element encoder 1920 may perform entropy encoding on a distance index of the merged motion vector difference and a direction index of the merged motion vector difference of the current block.
[0375] The syntax element encoder 1920 according to an embodiment may perform entropy encoding on two binary bits indicating the direction index of the merged motion vector difference respectively via the bypass mode. The syntax element encoder 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 may perform entropy encoding on the other binary bits indicating the distance index of the merged motion vector difference respectively in the bypass mode.
[0376] Fig.23 The values and meanings of the merge index, the distance index of the merge difference, and the direction index of the merge difference according to an embodiment are shown.
[0377] The distance index of the merged difference indicates the distance index of the merged motion vector difference. The direction index of the merged difference indicates the direction index of the merged motion vector difference.
[0378] The video decoding apparatus 1700 may determine a motion vector of the current block based on the merge index, the distance index of the merge difference, and the direction index of the merge difference.
[0379] Fig.23Table 2600 shows a merge index and a motion vector candidate corresponding thereto according to an embodiment. The merge candidate list according to an embodiment includes four motion vector candidates (1st, 2nd, 3rd and 4th MV candidates), and the merge index may be displayed in an index (0, 1, 2 or 3) indicating one of them.
[0380] In the MMVD mode, one motion vector candidate indicated by a merge index among the merge candidate list may be determined as a base motion vector.
[0381] exist Fig.23 In Table 2610, the distance index of the merged difference according to the embodiment is an integer between 0 and 7, and each index can be binarized according to the truncated unary encoding method. The distance index of the merged difference can indicate 2 N One of, where N is 0 to 7. The distance of the merged difference is determined based on the basic pixel unit, and when the basic pixel unit is 1 / 4, the distance of the merged motion vector difference corresponding to the distance index 0 of the merged difference may represent a 1 / 4 pixel distance, and the distance of the merged motion vector difference corresponding to the distance index 1 of the merged difference may represent a 1 / 2 pixel distance. The distance of the merged motion vector difference corresponding to the distance index 7 of the merged difference may represent a 32 pixel distance.
[0382] 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 distance of the merged motion vector difference can 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 distance of the merged motion vector difference obtained from the bitstream is 0, the distance 1 of the merged motion vector difference corresponding to the index 0 can be amplified to 2.
[0383] In addition, in Table 2620, the direction index of the merged motion vector difference of binary string 00 represents the motion vector candidate that changes along the + direction on the X-axis based on the base motion vector, and the direction index of the merged motion vector difference of binary string 11 represents the motion vector candidate that changes along the - direction on the Y-axis based on the base motion vector.
[0384] Fig.23 The merge index of the merged difference, the distance index of the merged difference, and the direction index of the merged difference are only examples, and the indexes available in the MMVD mode proposed in the present disclosure are not limited thereto.
[0385] For example, the number of candidates that can be selected from the merge candidate list in the MMVD mode may be limited to 2, and the merge index may be a 1-bit index.
[0386] Fig.24An equation for obtaining a motion vector by using a base motion vector and a merged motion vector difference according to an embodiment is shown.
[0387] 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 direction component and the vertical direction component of the motion vector mvLX. mvLX[x][y][0] represents the horizontal direction component of the motion vector mvLX, and mvLX[x][y][1] represents the vertical direction component of the motion vector mvLX.
[0388] mvLXN[m] represents the base motion vector indicated by the merge index in the merge candidate list. m represents one of the horizontal direction component and the vertical direction component of the base motion vector mvLXN. mvLXN[0] represents the horizontal direction component of the base motion vector mvLXN, and mvLXN[1] represents the vertical direction component of the base motion vector mvLXN.
[0389] refineMvLX[1] represents the merged motion vector difference. l represents one of the horizontal direction component and the vertical direction component of the merged motion vector difference refineMvLX. refineMvLX[0] represents the horizontal direction component of the merged motion vector difference refineMvLX, and refineMvLX[1] represents the vertical direction component of the merged motion vector difference refineMvLX.
[0390] In mvLX, mvLXN, and refineMvLX, LX represents one of the L0 prediction direction and the L1 prediction direction. Therefore, mvL0, mxL0N, and refineMxL0 represent the motion vector, base motion vector, and merged motion vector difference in the L0 prediction direction, and mvL1, mxL1N, and refineMxL1 represent the motion vector, base motion vector, and merged motion vector difference in the L1 prediction direction.
[0391] The video decoding apparatus 1700 according to an embodiment obtains a merge index from a bitstream, and determines a horizontal direction component mvLXN[0] of a base motion vector and a vertical direction component mvLXN[1] of a base motion vector indicated by the merge index from a merge candidate list.
[0392] The video decoding device 1700 according to an embodiment obtains a direction index of the merged difference and a distance index of the merged difference from a bit stream, and determines a horizontal direction component refineMvLX[0] of the merged motion vector difference and a vertical direction component refineMvLX[1] of the merged motion vector difference by using the direction index of the merged difference and the distance index of the merged difference.
[0393] The video decoding device 1700 according to an embodiment can obtain the horizontal direction component mvLX[0][0][0] of the motion vector of the current block by adding the horizontal direction component mvLXN[0] of the basic motion vector to the horizontal direction component refineMvLX[0] of the merged motion vector difference, and can obtain the vertical direction component mvLX[0][0][1] of the motion vector of the current block by adding the vertical direction component mvLXN[1] of the basic motion vector to the vertical direction component refineMvLX[1] of the merged motion vector difference.
[0394] Fig.37 A flowchart of a video encoding method according to another embodiment is shown.
[0395] Operation 2010 is equal to the above reference Fig. 20 The operations described in operation 2010.
[0396] Operation 2022 and operation 2024 correspond to Fig. 20 Operation 2020 specific operations.
[0397] In operation 2010, the inter prediction performer 1910 may determine whether the MMVD mode is applied in the current sequence. Therefore, the syntax element encoder 1920 may encode sequence MMVD information indicating whether the MMVD mode is applicable to the current sequence.
[0398] In operation 2022, when the MMVD mode is applicable, the inter prediction performer 1910 may determine whether to use motion vector differences in integer pixel units or sub-pixel units in the current sequence. Therefore, when the MMVD mode is applicable, the syntax element encoder 1920 may encode sub-pixel MMVD information indicating whether motion vector differences in integer pixel units or sub-pixel units are used in the current sequence.
[0399] In operation 2024, when the MMVD mode is applicable, the inter prediction performer 1910 may determine whether the MMVD mode is used for the current block included in the current sequence. Therefore, when the MMVD mode is applicable, the syntax element encoder 1920 may encode MMVD information indicating whether the MMVD mode is used for the current block included in the current sequence.
[0400] Operation 2032 is Fig. 20 In operation 2032, when the MMVD mode is used for the current block, the syntax element encoder 1920 may encode a distance index of the motion vector difference of the current block determined according to the distance of the motion vector difference of the integer pixel unit or the sub-pixel unit.
[0401] When the MMVD mode is used for the current block and a motion vector difference of an integer pixel unit is used, the syntax element encoder 1920 may determine and encode a distance index of the motion vector difference of the current block based on the distance of the motion vector difference of the integer pixel unit.
[0402] When the MMVD mode is used for the current block and a motion vector difference of a sub-pixel unit is used, the syntax element encoder 1920 may determine and encode a distance index of the motion vector difference of the current block based on the distance of the motion vector difference of the sub-pixel unit.
[0403] When the MMVD mode is not applicable, the syntax element encoder 1920 may not encode the sub-pixel MMVD information and the MMVD information.
[0404] When the distance of the motion vector difference is encoded in integer pixel units, the syntax element encoder 1920 may round the x-component value and the y-component value of the base motion vector of the current block in integer pixel units, and may determine the distance of the motion vector difference in integer pixel units by using the x-component value and the y-component value of the base motion vector rounded to integer pixel units. Therefore, the syntax element encoder 1920 may encode a distance index corresponding to the distance of the motion vector difference in integer pixel units.
[0405] When the distance of the motion vector difference is encoded in sub-pixel units, the syntax element encoder 1920 may round the x-component value and the y-component value of the base motion vector of the current block in sub-pixel units, and may determine the distance of the motion vector difference in sub-pixel units by using the x-component value and the y-component value of the base motion vector rounded to sub-pixel units. Therefore, the syntax element encoder 1920 may encode a distance index corresponding to the distance of the motion vector difference in sub-pixel units.
[0406] Therefore, when MMVD is applicable in the current sequence, the video encoding device 1900 may encode not only the sequence MMVD information, but also the sub-pixel MMVD information and the MMVD information. However, when MMVD is not applied in the current sequence, the video decoding device 1700 may encode only the sequence MMVD information, and may not need to encode both the sub-pixel MMVD information and the MMVD information. Because the information indicating whether MMVD is applied is encoded in stages according to syntax levels such as SPS, coding unit syntax, etc., the workload of the video encoding device 1900 for encoding syntax elements related to whether MMVD is applied can be reduced.
[0407] The video decoding apparatus 1700 and the video encoding apparatus 1900 according to an embodiment may signal a distance index of a motion vector difference in MMVD mode instead of the size of a motion vector. In addition, a direction index of a merged motion vector difference may be signaled in MMVD mode instead of signaling information indicating the direction of a motion vector.
[0408] The distance index of the motion vector difference can be represented based on the precision of the motion vector used in the video codec embedded in the video decoding device 1700 and the video encoding device 1900. For example, in the general video coding (VVC) codec, a 1 / 16 pixel unit is internally used as an MV. However, the precision indicating the motion vector is represented as 1 / 4. Therefore, when the distance index of the MMVD mode is 1, the change of the motion vector is represented with a precision of 1 / 4. When the distance index of the MMVD mode is 2, the change of the motion vector is represented with a precision of 1 / 2. A distance index can be used to represent multiple motion vector precisions, and the direction of the motion vector can be represented as a direction index of the merged motion vector difference.
[0409] The merged motion vector difference may be added to the motion vector predictor corresponding to the base motion vector selected in the merge candidate list. Because the distance index represents the precision of the motion vector, the motion vector predictor must be rounded with the same precision so that the precision of the final motion vector can match the precision of the distance index.
[0410] Prediction operator (value rounded using distance index information) + merged motion vector difference (distance index * preset accuracy) * direction index
[0411] The precision of the merged motion vector difference can be applied to the inter prediction mode used by the current motion vector. The concept of motion vector precision indexed by the distance of the merged motion vector difference can be applied to the motion vector predictor of the inter prediction mode, and the inter prediction mode includes 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, affine AMVP mode, etc. available in the current video codec. In addition, the concept of motion vector precision indexed by the distance of the merged motion vector difference can be applied to the motion vector difference component (including the first mvd component, the second mvd component, ..., the Nth mvd component) in each inter prediction mode. Therefore, various indexes used in each inter prediction mode can be interpreted and used as the motion vector precision corresponding thereto.
[0412] In the following, reference is made to Fig.25 and Fig.26 , a method of matching the distance of the merged difference with the accuracy of the motion vector or motion vector predictor will now be described.
[0413] Fig.25 An equation for adjusting the precision of a motion vector predictor or a base motion vector when the precision of the distance index of the merged difference is 64 according to an embodiment is shown. Fig.26 An equation for adjusting the precision of a motion vector predictor or base motion vector when the precision of the distance index of the merged difference is 16 according to an embodiment is shown.
[0414] The MMVD mode refers to a scheme in which motion vector differences are represented as logarithmic exponents. For example, the precision of the motion vector or pixel position can be selected to be 1 / 4, 1 / 2, 1, 2, 4, 8, 16, or 32. When the motion vector difference is represented in integer pixel units in the MMVD mode, the motion vector predictor is also set in integer pixel units, so that the precision of the motion vector difference and the precision of the motion vector predictor can be set equal in the MMVD mode. By allowing the precision of the motion vector difference and the precision of the motion vector predictor to be equal, the interpolation filtering process for motion compensation can be skipped, and by doing so, the data bus bandwidth for accessing the external memory is reduced, thereby improving the encoding / decoding efficiency.
[0415] For a specific example, Fig.25 and Fig.26 The precision of the motion vector in is 1 / 16. When the precision of the motion vector is 1 / 16 and the distance of the motion vector difference is 64, the distance of the motion vector difference may be 4 pixels in integer pixel units.
[0416] exist Fig.25 In order to round the x and y components of the actual MVP (motion vector predictor or base motion vector) in units of 4 pixels according to the distance of the motion vector difference, the x and y components of the MVP may be rounded to 64. MVP[0] indicates the x component of the MVP, and MVP[1] indicates the y component of the MVP.
[0417] exist Fig.26 In FIG. 4 , when the MVP is always rounded to an integer pixel unit, the x component and the y component of the MVP can be rounded to 16 because the precision of the motion vector is 1 / 16.
[0418] A flag representing information indicating whether the MMVD mode used in the skip mode or the merge mode is applied and information indicating whether the MMVD mode used in other prediction methods is applied may be used in the high-level syntax.
[0419] Since the MMVD mode is a method for transmitting a motion vector, the MMVD mode can be used for all inter-frame prediction techniques for transmitting a motion vector difference and an intra-frame prediction technique using a motion vector (e.g., a current picture reference (CRP) technique). An enable flag for indicating whether the MMVD mode is applicable to a corresponding prediction technique may be included in the high-level syntax.
[0420] As another example, in order to indicate the flag of the MMVD mode for other prediction techniques, such as the MMVD mode to be applied to the affine control point, the MMVD mode to be applied to the sub-block mode, the MMVD mode to be applied to the triangle partition prediction technique, the MMVD mode to be applied to the intra / inter combined prediction mode, etc., the MMVD flag in the skip mode and the MMVD flag in the merge mode can be used. That is, all prediction techniques using the MMVD mode in the high-level syntax can be controlled simultaneously by one representative MMVD enable flag. When the MMVD enable flag is 1, the MMVD mode can be used in all prediction techniques, and when the MMVD enable flag is 0, the MMVD mode cannot be used in all prediction techniques.
[0421] As another example, a representative flag may be signaled, and a specific flag may be conditionally signaled. When there is a tool using the MMVD mode, the video encoding apparatus 1900 may first transmit mmvd_enable_flag as a representative flag in the high-level syntax. When mmvd_enable_flag is 1, the video decoding apparatus 1700 may sequentially parse flags indicating whether the MMVD mode is applied in other inter prediction techniques, and then may determine whether the MMVD mode is applied to each other inter prediction technique.
[0422] For example, in the case where the MMVD mode is applied to the affine technique, when the MMVD enable flag as a representative flag is 1, it can be interpreted that the MMVD mode to be applied to the affine control point (CP) has been used.
[0423] As another example, when it is confirmed that mmvd_enable_flag as a representative flag is 1, it may mean that the MMVD mode has been used in a certain inter-frame prediction technology. In addition, the video decoding apparatus 1700 may parse the flag of the MMVD mode for the corresponding specific inter-frame prediction technology, thereby determining whether the MMVD mode has been used in each inter-frame prediction technology. Such syntax for the corresponding technology may have a parsing relationship depending on the representative mmvd_enable_flag, and the parsing relationship between the syntax for the corresponding technology may be parallel.
[0424] The MMVD mode includes two modes of the MMVD mode of the skip mode and the MMVD mode of the merge mode. The video decoding device 1700 and the video encoding device 1900 according to the embodiment can determine whether it is a skip mode by sending a skip mode flag of the current block with a signal, and then determine whether it is both a skip mode and an MMVD mode by sending an MMVD flag with a signal. In addition, when it is not a skip mode, the video decoding device 1700 and the video encoding device 1900 can determine whether it is a merge mode by sending a merge mode flag with a signal, and then determine whether it is both a merge mode and an MMVD mode by sending an MMVD flag with a signal. The video decoding device 1700 can indirectly identify the presence or absence of a residual according to which flag in the skip mode flag and the merge mode flag is sent with a signal. That is, when the MMVD flag is sent with a signal after the skip mode flag, there is no residual, but when the MMVD flag is sent with a signal after the merge mode flag, there may be a residual.
[0425] In various examples, hereinafter, the MMVD mode may be used independently of the skip mode and the merge mode. An embodiment will now be described in which, when the video decoding apparatus 1700 and the video encoding apparatus 1900 according to an embodiment use an independent MMVD flag, separate information indicating whether a residual is used is signaled.
[0426] The video encoding device 1900 according to an embodiment may generate and send a syntax element about whether to use the residual after the MMVD flag. For example, when the MMVD flag is 1, a flag (e.g., no_residue_flag) for determining whether to send the residual of the current block may be sent separately thereafter. When no_residue_flag is 1, the video decoding device 1700 may determine that the MMVD flag is 1 in skip mode, and may perform decoding without residual. When no_residue_flag is 0, the video decoding device 1700 may determine that the MMVD flag is 1 in merge mode, may additionally parse the residual, and then may perform decoding.
[0427] As another example, as in the advanced motion vector prediction (AMVP) mode of the HEVC standard, whether the residual of the corresponding color component as the Y, Cb, and Cr components exists is checked through cbf, and the residual can be parsed according to the result of the check. For example, it can be determined whether there is a residual for each component as the Y, Cb, and Cr components by sending a signal of the cbf (cu_cbf) of the coding unit, the cbf (tu_cbf_luma) of the transform unit of the Y component, the cbf (tu_cbf_cb) of the transform unit of the Cb component, the cbf (tu_cbf_cr) of the transform unit of the Cr component, etc. As another example, a flag indicating whether the residual exists in all Y, Cb, and Cr components can be sent with a signal.
[0428] As another example, the MMVD mode may not be allowed for the skip mode, but may be allowed only for the merge mode. Because motion information is predicted in the normal merge mode in the same manner as the skip mode, it can be assumed that there are always residuals in the merge mode. That is, in the HEVC standard, it is assumed that root_cbf is always 1, so the residual exists in at least one of the Y, Cb, and Cr components. After root_cbf, a flag indicating whether there is a residual can be sent with a signal for each of the components (Y, Cb, Cr) respectively. However, when the MMVD mode is allowed only in the merge mode, even when there is no residual in the MMVD mode, a flag for indicating whether there is a residual can be sent with a signal for each of Y, Cb, and Cr. In this case, although the MMVD mode is a merge mode, when there is no residual in the current block, the root_cbf can be sent with a signal to determine the presence or absence of the residual by using one root_cbf.
[0429] In addition, in the current VVC standard, a mode that combines intra prediction and inter prediction to generate prediction data, or a triangle partition prediction mode that performs prediction by allowing partitions of vertices of diagonal lines connecting blocks may be allowed to be used only in merge mode. Similar to the method proposed above, although the MMVD mode belongs to the merge mode, when there is no residual in the current block, root_cbf may be signaled to determine the presence or absence of a residual by using one root_cbf.
[0430] Fig. 27 A reference table for determining binarization of a plurality of pieces of merge-related information according to an embodiment is shown.
[0431] For example, the binarization of the syntax element mmvd_merge_flag indicating whether it is predicted in MMVD mode is fixed length binarization (FL), and in this regard, the cMax parameter value is 1. The binarization of mmvd_cand_flag corresponding to the merge index is also FL, and in this regard, the cMax parameter value may be 1.
[0432] The binarization of the syntax element mmvd_distance_idx corresponding to the distance index of the merged motion vector difference is truncated Rice binarization (TR), and in this regard, 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, and in this regard, the cMax parameter value may be 3.
[0433] In the following, reference is made to Figure 28 to Figure 33 , various binarizations for multiple pieces of MMVD-related information will now be described.
[0434] Fig.28 A comparison table showing binary strings of distance indices (mmvd) of 8 merged differences according to various binarizations.
[0435] The distance index of the merged difference (mmvd) can be mapped to a value indicating a specific distance of a motion vector difference in mmvd mode. For example, indexes 0, 1, 2, 3, 4, 5, 6, and 7 can be mapped to distances of motion vector differences 4, 8, 16, 32, 64, 128, 256, and 512, respectively. As another example, indexes 0, 1, 2, 3, 4, 5, 6, and 7 can be mapped to distances of motion vector differences 1, 2, 4, 8, 16, 32, 64, and 128, respectively.
[0436] Fig.28 Comparison of shows binary strings corresponding to the distance indices according to binarization 1 and binarization 2 when the number of distance indices of the merged motion vector difference is 0 to 7 (ie, 8).
[0437] Binarization 1 is a truncated unary encoding scheme in which the length of the binary string corresponding to the index becomes shorter as the index becomes smaller. Assuming that the distance of the motion vector difference corresponding to it appears most frequently as the index becomes smaller, this scheme is a useful binarization. However, it is not true that the distance of the motion vector difference corresponding to the first index 0 appears most frequently according to the characteristics and resolution of the image.
[0438] Even when the first index does not correspond to the distance of the motion vector difference that occurs most frequently, it is true that the small index corresponds to the distance of the motion vector difference that occurs most frequently. Based on the above fact, according to binarization 2, the video encoding device 1900 assigns a 2-bit binary string to distance indexes 0, 1, and 2, and assigns a binary string with a smaller number of bits to distance indexes 3, 4, 5, 6, and 7, compared to binarization 1. Therefore, according to binarization 2, compared to binarization 1, the effect that the probability of occurrence of the distance index of the motion vector difference and the number of bits of the binary string corresponding thereto are thoroughly and uniformly corrected can be expected.
[0439] In another embodiment, the video encoding device 1900 may determine a binary string corresponding to a distance index according to an actual probability of occurrence of a distance index of a motion vector difference in a real natural image. Variable length coding (VLC) may be used, by which a 1-bit binary string is assigned to a distance index corresponding to the distance of the difference when the probability of occurrence of a specific distance index of a motion vector difference is equal to or greater than 50%. However, when the probability of occurrence of the distance of the motion vector difference is generally less than 50%, a binary string corresponding to the distance index of the motion vector difference may be determined according to binarization 2.
[0440] The video decoding apparatus 1700 may perform inverse binarization on the distance index of the motion vector difference according to the binarization selected by the video encoding apparatus 1900. That is, the video decoding apparatus 1700 may parse the binary string of the distance index of the motion vector difference from the bitstream, and may determine the distance index of the motion vector difference corresponding to the binary string according to the binarization selected by the video encoding apparatus 1900.
[0441] The video encoding apparatus 1900 according to an embodiment may determine a distance index of a motion vector difference according to k-th order Exponential Golomb binarization.
[0442] Fig.29 An embodiment of k-th order Exponential Golomb binarization is shown.
[0443] k-order Exponential Golomb binarization refers to a scheme for changing a probability-based bit representation according to an exponent k. Compared to binarization 2, k-order Exponential Golomb binarization can also average the length of a binary string according to the occurrence probability of the distance of the motion vector difference.
[0444] like Fig.29 As shown, it can be defined that the length of the bit string corresponding to distance indexes 0 and 1 is 2, the length of the bit string corresponding to distance indexes 2, 3, and 4 is 3, the length of the bit string corresponding to distance index 5 is 4, and the length of the bit string corresponding to distance indexes 6 and 7 is 5. When the k index changes, the binary string assigned to each distance index can be changed.
[0445] In another embodiment, the binary string of the distance index of the motion vector difference of the MMVD can be determined according to the truncated Rice (TR) binarization process. For example, the variable cMax can be set to 7 and cRiceParam can be set to 7, which is required in the TR binarization process, or cMax can be set to 7 and cRiceParam can be set to 1.
[0446] In another embodiment, in the current sequence, current picture, current slice, current tile or current maximum coding unit, that is, in each data level, cRiceParam for TR binarization processing may be variably set according to the occurrence probability of the distance index of the motion vector difference. As cRiceParam becomes larger, bits may be allocated with the same probability so that cRiceParam may be individually set in the corresponding level and signaled. The cRiceParam information used in each data level may be signaled through the header information of the corresponding data level.
[0447] In a more specific example, the binarization may be variably changed based on the occurrence probability of the distance index of the MMVD motion vector difference in each data level. In addition, the binarization may not be limited to the TR binarization process, but may be changed based on a binarization table of a preset VLC scheme or FLC scheme according to various occurrence probabilities.
[0448] As another example, the coding efficiency can be increased by variably changing the maximum value of the distance index of the MMVD motion vector used in each sequence, each picture, each strip, each parallel block or each CTU. For example, when TR binarization is used, the cMax value can be changed. In order to use 6 distance indexes, the cMax value can be changed to 5. The digital information about cMax can be included in the header information of the current data level. In addition, cMax can be variably changed according to the probability of occurrence of the distance index in the corresponding data level.
[0449] In another embodiment, regardless of which binarization is used when the distance index of the motion vector difference of the MMVD mode is binarized, entropy coding of the context model applied may be performed on the first bit of the binary string corresponding to the distance index. This is because, when symbols are grouped according to probability in the binarization of symbol and binary string matching, the first bit of the binary string represents the main classification by which each symbol group is identified. Therefore, when the context model is applied to the first bit of the binary string, further increased entropy coding efficiency can be expected.
[0450] According to the binarization, the context model can be applied to the second bit. In addition, when the probability of occurrence of multiple specific distance indexes is high, the entropy coding efficiency can be improved by applying the binarization using the context. For example, when the probability of occurrence of the distance indexes of 0 and 1 in the above-mentioned binarization 1 and binarization 2 is high, the entropy coding efficiency can be improved by applying the binarization using the context to the first bit and the second bit.
[0451] For example, in a case where binarization using context is used, when the first bit of the binary string is 0, the distance index corresponding thereto may be 0 or 1, and when the first bit of the binary string is 1, other than 0 and 1 may be the distance index.
[0452] In another example, only when the first bit is 1, the context model can be applied to the second bit immediately thereafter. This is because the second bit can be classified in the second group (the group in which the first bit is 1) with a certain probability. Therefore, when the first bit is 1, when the context model is applied to the second bit, the entropy coding efficiency can be further improved.
[0453] Fig.30 A comparison table of binary strings indexed by distance of 6 merged differences according to various binarizations is shown.
[0454] Similar to Fig.28 , it can be defined that the length of the bit string corresponding to distance indexes 0, 1, and 2 is 2, the length of the bit string corresponding to distance index 3 is 3, and the length of the bit string corresponding to distance indexes 4 and 5 is 4.
[0455] Fig.31 A binary string generated by changing the binarization according to a distance index group of the merged difference according to an embodiment is shown.
[0456] Fig.31 1 and 2 when the number of distance indexes of the motion vector difference of the MMVD mode is N. The distance index may be mapped to a specific distance value of the motion vector. For example, the distance index may be mapped to a case where the size of the distance of the motion vector difference is 4, 8, 16, 32, 64, 128, 256, and 512. As another example, the distance index may be mapped to 1, 2, 4, 8, 16, 32, 64, and 128 as the size of the distance of the motion vector difference.
[0457] According to binarization 1, truncated unary coding (T-unary coding) can be used to represent the distance index.
[0458] In contrast, in order to improve entropy coding efficiency, one syntax element is added to each individual distance index in binarization 2 and 3. The syntax element is a flag used when grouping corresponding distance indexes so as to perform encoding with the least bits by grouping the most likely distance indexes individually.
[0459] A distance index group refers to a set of distance indices with a high probability of selection and includes the most frequently selected indices from a given distance index list. Therefore, the flag can be determined based on flags accumulated from distance index groups of blocks that have been encoded in the current frame or slice. In another example, the flag of the current block can be determined by using the corresponding flags of neighboring blocks encoded in MMVD mode.
[0460] Information about which distance index in the distance index group to use may be signaled through a high-level syntax, and a distance index selected based on the information may be used in a picture, tile, slice, etc., below the high-level syntax.
[0461] According to binarization 2, when it is assumed that the first distance indexes 0 and 1 are the most likely candidates, a distance index group 0 including distance indexes 0 and 1 may be determined. A group 1 including other distance indexes may be determined. A group flag 0 may be assigned to group 0, and a group flag 1 may be assigned to group 1. In general, the number of indexes included in group 1 may be determined by subtracting the number of indexes included in group 0 from the maximum number of distance indexes. For example, the number obtained by subtracting 2, which is the number of indexes of group 0, from N+1, which is the maximum number of distance indexes, may be the number of indexes of group 1.
[0462] The context model may be applied to the group flag. Since the selectable distance index is included in group 0, entropy coding efficiency may be improved by using the context model.
[0463] The indexes included in group 0 may be encoded using FLC, and the indexes included in group 1 may be arranged from the smallest, and then may be encoded using T unary encoding.
[0464] According to binarization 3, group 0 including distance indexes 0, 1, 2, and 3 is determined, assuming that the first distance index of 0, 1, 2, and 3 is the most likely candidate. Group 1 including other distance indexes is determined. In general, the number of indexes included in group 1 can be determined by subtracting the number of indexes included in group 0 from the maximum number of distance indexes.
[0465] The context model may be applied to the group flag. The indexes included in group 0 may be encoded using FLC, and the indexes included in group 1 may be arranged from the smallest and then may be encoded using T-unary encoding.
[0466] In reference Fig.31 In the binarization 2 and binarization 3 described, the distance indexes included in group 0 are not always encoded using FLC, and the distance indexes included in group 1 are not always encoded using T unary coding. Some indexes included in group 0 may be encoded using FLC, and other indexes may be encoded using T unary coding. Similarly, some indexes included in group 1 may be encoded using FLC, and other indexes may be encoded using T unary coding.
[0467] In the following, reference is made to Fig.32 and Fig.33 , binarization of codewords is assigned differently based on the distance accuracy of the motion vector difference.
[0468] Fig.32 Codewords for the case of 8 merged difference distance indices (mmvd) according to an embodiment are shown. Fig.33 Codewords for the case of 6 merged difference distance indices (mmvd) according to an embodiment are shown.
[0469] The distance offset of the motion vector difference may be simply a number expressed as a power of 2 (2^n, where n is an integer). Depending on whether the distance offset refers to the precision of sub-pixel units or the precision of integer pixel units, a codeword for the distance index may be assigned. For example, referring to Fig.32 , the total number of distances of motion vector differences may be 8, and the values thereof may be 1 / 4, 1 / 2, 1, 2, 4, 8, 16, and 32. Distance offsets of 1 / 4 and 1 / 2 of sub-pixel units may be determined as one group, and other distance offsets may be identified as another group, so that codewords regarding distance indexes may be allocated to each group by using different binarizations. According to each precision group, the codeword of the distance index may be determined by using FLC, or may be determined by using VLC including T unary coding. Fig.32 shows the codewords for each distance index in an embodiment where there are 8 distance offsets, and Fig.33 The codewords used for each distance index in an embodiment where there are 6 distance offsets are shown.
[0470] In the case where the probability of occurrence of distance offset with actual sub-pixel precision is higher than the probability of occurrence of distance offset with integer pixel unit precision, such as Fig.32 and Fig.33 Specifically, the probability of 0 in the precision flag is increased to improve the entropy coding efficiency, so that the bit amount can be reduced.
[0471] In accordance with Fig.32 and Fig.33In the codeword representation method of , the precision flag and index in each precision can be represented as syntax elements respectively. Different binarizations can be applied to the same syntax element according to the bits.
[0472] Hereinafter, an embodiment in which the video decoding apparatus 1700 and the video encoding apparatus 1900 apply a triangle partition prediction mode and an intra / inter combination prediction mode will now be described.
[0473] According to the triangular partition prediction mode, the current block can be divided into two triangular partition shapes along the diagonal line connecting the opposite vertices of the square block, and prediction can be performed on each triangular partition. According to this prediction technology, the area where the prediction blocks of the two triangular partitions touch is filled with the prediction value obtained by performing filtering on the prediction blocks of the two triangular partitions, thereby generating a new square prediction block.
[0474] Fig.34 Illustration of triangle partitions available in triangle partition prediction mode according to an embodiment.
[0475] Triangular partitions PU1 and PU2 may be determined by connecting upper left and lower right vertices of the current block 3400 facing each other. Triangular partitions PU1 and PU2 may be determined by connecting upper right and lower left vertices of the current block 3410 facing each other.
[0476] The current blocks 3400 and 3410 may be coding units.
[0477] Different motion vectors may be determined for triangle partitions according to prediction using two triangle partitions, and information about the motion vector may be signaled between the video encoding apparatus 1900 and the video decoding apparatus 1700 .
[0478] Fig.35 A prediction block determined by using triangle partitioning in triangle partitioning prediction mode according to an embodiment is shown.
[0479] The size of the prediction block 3500 may be 8×8, and the triangle partition prediction block may be generated in the triangle partition mode. By performing filtering on the prediction values P1 and P2 of the triangle partition prediction block, the final prediction value of the middle area where the triangle partition prediction blocks contact each other may be determined. The filtering weight may be determined inversely proportional to the distance from the prediction block area to the triangle partition prediction block.
[0480] For example, N, which is a number marked on each pixel in the middle area of the prediction block 3500, indicates a filtering weight. When N is 7, a filtering weight of 7 / 8 may be assigned to P, which is a prediction value of a near prediction block in a triangle partition prediction block. 1 (7 / 8*P 1), a filter weight of 8-7=1 can be assigned to P as the prediction value of the far prediction block 2 (1 / 8*P 2 ), and then the weighted sum of its results can be determined as the final prediction value (7 / 8*P 1 +1 / 8*P 2 ). When N is 6, a filtering weight of 6 / 8 may be assigned to P as the prediction value of the near prediction block in the triangle partition prediction block. 1 (6 / 8*P 1 ), a filter weight of 8-6=2 can be assigned to P as the prediction value of the far prediction block. 2 (2 / 8*P 2 ), and then the weighted sum of its results can be determined as the final prediction value (6 / 8*P 1 +2 / 8*P 2 ).
[0481] In the case where the size of the prediction block 3510 is 4*4, when N is 7, a filter weight of 7 / 8 may be assigned to P as the prediction value of the near prediction block in the triangular partition prediction block. 1 (7 / 8*P 1 ), a filter weight of 8-7=1 can be assigned to P as the prediction value of the far prediction block 2 (1 / 8*P 2 ), and then the weighted sum of its results can be determined as the final prediction value (7 / 8*P 1 +1 / 8*P 2 ).
[0482] The triangular partition mode according to an embodiment may not be used for a coding unit having a small size, that is, a case where the product of the width and height of the coding unit is less than 64. This is because when a small block is divided into triangular partitions, the division effect of the coding unit is reduced.
[0483] In addition, when the triangle partition does not cover the object of a very large coding unit, the quadtree or ternary tree coding unit partition method may be more efficient. Because the overhead of the flags that appear in the triangle partition mode is a workload, and the calculation of the triangle partition prediction increases the complexity of the encoder, the triangle partition mode may be inefficient for coding units with a certain large size.
[0484] Therefore, the video decoding apparatus 1700 and the video encoding apparatus 1900 according to an embodiment may determine whether to perform a triangle partitioning mode according to the following conditions: Here, MAX_CU_SIZE indicates a maximum size of a coding unit.
[0485] Condition 1: (width*height<64||width>=MAX_CU_SIZE||height>=MAX_CU_SIZE)
[0486] That is, when the product of the height and width of the current block is less than 64, the height of the current block is equal to or greater than the maximum size of the coding unit, or the width of the current block is equal to or greater than the maximum size of the coding unit, the video decoding device 1700 and the video encoding device 1900 according to the embodiment may determine that the triangle partition prediction mode cannot be applied to the current block.
[0487] According to condition 1, the triangle partitioning mode is prevented from being applied to areas with low prediction efficiency, thereby reducing the complexity of the encoder and preventing unnecessary mode flags from being sent by signal, thereby improving encoding efficiency.
[0488] As in Condition 2 below, the thresholds of the height and width of the coding unit may be modified to MAX_CU_SIZE / 2.
[0489] Condition 2: (width*height<64||width>=MAX_CU_SIZE / 2||height>=MAX_CU_SIZE / 2)
[0490] The video decoding apparatus 1700 and the video encoding apparatus 1900 according to an embodiment may determine a prediction block by an intra / inter combination mode.
[0491] The intra / inter combination mode (or multi-hypothesis mode) refers to a technology of predicting a current block in each of an intra prediction mode and an inter prediction mode to generate a corresponding prediction block, and weighted averaging the two prediction blocks to generate a new prediction block.
[0492] Syntax elements required for the intra prediction mode and the inter prediction mode, respectively, are transmitted to the video decoding apparatus 1700 to perform intra prediction and inter prediction.
[0493] The video encoding apparatus 1900 may transmit syntax elements related to the inter prediction mode in the form of a merge index, and the video decoding apparatus 1700 may reconstruct a motion vector and a reference picture.
[0494] Syntax elements related to intra prediction modes may include intra prediction direction information indicating one of four modes (DC, planar, horizontal, and vertical modes).
[0495] The intra / inter combination mode according to an embodiment is not available for a coding unit having a small size, that is, a case where the product of the width and height of the coding unit is less than 64. This is because the amount of computational work present in the combined calculation of intra prediction and inter prediction is greater than the effect of splitting the coding unit.
[0496] Therefore, the video decoding apparatus 1700 and the video encoding apparatus 1900 according to an embodiment may determine whether to perform a triangle partitioning mode according to the following conditions: Here, MAX_CU_SIZE indicates a maximum size of a coding unit.
[0497] Condition 1: (width*height<64||width>=MAX_CU_SIZE||height>=MAX_CU_SIZE)
[0498] That is, when the product of the height and width of the current block is less than 64, the height of the current block is equal to or greater than the maximum size of the coding unit, or the width of the current block is equal to or greater than the maximum size of the coding unit, the video decoding device 1700 and the video encoding device 1900 according to the embodiment may determine that the intra / inter combination mode cannot be applied to the current block.
[0499] According to condition 1, the triangle partitioning mode is prevented from being applied to areas with low prediction efficiency, thereby reducing the complexity of the encoder and preventing unnecessary mode flags from being sent by signal, thereby improving encoding efficiency.
[0500] As in Condition 2 below, the thresholds of the height and width of the coding unit may be modified to MAX_CU_SIZE / 2.
[0501] Condition 2: (width*height<64||width>=MAX_CU_SIZE / 2||height>=MAX_CU_SIZE / 2)
[0502] Also, when the triangle partition prediction mode is enabled, the video decoding apparatus 1700 according to an embodiment may determine whether the intra / inter combination prediction mode is enabled.
[0503] The syntax element obtainer 1710 according to an embodiment may obtain sequence MMVD information indicating whether triangle partition prediction mode is enabled for the current block from the bitstream. In addition, the syntax element obtainer 1710 may obtain second information indicating whether intra / inter combination prediction mode is enabled for the current block from the bitstream.
[0504] When the triangle partition prediction mode is enabled for the current block according to the sequence MMVD information, the decoder 1720 according to an embodiment may determine whether to apply the triangle partition prediction mode to the current block based on the height and width of the current block. When the product of the height and width of the current block is less than 64, the height of the current block is equal to or greater than the maximum size of the coding unit, or the width of the current block is equal to or greater than the maximum size of the coding unit, it may be determined that the triangle partition prediction mode may not be applied to the current block.
[0505] When the triangle partition prediction mode is enabled for the current block according to the sequence MMVD information, and the intra / inter combination prediction mode is enabled for the current block according to the second information, the decoder 1720 according to the embodiment may determine whether to apply the intra / inter combination prediction mode to the current block based on the height and width of the current block. When the product of the height and width of the current block is less than 64, the height of the current block is equal to or greater than the maximum size of the coding unit, or the width of the current block is equal to or greater than the maximum size of the coding unit, it may be determined that the intra / inter combination prediction mode may not be applied to the current block.
[0506] Specifically, when the triangle partition prediction mode is enabled, the intra / inter combination prediction mode is enabled, the product of the height and width of the current block is equal to or greater than 64, the height of the current block is smaller than the maximum size of the coding unit, or the width of the current block is smaller than the maximum size of the coding unit, the decoder 1720 may apply the intra / inter combination prediction mode to the current block.
[0507] Similarly, when the triangle partition prediction mode is enabled, the video encoding apparatus 1900 according to an embodiment may determine whether the intra / inter combination prediction mode is enabled.
[0508] When the triangle partition prediction mode is enabled for the current block, the inter prediction executor 1910 according to an embodiment may determine whether to apply the triangle partition prediction mode to the current block based on the height and width of the current block. When the product of the height and width of the current block is less than 64, the height of the current block is equal to or greater than the maximum size of the coding unit, or the width of the current block is equal to or greater than the maximum size of the coding unit, it may be determined that the triangle partition prediction mode may not be applied to the current block.
[0509] When the triangle partition prediction mode is enabled for the current block, and the intra / inter combination prediction mode is enabled for the current block according to the second information, the inter prediction executor 1910 according to an embodiment may determine whether to apply the intra / inter combination prediction mode to the current block based on the height and width of the current block. When the product of the height and width of the current block is less than 64, the height of the current block is equal to or greater than the maximum size of the coding unit, or the width of the current block is equal to or greater than the maximum size of the coding unit, it may be determined that the intra / inter combination prediction mode may not be applied to the current block.
[0510] The syntax element encoder 1920 according to an embodiment may encode sequence MMVD information indicating whether a triangle partition prediction mode is enabled for a current block. In addition, the syntax element encoder 1920 may encode second information indicating whether an intra / inter combination prediction mode is enabled for a current block.
[0511] Specifically, when the triangle partition prediction mode is enabled, the intra / inter combination prediction mode is enabled, the product of the height and width of the current block is equal to or greater than 64, the height of the current block is smaller than the maximum size of the coding unit, or the width of the current block is smaller than the maximum size of the coding unit, the inter prediction executor 1910 may apply the intra / inter combination prediction mode to the current block.
[0512] In addition, the embodiments of the present disclosure may be written as a program executable on a computer, and the program may be stored in a medium.
[0513] The medium may store the computer executable program continuously, or may temporarily store the computer executable program for execution or downloading. In addition, the medium may be any of a variety of recording media or storage media in which a single or multiple pieces of hardware are combined, and the medium is not limited to those media directly connected to a specific computer system, but may be distributed on a network. Examples of media include magnetic media (such as hard disks, floppy disks, and tapes) configured to store program instructions, optical recording media (such as compact disk read-only memory (CD-ROM) and digital versatile disk (DVD)), magneto-optical media (such as optical floppy disks, read-only memory (ROM), random access memory (RAM), flash memory, etc.). In addition, other examples of media include recording media and storage media managed by application stores that distribute applications or by websites, servers, etc. that provide or distribute various other types of software.
[0514] Although one or more embodiments of the present disclosure have been described in detail with reference to the above exemplary embodiments, it will be understood by those skilled in the art that the present disclosure is not limited to these embodiments and that various changes in form and details may be made therein without departing from the spirit and scope of the present disclosure.
Claims
1. A video decoding method, include: Obtaining sequence MMVD information indicating whether a merge mode with motion vector difference (MMVD mode) is enabled for the current sequence from a sequence parameter set SPS; When the MMVD mode is enabled for the current sequence according to the sequence MMVD information, obtaining, from the bitstream, MMVD information indicating whether the MMVD mode is used for a current block included in the current sequence in an inter prediction mode; When the MMVD mode is used for the current block in the inter prediction mode according to the MMVD information, a first binary bit of a distance index of a merged motion vector difference is obtained by performing entropy decoding on a bitstream using context information, and other binary bits of the distance index of a merged motion vector difference are obtained by performing entropy decoding on the bitstream in a bypass mode; According to the truncated Rice TR binarization method, obtaining the distance index of the merged motion vector difference corresponding to the first binary bit and other binary bits of the distance index of the merged motion vector difference; Obtaining from the bitstream a binary bit indicating a direction index for merging motion vector differences; According to the fixed length FL binarization method, a direction index of the merged motion vector difference corresponding to the binary bit indicating the direction index of the merged motion vector difference is obtained; reconstructing a motion vector of the current block based on a merged motion vector difference determined using a distance index of the merged motion vector difference and a direction index of the merged motion vector difference; as well as Reconstruct the current block by using the motion vector of the current block, Among them, one bit in the binary bits indicating the direction index of the merged motion vector difference indicates one of the x-axis component and the y-axis component, and another bit in the binary bits indicating the direction index of the merged motion vector difference indicates the sign in the x-axis component or the y-axis component.
2. A video decoding device, include: a syntax element obtainer configured to obtain, from a sequence parameter set SPS, sequence MMVD information indicating whether a merge mode with motion vector difference (MMVD mode) is enabled for a current sequence, and when the MMVD mode is enabled for the current sequence according to the sequence MMVD information, obtain, from a bitstream, MMVD information indicating whether the MMVD mode is applied to a current block included in the current sequence in an inter prediction mode; as well as A decoder configured to, when an MMVD mode is used for a current block in an inter prediction mode according to MMVD information, obtain a first binary bit of a distance index of a merged motion vector difference by performing entropy decoding on a bitstream using context information, and obtain other binary bits of the distance index of the merged motion vector difference by performing entropy decoding on the bitstream in a bypass mode, obtain a distance index of the merged motion vector difference corresponding to the first binary bit and other binary bits of the distance index of the merged motion vector difference according to a truncated Rice TR binarization method, obtain a binary bit indicating a direction index of the merged motion vector difference from the bitstream, and obtain a direction index of the merged motion vector difference corresponding to the binary bit indicating the direction index of the merged motion vector difference according to a fixed-length FL binarization method, and reconstruct a motion vector of the current block based on the merged motion vector difference determined using the distance index of the merged motion vector difference and the direction index of the merged motion vector difference, and reconstruct the current block by using the motion vector of the current block, Among them, one bit in the binary bits indicating the direction index of the merged motion vector difference indicates one of the x-axis component and the y-axis component, and another bit in the binary bits indicating the direction index of the merged motion vector difference indicates the sign in the x-axis component or the y-axis component.
3. A video encoding method, include: Encode sequence MMVD information indicating whether merge mode with motion vector difference (MMVD mode) is enabled for the current sequence into the sequence parameter set SPS; When the MMVD mode is enabled for the current sequence, encoding MMVD information indicating whether the MMVD mode is used for a current block included in the current sequence in an inter prediction mode; as well as When the MMVD mode is used for the current block in the inter prediction mode, a binary bit of a distance index of a merged motion vector difference corresponding to the distance index of the merged motion vector difference is obtained according to a truncated Rice TR binarization method, a first binary bit of the binary bits of the distance index of the merged motion vector difference is entropy encoded into a bitstream using context information, and other binary bits of the binary bits of the distance index of the merged motion vector difference are entropy encoded into the bitstream in a bypass mode, a binary bit of a direction index of the merged motion vector difference corresponding to the direction index of the merged motion vector difference is obtained according to a fixed-length FL binarization method, and entropy encoding is performed on the binary bit indicating the direction index of the merged motion vector difference of the current block into the bitstream, Among them, one bit in the binary bits indicating the direction index of the merged motion vector difference indicates one of the x-axis component and the y-axis component, and another bit in the binary bits indicating the direction index of the merged motion vector difference indicates the sign in the x-axis component or the y-axis component.
4. A method for storing a bit stream generated by encoding a video in a computer-readable storage medium, the method include: Encoding sequence MMVD information for the current sequence indicating whether merge mode with motion vector difference (MMVD mode) is enabled for the current sequence into the sequence parameter set SPS; When the MMVD mode is enabled for the current sequence, encoding MMVD information indicating whether the MMVD mode is used for a current block included in the current sequence in an inter prediction mode; as well as When the MMVD mode is used for the current block in the inter prediction mode, a binary bit of a distance index of a merged motion vector difference corresponding to the distance index of the merged motion vector difference is obtained according to a truncated Rice TR binarization method, a first binary bit of the binary bits of the distance index of the merged motion vector difference is entropy-encoded into information about the distance index of the merged motion vector difference using context information, other binary bits of the binary bits of the distance index of the merged motion vector difference are entropy-encoded into information about the distance index of the merged motion vector difference in a bypass mode, a binary bit of a direction index of the merged motion vector difference corresponding to the direction index of the merged motion vector difference is obtained according to a fixed-length FL binarization method, and a binary bit indicating the direction index of the merged motion vector difference of the current block is entropy-encoded into the information about the direction index of the merged motion vector difference; as well as storing the bitstream in a computer-readable storage medium, the bitstream comprising sequence MMVD information, MMVD information, information about a distance index of a merged motion vector difference, and information about a direction index of a merged motion vector difference, Among them, one bit in the binary bits indicating the direction index of the merged motion vector difference indicates one of the x-axis component and the y-axis component, and another bit in the binary bits indicating the direction index of the merged motion vector difference indicates the sign in the x-axis component or the y-axis component.
