MOTION INFORMATION ENCODING METHOD, DECODING METHOD, ENCODING DEVICE, DECODING DEVICE, AND RECORDING MEDIUM
The method addresses the challenge of efficiently representing motion information in video encoding and decoding by determining and applying primary residual motion vectors to basic motion vectors, thereby achieving effective bit representation and improved efficiency.
Patent Information
- Application Number
- JP2024053098
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2017-09-12
- Filing Date
- 2024-03-28
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2038-09-12
AI Technical Summary
Existing video encoding and decoding methods face challenges in efficiently representing motion information with a small number of bits, particularly in representing residual motion vectors effectively.
A method for decoding motion information involves determining the basic motion vector of a current block, identifying a primary residual motion vector from candidates segmented by a shift distance and direction, and applying this vector to the basic motion vector to obtain the motion vector of the current block.
This approach enables the representation of motion information and residual motion vectors using a small number of bits, improving encoding and decoding efficiency.
Smart Images

Figure 0007674071000001 
Figure 0007674071000002 
Figure 0007674071000003
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of video encoding and decoding, and more particularly to a method and apparatus for encoding motion information used in video encoding and decoding, and a method and apparatus for decoding motion information. [Background technology]
[0002] In a video encoding method and a video decoding method, in order to encode a video, a single picture can be divided into blocks, and each block can be predictively encoded through inter prediction or intra prediction.
[0003] The inter prediction is a method for compressing video by removing temporal redundancy between pictures, and motion estimation coding is a representative example. The motion estimation coding uses at least one reference picture to predict a block of a current picture. A reference block most similar to the current block can be searched for in a predetermined search range using a predetermined evaluation function. The current block is predicted based on the reference block, and the prediction block generated as a result of the prediction is subtracted from the current block to generate and code a residual block. In this case, in order to perform the prediction more accurately, an interpolation is performed on the search range of the reference picture to generate pixels in sub-pel units smaller than an integer pel unit, and inter prediction can be performed based on the generated sub-pel unit pixels.
[0004] In codecs such as H.264 AVC (advanced video coding) and HEVC (high efficiency video coding), in order to predict the motion vector of a current block, a motion vector of a previously coded block adjacent to the current block or a block included in a previously coded picture is used as a prediction motion vector of the current block. A residual motion vector, which is the difference between the motion vector of the current block and the prediction motion vector, is signaled at the decoder side through a predetermined method. Summary of the Invention [Problem to be solved by the invention]
[0005] A motion information encoding method and decoding method, and a motion information encoding device and decoding device according to an embodiment address a technical problem of expressing motion information with a small number of bits.
[0006] In addition, the motion information encoding method and decoding method, and the motion information encoding device and decoding device according to an embodiment of the present invention aim to express a residual motion vector with a small number of bits. [Means for solving the problem]
[0007] A method for decoding motion information according to one embodiment of the present disclosure may include a step of determining a base motion vector of a current block, a step of determining a primary residual motion vector for the current block based on information obtained from a bitstream among at least one primary residual motion vector candidate divided according to a displacement distance and a displacement direction, and a step of applying the primary residual motion vector to the base motion vector to determine a motion vector for the current block.
[0008] In one embodiment, the step of determining the motion vector of the current block may further include the steps of obtaining information indicating a secondary residual motion vector associated with the current block from a bitstream, and applying the secondary residual motion vector determined based on the information indicating the secondary residual motion vector to a base motion vector modified by applying the primary residual motion vector, thereby determining the motion vector of the current block. Effect of the Invention
[0009] A method and apparatus for encoding and decoding motion information, and a device for encoding and decoding motion information according to an embodiment of the present invention can represent motion information using a small number of bits.
[0010] In addition, the motion information encoding and decoding methods and the motion information encoding and decoding devices according to an embodiment may represent a residual motion vector with a small number of bits.
[0011] However, the effects that can be achieved by the motion information encoding method and decoding method, and the motion information encoding device and decoding device according to one embodiment are not limited to those mentioned above, and other effects not mentioned will be clearly understood by those skilled in the art in the technical field to which this disclosure pertains from the description below. [Brief description of the drawings]
[0012] In order to more fully understand the drawings referred to herein, a brief description of each drawing is provided. [Figure 1] FIG. 2 is a block diagram of a video decoding device according to an embodiment. [Diagram 2] 1 is a block diagram of a video encoding device according to an embodiment; [Diagram 3] 1 is a diagram illustrating a process in which a video decoding apparatus divides a current coding unit and determines at least one coding unit, according to an embodiment. [Figure 4]11 is a diagram illustrating a process in which a video decoding apparatus divides a non-square coding unit and determines at least one coding unit, according to an embodiment. [Diagram 5] 1 is a diagram illustrating a process in which a video decoding apparatus divides a coding unit based on at least one of block configuration information and partition configuration mode information, according to an embodiment. [Figure 6] 1 is a diagram illustrating a method for a video decoding apparatus to determine a predetermined coding unit from an odd number of coding units, according to an embodiment; [Figure 7] 11 is a diagram illustrating an order in which a plurality of coding units are processed when a video decoding apparatus divides a current coding unit to determine the plurality of coding units, according to an embodiment; [Figure 8] 11 is a diagram illustrating a process in which a video decoding apparatus determines to divide a current coding unit into an odd number of coding units when coding units cannot be processed in a predetermined order, according to an embodiment; [Figure 9] 1 is a diagram illustrating a process in which a video decoding apparatus divides a first coding unit and determines at least one coding unit, according to an embodiment. [Figure 10] 11 is a diagram illustrating that a video decoding device according to one embodiment restricts the manner in which a second coding unit may be divided when a non-square second coding unit determined by dividing a first coding unit satisfies a certain condition. [Figure 11] 11 is a diagram illustrating a process in which a video decoding apparatus divides a square-shaped coding unit when division mode information does not indicate division into four square-shaped coding units, according to one embodiment. [Figure 12] 11 is a diagram illustrating that a processing order among a plurality of coding units differs depending on a division process of the coding units, according to an embodiment. [Figure 13] 11 is a diagram illustrating a process of determining a depth of a coding unit according to changes in the shape and size of the coding unit when a coding unit is recursively divided to determine a plurality of coding units, according to one embodiment. [Figure 14]1 is a diagram illustrating a depth determined according to a type and size of a coding unit and an index (PID: part index) for a coding unit partition, according to an embodiment. [Figure 15] 1 is a diagram illustrating a plurality of coding units being determined according to a plurality of predetermined data units included in a picture, according to an embodiment; [Figure 16] 1 is a diagram illustrating processing blocks that are used as a reference for determining a determination order of reference coding units included in a picture, according to an embodiment; [Figure 17] 11 is a diagram illustrating coding units that may be determined for each picture when combinations of ways in which coding units may be divided vary from picture to picture, according to an embodiment; [Figure 18] 1 is a diagram illustrating various types of coding units that may be determined based on partition mode information that may be expressed as a binary code, according to an embodiment; [Figure 19] 11 is a diagram illustrating another type of coding unit that may be determined based on division mode information that may be expressed as a binary code, according to an embodiment; [Figure 20] 1 is a block diagram of an image encoding system and a decoding system that perform loop filtering; [Figure 21] FIG. 2 is a block diagram of a video decoding device according to an embodiment. [Figure 22] 1 is a diagram showing primary residual motion vector candidates displayed on a coordinate plane. [Figure 23] 1 is a diagram showing primary residual motion vector candidates displayed on a coordinate plane. [Figure 24] 1 is a diagram showing primary residual motion vector candidates displayed on a coordinate plane. [Diagram 25] 1 is a diagram showing primary residual motion vector candidates displayed on a coordinate plane. [Figure 26] 11 is a diagram illustrating an index indicating a primary residual motion vector candidate according to an embodiment; [Figure 27] 13 is a diagram for explaining motion information used for bidirectional prediction of blocks. [Figure 28] 1 is a diagram showing the positional relationship between a current picture and two reference pictures. [Figure 29] 13 is a diagram illustrating primary residual motion vector candidates for a current block that is bidirectionally predicted; [Diagram 30] 1 is a diagram showing the positional relationship between a current picture and two reference pictures. [Diagram 31] 13 is a diagram illustrating primary residual motion vector candidates for a current block that is bidirectionally predicted; [Diagram 32] 1 is a flowchart illustrating a video decoding method according to an embodiment. [Diagram 33] 1 is a block diagram of a video encoding device according to an embodiment; [Diagram 34] 1 is a flowchart illustrating a video encoding method according to an embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] A method for decoding motion information according to one embodiment of the present disclosure may include a step of determining a base motion vector of a current block, a step of determining a primary residual motion vector for the current block based on information obtained from a bitstream among at least one primary residual motion vector candidate divided according to a displacement distance and a displacement direction, and a step of applying the primary residual motion vector to the base motion vector to determine a motion vector for the current block.
[0014] In one embodiment, the step of determining the motion vector of the current block may further include the steps of obtaining information indicating a secondary residual motion vector associated with the current block from a bitstream, and applying the secondary residual motion vector determined based on the information indicating the secondary residual motion vector to a base motion vector modified by applying the primary residual motion vector, thereby determining the motion vector of the current block.
[0015] In one embodiment, the method for decoding motion information may further include a step of acquiring an index indicating at least one of a displacement distance and a displacement direction of the primary residual motion vector from a bitstream, and the step of determining the primary residual motion vector may include a step of determining a primary residual motion vector candidate corresponding to the acquired index among the at least one primary residual motion vector candidate as a primary residual motion vector related to the current block.
[0016] In an embodiment, the method for decoding motion information may further include determining one of at least one base motion vector candidate as a base motion vector of the current block.
[0017] In one embodiment, the step of determining the motion vector of the current block may include, when a base motion vector of the current block corresponds to a bidirectional motion vector, a prediction direction of the current block corresponds to bidirectional, and the primary residual motion vector is determined for a first unidirectional, determining a primary residual motion vector for a second unidirectional based on the primary residual motion vector for the first unidirectional; applying the primary residual motion vector for the first unidirectional to the base motion vector of the first unidirectional to determine the first unidirectional motion vector of the current block; and applying the primary residual motion vector for the second unidirectional to the base motion vector of the second unidirectional to determine the motion vector for the second unidirectional of the current block.
[0018] In one embodiment, the step of determining the primary residual motion vector for the second unidirectional may include determining at least one of a magnitude and a sign of a component value of the primary residual motion vector for the second unidirectional based on a positional relationship between a reference picture corresponding to a first unidirectional base motion vector, a reference picture corresponding to a second unidirectional base motion vector, and a current picture including the current block.
[0019] In one embodiment, the step of determining the motion vector of the current block may include, when the base motion vector of the current block corresponds to a first unidirectional motion vector and the prediction direction of the current block corresponds to a second unidirectional direction different from the first unidirectional, determining a base motion vector of the second unidirectional based on the base motion vector of the first unidirectional and determining a primary residual motion vector for the second unidirectional based on the primary residual motion vector for the first unidirectional, and applying the primary residual motion vector for the second unidirectional to the base motion vector of the second unidirectional to determine the motion vector of the current block.
[0020] In one embodiment, the step of determining the motion vector of the current block may include, when the base motion vector of the current block corresponds to a first unidirectional motion vector and the prediction direction of the current block corresponds to bidirectional, determining the second unidirectional base motion vector based on the first unidirectional base motion vector and determining a primary residual motion vector for the second unidirectional based on the primary residual motion vector for the first unidirectional; applying a primary residual motion vector for the first unidirectional to the first unidirectional base motion vector to determine the first unidirectional motion vector of the current block; and applying the primary residual motion vector for the second unidirectional to the second unidirectional base motion vector to determine the motion vector for the second unidirectional of the current block.
[0021] In an embodiment, the method for decoding motion information may further include entropy decoding at least a portion of an index indicating the primary residual motion vector from a bitstream using a context model.
[0022] In one embodiment, the method for decoding motion information further includes a step of determining at least one primary residual motion vector candidate corresponding to each of at least one base motion vector candidate, and among the at least one primary residual motion vector candidate, the primary residual motion vector candidate determined corresponding to the base motion vector candidate in both directions may include a primary residual motion vector candidate in a list 0 direction having values of the same sign or opposite sign and a primary residual motion vector candidate in a list 1 direction.
[0023] In one embodiment, the magnitude of at least one of the primary residual motion vector candidate in the list 0 direction and the primary residual motion vector candidate in the list 1 direction may be scaled taking into account the distance between a first reference picture corresponding to a first unidirectional base motion vector candidate and a current picture including the current block and a second reference picture corresponding to the second unidirectional base motion vector candidate.
[0024] In one embodiment, the method for decoding motion information may further include, when the current block corresponds to a first child block divided from a parent block, determining a motion vector of the current block as a base motion vector of the second child block, and applying a primary residual motion vector determined for the second child block to the base motion vector of the second child block to determine the motion vector of the second child block.
[0025] In one embodiment, the method for decoding motion information may further include, when the current block corresponds to a first child block divided from a parent block, applying at least one of information indicating a base motion vector, information indicating a displacement distance, and information indicating a displacement direction obtained in relation to the current block to a second child block.
[0026] In one embodiment, the method for decoding motion information may further include acquiring information indicating at least one of whether a predetermined encoding mode is applied to the current block, a base motion vector related to the current block, a primary residual motion vector related to the current block, a priority of a displacement distance, and a priority of a displacement direction at at least one level of a transformation unit level, a coding unit level, a maximum coding unit level, a slice level, and a picture level.
[0027] A method for encoding motion information according to one embodiment of the present disclosure may include a step of determining a base motion vector of a current block, a step of determining a primary residual motion vector related to the current block from at least one primary residual motion vector candidate classified by a displacement distance and a displacement direction based on a difference between the motion vector of the current block and the base motion vector, and a step of generating a bitstream including at least one of information indicating the base motion vector and information indicating the primary residual motion vector.
[0028] The present disclosure can be modified in various ways and can have various embodiments, but specific embodiments are illustrated in the drawings and will be described in detail through detailed descriptions. However, it is not intended to limit the embodiments of the present disclosure, and the present disclosure should be understood to include all modifications, equivalents, or alternatives included in the spirit and technical scope of the various embodiments.
[0029] In the description of the present embodiment, if a detailed description of related prior art is deemed to unnecessarily obscure the gist of the present disclosure, the detailed description will be omitted. In addition, numbers (e.g., 1, 2, etc.) used in the description of the specification are merely identification symbols for distinguishing one component from another.
[0030] In addition, in this specification, when a component is referred to as being "connected" or "connected" to another component, it should be understood that the one component may be directly connected or directly connected to the other component, but unless specifically stated to the contrary, it may also be connected or connected via another component in between.
[0031] In addition, in this specification, a component expressed as a "unit" or "module" may mean that two or more components are combined into one component, or one component may be divided into two or more components according to a further divided function. In addition, each component described below may additionally perform some or all of the functions of other components in addition to its own main function, and it goes without saying that some of the main functions of each component may be exclusively performed by other components.
[0032] Also, in this specification, an "image" or "picture" can refer to a still or moving image of a video, i.e., the video itself.
[0033] In this specification, a "sample" refers to data assigned to a sampling position of an image and to data to be processed. For example, in a spatial domain image, a pixel value and a transform coefficient in a transform domain are also samples. A unit including at least one such sample can be defined as a block.
[0034] In addition, in this specification, the term "current block" refers to a block of the maximum coding unit, coding unit, prediction unit, or transform unit of a current image to be encoded or decoded.
[0035] In addition, in this specification, a motion vector in the list 0 direction means that the motion vector is used to indicate a block in a reference picture included in list 0, and a motion vector in the list 1 direction means that the motion vector is used to indicate a block in a reference picture included in list 1. In addition, a motion vector being unidirectional means that the motion vector is used to indicate a block in a reference picture included in list 0 or list 1, and a motion vector being bidirectional means that the motion vector includes a motion vector in the list 0 direction and a motion vector in the list 1 direction.
[0036] Hereinafter, a video encoding method and apparatus therefor, and a video decoding method and apparatus therefor based on a coding unit and a transform unit having a tree structure according to an embodiment will be disclosed with reference to Figures 1 to 20. Each of the video encoding device 200 and the video decoding device 100 described with reference to Figures 1 to 20 may include a video encoding device 3300 and a video decoding device 2100 described with reference to Figures 21 to 34, respectively.
[0037] FIG. 1 illustrates a block diagram of a video decoder 100 according to one embodiment.
[0038] The video decoding device 100 may include a bitstream obtaining unit 110 and a decoding unit 120. The bitstream obtaining unit 110 and the decoding unit 120 may each include at least one processor. Also, the bitstream obtaining unit 110 and the decoding unit 120 may each include a memory that stores instructions executed by the at least one processor.
[0039] The bitstream acquiring unit 110 may receive a bitstream. The bitstream includes information obtained by encoding an image by the video encoding device 200 described below. The bitstream may be transmitted from the video encoding device 200. The video encoding device 200 and the video decoding device 100 may be connected to each other via a wired or wireless connection, and the bitstream acquiring unit 110 may receive the bitstream via a wired or wireless connection. The bitstream acquiring unit 110 may receive the bitstream from a recording medium such as an optical medium or a hard disk. The decoding unit 120 may restore an image based on information acquired from the received bitstream. The decoding unit 120 may acquire syntax elements for restoring an image from the bitstream. The decoding unit 120 may restore an image based on the syntax elements.
[0040] Describing the operation of the video decoding device 100 in detail, a bitstream obtaining unit 110 can receive a bitstream.
[0041] The video decoding apparatus 100 may perform an operation of acquiring a bin string corresponding to a partition mode of a coding unit from a bitstream. The video decoding apparatus 100 may then perform an operation of determining a partition rule for the coding unit. The video decoding apparatus 100 may also perform an operation of partitioning a coding unit into a plurality of coding units based on at least one of the partition rules and the bin string corresponding to the partition mode. To determine the partition rule, the video decoding apparatus 100 may determine a first allowable range of a size of the coding unit according to a ratio of a width and a height of the coding unit. To determine the partition rule, the video decoding apparatus 100 may determine a second allowable range of a size of the coding unit according to a partition mode of the coding unit.
[0042] In the following, the division of coding units according to one embodiment of the present disclosure will be described in detail.
[0043] First, a picture is divided into one or more slices. A slice is also a sequence of one or more coding tree units (CTUs). A coding tree block (CTB) is a concept that is contrasted with a coding tree unit (CTU).
[0044] A maximal coding block (CTB) means an NxN block containing NxN samples, where N is an integer. Each color component is also divided into one or more maximal coding blocks.
[0045] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), the largest coding unit (CTU) is a unit that includes the largest coded block of luma samples, the two largest coded blocks of corresponding chroma samples, and the syntax structure used to code the luma samples and chroma samples. When a picture is a monochrome picture, the largest coding unit is a unit that includes the largest coded block of monochrome samples and the syntax structure used to code the monochrome samples. When a picture is a picture that is coded into color planes separated by color components, the largest coding unit is a unit that includes the picture and the syntax structure used to code the samples of the picture.
[0046] One maximal coding block (CTB) is also divided into MxN coding blocks containing MxN samples (M, N are integers).
[0047] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) is a unit including a coding block of luma samples, two coding blocks of corresponding chroma samples, and a syntax structure used to code the luma samples and chroma samples. When a picture is a monochrome picture, a coding unit is a unit including a coding block of monochrome samples and a syntax structure used to code the monochrome samples. When a picture is a picture coded into color planes separated by color components, a coding unit is a unit including the picture and a syntax structure used to code the samples of the picture.
[0048] As described above, the largest coding block and the largest coding unit are distinct concepts, and the coding block and the coding unit are distinct concepts. That is, the (largest) coding unit refers to a data structure including a (largest) coding block including a sample and a syntax structure corresponding thereto. However, since a person skilled in the art can understand that the (largest) coding unit or the (largest) coding block refers to a block of a predetermined size including a predetermined number of samples, in the following description, the largest coding block and the largest coding unit, or the coding block and the coding unit, will be referred to without distinction unless there is a special reason.
[0049] The image is also divided into maximum coding units (CTUs), the size of which is also determined based on information obtained from the bitstream, and the shape of the maximum coding units may have a square shape of the same size, but is not limited thereto.
[0050] For example, information regarding a maximum size of a luma coding block may be acquired from a bitstream, where the maximum size of the luma coding block indicated by the information regarding the maximum size of the luma coding block may be one of 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, and 256x256.
[0051] For example, information on the maximum size of a luma coding block that can be divided into two and information on the luma block size difference may be obtained from a bitstream. The information on the luma block size difference may indicate a size difference between a luma maximum coding unit and a maximum luma coding block that can be divided into two. Thus, the size of the luma maximum coding unit is determined by combining the information on the maximum size of a luma coding block that can be divided into two obtained from the bitstream and the information on the luma block size difference. The size of the chroma maximum coding unit is also determined by using the size of the luma maximum coding unit. For example, if the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chroma block is half the size of the luma block, and similarly, the size of the chroma maximum coding unit is half the size of the luma maximum coding unit.
[0052] According to an embodiment, information on the maximum size of a luma coding block that can be binary split is obtained from a bitstream, so that the maximum size of a luma coding block that can be binary split is variably determined. In contrast, the maximum size of a luma coding block that can be ternary split may be fixed. For example, the maximum size of a luma coding block that can be ternary split in an I slice is 32x32, and the maximum size of a luma coding block that can be ternary split in a P slice or a B slice is 64x64.
[0053] The maximum coding unit is also hierarchically divided into coding units based on partition mode information acquired from the bitstream, where at least one of information indicating whether or not a quad split is performed, information indicating whether or not a multi-partition is performed, partition direction information, and partition type information is also acquired from the bitstream as the partition mode information.
[0054] For example, the information indicating whether or not a current coding unit is quad-split may indicate whether the current coding unit is quad-split (QUAD_SPLIT) or not.
[0055] If the current coding unit is not quad-split, the information indicating whether or not the current coding unit is to be split further may indicate whether the current coding unit is not to be split further (NO_SPLIT) or whether the current coding unit is to be split into binary / ternary.
[0056] If the current coding unit is binary-partitioned or ternary-partitioned, the division direction information indicates that the current coding unit is divided in one of the horizontal and vertical directions.
[0057] If the current coding unit is split horizontally or vertically, the split type information indicates that the current coding unit is split by binary splitting or ternary splitting.
[0058] The split mode of the current coding unit is determined by the split direction information and the split type information. If the current coding unit is binary split horizontally, the split mode is determined as binary horizontal split (SPLIT_BT_HOR), if the current coding unit is ternary split horizontally, the split mode is determined as ternary horizontal split (SPLIT_TT_HOR), if the current coding unit is binary split vertically, the split mode is determined as binary vertical split (SPLIT_BT_VER), and if the current coding unit is ternary split vertically, the split mode is determined as ternary vertical split (SPLIT_TT_VER).
[0059] The video decoding apparatus 100 may acquire partition mode information from one bin string from a bitstream. The format of the bitstream received by the video decoding apparatus 100 may include a fixed length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The bin string indicates information as a sequence of binary numbers. The bin string may be composed of at least one bit. The video decoding apparatus 100 may acquire partition mode information corresponding to the bin string based on a partition rule. The video decoding apparatus 100 may determine whether to partition a coding unit into quads or not, or a partition direction and a partition type, based on one bin string.
[0060] The coding unit may be smaller than or equal to the maximum coding unit. For example, the maximum coding unit is also a coding unit having a maximum size, and is therefore also one of the coding units. If the partition mode information related to the maximum coding unit indicates that it is not partitioned, the coding unit determined as the maximum coding unit has the same size as the maximum coding unit. If the partition mode information related to the maximum coding unit indicates that it is partitioned, the maximum coding unit is also partitioned into coding units. Also, if the partition mode information related to the coding unit indicates partitioning, the coding unit is further partitioned into coding units of smaller sizes. However, the partitioning of the image is not limited thereto, and the maximum coding unit and the coding units are not differentiated. The partitioning of the coding units will be described in more detail with reference to FIG. 3 to FIG. 16.
[0061] Also, one or more prediction blocks for prediction are determined from the coding unit, the prediction blocks being equal to or smaller than the coding unit, and one or more transform blocks for transformation are determined from the coding unit, the transform blocks being equal to or smaller than the coding unit.
[0062] The shapes and sizes of the transformation block and the prediction block are independent of each other.
[0063] In another embodiment, prediction is performed using the coding unit as a predictive block, and transformation is performed using the coding unit as a transform block.
[0064] The division of the coding unit will be described in more detail with reference to FIG. 3 to FIG. 16. The current block and the neighboring blocks of the present disclosure may indicate one of the largest coding unit, the coding unit, the prediction block, and the transformation block. The current block or the current coding unit is a block currently being decoded or encoded, or a block currently being divided. The neighboring blocks are also blocks that are restored before the current block. The neighboring blocks may be spatially or temporally adjacent to the current block. The neighboring blocks may be located at one of the lower left, left, upper left, upper, upper right, right, and lower right sides of the current block.
[0065] FIG. 3 illustrates a process in which a video decoding apparatus 100 divides a current coding unit and determines at least one coding unit according to an embodiment.
[0066] The block shape may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N, where N is a positive integer. The block shape information is information indicating at least one of the shape, direction, width and height ratio, or size of a coding unit.
[0067] The shape of the coding unit may include a square and a non-square. If the width and height of the coding unit are the same (i.e., the block shape of the coding unit is 4Nx4N), the video decoding device 100 may determine the block shape information of the coding unit as a square. The video decoding device 100 may determine the shape of the coding unit as a non-square.
[0068] When the width and height of the coding unit are different (i.e., when the block shape of the coding unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the video decoding device 100 may determine the block shape information of the coding unit as non-square. When the shape of the coding unit is non-square, the video decoding device 100 may determine the width and height ratio in the block shape information of the coding unit to be at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. In addition, based on the width and height of the coding unit, the video decoding device 100 may determine whether the coding unit is horizontal or vertical. Furthermore, the video decoding apparatus 100 may determine the size of the coding unit based on at least one of the width, height, and width of the coding unit.
[0069] The video decoding device 100 according to an embodiment may determine the type of the coding unit using block type information, and may determine the type in which the coding unit is to be partitioned using partition type mode information. That is, the partitioning method of the coding unit indicated by the partition type mode information is determined depending on the block type indicated by the block type information used by the video decoding device 100.
[0070] The video decoding device 100 may acquire partition mode information from a bitstream. However, the present invention is not limited thereto, and the video decoding device 100 and the video encoding device 200 may determine pre-agreed partition mode information based on the block format information. The video decoding device 100 may determine pre-agreed partition mode information for the maximum coding unit or the minimum coding unit. For example, the video decoding device 100 may determine the partition mode information for the maximum coding unit as quad partition. Also, the video decoding device 100 may determine the partition mode information for the minimum coding unit as "no partition". Specifically, the video decoding device 100 may determine the size of the maximum coding unit as 256x256. The video decoding device 100 may determine the pre-agreed partition mode information as quad partition. The quad partition is a partition mode in which both the width and height of the coding unit are divided into two equal parts. Based on the partition mode information, the video decoding device 100 may obtain a coding unit of 128x128 size from the maximum coding unit of 256x256 size. Also, the video decoding device 100 may determine the size of the minimum coding unit to be 4x4. The video decoding device 100 may obtain partition mode information indicating "not to be partitioned" for the minimum coding unit.
[0071] According to an embodiment, the video decoding apparatus 100 may use block shape information indicating whether the current coding unit is square. For example, the video decoding apparatus 100 may determine whether to not split the square coding unit, to split it vertically, to split it horizontally, or to split it into four coding units, according to the partition shape mode information. Referring to FIG. 3, when the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may not split the coding unit 310a having the same size as the current coding unit 300 according to the partition shape mode information indicating no partition, or may determine the divided coding units 310b, 310c, 310d, 310e, 310f, etc. according to the partition shape mode information indicating a predetermined partition method.
[0072] Referring to FIG. 3, the video decoding device 100 may determine two coding units 310b obtained by dividing the current coding unit 300 in the vertical direction based on the partition mode information indicating division in the vertical direction, according to an embodiment. The video decoding device 100 may determine two coding units 310c obtained by dividing the current coding unit 300 in the horizontal direction based on the partition mode information indicating division in the horizontal direction. The video decoding device 100 may determine four coding units 310d obtained by dividing the current coding unit 300 in the vertical and horizontal directions based on the partition mode information indicating division in the vertical and horizontal directions. The video decoding device 100 may determine three coding units 310e obtained by dividing the current coding unit 300 in the vertical direction based on the partition mode information indicating ternary division in the vertical direction, according to an embodiment. The video decoding device 100 may determine three coding units 310f obtained by dividing the current coding unit 300 in the horizontal direction based on the partition mode information indicating ternary division in the horizontal direction. However, the division patterns into which the square coding unit may be divided are not limited to the above-mentioned patterns, and include various patterns that may be indicated by the division pattern mode information. The predetermined division patterns into which the square coding unit may be divided will be described in detail below through various embodiments.
[0073] FIG. 4 illustrates a process in which a video decoding apparatus 100 divides a non-square coding unit to determine at least one coding unit, according to an embodiment.
[0074] According to an embodiment, the video decoding apparatus 100 may use block shape information indicating whether the current coding unit is non-square. The video decoding apparatus 100 may determine whether to not split the non-square current coding unit or to split it in a predetermined manner according to the partition mode information. Referring to FIG. 4, when the block shape information of the current coding unit 400 or 450 indicates a non-square shape, the video decoding apparatus 100 may determine a coding unit 410 or 460 having the same size as the current coding unit 400 or 450 according to the partition mode information indicating no partition, or may determine a partitioned coding unit 420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, or 480c according to the partition mode information indicating a predetermined partition method. The predetermined partition method for partitioning a non-square coding unit will be described in detail below through various embodiments.
[0075] According to an embodiment, the video decoding apparatus 100 may determine a manner in which a coding unit is divided using the partition mode information, and in this case, the partition mode information may indicate the number of at least one coding unit generated by dividing the coding unit. Referring to FIG 4, when the partition mode information indicates that the current coding unit 400 or 450 is divided into two coding units, the video decoding apparatus 100 may determine two coding units (420a, 420b, or 470a, 470b) included in the current coding unit by dividing the current coding unit 400 or 450 based on the partition mode information.
[0076] When the video decoding apparatus 100 according to an embodiment divides the non-square current coding unit 400 or 450 based on the division shape mode information, the video decoding apparatus 100 may divide the current coding unit in consideration of a position of a long side of the non-square current coding unit 400 or 450. For example, the video decoding apparatus 100 may divide the current coding unit 400 or 450 in a direction dividing the long side of the current coding unit 400 or 450 in consideration of the shape of the current coding unit 400 or 450 to determine a plurality of coding units.
[0077] According to an embodiment, when the partition mode information indicates that the coding unit is to be partitioned into an odd number of blocks (ternary partitioning), the video decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450. For example, when the partition mode information indicates that the current coding unit 400 or 450 is to be partitioned into three coding units, the video decoding device 100 may partition the current coding unit 400 or 450 into three coding units 430a, 430b, 430c, 480a, 480b, and 480c.
[0078] According to an embodiment, the width-to-height ratio of the current coding unit 400 or 450 may be 4:1 or 1:4. When the width-to-height ratio is 4:1, the width is greater than the height, so the block shape information is also horizontal. When the width-to-height ratio is 1:4, the width is smaller than the height, so the block shape information is also vertical. The video decoding apparatus 100 may determine to divide the current coding unit into an odd number of blocks based on the partition shape mode information. In addition, the video decoding apparatus 100 may determine a partition 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 vertical, the video decoding apparatus 100 may divide the current coding unit 400 in the horizontal direction to determine coding units 430a, 430b, and 430c. Also, if the current coding unit 450 is horizontal, the video decoding apparatus 100 may divide the current coding unit 450 vertically to determine coding units 480a, 480b, and 480c.
[0079] According to an embodiment, the video decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and the determined coding units may not have the same size. For example, the size of a certain coding unit 430b or 480b among the determined odd number of coding units 430a, 430b, 430c, 480a, 480b, and 480c may be different from the other coding units 430a, 430c, 480a, and 480c. That is, the coding units that may be determined by dividing the current coding unit 400 or 450 may have a plurality of sizes, and in some cases, the odd number of coding units 430a, 430b, 430c, 480a, 480b, and 480c may have different sizes.
[0080] According to an embodiment, when the partition mode information indicates that a coding unit is partitioned into an odd number of blocks, the video decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and may further impose a certain restriction on at least one of the odd number of coding units generated by partitioning. Referring to FIG 4, the video decoding device 100 may perform a decoding process for the central coding unit 430b, 480b among three coding units 430a, 430b, 430c, 480a, 480b, 480c generated by partitioning the current coding unit 400 or 450, different from the other coding units 430a, 430c, 480a, 480c. For example, the video decoding device 100 may limit the centrally located coding units 430b and 480b from being further divided, unlike the other coding units 430a, 430c, 480a, and 480c, or may limit the number of divisions to a predetermined number.
[0081] FIG. 5 illustrates a process in which a video decoding apparatus 100 divides a coding unit based on at least one of block configuration information and partition configuration mode information, according to an embodiment.
[0082] According to an embodiment, the video decoding apparatus 100 may determine whether or not to divide the square-shaped first coding unit 500 into coding units based on at least one of the block shape information and the partition shape mode information. According to an embodiment, if the partition shape mode information indicates that the first coding unit 500 is to be partitioned horizontally, the video decoding apparatus 100 may determine the second coding unit 510 by partitioning the first coding unit 500 horizontally. According to an embodiment, the first coding unit, the second coding unit, and the third coding unit used are terms used to understand the partitioning context between the coding units. For example, if the first coding unit is partitioned, the second coding unit is determined, and if the second coding unit is partitioned, the third coding unit is determined. Hereinafter, the relationship between the first coding unit, the second coding unit, and the third coding unit used may be understood to be due to the above-mentioned characteristics.
[0083] According to an embodiment, the video decoding apparatus 100 may determine whether or not to divide the determined second coding unit 510 into coding units based on the partition mode information. Referring to FIG. 5, the video decoding apparatus 100 may divide the non-square second coding unit 510 determined by dividing the first coding unit 500 into at least one third coding unit 520a, 520b, 520c, 520d based on the partition mode information, or may not divide the second coding unit 510. The video decoding apparatus 100 may acquire partition mode information, and may divide the first coding unit 500 based on the acquired partition mode information, for example, into a plurality of second coding units 510 of various types, and the second coding unit 510 may also be divided according to the manner in which the first coding unit 500 was divided based on the partition mode information. According to an embodiment, when the first coding unit 500 is split into the second coding unit 510 based on the split mode information related to the first coding unit 500, the second coding unit 510 is also split into third coding units 520a, 520b, 520c, 520d based on the split mode information related to the second coding unit 510. That is, the coding units are also split recursively based on the split mode information related to each coding unit. Thus, in a non-square coding unit, a square coding unit is determined, and such a square coding unit is recursively split to determine a non-square coding unit.
[0084] 5, a certain coding unit (e.g., a coding unit located in the middle or a square-shaped coding unit) among the odd number of third coding units 520b, 520c, and 520d determined by dividing the non-square-shaped second coding unit 510 is also divided recursively. According to an embodiment, the square-shaped third coding unit 520b, which is one of the odd number of third coding units 520b, 520c, and 520d, is divided horizontally into a plurality of fourth coding units. The non-square-shaped fourth coding unit 530b or 530d, which is one of the plurality of fourth coding units 530a, 530b, 530c, and 530d, is further divided into a plurality of coding units. For example, the non-square-shaped fourth coding unit 530b or 530d is further divided into an odd number of coding units. A method used for recursive division of coding units will be described below through various embodiments.
[0085] The video decoding device 100 according to an embodiment may divide each of the third coding units 520a, 520b, 520c, and 520d into coding units based on the partition mode information. The video decoding device 100 may also determine not to partition the second coding unit 510 based on the partition mode information. The video decoding device 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d according to an embodiment. The video decoding device 100 may impose a certain restriction on a certain third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the video decoding device 100 may restrict the coding unit 520c located in the middle of the odd number of third coding units 520b, 520c, and 520d so that it is not further divided or that it must be divided a settable number of times.
[0086] 5, the video decoding device 100 may restrict the coding unit 520c located in the middle of the odd number of third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to not be further divided or to be divided into a predetermined division form (e.g., to be divided into only four coding units or to be divided into a form corresponding to the division form of the second coding unit 510), or to be divided only a predetermined number of times (e.g., to be divided only n times, n>0). However, the above restriction on the coding unit 520c located in the middle is merely an embodiment, and should not be construed as being limited to the above embodiment, but should be construed as including various restrictions in which the coding unit 520c located in the middle is decoded differently from the other coding units 520b and 520d.
[0087] The video decoding apparatus 100 according to an embodiment may obtain partition mode information used to partition the current coding unit at a predetermined position within the current coding unit.
[0088] FIG. 6 illustrates a method for a video decoding apparatus 100 to determine a predetermined coding unit from among an odd number of coding units according to an embodiment.
[0089] 6, the partition mode information of the current coding unit 600, 650 may be obtained from a sample at a predetermined position (e.g., samples 640, 690 located in the middle) among a plurality of samples included in the current coding unit 600, 650. However, the predetermined position in the current coding unit 600 from which at least one of the partition mode information may be obtained is not limited to the center position shown in FIG. 6, but may include various positions (e.g., top end, bottom end, left end, right end, top left end, bottom left end, top right end, bottom right end, etc.) included in the current coding unit 600. The video decoding apparatus 100 may obtain the partition mode information obtained from the predetermined position and determine whether to partition the current coding unit into coding units of various types and sizes or not to divide the current coding unit.
[0090] According to an embodiment, when a current coding unit is divided into a predetermined number of coding units, the video decoding apparatus 100 may select one of the coding units. There are various methods for selecting one of the plurality of coding units, and the methods will be described below in the following various embodiments.
[0091] According to an embodiment, the video decoding apparatus 100 may divide a current coding unit into a plurality of coding units and determine a coding unit at a predetermined position.
[0092] According to an embodiment, the video decoding apparatus 100 may use information indicating the positions of the odd coding units to determine a coding unit located in the middle among the odd coding units. Referring to FIG 6, the video decoding apparatus 100 may divide a current coding unit 600 or a current coding unit 650 to determine odd coding units 620a, 620b, and 620c or odd coding units 660a, 660b, and 660c. The video decoding apparatus 100 may determine the middle coding unit 620b or the middle coding unit 660b using information regarding the positions of the odd coding units 620a, 620b, and 620c or the odd coding units 660a, 660b, and 660c. For example, the video decoding device 100 can determine 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 to determine the center coding unit 620b. Specifically, the video decoding device 100 can determine 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 to determine the center coding unit 620b.
[0093] According to an embodiment, the information indicating the positions of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c may include information related to the positions or coordinates of the coding units 620a, 620b, and 620c in a picture. According to an embodiment, the information indicating the positions of the top left samples 630a, 630b, and 630c 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 such width or height also corresponds to information indicating the difference between the coordinates of the coding units 620a, 620b, and 620c in a picture. That is, the video decoding device 100 can determine the coding unit 620b located in the middle by directly using information related to the positions or coordinates of the coding units 620a, 620b, and 620c within the picture, or by using information related to the width or height of the coding unit corresponding to the difference between the coordinates.
[0094] According to an embodiment, information indicating a position of the top left sample 630a of the top coding unit 620a may indicate (xa, ya) coordinates, information indicating a position of the top left sample 530b of the middle coding unit 620b may indicate (xb, yb) coordinates, and information indicating a position of the top left sample 630c of the bottom coding unit 620c may indicate (xc, yc) coordinates. The video decoding device 100 may determine the middle coding unit 620b using the coordinates of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively. For example, when the coordinates of the top left samples 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b including the coordinates (xb, yb) of the middle sample 630b may be determined as the middle coding unit among the coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. However, the coordinates indicating the positions of the top left samples 630a, 630b, and 630c may indicate coordinates indicating absolute positions within a picture, and further, the (dxb, dyb) coordinates indicating the relative position of the top left sample 630b of the middle coding unit 620b and the (dxc, dyc) coordinates indicating the relative position of the top left sample 630c of the bottom coding unit 620c may be used. In addition, the method of determining a coding unit at a predetermined position by using the coordinates of a sample as information indicating the position of the sample included in the coding unit should not be interpreted as being limited to the above-mentioned method, but should be interpreted as various arithmetic methods that can use the coordinates of the sample.
[0095] According to an embodiment, the video decoding device 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c, and may select a coding unit from the coding units 620a, 620b, and 620c according to a predetermined criterion. For example, the video decoding device 100 may select a coding unit 620b having a different size from the coding units 620a, 620b, and 620c.
[0096] According to an embodiment, the video decoding device 100 may determine the width or height of each of the coding units 620a, 620b, and 620c using (xa, ya) coordinates indicating the position of the top left sample 630a of the top coding unit 620a, (xb, yb) coordinates indicating the position of the top left sample 630b of the middle coding unit 620b, and (xc, yc) coordinates indicating the position of the top left sample 630c of the bottom coding unit 620c. The video decoding device 100 may determine the size of each of the coding units 620a, 620b, and 620c using (xa, ya), (xb, yb), and (xc, yc) coordinates indicating the positions of the coding units 620a, 620b, and 620c. According to an embodiment, the video decoding device 100 may determine the width of the top coding unit 620a as the width of the current coding unit 600. The video decoding apparatus 100 may determine the height of the top coding unit 620a as (yb-ya). The video decoding apparatus 100 according to an embodiment may determine the width of the middle coding unit 620b as the width of the current coding unit 600. The video decoding apparatus 100 may determine the height of the middle coding unit 620b as (yc-yb). The video decoding apparatus 100 according to an embodiment may determine the width or height of the bottom coding unit using the width or height of the current coding unit and the width and height of the top coding unit 620a and the middle coding unit 620b. The video decoding apparatus 100 may determine a coding unit having a different size from other coding units based on the determined widths and heights of the coding units 620a, 620b, and 620c. Referring to FIG. 6, the video decoding apparatus 100 may determine the middle coding unit 620b having a different size from the top coding unit 620a and the bottom coding unit 620c as a coding unit at a predetermined position. However, the above-mentioned process in which the video decoding device 100 determines a coding unit having a size different from other coding units is merely one embodiment of determining a coding unit at a predetermined position using the size of the coding unit determined based on sample coordinates, and various other processes may be used to determine a coding unit at a predetermined position by comparing the size of the coding unit determined based on predetermined sample coordinates.
[0097] The video decoding device 100 may determine the width or height of each of the coding units 660a, 660b, and 660c using the (xd, yd) coordinates indicating the position of the top left sample 670a of the left coding unit 660a, the (xe, ye) coordinates indicating the position of the top left sample 670b of the middle coding unit 660b, and the (xf, yf) coordinates indicating the position of the top left sample 670c of the right coding unit 660c. The video decoding device 100 may determine the size of each of the coding units 660a, 660b, and 660c using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.
[0098] According to an embodiment, the video decoding device 100 may determine the width of the left coding unit 660a as (xe-xd). The video 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 video decoding device 100 may determine the width of the middle coding unit 660b as (xf-xe). The video decoding device 100 may determine the height of the middle coding unit 660b as the height of the current coding unit 600. According to an embodiment, the video decoding device 100 may determine the width or height of the right coding unit 660c using the width or height of the current coding unit 650 and the widths and heights of the left coding unit 660a and the middle coding unit 660b. Based on the determined widths and heights of the coding units 660a, 660b, and 660c, the video decoding device 100 may determine a coding unit having a size different from other coding units. 6, the video decoding apparatus 100 may determine a middle coding unit 660b having a size different from the sizes of the left coding unit 660a and the right coding unit 660c as a coding unit at a predetermined position. However, the above-described process of the video decoding apparatus 100 determining a coding unit having a size different from other coding units is merely one embodiment of determining a coding unit at a predetermined position using the size of the coding unit determined based on sample coordinates, and therefore various processes of determining a coding unit at a predetermined position by comparing the size of the coding unit determined based on predetermined sample coordinates may be used.
[0099] However, the position of the sample considered to determine the position of the coding unit is not interpreted as being limited to the upper left end as mentioned above, but rather, information related to the position of any sample included in the coding unit is interpreted as being used.
[0100] According to an embodiment, the video decoding apparatus 100 may select a coding unit at a predetermined position from among an odd number of coding units determined by dividing the current coding unit, taking into consideration the shape of the current coding unit. For example, if the current coding unit is a non-square shape in which the width is greater than the height, the video decoding apparatus 100 may determine a coding unit at a predetermined position along the horizontal direction. That is, the video decoding apparatus 100 may determine one of the coding units at different positions in the horizontal direction and set a restriction on the coding unit. If the current coding unit is a non-square shape in which the height is greater than the width, the video decoding apparatus 100 may determine a coding unit at a predetermined position along the vertical direction. That is, the video decoding apparatus 100 may determine one of the coding units at different positions in the vertical direction and set a restriction on the coding unit.
[0101] According to an embodiment, the video decoding apparatus 100 may use information indicating the positions of each of the even-numbered coding units to determine a coding unit at a predetermined position among the even-numbered coding units. The video decoding apparatus 100 may determine the even-numbered coding units by dividing (binary dividing) the current coding unit, and may determine the coding unit at a predetermined position by using information regarding the positions of the even-numbered coding units. A detailed process related to this process corresponds to the process of determining a coding unit at a predetermined position (e.g., the middle position) among the odd-numbered coding units described in FIG. 6, and therefore will not be described in detail.
[0102] According to an embodiment, when a non-square current coding unit is divided into a plurality of coding units, in order to determine a coding unit at a predetermined position among the plurality of coding units, the video decoding apparatus 100 may use predetermined information related to the coding unit at a predetermined position during the division process. For example, in order to determine a coding unit at a center among the plurality of coding units into which the current coding unit is divided, the video decoding apparatus 100 may use at least one of block shape information and partition shape mode information stored in a sample included in a center coding unit during the division process.
[0103] 6, the video decoding apparatus 100 may divide a current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on the partition mode information, and may determine a coding unit 620b located in the middle of the plurality of coding units 620a, 620b, and 620c. Furthermore, the video decoding apparatus 100 may determine a coding unit 620b located in the middle by considering a position where the partition mode information is acquired. That is, the partition mode information of the current coding unit 600 is acquired from a sample 640 located in the middle 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 partition mode information, the coding unit 620b including the sample 640 may be determined as the coding unit located in the middle. However, information used to determine the coding unit located in the middle is not limited to the partition mode information, and various types of information may be used in the process of determining the coding unit located in the middle.
[0104] According to an embodiment, the predetermined information for identifying the coding unit at the predetermined position is also obtained from a predetermined sample included in the coding unit to be determined. Referring to FIG. 6, the video decoding device 100 may use partition mode information obtained from a sample at a predetermined position in the current coding unit 600 (e.g., a sample at the middle of the current coding unit 600) to determine a coding unit at a predetermined position (e.g., a coding unit at the middle of the coding units) among a plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. That is, the video decoding device 100 may determine the sample at the predetermined position by considering the block format of the current coding unit 600, and may determine a coding unit 620b including a sample from which predetermined information (e.g., partition mode information) can be obtained among a plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may set a predetermined restriction. 6, the video decoding apparatus 100 according to an embodiment may determine a sample 640 located in the middle of a current coding unit 600 as a sample from which certain information may be acquired, and may place a certain restriction in a process of decoding a coding unit 620b including such a sample 640. However, the position of the sample from which certain information may be acquired is not limited to the above position, but may be a sample at any position included in the coding unit 620b determined to place the restriction.
[0105] According to an embodiment, the position of the sample from which the predetermined information can be obtained is also determined according to the shape of the current coding unit 600. According to an embodiment, the block shape information may determine whether the shape of the current coding unit is square or non-square, and may determine the position of the sample from which the predetermined information can be obtained according to the shape. For example, the video decoding apparatus 100 may determine, using at least one of information related to the width and information related to the height of the current coding unit, a sample located on a boundary that divides at least one of the width and height of the current coding unit in half as a sample from which the predetermined information can be obtained. In yet another example, when the block shape information related to the current coding unit indicates whether the current coding unit is non-square, the video decoding apparatus 100 may determine one of the samples adjacent to a boundary that divides the long side of the current coding unit in half as a sample from which the predetermined information can be obtained.
[0106] When a current coding unit is divided into a plurality of coding units, the video decoding apparatus 100 according to an embodiment may use partition mode information to determine a coding unit at a predetermined position among the plurality of coding units. The video decoding apparatus 100 according to an embodiment may acquire partition mode information from a sample at a predetermined position included in the coding unit, and may divide a plurality of coding units generated by dividing the current coding unit using partition mode information acquired from a sample at a predetermined position included in each of the plurality of coding units. That is, the coding units are also recursively divided using partition mode information acquired from a sample at a predetermined position included in each of the coding units. The recursive division process of the coding unit has been described in detail with reference to FIG. 5, and therefore a detailed description thereof will be omitted.
[0107] A video decoding device 100 according to one embodiment can divide a current coding unit and determine at least one coding unit, and can determine the order in which such at least one coding unit is decoded by a predetermined block (e.g., the current coding unit).
[0108] FIG. 7 illustrates an order in which a plurality of coding units are processed when the video decoding apparatus 100 divides a current coding unit and determines the plurality of coding units, according to an embodiment.
[0109] According to one embodiment, the video decoding device 100 may, based on the partition mode information, partition the first coding unit 700 vertically to determine the second coding units 710a and 710b, partition the first coding unit 700 horizontally to determine the second coding units 730a and 730b, or partition the first coding unit 700 vertically and horizontally to determine the second coding units 750a, 750b, 750c, and 750d.
[0110] 7, the video decoding device 100 may determine the order such that the second coding units 710a and 710b determined by dividing the first coding unit 700 in the vertical direction are processed in the horizontal direction (710c). The video decoding device 100 may determine the processing order of the second coding units 730a and 730b determined by dividing the first coding unit 700 in the horizontal direction as the vertical direction (730c). The video decoding device 100 may determine the second coding units 750a, 750b, 750c, and 750d determined by dividing the first coding unit 700 in the vertical and horizontal directions according to a predetermined order (e.g., raster scan order or z scan order (750e), etc.) in which the coding units located in one row are processed and then the coding units located in the next row are processed.
[0111] According to an embodiment, the video decoding apparatus 100 may recursively divide the coding units. Referring to FIG. 7, the video decoding apparatus 100 may divide the first coding unit 700 to determine a plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d, and may recursively divide each of the determined coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. A method of dividing the plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d corresponds to a method of dividing the first coding unit 700. Accordingly, the plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d are also divided into a plurality of coding units independently. Referring to FIG 7, the video decoding device 100 may divide the first coding unit 700 in the vertical direction to determine the second coding units 710a and 710b, and may further determine whether or not to divide each of the second coding units 710a and 710b independently.
[0112] According to an embodiment, the video decoding apparatus 100 may divide the second coding unit 710a on the left side in the horizontal direction into third coding units 720a and 720b, and may not divide the second coding unit 710b on the right side.
[0113] According to an embodiment, the processing order of the coding units is also determined based on the division process of the coding units. In other words, the processing order of the divided coding units is also determined based on the processing order of the coding units immediately before the division. The video decoding device 100 may determine the processing order of the third coding units 720a and 720b determined by dividing the second coding unit 710a on the left side, independently of the second coding unit 710b on the right side. Since the second coding unit 710a on the left side is divided horizontally and the third coding units 720a and 720b are determined, the third coding units 720a and 720b are processed vertically (720c). In addition, since the order in which the second coding unit 710a on the left side and the second coding unit 710b on the right side are processed corresponds to the horizontal direction (710c), the third coding units 720a and 720b included in the second coding unit 710a on the left side may be processed in the vertical direction (720c) before the right coding unit 710b is processed. The above content is intended to explain a process in which the processing order of the coding units is determined based on the coding units before division, and should not be construed as being limited to the above embodiment, but should be construed as being used in various methods in which coding units determined by being divided in various forms are independently processed in a predetermined order.
[0114] FIG. 8 illustrates a process in which a video decoding apparatus 100 determines to divide a current coding unit into an odd number of coding units when a predetermined ordered coding unit is not processed, according to an embodiment.
[0115] The video decoding apparatus 100 according to an embodiment may determine that the current coding unit is divided into an odd number of coding units based on the acquired division mode information. Referring to FIG. 8, a square-shaped first coding unit 800 is divided into non-square-shaped second coding units 810a and 810b, and the second coding units 810a and 810b are also independently divided into third coding units 820a, 820b, 820c, 820d, and 820e. The video decoding apparatus 100 according to an embodiment may divide the left coding unit 810a of the second coding unit in the horizontal direction to determine a plurality of third coding units 820a and 820b, and may divide the right coding unit 810b into an odd number of third coding units 820c, 820d, and 820e.
[0116] According to an embodiment, the video decoding apparatus 100 may determine whether the third coding units 820a, 820b, 820c, 820d, and 820e can be processed in a predetermined order, and may determine whether there is an odd number of coding units. Referring to FIG. 8, the video decoding apparatus 100 may recursively divide the first coding unit 800 to determine the third coding units 820a, 820b, 820c, 820d, and 820e. The video decoding apparatus 100 may determine whether the first coding unit 800, the second coding unit 810a, 810b, or the third coding units 820a, 820b, 820c, 820d, and 820e are divided into an odd number of coding units in the division type based on at least one of the block type information and the division type mode information. For example, the coding unit located on the right side of the second coding units 810a and 810b is also divided into an odd number of third coding units 820c, 820d, and 820e. The order in which the coding units included in the first coding unit 800 are processed may be a predetermined order (e.g., z-scan order (830)), and the video decoding device 100 may 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 satisfy a condition for processing in the predetermined order.
[0117] According to an embodiment, the video decoding apparatus 100 may determine whether the third coding units 820a, 820b, 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition that they can be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the second coding units 810a and 810b is divided in half along the boundary between the third coding units 820a, 820b, 820c, 820d, and 820e. For example, the third coding units 820a and 820b determined by dividing the height of the non-square left second coding unit 810a in half may satisfy the condition. It is also determined that the third coding units 820c, 820d, and 820e, which are determined by dividing the right second coding unit 810b into three coding units, do not satisfy the condition because the boundary of the third coding units 820c, 820d, and 820e does not divide the width or height of the right second coding unit 810b in half. If such a condition is not satisfied, the video decoding device 100 may determine that the scanning order is broken, and may determine that the right second coding unit 810b is divided into an odd number of coding units based on the determination result. When the coding units are divided into an odd number of coding units, the video decoding device 100 according to an embodiment may impose a certain restriction on a coding unit at a predetermined position among the divided coding units. The content of such a restriction or the predetermined position has been described in detail through various embodiments, and therefore a detailed description thereof will be omitted.
[0118] FIG. 9 illustrates a process in which a video decoding apparatus 100 divides a first coding unit 900 to determine at least one coding unit, according to an embodiment.
[0119] The video decoding apparatus 100 according to an embodiment may divide the first coding unit 900 based on the division mode information acquired via the bitstream acquiring unit 110. The square-shaped first coding unit 900 may be divided into four square-shaped coding units or into a plurality of non-square-shaped coding units. For example, referring to FIG. 9, when the first coding unit 900 is a square and the division mode information indicates that the first coding unit 900 is to be divided into non-square coding units, the video decoding apparatus 100 may divide the first coding unit 900 into a plurality of non-square coding units. Specifically, when the division mode information indicates that the first coding unit 900 is to be divided horizontally or vertically to determine an odd number of coding units, the video decoding device 100 can divide the square-shaped first coding unit 900 into second coding units 910a, 910b, and 910c determined by dividing the first coding unit 900 vertically as an odd number of coding units, or into second coding units 920a, 920b, and 920c determined by dividing the first coding unit 900 horizontally.
[0120] According to an embodiment, the video 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 that they can be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the first coding unit 900 is divided in half along the boundaries of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Referring to FIG. 9, the boundaries of the second coding units 910a, 910b, and 910c determined by dividing the square-shaped first coding unit 900 in the vertical direction do not divide the width of the first coding unit 900 in half, so it is also determined that the first coding unit 900 does not satisfy the condition that they can be processed in a predetermined order. In addition, since the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in the horizontal direction do not divide the width of the first coding unit 900 in half, it is also determined that the first coding unit 900 does not satisfy the condition that it can be processed according to a predetermined order. If such a condition is not satisfied, the video decoding device 100 may determine that the scanning order is broken, and may determine that the first coding unit 900 is divided into an odd number of coding units based on the determination result. When the coding unit is divided into an odd number of coding units, the video decoding device 100 according to an embodiment may impose a predetermined restriction on a coding unit at a predetermined position among the divided coding units, and the content of such a restriction or the predetermined position has been described through various embodiments, and detailed description thereof will be omitted.
[0121] According to an embodiment, the video decoding apparatus 100 may divide the first coding unit and determine various types of coding units.
[0122] 9, the video decoding apparatus 100 may divide a square-shaped first coding unit 900, a non-square-shaped first coding unit 930, or a non-square-shaped first coding unit 950 into various types of coding units.
[0123] FIG. 10 illustrates that, in one embodiment, a video decoding device 100 restricts the manner in which the second coding unit may be divided when a non-square second coding unit determined by dividing a first coding unit 1000 satisfies certain conditions.
[0124] The video decoding apparatus 100 according to an embodiment may determine to divide the square-shaped first coding unit 1000 into non-square-shaped second coding units 1010a, 1010b, 1020a, and 1020b based on the division mode information acquired via the bitstream acquiring unit 110. The second coding units 1010a, 1010b, 1020a, and 1020b may be divided independently. Thus, the video decoding apparatus 100 may determine whether to divide the second coding units into a plurality of coding units or not to divide the coding units based on the division mode information related to each of the second coding units 1010a, 1010b, 1020a, and 1020b. The video decoding apparatus 100 according to an embodiment may determine the third coding units 1012a and 1012b by dividing the left non-square-shaped second coding unit 1010a, which is determined by dividing the first coding unit 1000 vertically, horizontally. However, when the video decoding device 100 divides the left second coding unit 1010a in the horizontal direction, the right second coding unit 1010b may be restricted so that it is not divided in the same horizontal direction as the left second coding unit 1010a. If the right second coding unit 1010b is divided in the same direction and the third coding units 1014a and 1014b are determined, the left second coding unit 1010a and the right second coding unit 1010b are divided independently in the horizontal direction, and the third coding units 1012a, 1012b, 1014a, and 1014b are determined. However, this is the same result as when the video decoding device 100 divides the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the division mode information, which is inefficient in terms of video decoding.
[0125] According to an embodiment, the video decoding device 100 may vertically divide the non-square second coding unit 1020a or 1020b, which is determined by dividing the first coding unit 1000 in the horizontal direction, to determine the third coding units 1022a, 1022b, 1024a, and 1024b. However, when the video decoding device 100 divides one of the second coding units (e.g., the top second coding unit 1020a) in the vertical direction, the video decoding device 100 may restrict the other second coding units (e.g., the bottom coding unit 1020b) from being divided vertically in the same direction as the top second coding unit 1020a, for the above-mentioned reasons.
[0126] FIG. 11 illustrates a process in which the video decoding apparatus 100 divides a square coding unit when the division mode information does not indicate division into four square coding units, according to an embodiment.
[0127] According to an embodiment, the video decoding device 100 may divide the first coding unit 1100 into second coding units 1110a, 1110b, 1120a, and 1120b based on the division mode information. The division mode information may include information related to various types into which the coding unit may be divided, but the information related to the various types may not include information for dividing the coding unit into four square coding units. According to such division mode information, the video decoding device 100 may not divide the square-shaped first coding unit 1100 into four square-shaped second coding units 1130a, 1130b, 1130c, and 1130d. Based on the division mode information, the video decoding device 100 may determine the non-square-shaped second coding units 1110a, 1110b, 1120a, and 1120b.
[0128] According to an embodiment, the video decoding apparatus 100 may independently divide the non-square second coding units 1110a, 1110b, 1120a, and 1120b. Through a recursive method, the second coding units 1110a, 1110b, 1120a, and 1120b are divided in a predetermined order, which is also a division method corresponding to the method of dividing the first coding unit 1100 based on the division mode information.
[0129] For example, the video decoding device 100 may divide the left second coding unit 1110a in the horizontal direction to determine square third coding units 1112a and 1112b, and may divide the right second coding unit 1110b in the horizontal direction to determine square third coding units 1114a and 1114b. Furthermore, the video decoding device 100 may divide both the left second coding unit 1110a and the right second coding unit 1110b in the horizontal direction to determine square third coding units 1116a, 1116b, 1116c, and 1116d. In this case, the coding units are determined in the same form as when the first coding unit 1100 is divided into four square second coding units 1130a, 1130b, 1130c, and 1130d.
[0130] As another example, the video decoding device 100 may vertically divide the top second coding unit 1120a to determine square third coding units 1122a and 1122b, and may vertically divide the bottom second coding unit 1120b to determine square third coding units 1124a and 1124b. Furthermore, the video decoding device 100 may vertically divide both the top second coding unit 1120a and the bottom second coding unit 1120b to determine square third coding units 1126a, 1126b, 1126a, and 1126b. In this case, the coding units are determined in the same form as when the first coding unit 1100 is divided into four square second coding units 1130a, 1130b, 1130c, and 1130d.
[0131] FIG. 12 illustrates how a processing order between multiple coding units may differ depending on a division process of the coding units, according to an embodiment.
[0132] According to an embodiment, the video decoding apparatus 100 may divide the first coding unit 1200 based on the partition mode information. When the block shape is a square and the partition mode information indicates that the first coding unit 1200 is partitioned in at least one of the horizontal and vertical directions, the video decoding apparatus 100 may divide the first coding unit 1200 to determine, for example, second coding units 1210a, 1210b, 1220a, and 1220b. Referring to FIG. 12, the non-square second coding units 1210a, 1210b, 1220a, and 1220b determined by partitioning the first coding unit 1200 only in the horizontal or vertical direction may be independently divided based on the partition mode information associated therewith. For example, the video decoding apparatus 100 may determine 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 vertically, and may determine 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 horizontally. The division process of the second coding units 1210a, 1210b, 1220a, and 1220b has been described in detail with reference to FIG. 11, and therefore will not be described in detail again.
[0133] The video decoding device 100 according to an embodiment may process the coding units in a predetermined order. The characteristics related to the processing of the coding units in a predetermined order have been described in detail with reference to FIG. 7, and therefore detailed description thereof will be omitted. Referring to FIG. 12, the video decoding device 100 may divide the square-shaped first coding unit 1200 to determine four square-shaped third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d. The video decoding device 100 according to an embodiment may determine the processing order of the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d according to the manner in which the first coding unit 1200 is divided.
[0134] According to one embodiment, the video decoding device 100 can horizontally divide the second coding units 1210a and 1210b, which have been generated by dividing them vertically, to determine the third coding units 1216a, 1216b, 1216c, and 1216d. The video decoding device 100 can process the third coding units 1216a, 1216b, 1216c, and 1216d in an order (1217) of first vertically processing the third coding units 1216a and 1216c included in the left second coding unit 1210a, and then vertically processing the third coding units 1216b and 1216d included in the right second coding unit 1210b.
[0135] According to one embodiment, the video decoding device 100 can vertically divide the second coding units 1220a and 1220b generated by dividing them horizontally to determine the third coding units 1226a, 1226b, 1226c, and 1226d, and the video decoding device 100 can process the third coding units 1226a, 1226b, 1226c, and 1226d in an order (1227) of first horizontally processing the third coding units 1226a and 1226b included in the upper second coding unit 1220a, and then horizontally processing the third coding units 1226c and 1226d included in the lower second coding unit 1220b.
[0136] 12, the second coding units 1210a, 1210b, 1220a, and 1220b are divided to determine square-shaped third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d. The second coding units 1210a and 1210b determined by dividing in the vertical direction and the second coding units 1220a and 1220b determined by dividing in the horizontal direction are divided in different shapes, but the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d determined later are coding units of the same shape, resulting in the division of the first coding unit 1200. As a result, the video decoding device 100 recursively divides the coding units through different processes based on the division type mode information, so that even if coding units of the same type are determined as a result, multiple coding units determined to be of the same type can be processed in different orders from each other.
[0137] FIG. 13 illustrates a process of determining the depth of a coding unit according to one embodiment, when a coding unit is recursively divided to determine multiple coding units, as the shape and size of the coding unit change.
[0138] According to an embodiment, the video decoding apparatus 100 may determine the depth of a coding unit according to a predetermined criterion. For example, the predetermined criterion may be the long side length of the coding unit. When the long side length of the current coding unit is divided to be 2n (n>0) times the long side length of the coding unit before division, the video decoding apparatus 100 may determine that the depth of the current coding unit is increased by n depths from the depth of the coding unit before division. Hereinafter, the coding unit with the increased depth will be referred to as a coding unit of a lower depth.
[0139] 13, according to an embodiment, the video decoding apparatus 100 may divide the square-shaped first coding unit 1300 based on block shape information indicating whether the block shape is a square (e.g., the block shape information may indicate "0: SQUARE"), and determine the second coding unit 1302, the third coding unit 1304, etc., of a lower depth. If the size of the square-shaped first coding unit 1300 is 2Nx2N, the second coding unit 1302 determined by dividing the width and height of the first coding unit 1300 by 1 / 2 may have a size of NxN. Furthermore, the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 by 1 / 2 may have a size of N / 2xN / 2. In this case, the width and height of the third coding unit 1304 correspond to 1 / 4 times that of the first coding unit 1300. If the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302, which is 1 / 2 the width and height of the first coding unit 1300, is also (D+1), and the depth of the third coding unit 1304, which is 1 / 4 the width and height of the first coding unit 1300, is also (D+2).
[0140] According to one embodiment, based on block shape information indicating a non-square shape (for example, the block shape information may indicate "1: NS_VER" indicating whether the block is a non-square shape in which the height is greater than the width, or "2: NS_HOR" indicating whether the block is a non-square shape in which the width is greater than the height), the video decoding device 100 may divide the first coding unit 1310 or 1320, which is non-square, and determine a second coding unit 1312 or 1322, a third coding unit 1314 or 1324, etc., of a lower depth.
[0141] The video decoding device 100 may divide at least one of the width and height of the first coding unit 1310 having a size of Nx2N to determine, for example, the second coding units 1302, 1312, and 1322. That is, the video decoding device 100 may divide the first coding unit 1310 in the horizontal direction to determine the second coding unit 1302 having a size of NxN or the second coding unit 1322 having a size of NxN / 2, or may divide the first coding unit 1310 in the horizontal and vertical directions to determine the second coding unit 1312 having a size of N / 2xN.
[0142] The video decoding device 100 according to an embodiment may divide at least one of the width and height of the first coding unit 1320 having a size of 2NxN to determine, for example, the second coding units 1302, 1312, and 1322. That is, the video decoding device 100 may divide the first coding unit 1320 vertically to determine the second coding unit 1302 having a size of NxN or the second coding unit 1312 having a size of N / 2xN, and may divide the first coding unit 1320 horizontally and vertically to determine the second coding unit 1322 having a size of NxN / 2.
[0143] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the second coding unit 1302 having a size of NxN, to determine, for example, the third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1302 in the vertical and horizontal directions to determine the third coding unit 1304 having a size of N / 2xN / 2, the third coding unit 1314 having a size of N / 4xN / 2, or the third coding unit 1324 having a size of N / 2xN / 4.
[0144] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the second coding unit 1312 having a size of N / 2xN to determine, for example, the third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1312 in the horizontal direction to determine the third coding unit 1304 having a size of N / 2xN / 2 or the third coding unit 1324 having a size of N / 2xN / 4, or may divide the second coding unit 1312 in the vertical and horizontal directions to determine the third coding unit 1314 having a size of N / 4xN / 2.
[0145] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the second coding unit 1322 having a size of NxN / 2 to determine, for example, the third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1322 vertically to determine the third coding unit 1304 having a size of N / 2xN / 2 or the third coding unit 1314 having a size of N / 4xN / 2, or may divide the second coding unit 1322 vertically and horizontally to determine the third coding unit 1324 having a size of N / 2xN / 4.
[0146] The video decoding apparatus 100 according to an embodiment may divide, for example, square-shaped coding units 1300, 1302, and 1304 in the horizontal or vertical direction. For example, the first coding unit 1300 having a size of 2Nx2N may be divided vertically to determine a first coding unit 1310 having a size of Nx2N, or may be divided horizontally to determine a first coding unit 1320 having a size of 2NxN. According to an embodiment, when the depth is determined based on the longest side length of the coding unit, the depth of the coding unit determined by dividing the first coding unit 1300 having a size of 2Nx2N in the horizontal or vertical direction may be the same as the depth of the first coding unit 1300.
[0147] According to an embodiment, the width and height of the third coding unit 1314 or 1324 corresponds to 1 / 4 times that of the first coding unit 1310 or 1320. When the depth of the first coding unit 1310 or 1320 is D, the depth of the second coding unit 1312 or 1322, which is 1 / 2 times the width and height of the first coding unit 1310 or 1320, is also (D+1), and the depth of the third coding unit 1314 or 1324, which is 1 / 4 times the width and height of the first coding unit 1310 or 1320, is also (D+2).
[0148] FIG. 14 illustrates a depth determined according to the type and size of a coding unit and an index (PID: part index) for coding unit partitioning according to one embodiment.
[0149] According to an embodiment, the video decoding apparatus 100 may divide the square-shaped first coding unit 1400 to determine various types of second coding units. Referring to FIG 14, the video decoding apparatus 100 may divide the first coding unit 1400 in at least one of the vertical direction and the horizontal direction according to the partition mode information to determine the second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d. That is, the video decoding apparatus 100 may determine the second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d based on the partition mode information related to the first coding unit 1400.
[0150] According to an embodiment, the depths of the second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d determined by the division mode information related to the square-shaped first coding unit 1400 are determined based on the long side length. For example, since the length of one side of the square-shaped first coding unit 1400 is the same as the long side length of the non-square-shaped second coding units 1402a, 1402b, 1404a, and 1404b, the depths of the first coding unit 1400 and the non-square-shaped second coding units 1402a, 1402b, 1404a, and 1404b can be regarded as being the same as D. In contrast, when the video decoding device 100 divides the first coding unit 1400 into four square-shaped second coding units 1406a, 1406b, 1406c, and 1406d based on the division mode information, the length of one side of the square-shaped second coding units 1406a, 1406b, 1406c, and 1406d is half the length of one side of the first coding unit 1400, so the depth of the second coding units 1406a, 1406b, 1406c, and 1406d is also a depth of (D+1), which is one depth lower than the depth D of the first coding unit 1400.
[0151] According to an embodiment, the video decoding apparatus 100 may divide a first coding unit 1410, whose height is greater than its width, horizontally into a plurality of second coding units 1412a, 1412b, 1414a, 1414b, and 1414c according to the division mode information.
[0152] According to an embodiment, the video decoding apparatus 100 may vertically divide a first coding unit 1420 having a width greater than its height into a plurality of second coding units 1422a, 1422b, 1424a, 1424b, and 1424c according to the division mode information.
[0153] According to an embodiment, the second coding units 1412a, 1412b, 1414a, 1414b, and 1414c are determined by the division mode information related to the non-square first coding unit 1410 or 1420. The depths of the second coding units 1422a, 1422b, 1424a, 1424b, and 1424c are determined based on the long side length. For example, the length of one side of the square second coding units 1412a and 1412b is 1 / 2 times the length of one side of the non-square first coding unit 1410 whose height is greater than its width, so the depths of the square second coding units 1412a and 1412b are (D+1), which is one depth lower than the depth D of the non-square first coding unit 1410.
[0154] Furthermore, the video decoding device 100 can divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the division mode 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, the long side length of the non-square second coding units 1414a and 1414c and the side length of the square second coding unit 1414b are 1 / 2 times the side length of the first coding unit 1410, so that the depths of the second coding units 1414a, 1414b, and 1414c are also a depth (D+1) that is one depth lower than D, which is the depth of the first coding unit 1410. The video decoding device 100 may determine the depth of a coding unit associated with a non-square first coding unit 1420 whose width is greater than its height in a manner corresponding to the above-mentioned manner for determining the depth of a coding unit associated with the first coding unit 1410.
[0155] In determining an index (PID) for partitioning a divided coding unit, the video decoding apparatus 100 according to an embodiment may determine an index based on a ratio of sizes between the coding units when the coding units divided into an odd number of coding units are not the same size. Referring to FIG. 14, the coding unit 1414b located in the middle of the coding units 1414a, 1414b, and 1414c divided into an odd number of coding units has the same width as the other coding units 1414a and 1414c, but is twice as high as the other coding units 1414a and 1414c. That is, in this case, the coding unit 1414b located in the middle may include the other coding units 1414a and 1414c. Therefore, if the index (PID) of the coding unit 1414b located in the middle according to the scanning order is 1, the index of the coding unit 1414c located next in the order is 3, which is increased by 2. That is, there is a discontinuity in the index value. According to one embodiment, the video decoding device 100 can determine whether coding units divided into an odd number of parts are not the same size as each other based on whether there is a discontinuity in the index for partitioning between such divided coding units.
[0156] According to an embodiment, the video decoder 100 may determine whether the current coding unit is divided into a specific division type based on the value of an index for distinguishing the plurality of coding units determined by dividing the current coding unit. Referring to FIG. 14, the video decoder 100 may divide a rectangular first coding unit 1410 whose height is greater than its width to determine even coding units 1412a, 1412b or odd coding units 1414a, 1414b, 1414c. The video decoder 100 may use an index (PID) indicating each coding unit to distinguish each of the plurality of coding units. According to an embodiment, the PID may also be obtained from a sample at a predetermined position (e.g., the top left sample) of each coding unit.
[0157] The video decoding apparatus 100 according to an embodiment may determine a coding unit at a predetermined position among the coding units determined by dividing the coding units using an index for dividing the coding units. According to an embodiment, when the division mode information related to the rectangular first coding unit 1410 whose height is greater than its width indicates that the first coding unit 1410 is divided into three coding units, the video decoding apparatus 100 may divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The video decoding apparatus 100 may assign an index related to each of the three coding units 1414a, 1414b, and 1414c. The video decoding apparatus 100 may compare the indexes related to each coding unit to determine a middle coding unit among the odd number of coding units. The video decoding apparatus 100 may determine the coding unit 1414b having an index corresponding to a middle value among the indexes based on the indexes of the coding units as a coding unit at a middle position among the coding units determined by dividing the first coding unit 1410. In determining an index for partitioning the divided coding units, the video decoder 100 according to an embodiment may determine an index based on a size ratio between the coding units when the coding units are not the same size. Referring to FIG. 14, a coding unit 1414b generated by dividing a first coding unit 1410 has the same width as other coding units 1414a and 1414c, but is twice as high as other coding units 1414a and 1414c, which have different heights. In this case, if the index (PID) of the coding unit 1414b located in the middle is 1, the index of the coding unit 1414c located next to it is 3, which is increased by 2.In such a case, when the indexes increase uniformly but the increments are different, the video decoding device 100 may determine that the current coding unit is divided into a plurality of coding units including a coding unit having a different size from the other coding units. According to an embodiment, when the division mode information indicates that the current coding unit is divided into an odd number of coding units, the video decoding device 100 may divide the current coding unit into a form in which a coding unit at a predetermined position (e.g., a middle coding unit) among the odd number of coding units has a different size from the other coding units. In this case, the video decoding device 100 may determine the middle coding unit having a different size using an index (PID) related to the coding unit. However, the above index and the size or position of the coding unit at the predetermined position to be determined are specified for describing an embodiment, and should not be construed as being limited thereto, and various indexes, positions and sizes of coding units may be used.
[0158] The video decoding apparatus 100 according to an embodiment may use a predetermined data unit from which recursive division of a coding unit begins.
[0159] FIG. 15 illustrates a number of coding units being determined according to a number of predefined data units included in a picture, according to one embodiment.
[0160] According to an embodiment, the predetermined data unit is also defined as a data unit into which the coding unit starts to be recursively divided using the division mode information. That is, the predetermined data unit corresponds to a coding unit of the highest depth used in the process of determining a plurality of coding units into which the current picture is divided. Hereinafter, for convenience of explanation, such a predetermined data unit is referred to as a reference data unit.
[0161] According to an embodiment, the reference data unit may have a predetermined size and shape. According to an embodiment, the reference coding unit may include MxN samples, where M and N may be the same as each other or may be integers expressed by a power of 2. That is, the reference data unit may have a square or non-square shape, and is subsequently divided into an integer number of coding units.
[0162] The video decoding apparatus 100 according to an embodiment may divide a current picture into a plurality of reference data units. The video decoding apparatus 100 according to an embodiment may divide a plurality of reference data units into which the current picture is divided, using partition mode information associated with each of the reference data units. The division process of the reference data units corresponds to a division process using a quad-tree structure.
[0163] According to an embodiment, the video decoding apparatus 100 may determine in advance a minimum size that a reference data unit included in a current picture may have, and may determine various sizes of reference data units that are equal to or larger than the minimum size, and may determine at least one coding unit using partition mode information based on the determined reference data unit.
[0164] 15, the video decoding apparatus 100 may use a square-shaped reference coding unit 1500 or a non-square-shaped reference coding unit 1502. According to an embodiment, the shape and size of the reference coding unit may be determined according to various data units (e.g., a sequence, a picture, a slice, a slice segment, a maximum coding unit, etc.) including at least one reference coding unit.
[0165] The bitstream acquiring unit 110 of the video decoding apparatus 100 according to an embodiment may acquire at least one of information related to the type of the base coding unit and information related to the size of the base coding unit from the bitstream for each of the various data units. The process of determining at least one coding unit included in the square-shaped base coding unit 1500 has been described in detail through the process of dividing the current coding unit 300 in Fig. 3, and the process of determining at least one coding unit included in the non-square-shaped base coding unit 1502 has been described in detail through the process of dividing the current coding unit 400 or 450 in Fig. 4, so detailed description thereof will be omitted.
[0166] The video decoding apparatus 100 according to an embodiment may use an index for identifying the size and type of the reference coding unit in order to determine the size and type of the reference coding unit according to a certain data unit that is predetermined based on a predetermined condition. That is, the bitstream acquiring unit 110 may acquire only an index for identifying the size and type of the reference coding unit for each slice, slice segment, maximum coding unit, etc. as a data unit that satisfies a predetermined condition (e.g., a data unit having a size equal to or smaller than a slice) among the various data units (e.g., a sequence, a picture, a slice, a slice segment, a maximum coding unit, etc.) from the bitstream. The video decoding apparatus 100 may determine the size and type of the reference data unit for each data unit that satisfies the predetermined condition by using the index. If information related to the type of the reference coding unit and information related to the size of the reference coding unit are acquired from the bitstream for each data unit of a relatively small size and used, the bitstream may not be used efficiently. Therefore, instead of directly acquiring information related to the type of the reference coding unit and information related to the size of the reference coding unit, only the index may be acquired and used. In this case, at least one of the sizes and types of the reference coding units corresponding to the index indicating the size and type of the reference coding unit is also predefined. That is, the video decoding apparatus 100 may determine at least one of the sizes and types of the reference coding units included in the data unit serving as a reference for obtaining the index by selecting at least one of the sizes and types of the predefined reference coding units according to the index.
[0167] The video decoding apparatus 100 according to an embodiment may use at least one reference coding unit included in one maximum coding unit. That is, the maximum coding unit for dividing a video includes at least one reference coding unit, and coding units are determined through a recursive division process of each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit corresponds to at least one integer multiple of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit is also a size obtained by dividing the maximum coding unit n times according to a quad tree structure. That is, the video decoding apparatus 100 may determine the base coding unit by dividing the maximum coding unit n times according to a quad tree structure, and may divide the base coding unit based on at least one of block configuration information and partition configuration mode information according to various embodiments.
[0168] FIG. 16 illustrates processing blocks that are responsible for determining a determined order of reference coding units included in a picture 1600, according to one embodiment.
[0169] The video decoding apparatus 100 according to an embodiment may determine at least one processing block for dividing a picture. The processing block is a data unit including at least one reference coding unit for dividing a picture, and the at least one reference coding unit included in the processing block may be determined in a specific order. That is, the determination order of the at least one reference coding unit determined in each processing block corresponds to one of various types of orders in which the reference coding unit is determined, and the determination order of the reference coding unit determined in each processing block may differ for each processing block. The determination order of the reference coding unit determined for each processing block may be one of various orders such as raster scan, Z-scan, N-scan, up-right diagonal scan, horizontal scan, and vertical scan, but the order that may be determined is not limited to the scan order.
[0170] According to an embodiment, the video decoding apparatus 100 may obtain information on the size of a processing block and determine a size of at least one processing block included in an image. The video decoding apparatus 100 may obtain information on the size of a processing block from a bitstream and determine a size of at least one processing block included in an image. The size of such a processing block is also a predetermined size of a data unit indicated by the information on the size of the processing block.
[0171] The bitstream acquisition unit 110 of the video decoding device 100 according to an embodiment may acquire information on the size of a processing block from a bitstream for each specific data unit. For example, the information on the size of a processing block is a data unit such as an image, a sequence, a picture, a slice, or a slice segment, and is also acquired from the bitstream. That is, the bitstream acquisition unit 110 may acquire information on the size of a processing block from a bitstream for each of the various data units described above, and the video decoding device 100 may determine the size of at least one processing block for dividing a picture using the acquired information on the size of the processing block, and the size of such a processing block may be an integer multiple of a reference coding unit.
[0172] According to an embodiment, the video decoding device 100 may determine the size of the processing blocks 1602 and 1612 included in the picture 1600. For example, the video decoding device 100 may determine the size of the processing blocks based on information related to the size of the processing blocks acquired from a bitstream. Referring to FIG. 16, according to an embodiment, the video decoding device 100 may determine the horizontal size of the processing blocks 1602 and 1612 to be four times the horizontal size of a reference coding unit, and the vertical size of the processing blocks 1602 and 1612 to be four times the vertical size of the reference coding unit. The video decoding device 100 may determine an order in which at least one reference coding unit is determined within at least one processing block.
[0173] According to an embodiment, the video decoding device 100 may determine each of the processing blocks 1602 and 1612 included in the picture 1600 based on the size of the processing block, and may determine a determination order of at least one reference coding unit included in the processing blocks 1602 and 1612. According to an embodiment, the determination of the reference coding unit may include determining a reference coding unit size.
[0174] The video decoding apparatus 100 according to an embodiment may acquire information on a determination order of at least one reference coding unit included in at least one processing block from a bitstream, and may determine an order in which at least one reference coding unit is determined based on the acquired information on the determination order. The information on the determination order may also be defined as an order or direction in which a reference coding unit is determined within a processing block. That is, the order in which a reference coding unit is determined may be determined independently for each processing block.
[0175] The video decoding apparatus 100 according to an embodiment may acquire information on a determination order of the reference coding units from a bitstream for each specific data unit. For example, the bitstream acquiring unit 110 may acquire information on a determination order of the reference coding units from a bitstream for each data unit such as an image, a sequence, a picture, a slice, a slice segment, or a processing block. Since the information on the determination order of the reference coding units indicates a determination order of the reference coding units within a processing block, the information on the determination order may be acquired for each specific data unit including an integer number of processing blocks.
[0176] According to an embodiment, the video decoding device 100 may determine at least one reference coding unit based on the determined order.
[0177] According to an embodiment, the bitstream acquiring unit 110 may acquire information related to a reference coding unit determination order as information related to the processing blocks 1602 and 1612 from the bitstream, and the video decoding apparatus 100 may determine an order for determining at least one reference coding unit included in the processing blocks 1602 and 1612, and may determine at least one reference coding unit included in the picture 1600 according to the determination order of the coding units. Referring to FIG. 16, the video decoding apparatus 100 may determine a determination order (1604, 1614) of at least one reference coding unit associated with each of the processing blocks 1602 and 1612. For example, when information related to the determination order of the reference coding units is acquired for each processing block, the determination order of the reference coding units associated with each of the processing blocks 1602 and 1612 may differ for each processing block. When the reference coding unit determination order (1604) associated with a processing block (1602) is the raster scan order, the reference coding units included in the processing block 1602 are also determined in the raster scan order. On the other hand, when the reference coding unit determination order (1614) associated with another processing block 1612 is the reverse of the raster scan order, the reference coding units included in the processing block 1612 are also determined in the reverse of the raster scan order.
[0178] According to an embodiment, the video decoding apparatus 100 may decode at least one reference coding unit determined. The video decoding apparatus 100 may decode video based on the reference coding unit determined through the above-described embodiment. The method of decoding the reference coding unit may include various methods of decoding video.
[0179] The video decoding apparatus 100 according to an embodiment may acquire and use block type information indicating a type of a current coding unit or partition type mode information indicating a method of dividing the current coding unit from a bitstream. The partition type mode information is included in a bitstream associated with various data units. For example, the video decoding apparatus 100 may use partition type mode information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, or a slice segment header. Furthermore, the video decoding apparatus 100 may acquire and use a syntax element corresponding to block type information or partition type mode information from the bitstream for each of a maximum coding unit, a reference coding unit, and a processing block.
[0180] A method for determining a division rule according to an embodiment of the present disclosure will now be described in detail.
[0181] The video decoding device 100 may determine a video partitioning rule. The partitioning rule may also be preset between the video decoding device 100 and the video encoding device 200. The video decoding device 100 may determine the video partitioning rule based on information acquired from a bitstream. The video decoding device 100 may determine the partitioning rule based on information acquired from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. The video decoding device 100 may determine the partitioning rule differently depending on a frame, a slice, a temporal layer, a maximum coding unit, or a coding unit.
[0182] The video decoding device 100 may determine the partition rule based on the block type of the coding unit. The block type may include the size, shape, width and height ratio, and direction of the coding unit. The video encoding device 200 and the video decoding device 100 may pre-determine to determine the partition rule based on the block type of the coding unit. However, the present invention is not limited thereto. The video decoding device 100 may determine the partition rule based on information acquired from a bitstream received from the video encoding device 200.
[0183] The shape of the coding unit may include a square and a non-square. If the width and height of the coding unit are the same, the video decoding device 100 may determine the shape of the coding unit to be a square. If the width and height of the coding unit are not the same, the video decoding device 100 may determine the shape of the coding unit to be a non-square.
[0184] The size of the coding unit may include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ..., 256x256. The size of the coding unit may be classified according to the long side length, the short side length, or the width of the coding unit. The video decoding device 100 may apply the same division rule to the coding units classified into the same group. For example, the video decoding device 100 may classify the coding units having the same long side length into the same size. In addition, the video decoding device 100 may apply the same division rule to the coding units having the same long side length.
[0185] The ratio of the width and height of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, 1:32, etc. 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 of the coding unit is greater than the height. The vertical direction may indicate a case where the width of the coding unit is smaller than the height.
[0186] The video decoding apparatus 100 may adaptively determine a partitioning rule based on the size of the coding unit. The video decoding apparatus 100 may determine an allowable partitioning mode differently based on the size of the coding unit. For example, the video decoding apparatus 100 may determine whether partitioning is allowed based on the size of the coding unit. The video decoding apparatus 100 may determine a partitioning direction according to the size of the coding unit. The video decoding apparatus 100 may determine an allowable partitioning type according to the size of the coding unit.
[0187] Determining the partitioning rule based on the size of the coding unit is also a default partitioning rule between the video encoding device 200 and the video decoding device 100. In addition, the video decoding device 100 can determine the partitioning rule based on information obtained from the bitstream.
[0188] The video decoding device 100 can adaptively determine the partitioning rule based on the position of the coding unit. The video decoding device 100 can adaptively determine the partitioning rule based on the position that the coding unit occupies in the video.
[0189] In addition, the video decoding apparatus 100 may determine a partition rule such that the coding units generated in different partition paths do not have the same block type. However, the present invention is not limited thereto, and the coding units generated in different partition paths may have the same block type. The coding units generated in different partition paths may have different decoding process orders. The decoding process order has been described with reference to FIG. 12, and therefore will not be described in detail.
[0190] FIG. 17 illustrates coding units that may be determined for each picture when the combinations of ways in which the coding units may be divided vary from picture to picture, according to an embodiment.
[0191] Referring to FIG. 17, the video decoding apparatus 100 may determine a different combination of partition forms into which the coding units may be divided for each picture. For example, the video decoding apparatus 100 may decode a video using a picture 1700 that is divided into four coding units, a picture 1710 that is divided into two or four coding units, and a picture 1720 that is divided into two, three, or four coding units, among at least one picture included in the video. The video decoding apparatus 100 may use only the partition form information indicating that the picture 1700 is divided into four square coding units to divide the picture 1700 into a plurality of coding units. The video decoding apparatus 100 may use only the partition form information indicating that the picture 1710 is divided into two or four coding units to divide the picture 1710. The video decoding apparatus 100 may use only the partition form information indicating that the picture 1720 is divided into two, three, or four coding units to divide the picture 1720. The above-mentioned combinations of partition forms are merely embodiments for explaining the operation of video decoding device 100, and therefore the above-mentioned combinations of partition forms should not be interpreted as being limited to the above-mentioned embodiments, but should be interpreted as various combinations of partition forms being available for each given data unit.
[0192] The bitstream acquisition unit 110 of the video decoding device 100 according to an embodiment may acquire a bitstream including an index indicating a combination of partition type information for each predetermined data unit (e.g., a sequence, a picture, a slice, etc.). For example, the bitstream acquisition unit 110 may acquire an index indicating a combination of partition type information in a sequence parameter set, a picture parameter set, or a slice header. The video decoding device 100 of the video decoding device 100 may determine a combination of partition types into which a coding unit may be divided for each predetermined data unit using the acquired index, and may thereby use a combination of partition types different from each other for each predetermined data unit.
[0193] FIG. 18 illustrates various types of coding units determined based on partition mode information that may be expressed in binary code, according to an embodiment.
[0194] The video decoding apparatus 100 according to an embodiment may divide a coding unit into various types using block type information and partition type mode information acquired via the bitstream acquisition unit 110. The types of the coding unit that may be divided include various types including those described in the above embodiments.
[0195] Referring to FIG. 18, the video decoding device 100 can divide a square-shaped coding unit in at least one of the horizontal and vertical directions based on the division mode information, and can divide a non-square-shaped coding unit in the horizontal or vertical direction.
[0196] In the case where the video decoding apparatus 100 according to an embodiment can divide a square coding unit in the horizontal and vertical directions and divide the coding unit into four square coding units, the division mode information for the square coding unit can indicate four types of division modes. According to an embodiment, the division mode information is also expressed as a two-digit binary code, and a binary code is assigned to each division mode. For example, if the coding unit is not divided, the division mode information is also expressed as (00b), if the coding unit is divided in the horizontal and vertical directions, the division mode information is also expressed as (01)b, if the coding unit is divided in the horizontal direction, the division mode information is also expressed as (10)b, and if the coding unit is divided in the vertical direction, the division mode information is also expressed as (11)b.
[0197] In the case where the video decoding apparatus 100 according to an embodiment divides a non-square coding unit in the horizontal or vertical direction, the type of division form that can be indicated by the division form mode information is also determined depending on the number of coding units into which the coding unit is divided. Referring to FIG. 18, the video decoding apparatus 100 according to an embodiment can divide a non-square coding unit into up to three coding units. The video decoding apparatus 100 can divide a coding unit into two coding units, in which case, the division form mode information can also be expressed as (10)b. The video decoding apparatus 100 can divide a coding unit into three coding units, in which case, the division form mode information can also be expressed as (11)b. The video decoding apparatus 100 can determine not to divide a coding unit, in which case, the division form mode information can also be expressed as (0)b. That is, the video decoding apparatus 100 can use variable length coding (VLC) instead of fixed length coding (FLC) to use a binary code indicating the division form mode information.
[0198] According to an embodiment, referring to FIG. 18, the binary code of the partition mode information indicating that the coding unit is not divided may be expressed as (0)b. If the binary code of the partition mode information indicating that the coding unit is not divided is set to (00b), the binary code of the 2-bit partition mode information must be used even if there is no partition mode information set to (01)b. However, as shown in FIG. 18, when three types of partition forms related to a non-square coding unit are used, the video decoding apparatus 100 can determine that the coding unit is not divided even if it uses the 1-bit binary code (0)b as the partition mode information, and therefore can efficiently use the bitstream. However, the partition form of the non-square coding unit indicated by the partition mode information should not be interpreted as being limited to the three forms shown in FIG. 18, but should be interpreted as being various forms including the above-mentioned embodiment.
[0199] FIG. 19 illustrates another type of coding unit that may be determined based on partition mode information that may be expressed in binary code, according to one embodiment.
[0200] Referring to FIG. 19, the video decoding apparatus 100 may divide a square coding unit in the horizontal or vertical direction and may divide a non-square coding unit in the horizontal or vertical direction based on the partition mode information. That is, the partition mode information may indicate that a square coding unit is to be divided in one direction. In such a case, the binary code of the partition mode information indicating that a square coding unit is not to be divided may also be expressed as (0)b. If the binary code of the partition mode information indicating that a coding unit is not to be divided is set to (00b), the binary code of the 2-bit partition mode information must be used even if there is no partition mode information set to (01)b. However, as shown in FIG. 19, in the case where three types of partition modes related to a square coding unit are used, the video decoding apparatus 100 may determine that the coding unit is not to be divided even if the 1-bit binary code (0)b is used as the partition mode information, and therefore, the bitstream may be used efficiently. However, the division form of the square-shaped coding unit indicated by the division form mode information should not be interpreted as being limited to the three forms shown in FIG. 19, but should be interpreted as being in various forms including the above-mentioned embodiments.
[0201] According to an embodiment, the block configuration information or partition mode information is also represented using a binary code, and such information is also immediately generated in the bitstream. Also, the block configuration information or partition mode information that is also represented by a binary code is not immediately generated in the bitstream, but is also used as a binary code input in CABAC (context adaptive binary arithmetic coding).
[0202] The video decoding apparatus 100 according to an embodiment of the present invention will now be described with respect to a process of acquiring syntax related to block topology information or partition topology mode information through CABAC. A bitstream including a binary code related to the syntax may be acquired through the bitstream acquiring unit 110. The video decoding apparatus 100 may detect a syntax element indicating block topology information or partition topology mode information by debinarizing a bin string included in the acquired bitstream. The video decoding apparatus 100 according to an embodiment of the present invention may obtain a set of binary bin strings corresponding to a syntax element to be decoded, and may decode each bin using probability information. The video decoding apparatus 100 may repeat the process until a bin string formed by the decoded bins is the same as one of the previously obtained bin strings. The video decoding apparatus 100 may determine a syntax element by debinarizing the bin string.
[0203] A video decoding apparatus 100 according to an embodiment may determine a syntax related to a bin string by performing a decoding process of adaptive binary arithmetic coding, and may update a probability model related to the acquired bins through a bitstream acquisition unit 110. Referring to FIG. 18, the bitstream acquisition unit 110 of the video decoding apparatus 100 may acquire a bitstream indicating a binary code indicating partition mode information according to an embodiment. The video decoding apparatus 100 may determine a syntax related to the partition mode information using the acquired binary code having a size of 1 bit or 2 bits. The video decoding apparatus 100 may update a probability related to each bit of the 2-bit binary code in order to determine a syntax related to the partition mode information. That is, the video decoding apparatus 100 may update a probability of having a value of 0 or 1 when decoding a next bin depending on whether a value of a first bin in the 2-bit binary code is a value of 0 or 1.
[0204] According to one embodiment, in the process of determining a syntax, the video decoding device 100 may update the probabilities associated with the bins used in the process of decoding the bins of a bin string associated with the syntax, and the video decoding device 100 may determine that a particular bit in the bin string has the same probability without updating the probability.
[0205] 18, in the process of determining a syntax using a bin string indicating partition mode information related to a non-square coding unit, the video decoding apparatus 100 may determine a syntax related to the partition mode information using one bin having a value of 0 when the non-square coding unit is not partitioned. That is, when the block topology information indicates whether the current coding unit is non-square, the first bin of the bin string related to the partition mode information is 0 when the non-square coding unit is not partitioned, and is 1 when the non-square coding unit is partitioned into two or three coding units. Thus, the probability that the first bin of the bin string of the partition mode information related to the non-square coding unit is 0 is 1 / 3, and the probability that it is 1 is 2 / 3. As described above, since the partition mode information indicating that a non-square coding unit is not partitioned is represented only as a 1-bit bin string having a value of 0, the video decoding device 100 may determine whether the second bin is 0 or 1 only when the first bin of the partition mode information is 1, and may determine the syntax related to the partition mode information. According to an embodiment, when the first bin related to the partition mode information is 1, the video decoding device 100 may decode the bins by considering that the probability that the second bin is 0 or 1 is the same as each other.
[0206] The video decoding apparatus 100 according to an embodiment may use various probabilities associated with each bin in a process of determining bins of a bin string related to the partition mode information. The video decoding apparatus 100 according to an embodiment may determine the probabilities of bins related to the partition mode information differently along the direction of a non-square block. The video decoding apparatus 100 according to an embodiment may determine the probabilities of bins related to the partition mode information differently depending on the width or long side length of a current coding unit. The video decoding apparatus 100 according to an embodiment may determine the probabilities of bins related to the partition mode information differently depending on at least one of the shape and long side length of a current coding unit.
[0207] According to an embodiment, the video decoding apparatus 100 may determine that the probability of bins related to the partition mode information is the same for coding units having a predetermined size or more. For example, based on the long side length of the coding unit, the video decoding apparatus 100 may determine that the probability of bins related to the partition mode information is the same for coding units having a size of 64 samples or more.
[0208] In the video decoding apparatus 100 according to an embodiment, the initial probabilities associated with the bins constituting the bin string of the partition mode information are also determined based on the slice type (eg, I slice, P slice, or B slice, . . . ).
[0209] FIG. 20 is a block diagram of an image encoding system and a video decoding system that perform loop filtering.
[0210] The encoding end 2010 of the video encoding and decoding system 2000 transmits an encoded bitstream of video, and the decoding end 2050 receives and decodes the bitstream to output a restored video. Here, the encoding end 2010 has a similar configuration to the video encoding device 200 described below, and the decoding end 2050 has a similar configuration to the video decoding device 100 described below.
[0211] In the encoding end 2010, the predictive coding unit 2015 outputs a reference image through inter prediction and intra prediction, and the transform and quantization unit 2020 quantizes residual data of the reference image and a current input image into quantized transform coefficients and outputs the quantized transform coefficients. The entropy coding unit 2025 encodes and transforms the quantized transform coefficients and outputs them as a bitstream. The quantized transform coefficients are restored to spatial domain data through the inverse quantization and inverse transform unit 2030, and the restored spatial domain data is output as a restored image through the deblocking filtering unit 2035 and the loop filtering unit 2040. The restored image is also used as a reference image for the next input image through the predictive coding unit 2015.
[0212] In the bitstream received by the decoding end 2050, the coded image data is restored to spatial domain residual data through the entropy decoding unit 2055 and the inverse quantization and inverse transform unit 2060. The reference image and the residual data output from the predictive decoding unit 2075 are combined to form spatial domain image data, and the deblocking filtering unit 2065 and the loop filtering unit 2070 filter the spatial domain image data to output a restored image related to the current original image. The restored image is also used as a reference image related to the next original image by the predictive decoding unit 2075.
[0213] The loop filtering unit 2040 of the encoding terminal 2010 performs loop filtering using filter information input by a user or a system setting. The filter information used by the loop filtering unit 2040 is output to the entropy encoding unit 2010 and transmitted to the decoding terminal 2050 together with the encoded video data. The loop filtering unit 2070 of the decoding terminal 2050 can perform loop filtering based on the filter information input from the decoding terminal 2050.
[0214] The above-described various embodiments have described operations related to a video decoding method performed by the video decoding device 100. Hereinafter, operations of the video encoding device 200 that performs a video encoding method corresponding to a reverse process of the video decoding method will be described through various embodiments.
[0215] FIG. 2 illustrates a block diagram of a video encoding device 200 capable of encoding video based on at least one of block configuration information and partition configuration mode information, according to an embodiment.
[0216] The video encoding device 200 may include an encoding unit 220 and a bitstream generating unit 210. The encoding unit 220 may receive an input image and encode the input image. The encoding unit 220 may encode the input image and obtain at least one syntax element. The syntax element may include at least one of a skip flag, a prediction mode, a motion vector difference, a motion vector prediction method (or index), a transform quantized coefficient, a coded block pattern, a coded block flag, an intra prediction mode, a direct flag, a merge flag, a delta QP, a reference index, a prediction direction, and a transform index. The encoding unit 220 may determine a context model based on block shape information including at least one of a shape, a direction, a width and height ratio, or a size of a coding unit.
[0217] The bitstream generator 210 may generate a bitstream based on the encoded input video. For example, the bitstream generator 210 may generate a bitstream by entropy encoding syntax elements based on a context model. In addition, the video encoding device 200 may transmit the bitstream to the video decoding device 100.
[0218] According to an embodiment, the encoding unit 220 of the video encoding device 200 may determine a shape of the coding unit. For example, the coding unit may have a square or non-square shape, and information indicating such a shape may be included in the block shape information.
[0219] According to an embodiment, the encoding unit 220 may determine what form the coding unit is to be divided into. The encoding unit 220 may determine the form of at least one coding unit included in the coding unit, and the bitstream generating unit 210 may generate a bitstream including division form mode information including information related to the form of the coding unit.
[0220] According to an embodiment, the encoding unit 220 may determine whether the coding unit is split or not split. If the encoding unit 220 determines that the coding unit includes only one coding unit or that the coding unit is not split, the bitstream generation unit 210 may generate a bitstream including split mode information indicating that the coding unit is not split. Alternatively, the encoding unit 220 may split into a plurality of coding units included in the coding unit, and the bitstream generation unit 210 may generate a bitstream including split mode information indicating that the coding unit is split into a plurality of coding units.
[0221] According to an embodiment, the division mode information may include information indicating how many coding units a coding unit is divided into or in which direction the coding unit is divided, For example, the division mode information may indicate division in at least one of the vertical direction and the horizontal direction, or may indicate no division.
[0222] The video encoding apparatus 200 determines information related to a partition mode based on a partition mode of a coding unit. The video encoding apparatus 200 determines a context model based on at least one of a shape, a direction, a ratio of width and height, or a size of the coding unit. Then, the video encoding apparatus 200 generates information related to a partition mode for partitioning the coding unit in a bitstream based on the context model.
[0223] In order to determine a context model, the video encoding apparatus 200 may obtain an array for associating at least one of a shape, a direction, a width-height ratio, or a size of a coding unit with an index related to the context model. The video encoding apparatus 200 may obtain an index related to the context model based on at least one of a shape, a direction, a width-height ratio, or a size of a coding unit from the array. The video encoding apparatus 200 may determine a context model based on the index related to the context model.
[0224] In order to determine the context model, the video encoding apparatus 200 may determine the context model further based on block shape information including at least one of a shape, a direction, a ratio of width and height, or a size of a neighboring coding unit adjacent to the coding unit. In addition, the neighboring coding unit may include at least one of a coding unit located on the lower left, left, upper left, upper, upper right, right, or lower right side of the coding unit.
[0225] Furthermore, the video encoding device 200 may compare a width size of the upper surrounding coding unit with a width size of the coding unit to determine a context model. Furthermore, the video encoding device 200 may compare a height size of the left and right surrounding coding units with a height size of the coding unit. Furthermore, the video encoding device 200 may determine a context model based on a comparison result.
[0226] The operation of the video encoding device 200 includes contents similar to those of the operation of the video decoding device 100 described with reference to FIGS. 3 to 20, and therefore a detailed description thereof will be omitted.
[0227] Hereinafter, a video decoding device 2100 and a video encoding device 3300 according to an embodiment will be described with reference to FIGS.
[0228] FIG. 21 is a block diagram of a video decoding device 2100 according to one embodiment.
[0229] Referring to FIG. 21, a video decoding apparatus 2100 according to an embodiment may include an acquiring unit 2110 and a motion information decoding unit 2130.
[0230] The video decoding device 2100 may obtain a bitstream generated as a result of video encoding, and may decode motion information for inter prediction based on information included in the bitstream.
[0231] The video decoding device 2100 according to an embodiment may include a central processor (not shown) that controls the acquiring unit 2110 and the motion information decoding unit 2130. Alternatively, the acquiring unit 2110 and the motion information decoding unit 2130 may be operated by their own processors (not shown), and the video decoding device 2100 may be operated as a whole by the processors (not shown) operating in an organic manner. Alternatively, the acquiring unit 2110 and the motion information decoding unit 2130 may be controlled under the control of an external processor (not shown) of the video decoding device 2100.
[0232] The video decoding device 2100 may include one or more data storage units (not shown) that store input / output data of the obtaining unit 2110 and the motion information decoding unit 2130. The video decoding device 2100 may include a memory control unit (not shown) that controls data input / output of the data storage units (not shown).
[0233] The video decoder 2100 may perform video decoding operations including prediction by operating in conjunction with an internal video decoding processor or an external video decoding processor to restore an image through video decoding. The internal video decoding processor of the video decoder 2100 according to an embodiment may be implemented by implementing a basic video decoding operation by including a video decoding processing module in a central processing unit or a graphic processing unit, rather than a separate processor.
[0234] The video decoding device 2100 may be included in the above-described video decoding device 100. For example, the acquiring unit 2110 may also be included in the bitstream acquiring unit 110 of the video decoding device 100 illustrated in FIG.
[0235] The acquisition unit 2110 receives a bitstream generated as a result of encoding an image. The bitstream may include information for determining a motion vector used for inter prediction of a current block. The current block is a block generated by dividing an image according to a tree structure, and corresponds to, for example, a maximum coding unit, a coding unit, or a transform unit.
[0236] The acquiring unit 2110 may determine the current block based on block type information and / or information related to a partition type mode included in at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. Furthermore, the acquiring unit 2110 may acquire a syntax element corresponding to block type information or information related to a partition type mode from the bitstream for each maximum coding unit, reference coding unit, and processing block, and use the acquired syntax element to determine the current block.
[0237] The bitstream may include information indicating a prediction mode of the current block, and the prediction mode of the current block may include at least one of an intra mode, an inter mode, a merge mode, a skip mode, and a mode preset according to the present disclosure. The preset modes are also modes for determining at least one primary residual motion vector candidate among primary residual motion vector candidates classified according to a displacement distance and a displacement direction as a primary residual motion vector related to the current block. The primary residual motion vector will be described in detail below.
[0238] In an embodiment, the bitstream may include information indicating at least one of whether a preset mode is applied to the current block, a base motion vector of the current block, a primary residual motion vector of the current block, a priority order of displacement distances for classifying primary residual motion vector candidates, and a priority order of displacement directions for classifying primary residual motion vector candidates. The acquiring unit 2110 may acquire the information included in the bitstream at a level corresponding to at least one unit among a coding unit, a transform unit, a maximum coding unit, a slice unit, and a picture unit.
[0239] The motion information decoder 2130 determines a motion vector of the current block based on information included in the bitstream.
[0240] The motion information decoder 2130 may determine whether a preset mode is applied to a current block based on information included in the bitstream. The information indicating whether a preset mode is applied may include a flag or an index.
[0241] The motion information decoding unit 2130 can obtain information indicating whether the pre-set mode is applied from a unit level bitstream corresponding to the current block and decode the current block according to the pre-set mode, and can also obtain information indicating whether the pre-set mode is applied from a unit level bitstream corresponding to an upper block, slice, or picture and decode a block included in the upper block, slice, or picture according to the pre-set mode.
[0242] In one example, the motion information decoder 2130 may determine whether a preset mode is applied to the current block based on information related to at least one of the current block, the previously decoded block, the current slice, the previously decoded slice, the current picture, and the previously decoded picture. In this case, the motion information decoder 2130 may determine whether a preset mode is applied based on the same criteria as the video encoding device 3300.
[0243] When the preset mode is applied to the current block, the motion information decoding unit 2130 may determine a primary residual motion vector candidate associated with at least one base motion vector candidate, and the primary residual motion vector candidates may be classified according to a displacement distance and a displacement direction.
[0244] In one embodiment, at least one base motion vector candidate of the current block is also determined based on the motion vectors of neighboring blocks that are spatially and temporally related to the current block. The neighboring blocks that are spatially and temporally related to the current block may include blocks that are decoded before the current block. The neighboring blocks that are spatially related to the current block may include, but are not limited to, a block located to the left of the current block and a block located above the current block.
[0245] In addition, the neighboring blocks that are temporally related to the current block may include, for example, blocks that are located at the same location as the current block and blocks that are spatially adjacent to the blocks at the same location among blocks included in a reference picture other than the current picture that contains the current block.
[0246] In an embodiment, the motion information decoding unit 2130 may determine a motion vector of a neighboring block related to the current block as at least one base motion vector candidate. Alternatively, the motion information decoding unit 2130 may change a motion vector of a neighboring block related to the current block to determine at least one base motion vector candidate. Alternatively, the motion information decoding unit 2130 may combine motion vectors of neighboring blocks related to the current block in a predetermined manner to determine at least one base motion vector candidate.
[0247] In one embodiment, the motion information decoder 2130 may determine at least one base motion vector candidate in the same manner as determining a candidate list of motion vector predictors in the merge mode or AMVP mode of HEVC.
[0248] In one embodiment, the motion information decoding unit 2130 may determine a zero motion vector having a component of 0 as a base motion vector candidate.
[0249] If at least one base motion vector candidate is determined, the motion information decoder 2130 may determine a base motion vector of the current block based on information included in the bitstream. The information indicating the base motion vector of the current block may include an index, and the index indicating the base motion vector of the current block may also be obtained from a bitstream corresponding to at least one of a transform unit level, a coding unit level, a maximum coding unit level, a slice level, or a picture level.
[0250] In one embodiment, information indicating the base motion vector of the current block may be coded using a fixed length coding (FLC), unary coding or truncated unary coding method and included in the bitstream.
[0251] In an embodiment, the motion information decoder 2130 may determine a base motion vector of the current block from at least one base motion vector candidate based on information related to at least one of the current block, a previously decoded block, a current slice, a previously decoded slice, a current picture, and a previously decoded picture. In this case, the motion information decoder 2130 may determine a base motion vector in the same manner as the video encoding device 3300.
[0252] Once the base motion vector for the current block is determined, the motion information decoder 2130 may determine a primary residual motion vector for the current block from among at least one primary residual motion vector candidate.
[0253] The primary residual motion vector candidates for the current block can be classified according to the displacement distance and the displacement direction, and the acquisition unit 2110 acquires information indicating at least one of the displacement distance and the displacement direction from the bitstream, and the motion information decoding unit 2130 can determine the primary residual motion vector corresponding to the information indicating at least one of the displacement distance and the displacement direction.
[0254] At least one of the information indicating the displacement distance and the information indicating the displacement direction for identifying the primary residual motion vector of the current block is also obtained from a bitstream at the transformation unit level, the coding unit level, the maximum coding unit level, the slice level or the picture level.
[0255] The information indicating the displacement distance and the displacement direction for identifying the primary residual motion vector of the current block may be coded by a fixed length coding (FLC) method, a unary coding method, or a truncated unary coding method and included in the bitstream. The acquiring unit 2110 may decode at least one of the information indicating the displacement direction, for example, an index indicating the displacement direction, from the bitstream using a context model.
[0256] In an embodiment, the motion information decoder 2130 may determine a primary residual motion vector of the current block from at least one primary residual motion vector candidate based on information related to at least one of the current block, a previously decoded block, a current slice, a previously decoded slice, a current picture, and a previously decoded picture. In this case, the motion information decoder 2130 may determine the primary residual motion vector in the same manner as the video encoding device 3300.
[0257] If the primary residual motion vector of the current block is determined, the motion information decoder 2130 may determine the motion vector of the current block by applying the primary residual motion vector to the base motion vector of the current block. In one example, the motion information decoder 2130 may determine the motion vector of the current block by combining the primary residual motion vector with the base motion vector of the current block.
[0258] When information indicating the secondary residual motion vector is included in the bitstream, the motion information decoding unit 2130 may determine a secondary residual motion vector of the current block based on the information indicating the secondary residual motion vector. The information indicating the secondary residual motion vector may be coded by a method different from the coding method of the information indicating the primary residual motion vector (e.g., fixed length coding, unary coding, or truncated unary coding) and included in the bitstream. As an example, the information indicating the secondary residual motion vector may be coded by an exponential golomb coding method and included in the bitstream. The acquiring unit 2110 may acquire information indicating the secondary residual motion vector from a bitstream at a transform unit level, a coding unit level, a maximum coding unit level, a slice level, or a picture level.
[0259] The motion information decoder 2130 may determine a motion vector of the current block by applying the secondary residual motion vector to a base motion vector changed by applying the primary residual motion vector. In one example, the motion information decoder 2130 may determine a motion vector of the current block by combining a secondary residual motion vector with a base motion vector changed by applying the primary residual motion vector.
[0260] In one embodiment, if the prediction direction of the current block is bi-directional, the secondary residual motion vector is also included in the bitstream for only one uni-direction. For example, information indicating the secondary residual motion vector may be included in the bitstream for only one of the list 0 direction and the list 1 direction.
[0261] If the secondary residual motion vector is included in the bitstream only for the list 0 direction, the motion information decoding unit 2130 may determine the motion vector for the list 0 direction of the current block by applying the secondary residual motion vector for the list 0 direction to the base motion vector for the list 0 direction changed by applying the primary residual motion vector for the list 0 direction. Then, the motion information decoding unit 2130 may determine the motion vector for the list 1 direction of the current block by applying the primary residual motion vector for the list 1 direction to the base motion vector for the list 1 direction, or may determine the motion vector for the list 1 direction of the current block by applying the secondary residual motion vector for the list 0 direction to the result of applying the primary residual motion vector for the list 1 direction to the base motion vector for the list 1 direction.
[0262] Comparing the preset mode according to the present disclosure with the AMVP mode of HEVC, in the AMVP mode, the decoding device determines a predicted motion vector and a residual motion vector, and then combines the two to determine a motion vector of a block. In the preset mode according to the present disclosure, the base motion vector performs a similar function to the predicted motion vector, and the primary residual motion vector performs a similar function to the residual motion vector of the AMVP mode. However, in the preset mode according to the present disclosure, the primary residual motion vector is classified according to a displacement distance and a displacement direction, and is coded by at least one of fixed length coding, unary coding, and truncated unary coding, whereas the residual motion vector of the AMVP mode is coded by an exponential golomb coding method. In addition, the preset mode according to the present disclosure can improve the accuracy of the motion vector of the block by coding / decoding the secondary residual motion vector.
[0263] Hereinafter, a method for determining a primary residual motion vector candidate corresponding to any one of the base motion vector candidates will be described with reference to FIGS.
[0264] 22 to 25 are diagrams showing primary residual motion vector candidates displayed on a coordinate plane.
[0265] 22 to 25, the motion information decoder 2130 may determine candidates located in a predetermined shape in forming the primary residual motion vector candidates. The predetermined shape may be a polygon such as a diamond or a square, or a shape similar to a circle.
[0266] The motion information decoding unit 2130 may determine a candidate at a displacement distance determined at a preset point (e.g., point (0,0)) as a primary residual motion vector candidate. At the preset point, the motion information decoding unit 2130 may determine a primary residual motion vector candidate at a first displacement distance as a first candidate group, a primary residual motion vector candidate at a second displacement distance as a second candidate group, and a primary residual motion vector candidate at an n-th displacement distance as an n-th candidate group. The motion information decoding unit 2130 may determine a primary residual motion vector candidate closest to the preset point as a first candidate group, and a primary residual motion vector candidate next closest to the first candidate group as a second candidate group. That is, as the displacement distance increases, the candidate group numbers are increased in order.
[0267] As the candidate group number increases, the interval of the transition distance may increase in logarithmic intervals or nonlinear intervals, etc. Also, as the candidate group number increases, the transition distance may increase in intervals of an integer N (e.g., N, 2N, 3N, ...). Also, as the candidate group increases, the transition distance is determined so that the difference from the previous transition distance increases uniformly.
[0268] The displacement distance may also be determined according to a user definition, or the motion information decoding unit 2130 may directly determine the displacement distance based on information related to the current block, the temporal layer, the GOP, etc., or may obtain information indicating the displacement distance for determining a primary residual motion vector candidate via a bitstream.
[0269] The motion information decoder 2130 may determine a displacement distance for determining a primary residual motion vector candidate of the current block according to the displacement distance determined at a higher level corresponding to the current block.
[0270] The number of primary residual motion vector candidates may be determined independently for each candidate group. The motion information decoding unit 2130 may determine the number of primary residual motion vector candidates for each candidate group of the current block according to number information determined at a higher level of the level corresponding to the current block.
[0271] 22 and 23 illustrate a case where the number of primary residual motion vector candidates in each candidate group is 4. Also, although FIG. 22 and 23 illustrate a case where the number of candidate groups is 3, the number of candidate groups is not limited to 3.
[0272] 22, the motion information decoder 2130 may determine primary residual motion vector candidates having a diamond shape distribution based on a preset point. The interval between each pixel corresponds to a 1 / 4 pixel distance, and the component values of the vector candidates are scaled 4 times for convenience below. The 1 / 4 pixel distance corresponds to a displacement distance of 1.
[0273] The motion information decoding unit 2130 may determine that the primary residual motion vector candidates ((1,0), (-1,0), (0,1), (0,-1)) located at a 1 / 4 pixel distance from the preset point are a first candidate group.
[0274] The motion information decoding unit 2130 may determine that the primary residual motion vector candidates ((2,0), (-2,0), (0,2), (0,-2)) located at a distance of 1 / 2 pixel from the preset point are a second candidate group.
[0275] The motion information decoding unit 2130 may determine that the primary residual motion vector candidates ((4,0), (-4,0), (0,4), (0,-4)) located at a distance of one pixel from the preset point are a third candidate group.
[0276] Referring to FIG. 23, the motion information decoding unit 2130 may determine primary residual motion vector candidates having a rectangular distribution based on a preset point.
[0277] The motion information decoding unit 2130 may determine that the primary residual motion vector candidates ((1,1), (1,-1), (-1,1), (-1,-1)) located at a distance of approximately 1 / 4 pixel based on the preset point are a first candidate group.
[0278] The motion information decoding unit 2130 may determine the primary residual motion vector candidates ((2,2), (2,-2), (-2,2), (-2,-2)) located at a distance of approximately 1 / 2 pixel based on the preset point as a second candidate group.
[0279] The motion information decoding unit 2130 may determine that the primary residual motion vector candidates ((4,4), (4,-4), (-4,4), (-4,-4)) located at a distance of about one pixel from the preset point are a third candidate group.
[0280] Referring to FIG. 24, the motion information decoder 2130 may determine that the number of primary residual motion vector candidates included in at least one candidate group among multiple candidate groups is different from that of other candidate groups.
[0281] Specifically, the motion information decoding unit 2130 can determine eight primary residual motion vector candidates ((1,0), (-1,0), (0,1), (0,-1), (1,1), (1,-1), (-1,1), (-1,-1)) located approximately 1 / 4 pixel away from the preset point as the first candidate group.
[0282] In addition, the motion information decoding unit 2130 can determine eight primary residual motion vector candidates ((2,0), (-2,0), (0,2), (0,-2), (2,2), (2,-2), (-2,2), (-2,-2)) located approximately 1 / 2 pixel away from the preset point as a second candidate group.
[0283] The motion information decoding unit 2130 may determine four primary residual motion vector candidates ((4,0), (-4,0), (0,4), (0,-4)) located at a distance of about one pixel from the preset point as a third candidate group.
[0284] 25, the motion information decoder 2130 may determine various distribution patterns of the primary residual motion vector candidates for each candidate group. As an example, the motion information decoder 2130 may determine the primary residual motion vector candidates ((1,0), (-1,0), (0,1), (0,-1)) having a diamond shape distribution based on a preset point as a first candidate group.
[0285] Also, the motion information decoding unit 2130 may determine that the primary residual motion vector candidates ((2,2), (-2,2), (2,-2), (-2,-2)) having a rectangular distribution based on the preset point are a second candidate group.
[0286] Also, the motion information decoder 2130 may determine the primary residual motion vector candidates ((4,0), (-4,0), (0,4), (0,-4)) having a diamond shape distribution based on the preset point as a third candidate group. The distribution shape of the primary residual motion vector candidates included in each candidate group may have various distribution shapes other than the distribution shape shown in FIG.
[0287] FIG. 26 is a diagram illustrating indexes indicating primary residual motion vector candidates according to an embodiment.
[0288] As shown in FIG. 26, reference numeral 2601 is a bit representation corresponding to an index indicating a base motion vector candidate, reference numeral 2602 is a bit representation corresponding to an index indicating a displacement distance (or candidate group) of a primary residual motion vector candidate, and reference numerals 2603 and 2604 are also bit representations corresponding to indexes indicating a displacement direction of a primary residual motion vector candidate.
[0289] The motion information decoding unit 2130 may assign an index to each of at least one base motion vector candidate to determine a base motion vector of the current block based on an index indicating a base motion vector included in the bitstream. Also, the motion information decoding unit 2130 may assign an index to each of primary residual motion vector candidates to determine a primary residual motion vector of the current block based on an index indicating a primary residual motion vector included in the bitstream.
[0290] 26, base motion vector candidate 0 is assigned an index of 0, and base motion vector candidate 1 is assigned an index of 10. The indexes indicating the base motion vector candidates are also expressed in a unary encoding method or a truncated unary encoding method in a predetermined order.
[0291] The number of bits to represent the index increases from base motion vector candidate 0 to base motion vector candidate 4, but the priority among the base motion vector candidates for assigning indexes can be set according to the same criteria as the video encoding device 3300.
[0292] In one embodiment, information indicating the priority order between the base motion vector candidates for assigning indexes is included in the bitstream, and in this case, the motion information decoding unit 2130 may assign indexes to each of the base motion vector candidates according to the information indicating the priority order acquired from the bitstream. The information indicating the priority order between the base motion vector candidates acquired from the bitstream may include information related to the order of change that has occurred in comparison with the priority order between the base motion vector candidates determined in the previous block, slice, or picture. For example, if the priority order of the base motion vector candidate 0 is 1st in the previous block, slice, or picture, but is changed to 3rd in relation to the current block, slice, or picture, the bitstream may include information that the priority order of the base motion vector candidate 0 has been changed to 3rd. Also, the bitstream includes information that no change has occurred in the priority order between the base motion vector candidates in the current block, slice, or picture in comparison with the priority order between the base motion vector candidates determined in the previous block, slice, or picture.
[0293] The primary residual motion vector candidates determined corresponding to one base motion vector candidate are also grouped into candidate groups according to a determined criterion. Here, the determined criterion is how far apart the candidate is from a preset point. An index for each grouped candidate group is also expressed by a unary coding method or a truncated unary coding method. According to an embodiment, an index for each grouped candidate group is also expressed by a fixed-length coding method.
[0294] Referring to FIG. 26, the number of bits required to represent the index of the candidate group increases from candidate group 0 corresponding to transition distance 1 to candidate group 7 corresponding to transition distance 8, but the priority order among the candidate groups for assigning indexes is set according to the same criteria as that of the video encoding device 3300.
[0295] In one embodiment, information indicating the priority between the candidate groups for assigning indexes is included in the bitstream, and in this case, the motion information decoding unit 2130 may assign indexes to each of the candidate groups according to the information indicating the priority acquired from the bitstream. The information indicating the priority between the candidate groups acquired from the bitstream may include information related to the order of change that has occurred in comparison with the priority between the candidate groups determined in the previous block, previous slice, or previous picture. For example, if the priority of the candidate group 0 in the previous block, previous slice, or previous picture is changed to the order of 3 in comparison with the priority between the candidate group 0 in the current block, current slice, or current picture, the bitstream may include information that the priority of the candidate group 0 has been changed to the order of 3. Also, the bitstream may include information that no change has occurred in the priority between the candidate groups in the current block, current slice, or current picture in comparison with the priority between the candidate groups determined in the previous block, previous slice, or previous picture.
[0296] Meanwhile, the candidate group 0 shown in FIG. 26 may include candidates that are separated by a displacement distance of 1 from the preset point, but in one embodiment, the candidate group 0 may include candidates that are separated by a distance of 0 from the preset point. A candidate that is separated by a distance of 0 from the preset point means the preset point itself, so as described in FIG. 22 to FIG. 25, when the preset point corresponds to (0,0), the primary residual motion vector candidate becomes (0,0). In that case, if the information indicating the candidate group for identifying the primary residual motion vector of the current block indicates the candidate group 0, the base motion vector of the current block, i.e., the motion vector of the current block, becomes the motion vector of the current block without the need to obtain information indicating the displacement direction. In other words, if any one base motion vector is determined for the current block, and if the information indicating the candidate group indicates the candidate group 0, the base motion vector becomes the motion vector of the current block, so that it is possible to replace the merge mode or skip mode of the conventional HEVC.
[0297] An index (or flag) indicating a transition direction is assigned to each of the primary residual motion vector candidates included in one of the candidate groups. In this case, the index indicating the transition direction is also expressed by a fixed-length coding method. For example, if one of the candidate groups includes four primary residual motion vector candidates, two bits are required to indicate each of the primary residual motion vector candidates.
[0298] The motion information decoding unit 2130 may divide the primary residual motion vector candidates included in one candidate group into groups according to their positions on the coordinate plane, and assign indexes or flags to the divided groups.
[0299] Referring to Figure 26, the primary residual motion vector candidates (1,0), (-1,0), (0,1), and (0,-1) corresponding to candidate group 0 of base motion vector 0 are assigned an index (or flag) of 0 or 1 as shown in drawing reference number 2603 depending on whether they are located on the x-axis or the y-axis, and an index (or flag) of 0 or 1 as shown in drawing reference number 2604 depending on whether they are located in the + or - direction.
[0300] As described above, the acquiring unit 2110 may decode at least one of the indexes indicating the shift direction of the primary residual motion vector from the bitstream using the context model. For example, the acquiring unit 2110 may divide four primary residual motion vector candidates included in one candidate group into two groups, each including two candidates located on the x-axis and two candidates located on the y-axis, and decode an index 2603 indicating whether the candidate is located on the x-axis or the y-axis using the context model. If it is determined whether the candidate is located on the x-axis or the y-axis, the acquiring unit 2110 may decode an index 2604 indicating whether the candidate is located in the + direction or the - direction using the context model.
[0301] In an embodiment, the motion information decoder 2130 includes only candidates located at preset points on the coordinate plane in each candidate group. For example, the motion information decoder 2130 may include only candidates located on the x-axis or only candidates located on the y-axis in each candidate group based on information related to at least one of a previous picture, a current picture, a previous slice, a current slice, a previous block, and a current block. For example, in FIG. 26, among candidates (1,0), (-1,0), (0,1), and (0,-1) included in candidate group 0, only (1,0) and (-1,0) are included in candidate group 0, and only the index 2604 is assigned to each candidate as an index indicating a transition direction.
[0302] In the following, a method for determining a primary residual motion vector candidate when the base motion vector candidate is a bidirectional motion vector will be described.
[0303] First, FIG. 27 is a diagram for explaining motion information used for bidirectional prediction of blocks, and illustrates a case where blocks are bidirectionally predicted in the AMVP mode of HEVC.
[0304] Block 2710 may be unidirectionally predicted using reference picture 2730 included in list 0 or reference picture 2750 included in list 1, or bidirectionally predicted using two reference pictures 2730, 2750 included in lists 0 and 1.
[0305] 27, when the prediction direction of block 2710 is unidirectional in the list 0 direction, the motion vector MV0 in the list 0 direction of block 2710 is determined based on the predicted motion vector MVP0 corresponding to the list 0 direction and the residual motion vector MVD0 for the list 0 direction. When the prediction direction of block 2710 is unidirectional in the list 1 direction, the motion vector MV1 in the list 1 direction of block 2710 is determined based on the predicted motion vector MVP1 corresponding to the list 1 direction and the residual motion vector MVD1 for the list 1 direction.
[0306] If the prediction direction of block 2710 is bidirectional, including the list 0 direction and the list 1 direction, a motion vector MV0 for the list 0 direction of block 2710 is determined based on a predicted motion vector MVP0 corresponding to the list 0 direction and a residual motion vector MVD0 for the list 0 direction, and a motion vector MV1 for the list 1 direction of block 2710 is determined based on a predicted motion vector MVP1 corresponding to the list 1 direction and a residual motion vector MVD1 for the list 1 direction.
[0307] In other words, when a block is bidirectionally predicted, it means that the motion vector of the block includes a motion vector in the list 0 direction and a motion vector in the list 1 direction, and the residual motion vector also includes a residual motion vector for the list 0 direction and a residual motion vector for the list 1 direction.
[0308] In one embodiment of the present disclosure, if any one of the base motion vector candidates corresponds to a bidirectional motion vector, it will include a base motion vector candidate for the list 0 direction and a base motion vector candidate for the list 1 direction, and the method of determining the primary residual motion vector candidate for the list 0 direction and the primary residual motion vector candidate for the list 1 direction will be described below.
[0309] FIG. 28 illustrates a positional relationship among a first reference picture 2830 indicated by a first unidirectional base motion vector candidate, a second reference picture 2850 indicated by a second unidirectional base motion vector candidate, and a current picture 2810 including a current block, when a certain base motion vector candidate corresponds to a bidirectional motion vector. In FIG. 28, the distance between the current picture 2810 and the first reference picture 2830 is d1, and the distance between the current picture 2810 and the second reference picture 2850 is d2. The distance between pictures means the difference in POC values between the two pictures. In addition, the first unidirectional means the list 0 direction or the list 1 direction, and the second unidirectional means a direction different from the first unidirectional.
[0310] 28, a current picture 2810 has a POC of B, and a first reference picture 2830 and a second reference picture 2850 have a POC of A and a POC of C, respectively. Primary residual motion vector candidates when POC B has a value between POC A and POC C are illustrated in FIG.
[0311] The primary residual motion vector candidates illustrated in the above FIG. 26 consist of residual candidates for list 0 or residual candidates for list 1 along the direction of the base motion vector candidates, but when the base motion vector candidates are bidirectional, each of the primary residual motion vector candidates may include a residual candidate for list 0 and a residual candidate for list 1.
[0312] When POC B has a value between POC A and POC C, each primary residual motion vector candidate divided according to the displacement distance and displacement direction may include a primary residual motion vector candidate for a first unidirectional direction having a magnitude value corresponding to the displacement distance, and a primary residual motion vector candidate for a second unidirectional direction having a magnitude value corresponding to the displacement distance but with an opposite sign.
[0313] For example, referring to FIG. 29, among the primary residual motion vector candidates belonging to candidate group 0, the primary residual motion vector candidate identified by index 00 indicating the displacement direction may include (1,0) having a magnitude value corresponding to the displacement distance as a component and (-1,0) having a value of the opposite sign as a component. (1,0) corresponds to the primary residual motion vector candidate for the first unidirectional, and (-1,0) corresponds to the primary residual motion vector candidate for the second unidirectional. If the index indicating the displacement direction is acquired as 00 from the bitstream, the motion information decoding unit 2130 may determine (1,0) as the primary residual motion vector for the first unidirectional of the current block and (-1,0) as the primary residual motion vector for the second unidirectional of the current block.
[0314] In one embodiment, the value of the primary residual motion vector candidate for any one uni-direction is scaled according to the distance between d1 and d2. For example, if the primary residual motion vector candidate for the first uni-direction when d1 is 1 is (1, 0), the primary residual motion vector candidate for the second uni-direction when d2 is 2 is also determined as (-2, 0).
[0315] In other words, if the primary residual motion vector candidate for the first unidirectional is (x, y), the primary residual motion vector candidate for the second unidirectional is also determined as ((d2 / d1)*(-x),(d2 / d1)*(-y)). In one example, d2 / d1 is calculated as an integer type, or may be calculated as a double type or a float type depending on the embodiment. Alternatively, depending on the embodiment, d2 / d1 may be converted using a bit shift operator (<<, >>), the converted value may be rounded, and then the bit shift operator may be applied to calculate the value.
[0316] 30 illustrates, in the case where a certain base motion vector candidate corresponds to a bidirectional motion vector, the positional relationship among a first reference picture 2930 indicated by a first unidirectional base motion vector candidate, a second reference picture 2950 indicated by a second unidirectional base motion vector candidate, and a current picture 2910 including a current block. In FIG. 30, the distance between the current picture 2910 and the first reference picture 2930 is d1, and the distance between the current picture 2910 and the second reference picture 2950 is d2.
[0317] 30, a current picture 2910 has a POC of A, and a first reference picture 2930 and a second reference picture 2950 have a POC of B and a POC of C, respectively. Primary residual motion vector candidates when POC A is smaller than POC B and POC C are shown in FIG. 31. Primary residual motion vector candidates when POC A is larger than POC B and POC C are also the same as those shown in FIG.
[0318] The primary residual motion vector candidates classified according to the displacement distance and the displacement direction may include a residual candidate for a first unidirectional direction and a residual candidate for a second unidirectional direction.
[0319] When POC A has a larger or smaller value than POC B and POC C, each primary residual motion vector candidate divided according to the displacement distance and displacement direction may include a primary residual motion vector candidate for a first unidirectional direction having a magnitude value corresponding to the displacement distance, and a primary residual motion vector candidate for a second unidirectional direction having a component value of the same sign and a magnitude corresponding to the displacement distance.
[0320] For example, referring to FIG. 31, among the primary residual motion vector candidates included in candidate group 0, the primary residual motion vector candidate identified by index 00 indicating the displacement direction may include (1,0) having a magnitude value corresponding to the displacement distance as a component, and (1,0) having a value of the same size and sign as (1,0) as a component.
[0321] In one embodiment, the value of the primary residual motion vector candidate for any one uni-direction is scaled according to the distance between d1 and d2. For example, if the primary residual motion vector candidate for the first uni-direction when d1 is 1 is (1,0), the primary residual motion vector candidate for the second uni-direction when d2 is 2 is also determined as (2,0).
[0322] In other words, if the primary residual motion vector candidate for the first unidirectional is (x, y), the primary residual motion vector candidate for the second unidirectional is also determined as ((d2 / d1)*(x),(d2 / d1)*(y)). In one example, d2 / d1 is calculated as an integer (int) type, or, depending on the embodiment, d2 / d1 is calculated as a double type or a float type. Alternatively, depending on the embodiment, d2 / d1 may be converted using a bit shift operator (<<, >>), the converted value may be rounded, and then the bit shift operator may be applied to the conversion.
[0323] Hereinafter, a method of determining a motion vector of a current block by considering a prediction direction of the current block and a direction of a base motion vector will be described.
[0324] If the prediction direction of the current block is the same as the direction of the base motion vector of the current block, the motion information decoding unit 2130 may determine the motion vector of the current block by applying the primary residual motion vector to the base motion vector of the current block.
[0325] In one embodiment, the acquisition unit 2110 may extract information indicating a use direction of the base motion vector, for example, an index, from the bitstream. The information indicating the use direction of the base motion vector corresponds to a prediction direction of the current block. In one example, when the use direction of the base motion vector is the list 0 direction, unidirectional prediction in the list 0 direction may be performed on the current block, and when the use direction of the base motion vector is the list 1 direction, unidirectional prediction in the list 1 direction may be performed on the current block. In addition, when the use direction of the base motion vector is bidirectional, bidirectional prediction may be performed on the current block.
[0326] For example, if the base motion vector is bidirectional, a bit value of 0 can indicate that the base motion vector is used in both directions, a bit value of 10 can indicate that the base motion vector is used in the list 0 direction, and a bit value of 11 can indicate that the base motion vector is used in the list 1 direction.
[0327] Also, for example, if the base motion vector is a first unidirectional direction in the list 0 direction or the list 1 direction, a bit value of 0 can indicate that the direction of use of the base motion vector is the first unidirectional direction, a bit value of 10 can indicate that the direction of use of the base motion vector is a second unidirectional direction different from the first unidirectional direction, and a bit value of 11 can indicate that the direction of use of the base motion vector is bidirectional.
[0328] The direction of use of the base motion vector corresponding to the bit value may be changed.
[0329] When the basic motion vector is bidirectional and the direction of use of the basic motion vector is bidirectional The motion information decoding unit 2130 may determine a motion vector for the list 0 direction of the current block by applying the primary residual motion vector for the list 0 direction to the base motion vector for the list 0 direction. Then, the motion information decoding unit 2130 may determine a motion vector for the list 1 direction of the current block by applying the primary residual motion vector for the list 1 direction to the base motion vector for the list 1 direction.
[0330] When the base motion vector is bidirectional and the usage direction of the base motion vector is bidirectional, but the bitstream includes only information indicating the primary residual motion vector for the list 0 direction, the motion information decoding unit 2130 can generate a primary residual motion vector for the list 1 direction based on the primary residual motion vector for the list 0 direction.
[0331] The motion information decoding unit 2130 can generate a primary residual motion vector for the list 1 direction by taking into account the positional relationship between the reference picture corresponding to the base motion vector in the list 0 direction, the current picture including the current block, and the reference picture corresponding to the base motion vector in the list 1 direction.
[0332] In one example, when the current picture is located between the reference picture in the list 0 direction and the reference picture in the list 1 direction, the motion information decoding unit 2130 may change the sign of the value of the primary residual motion vector for the list 0 direction to the opposite sign, scale the value of the primary residual motion vector for the list 0 direction according to the ratio of d1 (the distance between the current picture and the reference picture in the list 0 direction) and d2 (the distance between the current picture and the reference picture in the list 1 direction) to determine the primary residual motion vector for the list 1 direction. For example, if the primary residual motion vector for the list 0 direction is (1,1), d1 is 1, and d2 is 2, the primary residual motion vector for the list 1 direction is also determined as (-2,-2).
[0333] In another example, when the current picture is located before or after the reference picture in the list 0 direction and the reference picture in the list 1 direction, the motion information decoding unit 2130 may maintain the same sign of the value of the primary residual motion vector for the list 0 direction, scale the value of the primary residual motion vector for the list 0 direction according to a ratio of d1 and d2, and determine the primary residual motion vector for the list 1 direction. For example, when the primary residual motion vector for the list 0 direction is (1,1), d1 is 1, and d2 is 2, the primary residual motion vector for the list 1 direction is also determined to be (2,2).
[0334] When the basic motion vector is bidirectional and the direction of use of the basic motion vector is unidirectional If the base motion vector is bidirectional and the usage direction of the base motion vector is the list 0 direction or the list 1 direction, the motion information decoding unit 2130 can apply the primary residual motion vector for the list 0 direction or the primary residual motion vector for the list 1 direction to the base motion vector in the list 0 direction or the base motion vector in the list 1 direction to determine the motion vector of the current block in the list 0 direction or the list 1 direction.
[0335] If the usage direction of the base motion vector is the first unidirectional, but the bitstream includes only information indicating the primary residual motion vector for the second unidirectional, the motion information decoding unit 2130 can determine the primary residual motion vector for the first unidirectional from the primary residual motion vector for the second unidirectional, taking into account the positional relationship and distance between the current picture, the reference picture in the list 0 direction, and the reference picture in the list 1 direction, as described above.
[0336] When the basic motion vector and the direction of use of the basic motion vector are unidirectional When the base motion vector is a first unidirectional direction in the list 0 direction or the list 1 direction, the usage direction of the base motion vector is a second unidirectional direction different from the first unidirectional direction, and the bitstream includes only information indicating the primary residual motion vector for the first unidirectional direction, the motion information decoding unit 2130 can determine the base motion vector of the second unidirectional direction based on the base motion vector of the first unidirectional direction, and determine the primary residual motion vector for the second unidirectional direction based on the primary residual motion vector for the first unidirectional direction.
[0337] First, the motion information decoding unit 2130 can determine a second reference picture located in the opposite direction to the first reference picture, centered on the current picture, by taking into account d1 (the distance between the current picture and the first reference picture indicated by the first unidirectional basic motion vector).
[0338] In one example, a second reference picture separated by the same distance as d1 may be determined. In this case, since d1 and d2 (the distance between the current picture and the second reference picture) are the same and the current picture is located between the first reference picture and the second reference picture, the motion information decoder 2130 may invert the sign of the first unidirectional base motion vector to generate a second unidirectional base motion vector, and invert the sign of the primary residual motion vector for the first unidirectional to generate a primary residual motion vector for the second unidirectional.
[0339] If there is no picture spaced the same distance as d1, a picture located in the opposite direction to the first reference picture with respect to the current picture as the second reference picture may be determined as the second reference picture. In this case, the current picture is located between the first reference picture and the second reference picture, but d1 and d2 are different from each other. The motion information decoding unit 2130 may invert the sign of the base motion vector of the first unidirectional and scale it according to a ratio of d1 and d2 to generate a base motion vector of the second unidirectional. In addition, the motion information decoding unit 2130 may invert the sign of the primary residual motion vector for the first unidirectional and scale it according to a ratio of d1 and d2 to generate a primary residual motion vector for the second unidirectional.
[0340] When the current picture corresponds to the last picture of a GOP (group of pictures), the motion information decoding unit 2130 may determine any one picture located in the same direction as the first reference picture with respect to the current picture as the second reference picture. The first reference picture or the picture located closest to the current picture is also determined as the second reference picture. In this case, since the current picture is located after the first reference picture and the second reference picture, the motion information decoding unit 2130 may generate a second unidirectional basic motion vector by scaling the value of the first unidirectional basic motion vector by the ratio of d1 to d2 (without changing the sign). In addition, the motion information decoding unit 2130 may generate a first unidirectional primary residual motion vector by scaling the value of the first unidirectional primary residual motion vector by the ratio of d1 to d2 (without changing the sign).
[0341] In one example, when the current picture corresponds to the last picture of a GOP, if the first reference picture itself is determined as the second reference picture, the motion information decoding unit 2130 may also determine the first unidirectional base motion vector as the second unidirectional base motion vector and as the primary residual motion vector for the first unidirectional.
[0342] Once the base motion vector and the primary residual motion vector for the second unidirectional are generated, the motion information decoding unit 2130 can apply the primary residual motion vector for the second unidirectional to the base motion vector of the second unidirectional to determine the second unidirectional motion vector of the current block.
[0343] When the basic motion vector is unidirectional and the direction of use of the basic motion vector is bidirectional When the base motion vector is a first unidirectional in the list 0 direction or the list 1 direction, the usage direction of the base motion vector is bidirectional, and the bitstream includes only information indicating a primary residual motion vector for the first unidirectional, the motion information decoding unit 2130 can generate a base motion vector for a second unidirectional based on the base motion vector of the first unidirectional, and generate a primary residual motion vector for the second unidirectional based on the primary residual motion vector for the first unidirectional.
[0344] First, the motion information decoding unit 2130 can determine a second reference picture located in the opposite direction to the first reference picture, centered on the current picture, by taking into account d1 (the distance between the current picture and the first reference picture indicated by the first unidirectional basic motion vector).
[0345] In one example, a second reference picture separated by the same distance as d1 may be determined. In this case, since d1 and d2 (the distance between the current picture and the second reference picture) are the same and the current picture is located between the first reference picture and the second reference picture, the motion information decoder 2130 may invert the sign of the first unidirectional base motion vector to generate a second unidirectional base motion vector, and invert the sign of the primary residual motion vector for the first unidirectional to generate a primary residual motion vector for the second unidirectional.
[0346] If there is no picture spaced the same distance as d1, a picture located in the opposite direction to the first reference picture with respect to the current picture as the second reference picture may be determined as the second reference picture. In this case, the current picture is located between the first reference picture and the second reference picture, but d1 and d2 are different from each other. The motion information decoding unit 2130 may invert the sign of the base motion vector of the first unidirectional and scale it according to a ratio of d1 and d2 to generate a base motion vector of the second unidirectional. In addition, the motion information decoding unit 2130 may invert the sign of the primary residual motion vector for the first unidirectional and scale it according to a ratio of d1 and d2 to generate a primary residual motion vector for the second unidirectional.
[0347] If the current picture corresponds to the last picture of the GOP, the motion information decoding unit 2130 may determine any one picture located in the same direction as the first reference picture with respect to the current picture as the second reference picture. The first reference picture or the picture located closest to the current picture is also determined as the second reference picture. In this case, since the current picture is located after the first reference picture and the second reference picture, the motion information decoding unit 2130 may generate a second unidirectional basic motion vector by scaling the value of the first unidirectional basic motion vector by the ratio of d1 to d2 (without changing the sign). In addition, the motion information decoding unit 2130 may generate a first unidirectional primary residual motion vector by scaling the value of the first unidirectional primary residual motion vector by the ratio of d1 to d2 (without changing the sign).
[0348] In one example, when the current picture corresponds to the last picture of a GOP, if the first reference picture itself is determined as the second reference picture, the motion information decoding unit 2130 may also determine the first unidirectional base motion vector as the second unidirectional base motion vector and as the primary residual motion vector for the first unidirectional.
[0349] Once the base motion vector and the primary residual motion vector for the second unidirectional are generated, the motion information decoding unit 2130 can apply the primary residual motion vector for the second unidirectional to the base motion vector of the second unidirectional to determine the second unidirectional motion vector of the current block, and can apply the primary residual motion vector for the first unidirectional to the base motion vector of the first unidirectional to determine the first unidirectional motion vector of the current block.
[0350] Meanwhile, in one embodiment, the acquiring unit 2110 may acquire information indicating whether the current block is multi-pass coded or not, and information on the coding mode applied to the current block when multi-pass coding is applied, from the bitstream. Multi-pass coding means coding a block in two different coding modes, and then finally selecting a coding mode with higher efficiency to code the block.
[0351] If the acquisition unit 2110 determines that the current block has been multi-pass coded, it can acquire information, e.g., a flag, indicating in which of the two coding modes the current block has been coded.
[0352] If it is determined that the current block to which multi-pass coding is applied has been coded in a preset mode according to the present disclosure, the motion information decoding unit 2130 may decode motion information of the current block based on information indicating a base motion vector of the current block and information indicating a primary residual motion vector. If it is determined that the current block to which multi-pass coding is applied has been coded in a mode other than the preset mode, for example, a merge mode, a skip mode, or an AMVP mode, the motion information decoding unit 2130 may decode motion information according to the determined mode.
[0353] Meanwhile, the current block according to the present disclosure corresponds to a first child block divided from a parent block. When the bitstream includes information indicating division of the parent block, the motion information decoding unit 2130 may divide the parent block into a first child block and a second child block corresponding to the current block. Alternatively, the motion information decoding unit 2130 may divide the parent block into a first child block and a second child block corresponding to the current block, taking into consideration at least one of the size, width and height, of the parent block. For example, when the width of the parent block is longer than the height, the motion information decoding unit 2130 may divide the width of the parent block in half to determine two child blocks, and when the height of the parent block is longer than the width, the motion information decoding unit 2130 may divide the height of the parent block in half to determine two child blocks. The parent block refers to a block that is the basis of prediction, such as a prediction unit of HEVC. According to an embodiment, the motion information decoder 2130 may divide the parent block into a first child block, a second child block, and a third child block corresponding to the current block, that is, into three child blocks.
[0354] Furthermore, the shape of the child blocks is not limited to square or rectangular, but may include triangular and trapezoidal shapes.
[0355] When the preset mode according to the present disclosure is applied to the first child block, the motion information decoding unit 2130 can determine the motion vector of the first child block by the above-mentioned method.
[0356] As an example of a method for determining a motion vector of the second child block, the motion information decoding unit 2130 may determine a base motion vector and a primary residual motion vector of the second child block based on information indicating a base motion vector and information indicating a primary residual motion vector obtained from a bitstream, similar to the first child block, and may determine a motion vector of the second child block by combining the base motion vector and the primary residual motion vector. In this case, the base motion vector candidate and the primary residual motion vector candidate determined for the parent block may be used in the same manner for the first child block and the second child block. In other words, the base motion vector candidate and the primary residual motion vector candidate are determined at the parent block level, the motion vector of the first child block is determined based on information indicating the base motion vector and information indicating the primary residual motion vector of the first child block, and the motion vector of the second child block is also determined based on information indicating the base motion vector and information indicating the primary residual motion vector of the second child block.
[0357] In another example, the motion vector determined for the first child block may be determined as the base motion vector of the second child block, and only information indicating the primary residual motion vector of the second child block may be obtained from the bitstream to determine the primary residual motion vector of the second child block. The motion information decoding unit 2130 may match the primary residual motion vector of the second child block to the base motion vector of the second child block to determine the motion vector of the second child block.
[0358] As another example, at least one of information indicating a base motion vector, information indicating a displacement distance, and information indicating a displacement direction obtained from a bitstream in relation to the first child block may be shared with the second child block. In this case, the motion information decoding unit 2130 may determine a base motion vector and a primary residual motion vector of the second child block based on information shared with the second child block among information indicating a base motion vector, information indicating a displacement distance, and information indicating a displacement direction obtained from a bitstream in relation to the first child block, and residual information obtained from a bitstream in relation to the second child block.
[0359] Also, information indicating the secondary residual motion vector may be included in only one bitstream related to the first child block or the second child block. For example, if the secondary residual motion vector is determined in relation to the first child block, the motion information decoding unit 2130 may apply the secondary residual motion vector of the first child block to the second child block.
[0360] In one embodiment, the first child block is coded in a preset mode according to the present disclosure, and the second child block is coded in a mode different from the mode applied to the first child block, in which case the motion information decoding unit 2130 can decode the first child block and the second child block according to the modes applied to the first child block and the second child block, respectively.
[0361] When the motion vectors for the first and second child blocks are determined, a first prediction block corresponding to the first child block and a second prediction block corresponding to the second child block are determined by inter prediction. Then, the boundary between the first and second prediction blocks is smoothed and filtered, and the residual block is added to the final prediction block generated as a result of the filtering, and finally the parent block is restored. For the smooth filtering, an N-tap filter can be applied, and an overlapped block motion compensation (OBMC) method can be applied. According to the OBMC method, a weight can be applied to the overlapped portion of the first and second prediction blocks. The weight of the boundary area is 0.5:0.5, but the weight increases as the area becomes farther from the boundary.
[0362] FIG. 32 is a flowchart illustrating a video decoding method according to an embodiment.
[0363] In operation S3210, the video decoding apparatus 2100 determines a base motion vector of a current block. The video decoding apparatus 2100 may determine one of at least one base motion vector candidate as a base motion vector of the current block.
[0364] The video decoding device 2100 may determine the base motion vector of the current block based on the information indicating the base motion vector included in the bitstream. In one example, the video decoding device 2100 may obtain the information indicating the base motion vector at a block level, a slice level, or a picture level.
[0365] In operation S3220, the video decoding apparatus 2100 determines a primary residual motion vector of the current block.
[0366] The video decoding device 2100 determines a primary residual motion vector candidate for each of at least one base motion vector candidate, obtains information indicating the displacement distance and displacement direction of the primary residual motion vector from the bitstream, and determines a primary residual motion vector of a current block from the primary residual motion vector candidates.
[0367] The video decoding device 2100 may obtain at least one of the information indicating the disparity distance and the information indicating the disparity direction at a block level, a slice level, or a picture level.
[0368] In operation S3230, the video decoding apparatus 2100 may determine a motion vector of the current block by applying a primary residual motion vector to a base motion vector of the current block.
[0369] If the bitstream includes information indicating a secondary residual motion vector, the video decoding device 2100 can also determine the motion vector of the current block by applying the secondary residual motion vector to the base motion vector changed by applying the primary residual motion vector.
[0370] FIG. 33 is a block diagram of a video encoding device 3300 according to an embodiment.
[0371] Referring to FIG. 33, a video encoding device 3300 according to an embodiment of the present invention may include a motion information encoding unit 3310 and a generating unit 3330 .
[0372] The video encoding device 3300 can encode video and generate a bitstream including information generated as a result of the encoding.
[0373] The video encoding device 3300 according to an embodiment may include a central processor (not shown) that controls the motion information encoding unit 3310 and the generating unit 3330. Alternatively, the motion information encoding unit 3310 and the generating unit 3330 may be operated by their own processors (not shown), and the video encoding device 3300 may be operated as a whole by the processors (not shown) operating in an organic manner. Alternatively, the motion information encoding unit 3310 and the generating unit 3330 may be controlled under the control of an external processor (not shown).
[0374] The video encoding device 3300 may include one or more data storage units (not shown) that store input / output data of the motion information encoding unit 3310 and the generation unit 3330. The video encoding device 3300 may include a memory control unit (not shown) that controls data input / output of the data storage units (not shown).
[0375] The video encoding device 3300 may perform video encoding operations including prediction by operating in conjunction with an internal video encoding processor or an external video encoding processor to encode video. The internal video encoding processor of the video encoding device 3300 according to an embodiment may be implemented by implementing a basic video encoding operation by including a video encoding processing module in a central processing unit or a graphic processing unit, rather than a separate processor.
[0376] The video encoding device 3300 may be included in the above-mentioned video encoding device 200. For example, the generation unit 3330 may be included in the bitstream generation unit 210 of the video encoding device 200 illustrated in FIG.
[0377] The motion information encoding unit 3310 encodes a motion vector of a current block. The current block is a block generated by dividing an image according to a tree structure, and corresponds to, for example, a maximum coding unit, a coding unit, or a transform unit. The motion information encoding unit 3310 may determine a prediction mode to be applied to the current block. The prediction mode may include, for example, at least one of an intra mode, an inter mode, a merge mode, a skip mode, and a preset mode according to the present disclosure.
[0378] The generating unit 3330 generates a bitstream including information generated as an encoding result related to the motion vector. In an embodiment, the bitstream may include information indicating at least one of whether a preset mode is applied to the current block, a base motion vector of the current block, a primary residual motion vector of the current block, a priority order of displacement distances for classifying primary residual motion vector candidates, and a priority order of displacement directions for classifying primary residual motion vector candidates. The generating unit 3330 may include the information in a bitstream corresponding to at least one level of a coding unit level, a transform unit level, a maximum coding unit level, a slice unit level, and a picture unit level.
[0379] The motion information encoding unit 3310 can determine whether to apply a preset mode to the current block.
[0380] The motion information encoding unit 3310 can determine whether to apply a pre-set mode to the current block based on information related to at least one of the current block, a previously encoded block, a current slice, a previously encoded slice, a current picture, and a previously encoded picture.
[0381] In one example, the motion information encoding unit 3310 may determine whether to apply a preset mode to the current block by considering statistical information related to a prediction mode in a previous slice or a previous picture. The motion information encoding unit 3310 may also determine not to apply a preset mode to the current block based on the statistical information.
[0382] In one example, the motion information encoding unit 3310 may determine to apply a preset mode to the current block based on a cost corresponding to each of a number of prediction modes applicable to the current block. When calculating the cost, a rate-distortion cost may be used.
[0383] When the preset mode is applied to the current block, the motion information encoding unit 3310 may determine a primary residual motion vector candidate associated with at least one base motion vector candidate. The primary residual motion vector candidates are also classified according to a displacement distance and a displacement direction. The method of determining the primary residual motion vector candidate is the same as that described in relation to the video decoding apparatus 2100, and therefore a detailed description thereof will be omitted.
[0384] In one embodiment, at least one base motion vector candidate for the current block is also determined based on motion vectors of neighboring blocks that are spatially and temporally related to the current block, which may include blocks that were coded prior to the current block.
[0385] In an embodiment, the motion information encoding unit 3310 may determine a motion vector of a neighboring block related to the current block as at least one base motion vector candidate. Alternatively, the motion information encoding unit 3310 may change a motion vector of a neighboring block related to the current block to determine at least one base motion vector candidate. Alternatively, the motion information encoding unit 3310 may combine motion vectors of neighboring blocks related to the current block in a predetermined manner to determine at least one base motion vector candidate.
[0386] In an embodiment, the motion information encoding unit 3310 may determine at least one base motion vector candidate in the same manner as the method of determining a candidate list of motion vector predictors in the merge mode or AMVP mode of HEVC.
[0387] In an embodiment, the motion information encoding unit 3310 may determine a zero motion vector having 0 as a component as a base motion vector candidate.
[0388] If at least one base motion vector candidate is determined, the motion information encoding unit 3310 may determine a base motion vector of a current block from the at least one base motion vector candidate. The motion information encoding unit 3310 may determine the base motion vector of the current block based on information related to at least one of the current block, a previously encoded block, a current slice, a previously encoded slice, a current picture, and a previously encoded picture.
[0389] In one example, the motion information encoding unit 3310 may determine a base motion vector for the current block by considering statistical information in a previous slice or a previous picture. In another example, the motion information encoding unit 3310 may determine a base motion vector for the current block based on a cost between at least one base motion vector candidate. When calculating the cost, a rate and distortion cost may be used.
[0390] In one embodiment, information indicating the base motion vector of the current block may be coded by a fixed length coding (FLC), unary coding, or truncated unary coding method and included in the bitstream.
[0391] Once the base motion vector for the current block is determined, the motion information encoding unit 3310 may determine a primary residual motion vector for the current block from at least one primary residual motion vector candidate.
[0392] The motion information encoding unit 3310 may determine a primary residual motion vector of the current block from at least one primary residual motion vector candidate by considering a difference between the motion vector of the current block and a base motion vector of the current block.
[0393] The information indicating the displacement distance and the displacement direction for identifying the primary residual motion vector of the current block may be coded by at least one of fixed length coding, unary coding, and truncated unary coding, and may be included in the bitstream. The generating unit 3330 may code the information indicating the displacement direction, for example, at least one of an index indicating the displacement direction, using a context model, and include the coded information in the bitstream.
[0394] In one embodiment, the motion information encoding unit 3310 may also determine a primary residual motion vector of the current block from at least one primary residual motion vector candidate based on information related to at least one of the current block, a previously encoded block, a current slice, a previously encoded slice, a current picture, and a previously encoded picture.
[0395] If the primary residual motion vector of the current block is determined, the motion information encoding unit 3310 may apply the primary residual motion vector to the base motion vector of the current block, compare a value generated as a result of the application with the motion vector of the current block, and determine a secondary residual motion vector. For example, the secondary residual motion vector corresponds to a value obtained by subtracting a result of adding the base motion vector and the primary residual motion vector of the current block from the motion vector of the current block.
[0396] If the secondary residual motion vector is determined, the generating unit 3330 may generate a bitstream including information indicating the secondary residual motion vector of the current block. The generating unit 3330 may encode the information indicating the secondary residual motion vector by a method different from the encoding method of the information indicating the primary residual motion vector (e.g., fixed length encoding, unary encoding, or truncated unary encoding) and include it in the bitstream. As an example, the information indicating the secondary residual motion vector may be encoded by an exponential golomb coding method and included in the bitstream. The generating unit 3330 may include the information indicating the secondary residual motion vector in a bitstream corresponding to a transform unit level, a coding unit level, a maximum coding unit level, a slice level, or a picture level.
[0397] In one embodiment, if the prediction direction of the current block is bidirectional, the generator 3330 may include in the bitstream only information indicating the secondary residual motion vector for any one of the unidirectional directions, not the secondary residual motion vector for both directions.
[0398] The generation unit 3330 can include an index indicating a base motion vector of the current block and an index indicating a primary residual motion vector in the bitstream, and to this end, the motion information encoding unit 3310 can assign indexes to at least one base motion vector candidate and at least one primary residual motion vector candidate.
[0399] As shown in FIG. 26, reference numeral 2601 corresponds to an index indicating a base motion vector candidate, reference numeral 2602 corresponds to an index indicating a displacement distance (or candidate group) of a primary residual motion vector candidate, and reference numeral 2603 and reference numeral 2604 correspond to indexes indicating a displacement direction of a primary residual motion vector candidate.
[0400] 26, the base motion vector candidate 0 is assigned an index of 0, and the base motion vector candidate 1 is assigned an index of 10. That is, the indexes indicating the base motion vector candidates are also expressed by a unary coding method or a truncated unary coding method in a predetermined order.
[0401] The number of bits required to represent the index increases from base motion vector candidate 0 to base motion vector candidate 4, but the priority order between the base motion vector candidates for assigning indexes is also determined by a preset criterion.
[0402] In one embodiment, the motion information encoding unit 3310 may determine the priority among the base motion vector candidates for the current block by considering the number or ratio of times the base motion vector candidates have been selected as base motion vectors in a previous slice or picture. For example, if base motion vector candidate 3 has been selected most frequently as a base motion vector for a block in a previous slice or picture, the motion information encoding unit 3310 may assign an index of 0 to base motion vector candidate 3.
[0403] In one embodiment, information indicating a priority among base motion vector candidates for indexing may be included in a bitstream. The information indicating the priority among base motion vector candidates may include information regarding an order in which a change has occurred compared with the priority among base motion vector candidates determined in a previous block, slice, or picture.
[0404] The primary residual motion vector candidates determined corresponding to one base motion vector candidate are also grouped into candidate groups according to a determined criterion. Here, the determined criterion is how far apart the candidate is from a preset point. An index for each grouped candidate group is also expressed by a unary coding method or a truncated unary coding method. Depending on the embodiment, an index for each grouped candidate group is also expressed by a fixed length coding method.
[0405] Referring to FIG. 26, the number of bits required to represent the index of a candidate group increases from candidate group 0 corresponding to a transition distance of 1 to candidate group 7 corresponding to a transition distance of 8, but the priority among candidate groups for assigning indexes is also determined according to preset criteria.
[0406] In an embodiment, the motion information encoder 3310 may determine the priority among the candidate groups for the current block by considering the number or ratio of times that the candidate groups were selected to identify the primary residual motion vector in the previous slice or picture. For example, if the primary residual motion vector candidates included in candidate group 3 were selected most frequently as the primary residual motion vector of the block in the previous slice or picture, the motion information encoder 3310 may assign an index of 0 to candidate group 3.
[0407] In one embodiment, information indicating a priority order between candidate groups for indexing may be included in a bitstream. The information indicating the priority order between candidate groups may include information regarding an order in which a change has occurred compared with a priority order between candidate groups determined in a previous block, slice, or picture.
[0408] Meanwhile, the candidate group 0 shown in FIG. 26 may include candidates that are separated from the preset point by a displacement distance of 1. However, in one embodiment, the candidate group 0 may include candidates that are separated from the preset point by a displacement distance of 0. A candidate that is separated from the preset point by a displacement distance of 0 means the preset point itself, so that when the preset point corresponds to (0,0), the primary residual motion vector candidate becomes (0,0) as described in FIG. 22 to FIG. 25. In this case, if the information indicating the candidate group for identifying the primary residual motion vector indicates the candidate group 0, the base motion vector, that is, the motion vector of the block, is also used unless the secondary residual motion vector exists. In other words, the motion information encoding unit 3310 may select the candidate group 0 if the base motion vector of the current block is the same as the motion vector of the current block, and may include information indicating the candidate group 0 in the bitstream. If the candidate group 0 is selected, the base motion vector becomes the motion vector of the current block, that is, the motion vector of the current block, and thus it is possible to replace the merge mode or skip mode of the conventional HEVC.
[0409] An index (or flag) indicating a transition direction is assigned to each of the primary residual motion vector candidates included in one of the candidate groups. In this case, the index indicating the transition direction is also expressed by a fixed-length coding method. For example, if one of the candidate groups includes four primary residual motion vector candidates, two bits are required to indicate each of the primary residual motion vector candidates.
[0410] The motion information encoding unit 3310 may divide the primary residual motion vector candidates included in one candidate group into groups according to their positions on the coordinate plane, and assign indexes corresponding to the divided groups.
[0411] Referring to FIG. 26, the primary residual motion vector candidates (1,0), (-1,0), (0,1), and (0,-1) corresponding to candidate group 0 of base motion vector 0 are assigned an index (or flag) of 0 or 1 as shown in drawing reference number 2603 depending on whether they are located on the x-axis or the y-axis, and an index (or flag) of 0 or 1 as shown in drawing reference number 2604 depending on whether they are located in the + or - direction.
[0412] As described above, the generating unit 3330 may encode at least one of the indexes indicating the shift direction of the primary residual motion vector using a context model. For example, the generating unit 3330 may divide four primary residual motion vector candidates included in one candidate group into two groups, each including two candidates located on the x-axis and two candidates located on the y-axis, and encode an index 2603 indicating whether the candidate is located on the x-axis or the y-axis using the context model. If it is determined whether the candidate is located on the x-axis or the y-axis, the generating unit 3330 may encode an index 2604 indicating whether the candidate is located in the + direction or the - direction using the context model.
[0413] In an embodiment, the motion information encoding unit 3310 may include only candidates located at a preset point on the coordinate plane in each candidate group. For example, the motion information encoding unit 3310 may include only candidates located on the x-axis or the y-axis in each candidate group based on information related to at least one of a previous picture, a current picture, a previous slice, a current slice, a previous block, and a current block. For example, in FIG. 26, among candidates (1,0), (-1,0), (0,1), and (0,-1) included in candidate group 0, only (1,0) and (-1,0) are included in candidate group 0, and only the index of reference numeral 2704 is assigned to each candidate as an index indicating a transition direction for identifying a candidate.
[0414] When the base motion vector candidate is a bidirectional motion vector, the motion information encoding unit 3310 may configure each of the primary residual motion vector candidates classified according to the displacement distance and the displacement direction to include a primary residual motion vector candidate for the list 0 direction and a primary residual motion vector candidate for the list 1 direction. A method of determining primary residual motion vector candidates for both directions is the same as that described in relation to the video decoding apparatus 2100, and therefore a detailed description thereof will be omitted.
[0415] In one embodiment, the image encoding method may determine a direction in which the base motion vector is to be used if the base motion vector of the current block is determined, and the generator 3330 may include information indicating the direction in which the base motion vector is to be used in the bitstream.
[0416] The base motion vector may be a motion vector for the list 0 direction, a motion vector for the list 1 direction, or a motion vector for both directions, and the video encoding method can determine the direction in which the base motion vector is used so that the encoding efficiency of the motion vector of the current block is high.
[0417] The information indicating the use direction of the base motion vector may include an index. For example, if the base motion vector is bidirectional, a bit value of 0 may indicate that the use direction of the base motion vector is bidirectional, a bit value of 10 may indicate that the use direction of the base motion vector is the list 0 direction, and a bit value of 11 may indicate that the use direction of the base motion vector is the list 1 direction.
[0418] Also, for example, if the base motion vector is a first unidirectional direction in the list 0 direction or the list 1 direction, a bit value of 0 can indicate that the direction of use of the base motion vector is the first unidirectional direction, a bit value of 10 can indicate that the direction of use of the base motion vector is a second unidirectional direction different from the first unidirectional direction, and a bit value of 11 can indicate that the direction of use of the base motion vector is bidirectional.
[0419] The direction of use of the base motion vector corresponding to the bit value may also be changed.
[0420] In one example, when the base motion vector is bidirectional and the use direction of the base motion vector is determined to be bidirectional, the motion information encoding unit 3310 may determine a primary residual motion vector for the list 0 direction of the current block and a primary residual motion vector for the list 1 direction of the current block. Then, the generation unit 3330 may include information indicating the bidirectional base motion vector, and information indicating the primary residual motion vector for the list 0 direction of the current block and the primary residual motion vector for the list 1 direction of the current block in the bitstream.
[0421] As another example, when the base motion vector is bidirectional and the usage direction of the base motion vector is determined to be bidirectional, the motion information encoding unit 3310 may determine a primary residual motion vector for the list 0 direction of the current block and a primary residual motion vector for the list 1 direction, but the generation unit 3330 may include information indicating only one of the primary residual motion vector for the list 0 direction and the primary residual motion vector for the list 1 direction, and information indicating the base motion vector, in the bitstream.
[0422] As yet another example, when the base motion vector is bidirectional and the usage direction of the base motion vector is a first unidirectional direction, such as the list 0 direction or the list 1 direction, the motion information encoding unit 3310 determines a primary residual motion vector for the first unidirectional direction of the current block, and the generating unit 3330 can include information indicating the base motion vector and information indicating the primary residual motion vector for the first unidirectional direction in the bitstream.
[0423] As yet another example, when the base motion vector is bidirectional and the usage direction of the base motion vector is a first unidirectional direction, such as list 0 direction or list 1 direction, the motion information encoding unit 3310 determines a primary residual motion vector for a second unidirectional direction different from the first unidirectional direction of the current block, and the generating unit 3330 can include information indicating the base motion vector and information indicating the primary residual motion vector for the second unidirectional direction in the bitstream.
[0424] As yet another example, when the base motion vector is a first unidirectional direction in the list 0 direction or the list 1 direction, and the usage direction of the base motion vector is a second unidirectional direction different from the first unidirectional direction, the motion information encoding unit 3310 determines a primary residual motion vector of the current block for the first unidirectional direction, and the generation unit 3330 can include information indicating the base motion vector and information indicating the primary residual motion vector for the first unidirectional direction in the bitstream.
[0425] As yet another example, when the base motion vector is a first unidirectional direction in the list 0 direction or the list 1 direction, and the usage direction of the base motion vector is bidirectional, the motion information encoding unit 3310 determines a primary residual motion vector of the current block for the first unidirectional direction, and the generation unit 3330 can include information indicating the base motion vector and information indicating the primary residual motion vector for the first unidirectional direction in the bitstream.
[0426] Meanwhile, in one embodiment, the motion information encoder 3310 may determine whether to apply multi-pass coding to the current block. The motion information encoder 3310 may encode the current block using two different encoding modes and then select one of the encoding modes based on a cost. The generator 3330 may include, in a bitstream, information indicating whether the current block has been multi-pass coded and, if multi-pass coding has been applied, information on the coding mode applied to the current block.
[0427] The two different encoding modes may include any one of the AMVP mode, the merge mode, and the skip mode, and a preset mode according to the present disclosure.
[0428] In one embodiment, the motion information encoding unit 3310 may determine whether to divide a parent block and divide the parent block into a first child block corresponding to the current block and a second child block adjacent thereto. Depending on the embodiment, the motion information encoding unit 3310 may determine whether to divide a parent block and divide the parent block into a first child block corresponding to the current block and a second child block and a third child block adjacent thereto.
[0429] The motion information encoding unit 3310 encodes the first child block according to the above-mentioned preset mode, and the generating unit 3330 can generate a bitstream including information generated as a result of encoding the first child block.
[0430] Regarding the coding method of the second child block, as an example, the motion information coding unit 3310 may code the second child block according to a preset mode according to the present disclosure, similarly to the first child block. In this case, the base motion vector candidate and the primary residual motion vector candidate determined for the parent block may be used in the same manner for the first child block and the second child block. In other words, the base motion vector candidate and the primary residual motion vector candidate are determined at the parent block level, and among the base motion vector candidates, the base motion vector of the first child block and the base motion vector of the second child block are determined independently, and among the primary residual motion vector candidates, the primary residual motion vector of the first child block and the primary residual motion vector of the second child block are also determined independently.
[0431] In another example, the motion information encoding unit 3310 may determine the motion vector determined for the first child block as the base motion vector of the second child block, and determine the primary residual motion vector of the second child block from the primary residual motion vector candidates. The generation unit 3330 may not include information indicating the base motion vector of the second child block in the bitstream, but may instead include information indicating the primary residual motion vector of the second child block in the bitstream.
[0432] As another example, at least one of the basic motion vector, the displacement distance, and the displacement direction determined in relation to the first child block may be applied to the second child block, in which case the motion information encoding unit 3310 may encode the motion vector of the second child block using at least one of the basic motion vector, the displacement distance, and the displacement direction determined in relation to the first child block.
[0433] In addition, the motion information encoding unit 3310 may determine only a secondary residual motion vector associated with any one of the first child block and the second child block, and the generation unit 3330 may include information indicating the determined secondary residual motion vector in the bitstream.
[0434] In one embodiment, the motion information encoder 3310 may encode the first child block in a preset mode according to the present disclosure, and encode the second child block in a mode different from the mode applied to the first child block.
[0435] FIG. 34 is a flowchart illustrating a video encoding method according to an embodiment.
[0436] In operation S3410, the image encoding device 3300 determines a base motion vector of a current block. The image encoding device 3300 may determine one of at least one base motion vector candidate as a base motion vector of the current block.
[0437] In operation S3420, the image encoding device 3300 determines a primary residual motion vector of the current block.
[0438] The video encoding apparatus 3300 may determine a primary residual motion vector candidate for each of the at least one base motion vector candidate, and may determine a primary residual motion vector of the current block from among the primary residual motion vector candidates.
[0439] The video encoding device 3300 may also determine, as the primary residual motion vector of the current block, a primary residual motion vector candidate having a value most similar to a value obtained by subtracting the base motion vector of the current block from the motion vector of the current block.
[0440] In operation S3430, the image encoding device 3300 generates a bitstream generated as a result of encoding the current block.
[0441] The bitstream may include information indicating at least one of whether a preset mode is applied to the current block, a base motion vector of the current block, a primary residual motion vector of the current block, a priority order of displacement distances for classifying primary residual motion vector candidates, and a priority order of displacement directions for classifying primary residual motion vector candidates. The generator 3330 may include the information in a bitstream corresponding to at least one level of a coding unit level, a transform unit level, a maximum coding unit level, a slice unit level, and a picture unit level.
[0442] Meanwhile, the above-described embodiments of the present disclosure can be created into a program that can be executed on a computer, and the created program can be stored in a medium.
[0443] The medium may be a medium for continuously storing a program executable by a computer or a medium for temporarily storing the program for execution or download. The medium may be a variety of recording or storage means in the form of a single or multiple pieces of hardware combined, and may not be limited to a medium directly connected to a computer system, but may be distributed over a network. Examples of the medium include magnetic media such as hard disks, floppy disks, and magnetic tapes; optical recording media such as compact disc read only memory (CD-ROM) and digital versatile disc (DVD); magnetic-optical media such as floptical disks; and read-only memory (ROM), random access memory (RAM), flash memory, etc., which are configured to store program instructions. Examples of other media include recording media or recording media managed by app stores that distribute applications, sites that supply or distribute various software, and servers.
[0444] The above describes in detail the technical ideas of the present disclosure by citing preferred embodiments. However, the technical ideas of the present disclosure are not limited to the above-described embodiments, and various modifications and changes may be made by those skilled in the art within the scope of the technical ideas of the present disclosure.
[0445] (Appendix 1) 1. A method for decoding motion information, comprising: determining a base motion vector of a current block; determining a primary residual motion vector for the current block based on information obtained from a bitstream from at least one primary residual motion vector candidate classified according to a displacement distance and a displacement direction; applying the primary residual motion vector to the base motion vector to determine a motion vector for the current block. (Appendix 2) The step of determining a motion vector of the current block comprises: obtaining information indicating a secondary residual motion vector associated with the current block from a bitstream; The motion information decoding method of claim 1, further comprising: applying a secondary residual motion vector determined based on information indicating the secondary residual motion vector to a base motion vector changed by applying the primary residual motion vector to determine a motion vector of the current block. (Appendix 3) The method for decoding motion information includes: obtaining an index indicating at least one of a displacement distance and a displacement direction of the primary residual motion vector from a bitstream; The step of determining a primary residual motion vector comprises: The motion information decoding method of claim 1, further comprising a step of determining a primary residual motion vector candidate corresponding to the obtained index among the at least one primary residual motion vector candidate as a primary residual motion vector related to the current block. (Appendix 4) The method for decoding motion information includes: The method for decoding motion information described in Appendix 1, further comprising a step of determining one of at least one base motion vector candidate as a base motion vector of the current block. (Appendix 5) The step of determining a motion vector of the current block comprises: determining a primary residual motion vector for a second unidirectional block based on the primary residual motion vector for the first unidirectional block when the base motion vector of the current block corresponds to a bidirectional motion vector, a prediction direction of the current block corresponds to bidirectional, and the primary residual motion vector is determined for a first unidirectional block; determining the first unidirectional motion vector of the current block by applying a primary residual motion vector for the first unidirectional vector to the first unidirectional base motion vector; and applying a primary residual motion vector for the second unidirectional to the base motion vector of the second unidirectional to determine a motion vector for the second unidirectional of the current block. (Appendix 6) The step of determining a primary residual motion vector for the second unidirectional motion vector comprises: A method for decoding motion information as described in Appendix 5, characterized in that it includes a step of determining at least one of the magnitude and sign of component values of a primary residual motion vector for the second unidirectional based on a positional relationship between a reference picture corresponding to a first unidirectional base motion vector, a reference picture corresponding to a second unidirectional base motion vector, and a current picture including the current block. (Appendix 7) The step of determining a motion vector of the current block comprises: determining a base motion vector of the second unidirectional based on the base motion vector of the first unidirectional when the base motion vector of the current block corresponds to a first unidirectional motion vector and a prediction direction of the current block corresponds to a second unidirectional different from the first unidirectional; and determining a primary residual motion vector for the second unidirectional based on the primary residual motion vector for the first unidirectional; and applying a primary residual motion vector for the second unidirectional to the base motion vector of the second unidirectional to determine a motion vector of the current block. (Appendix 8) The step of determining a motion vector of the current block comprises: determining a second unidirectional base motion vector based on the first unidirectional base motion vector when the base motion vector of the current block corresponds to a first unidirectional motion vector and a prediction direction of the current block corresponds to bidirectional, and determining a primary residual motion vector for the second unidirectional based on the primary residual motion vector for the first unidirectional; determining the first unidirectional motion vector of the current block by applying a primary residual motion vector for the first unidirectional vector to the first unidirectional base motion vector; and applying a primary residual motion vector for the second unidirectional to the base motion vector of the second unidirectional to determine the second unidirectional motion vector of the current block. (Appendix 9) The method for decoding motion information includes: The motion information decoding method of claim 1, further comprising a step of entropy decoding at least a portion of the index indicating the primary residual motion vector from the bitstream using a context model. (Appendix 10) The method for decoding the motion information is as follows: determining at least one primary residual motion vector candidate for each of the at least one base motion vector candidate, The motion information decoding method described in Appendix 1, characterized in that the primary residual motion vector candidate determined corresponding to the bidirectional base motion vector candidate among the at least one primary residual motion vector candidate includes a primary residual motion vector candidate in a list 0 direction having values of the same sign or opposite sign, and a primary residual motion vector candidate in a list 1 direction. (Appendix 11) The magnitude of at least one of the primary residual motion vector candidates in the list 0 direction and the primary residual motion vector candidates in the list 1 direction is A method for decoding motion information as described in Appendix 10, characterized in that scaling is performed taking into account distances between a first reference picture corresponding to a first unidirectional base motion vector candidate, a current picture including the current block, and a second reference picture corresponding to the second unidirectional base motion vector candidate. (Appendix 12) The method for decoding motion information includes: determining a motion vector of the current block as a base motion vector of the second child block when the current block corresponds to a first child block divided from a parent block; The method for decoding motion information described in Appendix 1, further comprising a step of applying the primary residual motion vector determined for the second child block to a base motion vector of the second child block to determine a motion vector of the second child block. (Appendix 13) The method for decoding motion information includes: The motion information decoding method of claim 1, further comprising the step of applying at least one of information indicating a base motion vector, information indicating a displacement distance, and information indicating a displacement direction obtained in relation to the current block to a second child block when the current block corresponds to a first child block divided from a parent block. (Appendix 14) The method for decoding motion information includes: The motion information decoding method of claim 1, further comprising the step of acquiring information indicating at least one of whether a predetermined encoding mode is applied to the current block, a base motion vector related to the current block, a primary residual motion vector related to the current block, a priority of a displacement distance, and a priority of a displacement direction at at least one level of a transformation unit level, a coding unit level, a maximum coding unit level, a slice level, and a picture level. (Appendix 15) 1. A method for encoding motion information, comprising: determining a base motion vector of a current block; determining a primary residual motion vector for the current block from at least one primary residual motion vector candidate classified according to a displacement distance and a displacement direction based on a difference between the motion vector of the current block and the base motion vector; generating a bitstream including at least one of information indicating the base motion vector and information indicating the primary residual motion vector.
Claims
1. 1. A method for decoding motion information, comprising: parsing the displacement distance index and the displacement direction index from the bitstream to obtain a primary residual motion vector for the first list; if the current block is bi-predicted, deriving a secondary residual motion vector for the second list based on the primary residual motion vector, a picture order count (POC) of a current picture, a POC of a first reference picture in the first list, and a POC of a second reference picture in the second list; obtaining a first motion vector for the first list using the primary residual motion vector and a first base motion vector for the first list; obtaining a second motion vector for the second list using the secondary residual motion vector and a second base motion vector for the second list; reconstructing the current block using the first motion vector, the first reference picture, the second motion vector, and the second reference picture; A method for decoding motion information, wherein a picture is divided into a plurality of largest coding units, and one of the plurality of largest coding units is hierarchically divided into at least one coding unit including the current block.
2. 1. A method for encoding motion information, comprising: obtaining a primary residual motion vector for the first list using a first motion vector for a first list of a current block and a first base motion vector for the first list; if it is determined that the current block is bi-predicted, deriving a secondary residual motion vector for the second list based on the primary residual motion vector, a picture order count (POC) of a current picture, a POC of a first reference picture in the first list, and a POC of a second reference picture in a second list; generating a bitstream including a transition distance index and a transition direction index; the displacement distance index and the displacement direction index indicate the primary residual motion vector; A method for encoding motion information, wherein a picture is divided into a plurality of largest coding units, and one of the plurality of largest coding units is hierarchically divided into at least one coding unit including the current block.
3. A computer-readable recording medium having a program recorded thereon for performing a method for generating a bitstream, comprising: The bitstream comprises: A displacement distance index; a transition direction index, The method comprises: obtaining a primary residual motion vector for the first list using a first motion vector for a first list of a current block and a first base motion vector for the first list; generating a bitstream including the displacement distance index and the displacement direction index indicating the primary residual motion vector; if it is determined that the current block is bi-predicted, a secondary residual motion vector for the second list is derived based on the primary residual motion vector, a picture order count (POC) of a current picture, a POC of a first reference picture in the first list, and a POC of a second reference picture in a second list; A recording medium, comprising: a picture divided into a plurality of maximum coding units, one of which is hierarchically divided into at least one coding unit including the current block.
Citation Information
Patent Citations
Encoder and encoding method, and decoder and decoding method
JP2006279573A
Image encoder, image encoding method and image encoding program
JP2013034186A
Motion vector prediction in video coding
US20120269270A1
Video encoding device and video decoding device using high-precision skip encoding and method thereof
WO2016068685A1