Method and apparatus for encoding and decoding motion information
By scaling and comparing disparity distances to determine motion vectors, the problem of low efficiency of motion information encoding and decoding in the existing technology is solved, and more accurate and efficient motion information transmission is achieved.
Patent Information
- Application Number
- CN202410817437.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2017-09-19
- Filing Date
- 2018-09-12
- Publication Date
- 2024-09-10
AI Technical Summary
In the existing technology, in image encoding and decoding, the encoding and decoding efficiency of motion information is low, and it is difficult to effectively use a small number of bits to represent and transmit more accurate motion vectors.
By obtaining the disparity distance information, scaling is performed based on the comparison result between the basic pixel unit and the minimum pixel unit, and the predicted motion vector is determined, and then the motion vector of the current block is determined to achieve efficient encoding and decoding of motion information.
It achieves the use of a small number of bits to represent and transmit more accurate motion information, improving the efficiency of image encoding and decoding.
Smart Images

Figure CN118632013A
Abstract
Description
[0001] This application is a divisional application of an invention patent application with an application date of September 12, 2018, application number 201880060929.X, and invention name “Method for encoding and decoding motion information and device for encoding and decoding motion information”. Technical Field
[0002] The present disclosure relates to the field of image encoding and decoding. More specifically, the present disclosure relates to a method and apparatus for encoding motion information for image encoding and decoding and a method and apparatus for decoding motion information for image encoding and decoding. Background Art
[0003] In the method of encoding and decoding an image, in order to encode the image, one picture may be divided into blocks and each of the blocks may be prediction-encoded by using inter prediction or intra prediction.
[0004] Inter-frame prediction refers to a method of compressing an image by removing temporal redundancy between pictures, and a representative example of inter-frame prediction is motion estimation coding. In motion estimation coding, each block of the current picture is predicted by using at least one reference picture. A reference block most similar to the current block is found within a predetermined search range by using a predetermined evaluation function. The current block is predicted based on the reference block, and the residual block generated by subtracting the prediction block generated as a prediction result from the current block is encoded. In this case, in order to perform prediction more accurately, interpolation is performed on the search range of the reference picture, and pixels of sub-pel units smaller than integer-pel units can be generated, and inter-frame prediction can be performed on the pixels of the generated sub-pel units.
[0005] In codecs such as H.264 Advanced Video Coding (AVC) and High Efficiency Video Coding (HEVC), in order to predict the motion vector of a current block, a motion vector of a previously encoded block adjacent to the current block or a block included in a previously encoded picture is used as a predicted motion vector of the current block. A differential motion vector, which is a difference between the predicted motion vector and the motion vector of the current block, is signaled to a decoder using a predetermined method. Summary of the invention
[0006] Technical issues
[0007] According to an embodiment, a method of encoding and decoding motion information and an apparatus for encoding and decoding motion information are provided, which may represent the motion information by using a small number of bits.
[0008] According to an embodiment, there are also provided a method of encoding and decoding motion information and an apparatus for encoding and decoding motion information, which can signal more accurate motion information by using a small number of bits.
[0009] Solution
[0010] According to an embodiment of the present disclosure, a method for decoding motion information may include: obtaining information indicating a disparity distance used to determine a predicted motion vector of a current block; scaling the disparity distance corresponding to the obtained information based on a comparison result between a basic pixel unit and a minimum pixel unit that can be indicated by the motion vector of the current block; determining a predicted motion vector candidate among one or more predicted motion vector candidates that is changed by a scaled disparity distance from a basic motion vector of the current block as the predicted motion vector of the current block; and determining the motion vector of the current block by using the predicted motion vector.
[0011] Beneficial Effects
[0012] A method of encoding and decoding motion information and an apparatus for encoding and decoding motion information according to an embodiment may represent motion information by using a small number of bits.
[0013] In addition, a method of encoding and decoding motion information and an apparatus for encoding and decoding motion information may signal a more accurate motion vector by using a small number of bits.
[0014] However, the effects that can be achieved by the method of encoding and decoding motion information and the device for encoding and decoding motion information according to the embodiment are not limited thereto, and other unmentioned effects will be apparent to those of ordinary skill in the art through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] A brief explanation of each figure is provided to provide a more complete understanding of the figures.
[0016] Figure 1 is a block diagram of an image decoding apparatus capable of decoding an image based on at least one of block shape information and division shape information according to an embodiment.
[0017] Figure 2 is a block diagram of an image encoding apparatus capable of encoding an image based on at least one of block shape information and division shape information according to an embodiment.
[0018] Figure 3 A process of determining at least one coding unit by splitting a current coding unit according to an embodiment is illustrated.
[0019] Figure 4A process of determining at least one coding unit by splitting a non-square coding unit according to an embodiment is illustrated.
[0020] Figure 5 A process of splitting a coding unit based on at least one of block shape information and partition shape information according to an embodiment is illustrated.
[0021] Figure 6 A method of determining a predetermined coding unit from among an odd number of coding units according to an embodiment is illustrated.
[0022] Figure 7 Illustrated is an order in which a plurality of coding units are processed when a plurality of coding units are determined by splitting a current coding unit, according to an embodiment.
[0023] Figure 8 A process of determining that a current coding unit is to be split into an odd number of coding units when coding units cannot be processed in a predetermined order according to an embodiment is illustrated.
[0024] Fig. 9 A process of determining at least one coding unit by splitting a first coding unit according to an embodiment is illustrated.
[0025] Fig.10 It is illustrated that shapes into which the second coding unit may be divided are limited when a second coding unit having a non-square shape determined by dividing the first coding unit satisfies a predetermined condition according to an embodiment.
[0026] Fig.11 A process of splitting a square coding unit when the division shape information indicates that the square coding unit is not to be split into four square coding units according to an embodiment is illustrated.
[0027] Fig.12 It is shown that a processing order among a plurality of coding units may be changed according to a process of splitting the coding units according to an embodiment.
[0028] Fig.13 A process of determining a depth of a coding unit as a shape and a size of a coding unit change when a coding unit is recursively split so that a plurality of coding units are determined according to an embodiment is illustrated.
[0029] Fig.14 Depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.
[0030] Fig.15 It is shown that a plurality of coding units are determined based on a plurality of predetermined data units included in a picture according to an embodiment.
[0031] Fig.16 A processing block serving as a unit for determining an order of reference coding units included in a picture according to an embodiment is illustrated.
[0032] Fig.17 Illustrations of coding units that may be determined for each picture when a combination of shapes into which a coding unit may be divided differs for each picture according to an embodiment.
[0033] Fig.18 Various shapes of coding units that may be determined based on division shape information that may be represented as a binary code according to an embodiment are illustrated.
[0034] Fig.19 Other shapes of coding units that may be determined based on division shape information that may be represented as a binary code according to an embodiment are illustrated.
[0035] Fig. 20 is a block diagram of an image encoding and decoding system for performing loop filtering.
[0036] Fig.21 is a block diagram of an image decoding apparatus according to an embodiment.
[0037] Figure 22 to Figure 25 Each shows a predicted motion vector candidate displayed on a coordinate plane.
[0038] Fig.26 is a diagram illustrating prediction motion vector candidates determined based on a disparity distance scaled according to a minimum pixel unit.
[0039] Fig. 27 is a diagram for describing a method of changing a base motion vector candidate.
[0040] Fig.28 is a diagram for describing an index indicating a prediction motion vector candidate according to an embodiment.
[0041] Fig.29 is a diagram for describing motion information used for bidirectional prediction of a block.
[0042] Fig.30 is a diagram showing the positional relationship between a current picture and two reference pictures.
[0043] Fig.31 is a diagram showing prediction motion vector candidates for a current block that is bi-directionally predicted.
[0044] Fig.32 is a diagram showing the positional relationship between a current picture and two reference pictures.
[0045] Fig.33 is a diagram showing prediction motion vector candidates for a current block that is bi-directionally predicted.
[0046] Fig.34 is a diagram for describing a process of obtaining parameters related to a preset mode, performed by an image decoding apparatus according to an embodiment.
[0047] Fig.35 is a flowchart for describing an image decoding method according to an embodiment.
[0048] Fig.36 is a block diagram of an image encoding apparatus according to an embodiment.
[0049] Fig.37 is a flowchart for describing an image encoding method according to an embodiment. DETAILED DESCRIPTION
[0050] Best Practices
[0051] According to an embodiment of the present disclosure, a method for decoding motion information includes: obtaining information indicating a disparity distance for determining a predicted motion vector of a current block; scaling the disparity distance corresponding to the obtained information based on a comparison result between a basic pixel unit and a minimum pixel unit that can be indicated by the motion vector of the current block; determining a predicted motion vector candidate among one or more predicted motion vector candidates that is changed by a scaled disparity distance from a basic motion vector of the current block as the predicted motion vector of the current block; and determining the motion vector of the current block by using the predicted motion vector.
[0052] In an embodiment, the step of scaling the disparity distance may include scaling the disparity distance based on a ratio between the basic pixel unit and the minimum pixel unit.
[0053] In an embodiment, the step of obtaining information indicating the disparity distance may include: obtaining information indicating a disparity direction, and the step of determining a predicted motion vector candidate having the disparity distance changed and scaled as the predicted motion vector of the current block may include: determining the predicted motion vector candidate having the disparity distance changed and scaled from the base motion vector of the current block according to the disparity direction corresponding to the obtained information indicating the disparity direction as the predicted motion vector of the current block.
[0054] In an embodiment, the step of obtaining the information indicating the disparity direction may include obtaining at least one of the information indicating the disparity distance and the information indicating the disparity direction by entropy decoding a bit value included in a bitstream according to a context model.
[0055] In an embodiment, the step of obtaining at least one of the information indicating the disparity distance and the information indicating the disparity direction may include: selecting a context model for obtaining at least one of the information indicating the disparity distance and the information indicating the disparity direction based on information related to a previously decoded block to which the same prediction mode as the prediction mode applied to the current block is applied.
[0056] In an embodiment, the method may further include: determining one base motion vector candidate among one or more base motion vector candidates as the base motion vector of the current block.
[0057] In an embodiment, the method may further include: scaling one or more disparity distances predetermined based on the basic pixel unit based on the minimum pixel unit; and determining, based on the one or more basic motion vector candidates, one or more predicted motion vector candidates whose one or more disparity distances are changed and scaled from the basic motion vector candidates.
[0058] In an embodiment, the step of determining the one or more predicted motion vector candidates may include: changing a basic motion vector candidate among the one or more basic motion vector candidates that can indicate a pixel unit smaller than the minimum pixel unit based on the minimum pixel unit; and determining the one or more predicted motion vector candidates of the one or more disparity distances after the change in scaling from the changed basic motion vector candidate.
[0059] In an embodiment, the predetermined one or more disparity distances may be determined differently for the one or more base motion vector candidates.
[0060] In an embodiment, the step of determining the one or more predicted motion vector candidates may include: for bidirectional base motion vector candidates, determining one or more predicted motion vector candidates of the first unidirectional base motion vector that are changed by the one or more disparity distances after scaling from the first unidirectional base motion vector; rescaling the one or more scaled disparity distances based on a positional relationship among a current picture including the current block, a first reference picture indicated by the first unidirectional base motion vector candidate, and a second reference picture indicated by the second unidirectional base motion vector candidate; and determining one or more predicted motion vector candidates of the second unidirectional that are changed by the one or more rescaled disparity distances from the second unidirectional base motion vector candidate.
[0061] In an embodiment, the disparity direction of the one or more prediction motion vector candidates of the second unidirectional direction may be the same as or opposite to the disparity direction of the one or more prediction motion vector candidates of the first unidirectional direction.
[0062] In an embodiment, the step of determining the predicted motion vector candidate of the scaled disparity distance as the predicted motion vector of the current block may include: when the disparity distance corresponding to the obtained information is 0, determining the base motion vector of the current block as the predicted motion vector of the current block.
[0063] In an embodiment, the method may further include: when it is determined that the first prediction mode is applied to the current block, obtaining information indicating whether the second prediction mode is applied to the current block from the bitstream, wherein when the second prediction mode is applied to the current block, obtaining information indicating the disparity distance.
[0064] In an embodiment, the step of determining the motion vector of the current block may include: obtaining a differential motion vector related to the current block from a bitstream; and determining the motion vector of the current block by applying the differential motion vector corresponding to information indicating the differential motion vector to the predicted motion vector.
[0065] A method for encoding motion information according to an embodiment of the present disclosure includes: scaling one or more disparity distances predetermined based on basic pixel units based on a minimum pixel unit that can be indicated by a motion vector of a current block; determining one or more predicted motion vector candidates based on one or more base motion vector candidates whose one or more disparity distances are changed and scaled from the base motion vector candidates; determining a predicted motion vector of the current block from the one or more predicted motion vector candidates; and generating a bitstream, wherein the bitstream includes information indicating a disparity distance of a predicted motion vector candidate that is used to specify the predicted motion vector determined as the current block.
[0066] Public method
[0067] Since the present disclosure allows various changes and multiple embodiments, the exemplary embodiments will be shown in the drawings and described in detail in the written description. However, this is not intended to limit the present disclosure to a specific embodiment, and it will be understood that all changes, equivalent forms and substitutions that do not depart from the spirit and technical scope of the present disclosure are included in the present disclosure.
[0068] In the description of the present disclosure, when it is considered that the specific detailed explanation of the related art may unnecessarily obscure the essence of the present disclosure, the specific detailed explanation of the related art is omitted. In addition, the numbers (e.g., first and second) used in the description of the embodiments of the present disclosure are only intended to distinguish one component from another component.
[0069] When a component is referred to as being "connected" or "accessed" to any other component or being "connected" or "accessed" through any other component, it should be understood that the component may be directly connected or accessed to the other component or connected or accessed through the other component, and another new component may also be interposed between them unless otherwise specifically indicated.
[0070] Regarding elements with suffixes such as "unit" or "module", two or more elements may be combined into one element according to function or one element may be divided into two or more elements according to function. In addition, each of the various components to be described below may additionally perform some or all of the functions that other components are responsible for in addition to the main functions that each component is responsible for, and some of the main functions that the various components are responsible for may be exclusively performed by other components.
[0071] Furthermore, the term "image" or "frame" used herein may refer to a still image or a moving image of a video (ie, the video itself).
[0072] In addition, the term "sample" used herein means data assigned to a sampling position of an image and to be processed. For example, a pixel in an image in a spatial domain or a transform coefficient in a transform domain may be a sample. A unit including one or more samples may be defined as a block.
[0073] Also, the term 'current block' used herein may mean a block of a maximum coding unit, a coding unit, a prediction unit, or a transformation unit of a current image to be encoded or decoded.
[0074] Furthermore, in the present specification, when a motion vector is in the list 0 direction, it may mean that the motion vector is a motion vector indicating a block in a reference picture included in list 0, and when a motion vector is in the list 1 direction, it may mean that the motion vector is a motion vector indicating a block in a reference picture included in list 1. Furthermore, when a motion vector is unidirectional, it may mean that the motion vector is a motion vector indicating a block in a reference picture included in list 0 or list 1, and when a motion vector is bidirectional, it may mean that the motion vector includes a motion vector in the list 0 direction and a motion vector in the list 1 direction.
[0075] Will refer to Figures 1 to 20 An image encoding method and apparatus based on a transformation unit and a coding unit having a tree structure and an image decoding method and apparatus according to an embodiment are described. Figures 1 to 20 The image encoding device 200 and the image decoding device 100 described may respectively include a reference Figures 21 to 37 An image encoding device 3600 and an image decoding device 2100 are described.
[0076] Figure 1is a block diagram of an image decoding apparatus 100 according to an embodiment.
[0077] The image decoding apparatus 100 may include a bitstream obtainer 110 and a decoder 120. The bitstream obtainer 110 and the decoder 120 may include at least one processor. In addition, the bitstream obtainer 110 and the decoder 120 may include a memory storing instructions to be executed by at least one processor.
[0078] The bitstream obtainer 110 may receive a bitstream. The bitstream includes information obtained when the image encoding device 200 encodes an image as described below. In addition, the bitstream may be sent from the image encoding device 200. The image encoding device 200 and the image decoding device 100 may be connected to each other by wire or wirelessly, and the bitstream obtainer 110 may receive the bitstream by wire or wirelessly. The bitstream obtainer 110 may receive the bitstream from a storage medium (such as an optical medium or a hard disk). The decoder 120 may reconstruct the image based on the information obtained from the received bitstream. The decoder 120 may obtain syntax elements for reconstructing the image from the bitstream. The decoder 120 may reconstruct the image based on the syntax elements.
[0079] The operation of the image decoding apparatus 100 will be described in detail. The bitstream obtainer 110 may receive a bitstream.
[0080] The image decoding apparatus 100 may perform an operation of obtaining a binary bit string corresponding to a division shape pattern of a coding unit from a bitstream. The image decoding apparatus 100 may perform an operation of determining a division rule of a coding unit. In addition, based on at least one of the binary string corresponding to the division shape pattern and the division rule, the image decoding apparatus 100 may perform an operation of dividing a coding unit into a plurality of coding units. In order to determine the division rule, the image decoding apparatus 100 may determine an allowable first range of the size of the coding unit according to a ratio between a width and a height of the coding unit. In order to determine the division rule, the image decoding apparatus 100 may determine an allowable second range of the size of the coding unit according to the division shape pattern of the coding unit.
[0081] An operation of splitting a coding unit according to an embodiment of the present disclosure will be described in detail.
[0082] First, a picture may be divided into one or more slices. A slice may be a sequence of maximum coding units (coding tree units (CTUs)). Conceptually, compared to the maximum coding unit (CTU), there is a maximum coding block (coding tree block (CTB)).
[0083] A maximum coding block (CTB) represents an N×N block including N×N samples (N is an integer). Each color component can be divided into one or more maximum coding blocks.
[0084] When a picture has three sample arrays (sample arrays for Y component, Cr component, and Cb component), the maximum coding unit (CTU) includes a maximum coding block of luma samples, two corresponding maximum coding blocks of chroma samples, and a syntax structure for encoding luma samples and chroma samples. When the picture is a monochrome picture, the maximum coding unit includes a maximum coding block of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture with color planes separated according to color components, the maximum coding unit includes a syntax structure for encoding the picture and samples of the picture.
[0085] One maximum coding block (CTB) may be divided into M×N coding blocks including M×N samples (M and N are integers).
[0086] When the picture has sample arrays for Y component, Cr component and Cb component, the coding unit (CU) includes a coding block of luma samples, two corresponding coding blocks of chroma samples, and a syntax structure for encoding the luma samples and the chroma samples. When the picture is a monochrome picture, the coding unit includes a coding block of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture with color planes separated according to color components, the coding unit includes a syntax structure for encoding the picture and the samples of the picture.
[0087] As described above, the maximum coding block and the maximum coding unit are conceptually distinguished from each other, and the coding block and the coding unit are conceptually distinguished from each other. That is, the (maximum) coding unit represents a data structure including a (maximum) coding block including corresponding samples and a syntax structure corresponding to the (maximum) coding block. However, because a person skilled in the art understands that a (maximum) coding unit or a (maximum) coding block represents a block of a predetermined size including a predetermined number of samples, unless otherwise described, the maximum coding block and the maximum coding unit or the coding block and the coding unit are mentioned in the following description without distinction.
[0088] The image may be divided into maximum coding units (CTUs). The size of each maximum coding unit may be determined based on information obtained from the bitstream. The shape of each maximum coding unit may be a square shape of the same size. However, the present disclosure is not limited thereto.
[0089] For example, information about the maximum size of the luma coding block may be obtained from the bitstream. For example, the maximum size of the luma coding block indicated by the information about the maximum size of the luma coding block may be one of 4×4, 8×8, 16×16, 32×32, 64×64, 128×128, and 256×256.
[0090] For example, information about the luminance block size difference and the maximum size of the luminance coding block that can be divided into two may be obtained from the bitstream. The information about the luminance block size difference may represent the size difference between the luminance maximum coding unit and the maximum luminance coding block that can be divided into two. Therefore, when the information about the maximum size of the luminance coding block that can be divided into two obtained from the bitstream and the information about the luminance block size difference are combined with each other, the size of the luminance maximum coding unit may be determined. The size of the chrominance maximum coding unit may be determined by using the size of the luminance maximum coding unit. For example, when the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chrominance block may be half the size of the luminance block, and the size of the chrominance maximum coding unit may be half the size of the luminance maximum coding unit.
[0091] According to an embodiment, since information about the maximum size of a brightness coding block that can be divided into two is obtained from a bitstream, the maximum size of the brightness coding block that can be divided into two can be determined variably. Conversely, the maximum size of a brightness coding block that can be divided into three can be fixed. For example, the maximum size of a brightness coding block that can be divided into three in an I slice can be 32×32, and the maximum size of a brightness coding block that can be divided into three in a P slice or a B slice can be 64×64.
[0092] In addition, the maximum coding unit may be hierarchically divided into coding units based on the division shape pattern information obtained from the bitstream. At least one of information indicating whether to perform four divisions, information indicating whether to perform multi-division, division direction information, and division type information may be obtained from the bitstream as the division shape pattern information.
[0093] For example, the information indicating whether to perform four-split may indicate whether the current coding unit is divided into four (QUAD_SPLIT).
[0094] When the current coding unit is not divided into four, the information indicating whether to perform multi-split may indicate that the current coding unit is no longer split (NO_SPLIT) or is divided into two / three.
[0095] When the current coding unit is divided into two or three, the division direction information indicates that the current coding unit is divided in one direction of a horizontal direction and a vertical direction.
[0096] When the current coding unit is split in a horizontal direction or a vertical direction, the split type information indicates whether the current coding unit is split into two or three.
[0097] The split mode of the current coding unit may be determined according to the split direction information and the split type information. The split mode when the current coding unit is split into two in the horizontal direction may be determined as a horizontal two-split mode (SPLIT_BT_HOR), the split mode when the current coding unit is split into three in the horizontal direction may be determined as a horizontal three-split mode (SPLIT_TT_HOR), the split mode when the current coding unit is split into two in the vertical direction may be determined as a vertical two-split mode (SPLIT_BT_VER), and the split mode when the current coding unit is split into three in the vertical direction may be determined as a vertical three-split mode (SPLIT_TT_VER).
[0098] The image decoding apparatus 100 may obtain the division shape pattern information from a bit stream from a binary bit string. The bit stream received by the image decoding apparatus 100 may include a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. A binary bit string is a binary sequence of information. A binary bit string may include at least one bit. The image decoding apparatus 100 may obtain the division shape pattern information corresponding to the binary bit string based on a division rule. The image decoding apparatus 100 may determine whether to perform four divisions on the coding unit, the division direction, and the division type based on a binary bit string.
[0099] The coding unit may be equal to or smaller than the maximum coding unit. For example, since the maximum coding unit is a coding unit having the maximum size, the maximum coding unit is one of the coding units. When the division shape pattern information about the maximum coding unit indicates that division is not performed, the coding unit determined in the maximum coding unit has the same size as the size of the maximum coding unit. When the division shape pattern information about the maximum coding unit indicates that division is performed, the maximum coding unit may be divided into coding units. In addition, when the division shape pattern information about the coding unit indicates that division is performed, the coding unit may be divided into smaller coding units. However, the division of the image is not limited thereto, and the maximum coding unit and the coding unit may not be distinguished from each other. Referring to Figures 3 to 16 The division of coding units is described in more detail.
[0100] In addition, one or more prediction blocks for prediction may be determined from the coding unit. The prediction block may be equal to or smaller than the coding unit. In addition, one or more transform blocks for transformation may be determined from the coding unit. The transform block may be equal to or smaller than the coding unit.
[0101] The shapes and sizes of the transform block and the prediction block may be unrelated to each other.
[0102] In another embodiment, prediction may be performed by using a coding unit as a prediction unit. In addition, transformation may be performed by using a coding unit as a transformation block.
[0103] Will refer to Figures 3 to 16 The division of the coding unit is described in more detail. Each of the current block and the neighboring block of the present disclosure may indicate one of the maximum coding unit, the coding unit, the prediction block, and the transform block. In addition, the current block or the current coding unit is a block currently being decoded or encoded or a block currently being divided. The neighboring block may be a block reconstructed before the current block. The neighboring block may be adjacent to the current block in space or time. The neighboring block may be located at one of the lower left side, left side, upper left side, upper side, upper right side, right side, and lower right side of the current block.
[0104] Figure 3 A process of determining at least one coding unit by splitting a current coding unit, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0105] The block shape may include 4N×4N, 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N. N may be a positive integer. The block shape information is information indicating at least one of a shape, a direction, a ratio between a width and a height, and a size of a coding unit.
[0106] The shape of the coding unit may include a square shape and a non-square shape. When the width and height of the coding unit are the same (that is, when the block shape of the coding unit is 4N×4N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a square shape. The image decoding apparatus 100 may determine the shape of the coding unit as a non-square shape.
[0107] When the width and height of the coding unit are different from each other (that is, when the block shape of the coding unit is 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N), the image decoding apparatus 100 may determine the block shape information of the coding unit as a non-square shape. When the shape of the coding unit is a non-square shape, the image decoding apparatus 100 may determine the ratio of the width to the height in the block shape information of the coding unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. In addition, the image decoding apparatus 100 may determine whether the coding unit is in the horizontal direction or in the vertical direction based on the width length and height length of the coding unit. In addition, the image decoding apparatus 100 may determine the size of the coding unit based on at least one of the width length, height length, and area of the coding unit.
[0108] According to an embodiment, the image decoding apparatus 100 may determine the shape of the coding unit by using block shape information, and may determine into which shape the coding unit is divided by using division shape mode information. That is, the coding unit division method indicated by the division shape mode information may be determined according to which block shape is indicated by the block shape information used by the image decoding apparatus 100.
[0109] The image decoding device 100 may determine the division shape pattern information from the bitstream. However, the present disclosure is not limited thereto, and the image decoding device 100 and the image encoding device 200 may determine the pre-agreed division shape pattern information based on the block shape information. The image decoding device 100 may determine the pre-agreed division shape pattern information for the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine that the pre-agreed division shape pattern information for the maximum coding unit indicates four divisions. In addition, the image decoding device 100 may determine that the pre-agreed division shape pattern information for the minimum coding unit indicates "no division is performed". For example, the image decoding device 100 may determine the size of the maximum coding unit to be 256×256. The image decoding device 100 may determine that the pre-agreed division shape pattern information indicates four divisions. Four divisions are division shape patterns that divide the width and height of the coding unit into two equal parts. The image decoding device 100 may obtain a coding unit of size 128×128 from a maximum coding unit of size 256×256 based on the division shape pattern information. Also, the image decoding apparatus 100 may determine the size of the minimum coding unit to be 4 × 4. The image decoding apparatus 100 may obtain division shape pattern information indicating “do not perform division” with respect to the minimum coding unit.
[0110] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a square shape. For example, the image decoding apparatus 100 may determine whether to split the square coding unit, whether to split the square coding unit vertically, whether to split the square coding unit horizontally, or whether to split the square coding unit into four coding units based on the split shape mode information. Figure 3 , when the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may determine not to divide the coding unit 310a having the same size as the current coding unit 300 based on the division shape pattern information indicating that division is not performed, or may determine the coding units 310b, 310c, 310d, 310e and 310f divided based on the division shape pattern information indicating a predetermined division method.
[0111] Reference Figure 3According to an embodiment, the image decoding apparatus 100 may determine two coding units 310b obtained by vertically splitting the current coding unit 300 based on the split shape pattern information indicating that splitting is performed vertically. The image decoding apparatus 100 may determine two coding units 310c obtained by horizontally splitting the current coding unit 300 based on the split shape pattern information indicating that splitting is performed horizontally. The image decoding apparatus 100 may determine four coding units 310d obtained by vertically and horizontally splitting the current coding unit 300 based on the split shape pattern information indicating that splitting is performed vertically and horizontally. According to an embodiment, the image decoding apparatus 100 may determine three coding units 310e obtained by vertically splitting the current coding unit 300 based on the split shape pattern information indicating that three splitting is performed vertically. The image decoding apparatus 100 may determine three coding units 310f obtained by horizontally splitting the current coding unit 300 based on the split shape pattern information indicating that three splitting is performed horizontally. However, the splitting method of the square coding unit is not limited to the above method, and the split shape pattern information may include various methods. The predetermined division method for dividing the square coding unit will be described in detail below through various embodiments.
[0112] Figure 4 A process of determining at least one coding unit by splitting a non-square coding unit, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0113] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a non-square shape. The image decoding apparatus 100 may determine whether to split the non-square current coding unit or to split the non-square current coding unit by using a predetermined method according to the split shape mode information. Figure 4 , when the block shape information of the current coding unit 400 or 450 indicates a non-square shape, the image decoding apparatus 100 may determine a coding unit 410 or a coding unit 460 having the same size as the current coding unit 400 or 450 based on the division shape pattern information indicating that division is not performed, or determine coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c divided based on the division shape pattern information indicating a predetermined division method. A predetermined division method for dividing a non-square coding unit will be described in detail below through various embodiments.
[0114] According to an embodiment, the image decoding apparatus 100 may determine a splitting method of a coding unit by using splitting shape pattern information, and in this case, the splitting shape pattern information may indicate the number of one or more coding units generated by splitting the coding unit. Figure 4When the division shape pattern information indicates that the current coding unit 400 or 450 is divided into two coding units, the image decoding device 100 can determine the two coding units 420a and 420b or 470a and 470b included in the current coding unit 400 or 450 by dividing the current coding unit 400 or 450 based on the division shape pattern information.
[0115] According to an embodiment, when the image decoding apparatus 100 splits the non-square current coding unit 400 or 450 based on the split shape pattern information, the position of the long side of the non-square current coding unit 400 or 450 may be considered. For example, the image decoding apparatus 100 may determine a plurality of coding units by splitting the long side of the current coding unit 400 or 450 considering the shape of the current coding unit 400 or 450.
[0116] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided (three-divided) into an odd number of blocks, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450. For example, when the division shape pattern information indicates that the current coding unit 400 or 450 is divided into three coding units, the image decoding apparatus 100 may divide the current coding unit 400 or 450 into three coding units 430a, 430b, and 430c or 480a, 480b, and 480c.
[0117] According to an embodiment, the ratio between the width and the height of the current coding unit 400 or 450 may be 4:1 or 1:4. When the ratio between the width and the height is 4:1, the width length is greater than the height length, and thus the block shape information may be horizontal. When the ratio between the width and the height is 1:4, the width length is less than the height length, and thus the block shape information may be vertical. The image decoding apparatus 100 may determine to divide the current coding unit into an odd number of blocks based on the division shape pattern information. In addition, the image decoding apparatus 100 may determine the division direction of the current coding unit 400 or 450 based on the block shape information of the current coding unit 400 or 450. For example, when the current coding unit 400 is in a vertical direction, the image decoding apparatus 100 may horizontally divide the current coding unit 400 and may determine the coding units 430a, 430b, and 430c. Also, when the current coding unit 450 is in a horizontal direction, the image decoding apparatus 100 may vertically split the current coding unit 450 and may determine coding units 480a, 480b, and 480c.
[0118] According to an embodiment, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and the sizes of all the determined coding units may be different. For example, a predetermined coding unit 430b or coding unit 480b among the determined odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have a size different from that of other coding units 430a and 430c or 480a and 480c. That is, the coding units determined by dividing the current coding unit 400 or 450 may have a variety of sizes, and in some cases, all the coding units among the odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have different sizes.
[0119] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of blocks, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and may apply a predetermined restriction to at least one of the odd number of coding units generated by dividing the current coding unit 400 or 450. Figure 4 , the image decoding apparatus 100 may allow a decoding method of a coding unit 430b or a coding unit 480b to be different from a decoding method of other coding units 430a and 430c or 480a and 480c, wherein the coding unit 430b or the coding unit 480b is at a center position among three coding units 430a, 430b, and 430c or 480a, 480b, and 480c generated by dividing the current coding unit 400 or 450. For example, unlike other coding units 430a and 430c or 480a and 480c, the image decoding apparatus 100 may restrict the coding unit 430b or the coding unit 480b at the center position from being further divided or being divided only a predetermined number of times.
[0120] Figure 5 A process of splitting a coding unit based on at least one of block shape information and division shape pattern information, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0121] According to an embodiment, the image decoding apparatus 100 may determine whether to divide the square first coding unit 500 into coding units or not to divide the square first coding unit 500 based on at least one of the block shape information and the division shape mode information. According to an embodiment, when the division shape mode information indicates that the first coding unit 500 is divided in the horizontal direction, the image decoding apparatus 100 may determine the second coding unit 510 by dividing the first coding unit 500 in the horizontal direction. The first coding unit, the second coding unit, and the third coding unit used according to the embodiment are terms for understanding the relationship between the coding unit before and after the coding unit is divided. For example, the second coding unit may be determined by dividing the first coding unit, and the third coding unit may be determined by dividing the second coding unit. It will be understood that the relationship between the first coding unit, the second coding unit, and the third coding unit is applicable to the following description.
[0122] According to an embodiment, the image decoding apparatus 100 may determine whether to split the determined second coding unit 510 into coding units or not to split the determined second coding unit 510 based on the division shape pattern information. Figure 5 , the image decoding apparatus 100 may split or not split the non-square second coding unit 510 determined by splitting the first coding unit 500 into one or more third coding units 520a or 520b, 520c, and 520d based on the split shape pattern information. The image decoding apparatus 100 may obtain the split shape pattern information, and may split a plurality of second coding units (e.g., 510) of various shapes by splitting the first coding unit 500 based on the obtained split shape pattern information, and may split the second coding unit 510 by using the split method of the first coding unit 500 based on the split shape pattern information. According to an embodiment, when the first coding unit 500 is split into the second coding unit 510 based on the split shape pattern information of the first coding unit 500, the second coding unit 510 may also be split into the third coding units 520a or 520b, 520c, and 520d based on the split shape pattern information of the second coding unit 510. That is, the coding unit may be recursively split based on the split shape pattern information of each coding unit. Thus, a square coding unit may be determined by splitting a non-square coding unit, and a non-square coding unit may be determined by recursively splitting the square coding unit.
[0123] Reference Figure 5, a predetermined coding unit (e.g., a coding unit at a center position or a square coding unit) among the odd number of third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510 may be recursively divided. According to an embodiment, the non-square third coding unit 520b among the odd number of third coding units 520b, 520c, and 520d may be divided into a plurality of fourth coding units in the horizontal direction. The non-square fourth coding unit 530b or 530d among the plurality of fourth coding units 530a, 530b, 530c, and 530d may be divided into a plurality of coding units again. For example, the non-square fourth coding unit 530b or 530d may be divided into an odd number of coding units again. A method that may be used to recursively divide a coding unit will be described below through various embodiments.
[0124] According to an embodiment, the image decoding apparatus 100 may divide each of the third coding unit 520a or 520b, 520c, and 520d into coding units based on the division shape pattern information. In addition, the image decoding apparatus 100 may determine not to divide the second coding unit 510 based on the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The image decoding apparatus 100 may impose a predetermined restriction on a predetermined third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding apparatus 100 may limit the third coding unit 520c at the center position among the odd number of third coding units 520b, 520c, and 520d to no longer be divided or to be divided a set number of times.
[0125] Reference Figure 5 , the image decoding apparatus 100 may limit the third coding unit 520c at the center position among the odd-numbered third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to no longer be divided, to be divided by using a predetermined division method (e.g., only divided into four coding units or divided by using the division method of the second coding unit 510), or to be divided only a predetermined number of times (e.g., only divided n times (where n>0)). However, the limitation on the third coding unit 520c at the center position is not limited to the above example, and may include various limitations for decoding the third coding unit 520c at the center position differently from the other third coding units 520b and 520d.
[0126] According to an embodiment, the image decoding apparatus 100 may obtain split shape pattern information for splitting the current coding unit from a predetermined position in the current coding unit.
[0127] Figure 6 A method of determining a predetermined coding unit from among odd-numbered coding units, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0128] Reference Figure 6 , the division shape mode information of the current coding unit 600 or 650 may be obtained from a sample at a predetermined position (e.g., a sample 640 or 690 at a center position) among a plurality of samples included in the current coding unit 600 or 650. However, the predetermined position in the current coding unit 600 where the division shape mode information may be obtained is not limited to Figure 6 , and may include various positions (e.g., top, bottom, left, right, top left, bottom left, top right, and bottom right positions) included in the current coding unit 600. The image decoding apparatus 100 may obtain the division shape pattern information from a predetermined position and may determine whether to divide the current coding unit into coding units of various shapes and sizes or not to divide the current coding unit.
[0129] According to an embodiment, when the current coding unit is split into a predetermined number of coding units, the image decoding apparatus 100 may select one of the coding units. Various methods that may be used to select one of a plurality of coding units will be described below through various embodiments.
[0130] According to an embodiment, the image decoding apparatus 100 may split a current coding unit into a plurality of coding units, and may determine a coding unit at a predetermined position.
[0131] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a center position among the odd-numbered coding units using information indicating the positions of the odd-numbered coding units. Figure 6, the image decoding apparatus 100 may determine the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c by dividing the current coding unit 600 or the current coding unit 650. The image decoding apparatus 100 may determine the coding unit 620b at the center position or the coding unit 660b at the center position by using information about the positions of the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c. For example, the image decoding apparatus 100 may determine the coding unit 620b at the center position by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of predetermined samples included in the coding units 620a, 620b, and 620c. In detail, the image decoding apparatus 100 may determine the coding unit 620b at the center position by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of the upper left samples 630a, 630b, and 630c of the coding units 620a, 620b, and 620c.
[0132] According to an embodiment, the information indicating the positions of the upper left sample points 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture. According to an embodiment, the information indicating the positions of the upper left sample points 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information indicating the width or height of the coding units 620a, 620b, and 620c included in the current coding unit 600, and the width or height may correspond to the information indicating the difference between the coordinates of the coding units 620a, 620b, and 620c in the picture. That is, the image decoding apparatus 100 may determine the coding unit 620b at the center position by directly using the information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture or by using the information about the width or height of the coding unit corresponding to the difference between the coordinates.
[0133] According to an embodiment, information indicating the position of the upper left sample point 630a of the upper coding unit 620a may include coordinates (xa, ya), information indicating the position of the upper left sample point 630b of the middle coding unit 620b may include coordinates (xb, yb), and information indicating the position of the upper left sample point 630c of the lower coding unit 620c may include coordinates (xc, yc). The image decoding apparatus 100 may determine the middle coding unit 620b by using the coordinates of the upper left sample points 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c. For example, when the coordinates of the upper left sample points 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b including the coordinates (xb, yb) of the sample point 630b at the center position may be determined as the coding unit at the center position among the coding units 620a, 620b, and 620c determined by splitting the current coding unit 600. However, the coordinates indicating the positions of the upper left sample points 630a, 630b, and 630c may include coordinates indicating absolute positions in the screen, or coordinates (dxb, dyb) indicating the relative position of the upper left sample point 630b of the middle coding unit 620b relative to the position of the upper left sample point 630a of the upper coding unit 620a and coordinates (dxc, dyc) indicating the relative position of the upper left sample point 630c of the lower coding unit 620c relative to the position of the upper left sample point 630a of the upper coding unit 620a may be used. In addition, a method of determining a coding unit at a predetermined position by using the coordinates of the sample points included in the coding unit as information indicating the positions of the sample points is not limited to the above method, and may include various arithmetic methods capable of using the coordinates of the sample points.
[0134] According to an embodiment, the image decoding apparatus 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c, and may select one of the coding units 620a, 620b, and 620c based on a predetermined criterion. For example, the image decoding apparatus 100 may select a coding unit 620b having a size different from that of other coding units from among the coding units 620a, 620b, and 620c.
[0135] According to an embodiment, the image decoding apparatus 100 may determine the width or height of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya) indicating the position of the upper left sample point 630a of the upper coding unit 620a, the coordinates (xb, yb) indicating the position of the upper left sample point 630b of the middle coding unit 620b, and the coordinates (xc, yc) indicating the position of the upper left sample point 630c of the lower coding unit 620c. The image decoding apparatus 100 may determine the respective sizes of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 620a, 620b, and 620c. According to an embodiment, the image decoding apparatus 100 may determine the width of the upper coding unit 620a as the width of the current coding unit 600. The image decoding apparatus 100 may determine the height of the upper coding unit 620a as yb-ya. According to an embodiment, the image decoding apparatus 100 may determine the width of the intermediate coding unit 620b as the width of the current coding unit 600. The image decoding apparatus 100 may determine the height of the intermediate coding unit 620b as yc-yb. According to an embodiment, the image decoding apparatus 100 may determine the width or height of the lower coding unit 620c by using the width or height of the current coding unit 600 and the width or height of the upper coding unit 620a and the intermediate coding unit 620b. The image decoding apparatus 100 may determine a coding unit having a size different from that of other coding units based on the determined width and height of the coding units 620a to 620c. Referring to Figure 6 , the image decoding apparatus 100 may determine the middle coding unit 620b having a size different from the sizes of the upper coding unit 620a and the lower coding unit 620c as the coding unit at the predetermined position. However, the above-described method of determining the coding unit having a size different from the sizes of other coding units performed by the image decoding apparatus 100 corresponds only to an example of determining the coding unit at the predetermined position by using the size of the coding unit determined based on the coordinates of the sample points, and therefore, various methods of determining the coding unit at the predetermined position by comparing the size of the coding unit determined based on the coordinates of the predetermined sample points may be used.
[0136] The image decoding apparatus 100 may determine the width or height of each of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd) as information indicating the position of the upper left sample point 670a of the left coding unit 660a, the coordinates (xe, ye) as information indicating the position of the upper left sample point 670b of the middle coding unit 660b, and the coordinates (xf, yf) as information indicating the position of the upper left sample point 670c of the right coding unit 660c. The image decoding apparatus 100 may determine the sizes of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.
[0137] According to an embodiment, the image decoding apparatus 100 may determine the width of the left coding unit 660a as xe-xd. The image decoding apparatus 100 may determine the height of the left coding unit 660a as the height of the current coding unit 650. According to an embodiment, the image decoding apparatus 100 may determine the width of the middle coding unit 660b as xf-xe. The image decoding apparatus 100 may determine the height of the middle coding unit 660b as the height of the current coding unit 650. According to an embodiment, the image decoding apparatus 100 may determine the width or height of the right coding unit 660c by using the width or height of the current coding unit 650 and the widths and heights of the left coding unit 660a and the middle coding unit 660b. The image decoding apparatus 100 may determine a coding unit having a size different from sizes of other coding units based on the determined widths and heights of the coding units 660a, 660b, and 660c. Referring to Figure 6 , the image decoding apparatus 100 may determine the middle coding unit 660b having a size different from the sizes of the left coding unit 660a and the right coding unit 660c as the coding unit at the predetermined position. However, the above-mentioned method of determining the coding unit having a size different from the sizes of other coding units performed by the image decoding apparatus 100 corresponds only to an example of determining the coding unit at the predetermined position by using the size of the coding unit determined based on the coordinates of the sample points, and therefore, various methods of determining the coding unit at the predetermined position by comparing the size of the coding unit determined based on the coordinates of the predetermined sample points may be used.
[0138] However, the position of the sample considered in determining the position of the coding unit is not limited to the above-mentioned upper left position, and information on arbitrary positions of the samples included in the coding unit may be used.
[0139] According to an embodiment, the image decoding apparatus 100 may select a coding unit at a predetermined position from an odd number of coding units determined by dividing the current coding unit, considering the shape of the current coding unit. For example, when the current coding unit has a non-square shape in which the width is longer than the height, the image decoding apparatus 100 may determine a coding unit at a predetermined position in the horizontal direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions in the horizontal direction and may impose restrictions on the coding unit. When the current coding unit has a non-square shape in which the height is greater than the width, the image decoding apparatus 100 may determine a coding unit at a predetermined position in the vertical direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions in the vertical direction and may impose restrictions on the coding unit.
[0140] According to an embodiment, the image decoding apparatus 100 may use information indicating respective positions of even-numbered coding units to determine a coding unit at a predetermined position among the even-numbered coding units. The image decoding apparatus 100 may determine the even-numbered coding units by dividing (dividing) the current coding unit, and may determine the coding unit at the predetermined position by using information about the positions of the even-numbered coding units. Operations related thereto may be similar to those already described above with reference to Figure 6 The operation of determining a coding unit at a predetermined position (eg, a center position) among odd-numbered coding units described in detail corresponds, and thus a detailed description thereof is not provided here.
[0141] According to an embodiment, when a non-square current coding unit is split into a plurality of coding units, predetermined information about a coding unit at a predetermined position may be used in a split operation to determine a coding unit at a predetermined position among the plurality of coding units. For example, the image decoding apparatus 100 may determine a coding unit at a center position among the plurality of coding units determined by splitting the current coding unit using at least one of block shape information and split shape pattern information stored in samples included in the coding unit at the center position in the split operation.
[0142] Reference Figure 6, the image decoding apparatus 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on the division shape pattern information, and may determine the coding unit 620b at the center position among the plurality of coding units 620a, 620b, and 620c. In addition, the image decoding apparatus 100 may determine the coding unit 620b at the center position in consideration of the position where the division shape pattern information is obtained. That is, the division shape pattern information of the current coding unit 600 may be obtained from the sample point 640 at the center position of the current coding unit 600, and when the current coding unit 600 is divided into a plurality of coding units 620a, 620b, and 620c based on the division shape pattern information, the coding unit 620b including the sample point 640 may be determined as the coding unit at the center position. However, information for determining the coding unit at the center position is not limited to the division shape pattern information, and various types of information may be used to determine the coding unit at the center position.
[0143] According to an embodiment, predetermined information for identifying a coding unit at a predetermined position may be obtained from predetermined samples included in a coding unit to be determined. Figure 6 , the image decoding apparatus 100 may determine a coding unit at a predetermined position (e.g., a coding unit at a center position of the divided coding units) among a plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, using division shape pattern information obtained from a sample at a predetermined position in the current coding unit 600 (e.g., a sample at a center position of the divided coding unit 600). That is, the image decoding apparatus 100 may determine the sample at the predetermined position by considering the block shape of the current coding unit 600, may determine a coding unit 620b including a sample for which predetermined information (e.g., division shape pattern information) may be obtained from among a plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may impose predetermined restrictions on the coding unit 620b. Referring to Figure 6 According to an embodiment, in a decoding operation, the image decoding apparatus 100 may determine a sample 640 at a center position of a current coding unit 600 as a sample at which predetermined information may be obtained, and may impose a predetermined restriction on a coding unit 620b including the sample 640. However, the position of the sample at which the predetermined information may be obtained is not limited to the above position, and may include any position of the sample included in the coding unit 620b to be determined for restriction.
[0144] According to an embodiment, the position of the sample at which the predetermined information can be obtained may be determined based on the shape of the current coding unit 600. According to an embodiment, the block shape information may indicate whether the current coding unit has a square shape or a non-square shape, and the position of the sample at which the predetermined information can be obtained may be determined based on the shape. For example, the image decoding apparatus 100 may determine a sample located on a boundary for dividing at least one of the width and the height of the current coding unit in half as a sample at which the predetermined information can be obtained by using at least one of the information about the width of the current coding unit and the information about the height of the current coding unit. As another example, when the block shape information of the current coding unit indicates a non-square shape, the image decoding apparatus 100 may determine one of the samples adjacent to the boundary for dividing the long side of the current coding unit in half as a sample at which the predetermined information can be obtained.
[0145] According to an embodiment, when a current coding unit is divided into a plurality of coding units, the image decoding apparatus 100 may use division shape pattern information to determine a coding unit at a predetermined position among the plurality of coding units. According to an embodiment, the image decoding apparatus 100 may obtain division shape pattern information from a sample at a predetermined position in a coding unit, and may divide the plurality of coding units by using division shape pattern information obtained from a sample at a predetermined position in each of a plurality of coding units generated by dividing the current coding unit. That is, the coding unit may be recursively divided based on the division shape pattern information obtained from the sample at the predetermined position in each coding unit. As has been described above with reference to Figure 5 An operation of recursively splitting the coding unit is described, and thus a detailed description thereof will not be provided here.
[0146] According to an embodiment, the image decoding apparatus 100 may determine one or more coding units by splitting a current coding unit, and may determine an order in which to decode the one or more coding units based on a predetermined block (eg, the current coding unit).
[0147] Figure 7 An order in which a plurality of coding units are processed when the image decoding apparatus 100 determines a plurality of coding units by splitting a current coding unit according to an embodiment is illustrated.
[0148] According to an embodiment, based on the division shape pattern information, the image decoding device 100 may determine the second coding units 710a and 710b by dividing the first coding unit 700 in a vertical direction, may determine the second coding units 730a and 730b by dividing the first coding unit 700 in a horizontal direction, or may determine the second coding units 750a to 750d by dividing the first coding unit 700 in vertical and horizontal directions.
[0149] Reference Figure 7 , the image decoding apparatus 100 may determine to process the second coding units 710a and 710b determined by dividing the first coding unit 700 in the vertical direction in a horizontal direction order 710c. The image decoding apparatus 100 may determine to process the second coding units 730a and 730b determined by dividing the first coding unit 700 in the horizontal direction in a vertical direction order 730c. The image decoding apparatus 100 may determine to process the second coding units 750a to 750d determined by dividing the first coding unit 700 in the vertical and horizontal directions in a predetermined order (for example, in a raster scan order or a zigzag scan order 750e), wherein the predetermined order is used to process the coding units in one row and then process the coding units in the next row.
[0150] According to an embodiment, the image decoding apparatus 100 may recursively divide the coding unit. Figure 7 , the image decoding device 100 may determine a plurality of second coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d by dividing the first coding unit 700, and may recursively divide each of the determined plurality of second coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. The division method of the plurality of second coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d may correspond to the division method of the first coding unit 700. In this way, each of the plurality of second coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d may be independently divided into a plurality of coding units. Referring to Figure 7 , the image decoding apparatus 100 may determine the second coding units 710a and 710b by dividing the first coding unit 700 in a vertical direction, and may determine to divide each of the second coding units 710a and 710b independently or not to divide each of the second coding units 710a and 710b.
[0151] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 720a and 720b by splitting the left second coding unit 710a in a horizontal direction, and may not split the right second coding unit 710b.
[0152] According to an embodiment, the processing order of the coding units may be determined based on the operation of dividing the coding units. In other words, the processing order of the divided coding units may be determined based on the processing order of the coding units immediately before being divided. The image decoding apparatus 100 may determine the processing order of the third coding units 720a and 720b determined by dividing the left second coding unit 710a independently of the right second coding unit 710b. Since the third coding units 720a and 720b are determined by dividing the left second coding unit 710a in the horizontal direction, the third coding units 720a and 720b may be processed in a vertical direction order 720c. Since the left second coding unit 710a and the right second coding unit 710b are processed in a horizontal direction order 710c, the right second coding unit 710b may be processed after the third coding units 720a and 720b included in the left second coding unit 710a are processed in a vertical direction order 720c. The operation of determining the processing order of coding units based on the coding units before being split is not limited to the above example, and various methods may be used to independently process coding units that are split and determined to be various shapes in a predetermined order.
[0153] Figure 8 A process of determining that a current coding unit is to be split into an odd number of coding units when coding units may not be processed in a predetermined order, performed by the image decoding apparatus 100 according to an embodiment is illustrated.
[0154] According to an embodiment, the image decoding apparatus 100 may determine whether the current coding unit is split into an odd number of coding units based on the obtained division shape pattern information. Figure 8 , the square first coding unit 800 may be divided into non-square second coding units 810a and 810b, and the second coding units 810a and 810b may be independently divided into third coding units 820a and 820b and 820c to 820e. According to an embodiment, the image decoding apparatus 100 may determine a plurality of third coding units 820a and 820b by dividing the left second coding unit 810a in the horizontal direction, and may divide the right second coding unit 810b into an odd number of third coding units 820c to 820e.
[0155] According to an embodiment, the image decoding apparatus 100 may determine whether to split any coding unit into an odd number of coding units by determining whether the third coding units 820a and 820b and 820c to 820e can be processed in a predetermined order. Figure 8, the image decoding apparatus 100 may determine the third coding units 820a and 820b and 820c to 820e by recursively dividing the first coding unit 800. The image decoding apparatus 100 may determine whether any one of the following coding units is divided into an odd number of coding units based on at least one of the block shape information and the division shape mode information: the first coding unit 800, the second coding units 810a and 810b, and the third coding units 820a and 820b and 820c, 820d, and 820e. For example, the right second coding unit 810b may be divided into an odd number of third coding units 820c, 820d, and 820e. The processing order of the multiple coding units included in the first coding unit 800 can be a predetermined order (for example, a zigzag scanning order 830), and the image decoding device 100 can determine whether the third coding units 820c, 820d and 820e determined by dividing the right second coding unit 810b into an odd number of coding units meet the conditions for processing in the predetermined order.
[0156] According to an embodiment, the image decoding apparatus 100 may determine whether the third coding units 820a and 820b and 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition for processing in a predetermined order, and the condition is related to whether at least one of the width and height of the second coding units 810a and 810b is divided in half along the boundary of the third coding units 820a and 820b and 820c, 820d, and 820e. For example, the third coding units 820a and 820b determined by dividing the height of the non-square left second coding unit 810a in half may satisfy the condition. However, since the boundary of the third coding units 820c, 820d, and 820e determined by dividing the right second coding unit 810b into three coding units does not divide the width or height of the right second coding unit 810b in half, it may be determined that the third coding units 820c, 820d, and 820e do not satisfy the condition. When the condition is not satisfied as described above, the image decoding apparatus 100 may decide that the scanning order is discontinuous, and determine that the right second coding unit 810b is divided into an odd number of coding units based on the decision result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a predetermined restriction on the coding unit at a predetermined position in the divided coding unit, and the restriction or the predetermined position has been described above through various embodiments, so a detailed description thereof will not be provided here.
[0157] Fig. 9 A process of determining at least one coding unit by splitting the first coding unit 900 , performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0158] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 900 based on the division shape pattern information obtained by the bitstream obtainer 110. The square first coding unit 900 may be divided into four square coding units, or may be divided into a plurality of non-square coding units. Fig. 9 , when the first coding unit 900 has a square shape and the division shape pattern information indicates that the first coding unit 900 is divided into non-square coding units, the image decoding apparatus 100 may divide the first coding unit 900 into a plurality of non-square coding units. In detail, when the division shape pattern information indicates that an odd number of coding units is determined by dividing the first coding unit 900 in a horizontal direction or a vertical direction, the image decoding apparatus 100 may divide the square first coding unit 900 into an odd number of coding units (for example, second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in a vertical direction or second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in a horizontal direction).
[0159] According to an embodiment, the image decoding apparatus 100 may determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition for processing in a predetermined order, and the condition is related to whether at least one of the width and height of the first coding unit 900 is divided in half along the boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Fig. 9 , because the boundaries of the second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in the vertical direction do not divide the width of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not satisfy the condition for processing in a predetermined order. In addition, because the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in the horizontal direction do not divide the height of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not satisfy the condition for processing in a predetermined order. When the condition is not satisfied as described above, the image decoding apparatus 100 may decide that the scanning order is not continuous, and may determine that the first coding unit 900 is divided into an odd number of coding units based on the decision result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a predetermined restriction on the coding unit at a predetermined position in the divided coding unit, and the restriction or the predetermined position has been described above through various embodiments, so a detailed description thereof will not be provided here.
[0160] According to an embodiment, the image decoding apparatus 100 may determine coding units of various shapes by splitting the first coding unit.
[0161] Reference Fig. 9 , the image decoding apparatus 100 may divide the square first coding unit 900 or the non-square first coding unit 930 or 950 into coding units of various shapes.
[0162] Fig.10 It is shown that shapes into which the second coding unit may be split by the image decoding apparatus 100 are restricted when a second coding unit having a non-square shape determined by splitting the first coding unit 1000 satisfies a predetermined condition according to an embodiment.
[0163] According to an embodiment, the image decoding apparatus 100 may determine to divide the square first coding unit 1000 into non-square second coding units 1010a, 1010b, 1020a, and 1020b based on the division shape pattern information obtained by the bitstream obtainer 110. The second coding units 1010a, 1010b, 1020a, and 1020b may be independently divided. Like this, based on the division shape pattern information of each of the second coding units 1010a, 1010b, 1020a, and 1020b, the image decoding apparatus 100 may determine to divide the first coding unit 1000 into a plurality of coding units or not to divide the first coding unit 1000. According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1012a and 1012b by dividing the non-square left second coding unit 1010a determined by dividing the first coding unit 1000 in the vertical direction in the horizontal direction. However, when the left second coding unit 1010a is divided in the horizontal direction, the image decoding apparatus 100 may restrict the right second coding unit 1010b from being divided in the horizontal direction in which the left second coding unit 1010a is divided. When the third coding units 1014a and 1014b are determined by dividing the right second coding unit 1010b in the same direction, since the left second coding unit 1010a and the right second coding unit 1010b are independently divided in the horizontal direction, the third coding units 1012a, 1012b, 1014a, and 1014b may be determined. However, this case has the same effect as the case in which the image decoding apparatus 100 divides the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the division shape pattern information, and may be inefficient in image decoding.
[0164] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1022a, 1022b, 1024a, and 1024b by vertically splitting the non-square second coding unit 1020a or 1020b determined by splitting the first coding unit 1000 in the horizontal direction. However, when the second coding unit (e.g., the upper second coding unit 1020a) is split in the vertical direction, the image decoding apparatus 100 may restrict another second coding unit (e.g., the lower second coding unit 1020b) from being split in the vertical direction in which the upper second coding unit 1020a is split for the above-mentioned reason.
[0165] Fig.11 A process of splitting a square coding unit when division shape pattern information indicates that the square coding unit is not to be split into four square coding units, performed by the image decoding apparatus 100 according to an embodiment, is illustrated.
[0166] According to an embodiment, the image decoding apparatus 100 may determine second coding units 1110a, 1110b, 1120a, 1120b, etc. by dividing the first coding unit 1100 based on the division shape pattern information. The division shape pattern information may include information about various methods of dividing the coding unit, but the information about the various division methods may not include information for dividing the coding unit into four square coding units. According to such division shape pattern information, the image decoding apparatus 100 may not divide the square first coding unit 1100 into four square second coding units 1130a, 1130b, 1130c, and 1130d. The image decoding apparatus 100 may determine non-square second coding units 1110a, 1110b, 1120a, 1120b, etc. based on the division shape pattern information.
[0167] According to an embodiment, the image decoding apparatus 100 may independently divide the non-square second coding units 1110a, 1110b, 1120a, 1120b, etc. Each of the second coding units 1110a, 1110b, 1120a, 1120b, etc. may be recursively divided in a predetermined order, and this division method may correspond to the method of dividing the first coding unit 1100 based on the division shape pattern information.
[0168] For example, the image decoding apparatus 100 may determine square third coding units 1112a and 1112b by dividing the left second coding unit 1110a in the horizontal direction, and may determine square third coding units 1114a and 1114b by dividing the right second coding unit 1110b in the horizontal direction. In addition, the image decoding apparatus 100 may determine square third coding units 1116a, 1116b, 1116c, and 1116d by dividing both the left second coding unit 1110a and the right second coding unit 1110b in the horizontal direction. In this case, a coding unit having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 may be determined.
[0169] As another example, the image decoding apparatus 100 may determine the third coding units 1122a and 1122b of the square shape by dividing the upper second coding unit 1120a in the vertical direction, and may determine the third coding units 1124a and 1124b of the square shape by dividing the lower second coding unit 1120b in the vertical direction. In addition, the image decoding apparatus 100 may determine the third coding units 1126a, 1126b, 1126c, and 1126d of the square shape by dividing both the upper second coding unit 1120a and the lower second coding unit 1120b in the vertical direction. In this case, a coding unit having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 may be determined.
[0170] Fig.12 It is shown that a processing order among a plurality of coding units may be changed according to a process of dividing the coding units according to an embodiment.
[0171] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 1200 based on the division shape pattern information. When the block shape is a square shape and the division shape pattern information indicates that the first coding unit 1200 is divided in at least one of the horizontal direction and the vertical direction, the image decoding apparatus 100 may determine the second coding units 1210a, 1210b, 1220a, and 1220b by dividing the first coding unit 1200. Fig.12, the non-square second coding units 1210a, 1210b, 1220a, and 1220b determined by dividing the first coding unit 1200 only in the horizontal direction or the vertical direction can be independently divided based on the division shape pattern information of each coding unit. For example, the image decoding device 100 can determine the third coding units 1216a, 1216b, 1216c, and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in the vertical direction in the horizontal direction, and can determine the third coding units 1226a, 1226b, 1226c, and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 in the horizontal direction in the vertical direction. As has been referred to above Fig.11 The operation of dividing the second coding units 1210a, 1210b, 1220a, and 1220b is described, and thus a detailed description thereof will not be provided here.
[0172] According to an embodiment, the image decoding apparatus 100 may process the coding units in a predetermined order. Figure 7 The operation of processing the encoding units in a predetermined order is described, and thus a detailed description thereof will not be provided here. Fig.12 , the image decoding apparatus 100 may determine four square third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d by dividing the square first coding unit 1200. According to an embodiment, the image decoding apparatus 100 may determine the processing order of the third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d based on the division method of the first coding unit 1200.
[0173] According to an embodiment, the image decoding device 100 can determine the third coding units 1216a, 1216b, 1216c and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in the vertical direction in the horizontal direction, and the third coding units 1216a, 1216b, 1216c and 1216d can be processed in the following processing order 1217: first, the third coding units 1216a and 1216c included in the left second coding unit 1210a are processed in the vertical direction, and then the third coding units 1216b and 1216d included in the right second coding unit 1210b are processed in the vertical direction.
[0174] According to an embodiment, the image decoding device 100 can determine the third coding units 1226a, 1226b, 1226c and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 in the horizontal direction in the vertical direction, and the third coding units 1226a, 1226b, 1226c and 1226d can be processed in the following processing order 1227: first, the third coding units 1226a and 1226b included in the upper second coding unit 1220a are processed in the horizontal direction, and then the third coding units 1226c and 1226d included in the lower second coding unit 1220b are processed in the horizontal direction.
[0175] Reference Fig.12 , square third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d can be determined by dividing the second coding units 1210a, 1210b, 1220a and 1220b respectively. Although the second coding units 1210a and 1210b determined by splitting the first coding unit 1200 in the vertical direction are different from the second coding units 1220a and 1220b determined by splitting the first coding unit 1200 in the horizontal direction, the third coding units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d split from the second coding units 1210a and 1210b and the second coding units 1220a and 1220b ultimately show the same shape of coding units split from the first coding unit 1200. Like this, by recursively splitting the coding units in different ways based on the split shape pattern information, even if the coding units are ultimately determined to be the same shape, the image decoding apparatus 100 may process a plurality of coding units in different orders.
[0176] Fig.13 A process of determining a depth of a coding unit as a shape and a size of a coding unit change when a coding unit is recursively split so that a plurality of coding units are determined according to an embodiment is illustrated.
[0177] According to an embodiment, the image decoding device 100 may determine the depth of the coding unit based on a predetermined criterion. For example, the predetermined criterion may be the length of the long side of the coding unit. When the length of the long side of the coding unit before being divided is 2n (n>0) times the length of the long side of the divided current coding unit, the image decoding device 100 may determine that the depth of the current coding unit is increased by n compared to the depth of the coding unit before being divided. In the following description, a coding unit with an increased depth is represented as a coding unit of a deeper depth.
[0178] Reference Fig.13 According to an embodiment, the image decoding apparatus 100 may determine a second coding unit 1302 and a third coding unit 1304 of a deeper depth, etc. by dividing the square first coding unit 1300 based on block shape information indicating a square shape (for example, the block shape information may be represented as "0: SQUARE"). Assuming that the size of the square first coding unit 1300 is 2N×2N, the second coding unit 1302 determined by dividing the width and height of the first coding unit 1300 into 1 / 2 may have a size of N×N. In addition, the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 into 1 / 2 may have a size of N / 2×N / 2. In this case, the width and height of the third coding unit 1304 are 1 / 4 of the width and height of the first coding unit 1300. When the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302 whose width and height are 1 / 2 of the width and height of the first coding unit 1300 may be D+1, and the depth of the third coding unit 1304 whose width and height are 1 / 4 of the width and height of the first coding unit 1300 may be D+2.
[0179] According to an embodiment, the image decoding device 100 can determine a second coding unit 1312 or 1322 and a third coding unit 1314 or 1324, etc. of a deeper depth by dividing the non-square first coding unit 1310 or 1320 based on block shape information indicating a non-square shape (for example, the block shape information may be represented as "1:NS_VER" indicating a non-square shape in which the height is longer than the width, or may be represented as "2:NS_HOR" indicating a non-square shape in which the width is longer than the height).
[0180] The image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by splitting at least one of the width and the height of the first coding unit 1310 having a size of N×2N. That is, the image decoding apparatus 100 may determine the second coding unit 1302 having a size of N×N or the second coding unit 1322 having a size of N×N / 2 by splitting the first coding unit 1310 in a horizontal direction, or may determine the second coding unit 1312 having a size of N / 2×N by splitting the first coding unit 1310 in horizontal and vertical directions.
[0181] According to an embodiment, the image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by splitting at least one of the width and the height of the first coding unit 1320 having a size of 2N×N. That is, the image decoding apparatus 100 may determine the second coding unit 1302 having a size of N×N or the second coding unit 1312 having a size of N / 2×N by splitting the first coding unit 1320 in a vertical direction, or may determine the second coding unit 1322 having a size of N×N / 2 by splitting the first coding unit 1320 in horizontal and vertical directions.
[0182] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1302 having a size of N×N. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2, the third coding unit 1314 having a size of N / 4×N / 2, or the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1302 in the vertical direction and the horizontal direction.
[0183] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by splitting at least one of the width and the height of the second coding unit 1312 having a size of N / 2×N. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1324 having a size of N / 2×N / 4 by splitting the second coding unit 1312 in a horizontal direction, or may determine the third coding unit 1314 having a size of N / 4×N / 2 by splitting the second coding unit 1312 in vertical and horizontal directions.
[0184] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by splitting at least one of the width and the height of the second coding unit 1322 having a size of N×N / 2. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1314 having a size of N / 4×N / 2 by splitting the second coding unit 1322 in a vertical direction, or may determine the third coding unit 1324 having a size of N / 2×N / 4 by splitting the second coding unit 1322 in vertical and horizontal directions.
[0185] According to an embodiment, the image decoding apparatus 100 may split the square coding unit 1300, 1302, or 1304 in a horizontal direction or a vertical direction. For example, the image decoding apparatus 100 may determine a first coding unit 1310 having a size of N×2N by splitting the first coding unit 1300 having a size of 2N×2N in a vertical direction, or may determine a first coding unit 1320 having a size of 2N×N by splitting the first coding unit 1300 in a horizontal direction. According to an embodiment, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by splitting the first coding unit 1300 having a size of 2N×2N in a horizontal direction or a vertical direction may be the same as the depth of the first coding unit 1300.
[0186] According to an embodiment, the width and height of the third coding unit 1314 or 1324 may be 1 / 4 of the width and height of the first coding unit 1310 or 1320. When the depth of the first coding unit 1310 or 1320 is D, the depth of the second coding unit 1312 or 1322 whose width and height are 1 / 2 of the width and height of the first coding unit 1310 or 1320 may be D+1, and the depth of the third coding unit 1314 or 1324 whose width and height are 1 / 4 of the width and height of the first coding unit 1310 or 1320 may be D+2.
[0187] Fig.14 Depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.
[0188] According to an embodiment, the image decoding apparatus 100 may determine second coding units of various shapes by dividing the square first coding unit 1400. Fig.14 , the image decoding apparatus 100 may determine the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d by dividing the first coding unit 1400 in at least one of the vertical direction and the horizontal direction based on the division shape pattern information. That is, the image decoding apparatus 100 may determine the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information of the first coding unit 1400.
[0189] According to an embodiment, the depths of the second coding units 1402a and 1402b, the second coding units 1404a and 1404b, and the second coding units 1406a, 1406b, 1406c, and 1406d determined based on the division shape pattern information of the square first coding unit 1400 may be determined based on the lengths of their long sides. For example, since the length of the side of the square first coding unit 1400 is equal to the length of the long side of the non-square second coding units 1402a and 1402b and 1404a and 1404b, the first coding unit 1400 and the non-square second coding units 1402a and 1402b and 1404a and 1404b may have the same depth (e.g., D). However, when the image decoding device 100 divides the first coding unit 1400 into four square second coding units 1406a, 1406b, 1406c and 1406d based on the division shape pattern information, because the length of the side of the square second coding units 1406a, 1406b, 1406c and 1406d is 1 / 2 of the length of the side of the first coding unit 1400, the depth of the second coding units 1406a, 1406b, 1406c and 1406d can be D+1, which is 1 deeper than the depth D of the first coding unit 1400.
[0190] According to an embodiment, the image decoding apparatus 100 may determine a plurality of second coding units 1412a and 1412b and 1414a, 1414b and 1414c by dividing the first coding unit 1410 whose height is longer than the width in the horizontal direction based on the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may determine a plurality of second coding units 1422a and 1422b and 1424a, 1424b and 1424c by dividing the first coding unit 1420 whose width is longer than the height in the vertical direction based on the division shape pattern information.
[0191] According to an embodiment, the depths of the second coding units 1412a and 1412b, the second coding units 1414a, 1414b and 1414c, the second coding units 1422a and 1422b, and the second coding units 1424a, 1424b and 1424c determined based on the division shape pattern information of the non-square first coding unit 1410 or 1420 may be determined based on the length of their long sides. For example, since the length of the side of the square second coding units 1412a and 1412b is 1 / 2 of the length of the long side of the first coding unit 1410 having a non-square shape having a height longer than a width, the depth of the square second coding units 1412a and 1412b is D+1 which is 1 deeper than the depth D of the non-square first coding unit 1410.
[0192] In addition, the image decoding apparatus 100 may divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the division shape pattern information. The odd number of second coding units 1414a, 1414b, and 1414c may include the non-square second coding units 1414a and 1414c and the square second coding unit 1414b. In this case, since the length of the long side of the non-square second coding units 1414a and 1414c and the length of the side of the square second coding unit 1414b are 1 / 2 of the length of the long side of the first coding unit 1410, the depth of the second coding units 1414a, 1414b, and 1414c may be D+1 which is 1 deeper than the depth D of the non-square first coding unit 1410. The image decoding apparatus 100 may determine the depths of the coding units split from the first coding unit 1420 having a non-square shape having a width longer than a height by using the above-described method of determining the depths of the coding units split from the first coding unit 1410 .
[0193] According to an embodiment, when the divided odd-numbered coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for identifying the divided coding units based on a size ratio between the coding units. Fig.14 , the width of the coding unit 1414b at the center position among the divided odd-numbered coding units 1414a, 1414b, and 1414c may be equal to the width of the other coding units 1414a and 1414c and its height may be twice the height of the other coding units 1414a and 1414c. That is, in this case, the coding unit 1414b at the center position may include two other coding units 1414a or 1414c. Therefore, when the PID of the coding unit 1414b at the center position is 1 based on the scanning order, the PID of the coding unit 1414c located adjacent to the coding unit 1414b may increase by 2 and may therefore be 3. That is, there may be discontinuity in the PID value. According to an embodiment, the image decoding apparatus 100 may determine whether the divided odd-numbered coding units do not have equal sizes based on whether there is discontinuity in the PID for identifying the divided coding units.
[0194] According to an embodiment, the image decoding apparatus 100 may determine whether to use a specific splitting method based on a PID value for identifying a plurality of coding units determined by splitting a current coding unit. Fig.14, the image decoding apparatus 100 may determine an even number of coding units 1412a and 1412b or an odd number of coding units 1414a, 1414b, and 1414c by dividing the first coding unit 1410 having a rectangular shape whose height is longer than its width. The image decoding apparatus 100 may use the PID to identify each coding unit. According to an embodiment, the PID may be obtained from a sample point at a predetermined position of each coding unit (e.g., an upper left sample point).
[0195] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a predetermined position among the divided coding units by using a PID for distinguishing coding units. According to an embodiment, when the division shape pattern information of the first coding unit 1410 having a rectangular shape having a height longer than a width indicates that the coding unit is divided into three coding units, the image decoding apparatus 100 may divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The image decoding apparatus 100 may assign a PID to each of the three coding units 1414a, 1414b, and 1414c. The image decoding apparatus 100 may compare the PIDs of the divided odd-numbered coding units to determine a coding unit at a center position among the divided odd-numbered coding units. The image decoding apparatus 100 may determine the coding unit 1414b having a PID corresponding to an intermediate value among the PIDs of the coding units as a coding unit at a center position among the coding units determined by dividing the first coding unit 1410. According to an embodiment, when the divided coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for distinguishing the divided coding units based on a size ratio between the coding units. Fig.14, the width of the coding unit 1414b generated by dividing the first coding unit 1410 may be equal to the width of the other coding units 1414a and 1414c, and the height thereof may be twice the height of the other coding units 1414a and 1414c. In this case, when the PID of the coding unit 1414b at the center position is 1, the PID of the coding unit 1414c located adjacent to the coding unit 1414b may increase by 2 and thus may be 3. When the PID is not uniformly increased as described above, the image decoding apparatus 100 may determine that the coding unit is divided into a plurality of coding units including coding units having sizes different from those of other coding units. According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may divide the current coding unit in such a manner that a coding unit at a predetermined position (e.g., a coding unit at a center position) among the odd number of coding units has a size different from that of other coding units. In this case, the image decoding apparatus 100 may determine the coding units at the center position having different sizes by using the PIDs of the coding units. However, the PID and the size or position of the coding unit of the predetermined position to be determined are not limited to the above-mentioned examples, and various PIDs and various positions and sizes of the coding unit may be used.
[0196] According to an embodiment, the image decoding apparatus 100 may use a predetermined data unit in which a coding unit starts to be recursively divided.
[0197] Fig.15 It is shown that a plurality of coding units are determined based on a plurality of predetermined data units included in a picture according to an embodiment.
[0198] According to an embodiment, a predetermined data unit may be defined as a data unit that starts recursively splitting a coding unit by using division shape pattern information. That is, the predetermined data unit may correspond to a coding unit for determining a highest depth of a plurality of coding units split from a current picture. In the following description, for ease of explanation, a predetermined data unit is referred to as a reference data unit.
[0199] According to an embodiment, the reference data unit may have a predetermined size and a predetermined shape. According to an embodiment, the reference data unit may include M×N samples. Here, M and N may be equal to each other and may be an integer represented as a power of 2. That is, the reference data unit may have a square shape or a non-square shape and may be divided into an integer number of coding units.
[0200] According to an embodiment, the image decoding apparatus 100 may divide the current picture into a plurality of reference data units. According to an embodiment, the image decoding apparatus 100 may divide the plurality of reference data units divided from the current picture by using the division shape pattern information for each reference data unit. The operation of dividing the reference data unit may correspond to the division operation using the quadtree structure.
[0201] According to an embodiment, the image decoding apparatus 100 may predetermine a minimum size allowed for a reference data unit included in the current picture. Therefore, the image decoding apparatus 100 may determine various reference data units having a size equal to or larger than the minimum size, and may determine one or more coding units by using the division shape pattern information with reference to the determined reference data unit.
[0202] Reference Fig.15 , the image decoding apparatus 100 may use a square reference coding unit 1500 or a non-square reference coding unit 1502. According to an embodiment, the shape and size of the reference coding unit may be determined based on various data units (e.g., a sequence, a picture, a slice, a slice segment, a maximum coding unit, etc.) that can include one or more reference coding units.
[0203] According to an embodiment, the bitstream obtainer 110 of the image decoding apparatus 100 may obtain at least one of reference coding unit shape information and reference coding unit size information for each of various data units from the bitstream. Figure 3 The operation of dividing the current coding unit 300 describes the operation of determining one or more coding units included in the square reference coding unit 1500, and the above has been described with respect to Figure 4 The operation of splitting the current coding unit 400 or 450 describes an operation of determining one or more coding units included in the non-square reference coding unit 1502, and therefore, a detailed description thereof will not be provided here.
[0204] According to an embodiment, the image decoding apparatus 100 may determine the size and shape of the reference coding unit using the PID for identifying the size and shape of the reference coding unit according to some data units previously determined based on a predetermined condition. That is, the bitstream obtainer 110 may obtain only the PID for identifying the size and shape of the reference coding unit for each slice, slice segment, or maximum coding unit from the bitstream, wherein each slice, slice segment, or maximum coding unit is a data unit (e.g., a data unit having a size equal to or smaller than a slice) among various data units (e.g., a sequence, a picture, a slice, a slice segment, a maximum coding unit, etc.) that satisfies the predetermined condition. The image decoding apparatus 100 may determine the size and shape of the reference data unit for each data unit that satisfies the predetermined condition by using the PID. When the reference coding unit shape information and the reference coding unit size information are obtained and used from the bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high, and therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the size and shape of the reference coding unit corresponding to the PID for identifying the size and shape of the reference coding unit may be predetermined. That is, the image decoding apparatus 100 may determine at least one of the size and shape of the reference coding unit included in the data unit serving as the unit for obtaining the PID by selecting at least one of the sizes and shapes of the reference coding unit that is determined in advance based on the PID.
[0205] According to an embodiment, the image decoding device 100 may use one or more reference coding units included in the maximum coding unit. That is, the maximum coding unit divided from the picture may include one or more reference coding units, and the coding unit may be determined by recursively dividing each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit may be an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be obtained by dividing the maximum coding unit n times based on a quadtree structure. That is, according to various embodiments, the image decoding device 100 may determine the reference coding unit by dividing the maximum coding unit n times based on a quadtree structure, and the reference coding unit may be divided based on at least one of the block shape information and the division shape pattern information.
[0206] Fig.16 A processing block serving as a unit for determining an order of reference coding units included in the picture 1600 according to an embodiment is illustrated.
[0207] According to an embodiment, the image decoding device 100 may determine one or more processing blocks divided from a picture. A processing block is a data unit including one or more reference coding units divided from an image, and the one or more reference coding units included in the processing block may be determined according to a specific order. That is, the determination order of the one or more reference coding units determined in each processing block may correspond to one of various types of orders for determining reference coding units, and may vary according to the processing block. The determination order of the reference coding units determined for each processing block may be one of various orders (e.g., raster scanning, zigzag scanning, N-shaped scanning, upper right diagonal scanning, horizontal scanning, and vertical scanning), but is not limited to the scanning order mentioned above.
[0208] According to an embodiment, the image decoding apparatus 100 may obtain processing block size information and may determine the size of one or more processing blocks included in the image. The image decoding apparatus 100 may obtain processing block size information from a bitstream and may determine the size of one or more processing blocks included in the image. The size of the processing block may be a predetermined size of a data unit indicated by the processing block size information.
[0209] According to an embodiment, the bitstream obtainer 110 of the image decoding device 100 may obtain processing block size information from the bitstream according to each specific data unit. For example, the processing block size information may be obtained from the bitstream according to data units such as an image, a sequence, a picture, a slice, or a slice segment. That is, the bitstream obtainer 110 may obtain processing block size information from the bitstream according to each of the various data units, and the image decoding device 100 may determine the size of one or more processing blocks divided from the picture by using the obtained processing block size information, and the size of the processing block may be an integer multiple of the size of the reference coding unit.
[0210] According to an embodiment, the image decoding apparatus 100 may determine the sizes of the processing blocks 1602 and 1612 included in the picture 1600. For example, the image decoding apparatus 100 may determine the sizes of the processing blocks based on processing block size information obtained from a bitstream. Fig.16 According to an embodiment, the image decoding apparatus 100 may determine the width of the processing blocks 1602 and 1612 to be four times the width of the reference coding unit, and may determine the height of the processing blocks 1602 and 1612 to be four times the height of the reference coding unit. The image decoding apparatus 100 may determine the determination order of one or more reference coding units in one or more processing blocks.
[0211] According to an embodiment, the image decoding apparatus 100 may determine the processing blocks 1602 and 1612 included in the picture 1600 based on the size of the processing blocks, and may determine a determination order of one or more reference coding units included in the processing blocks 1602 and 1612. According to an embodiment, the operation of determining the reference coding unit may include determining the size of the reference coding unit.
[0212] According to an embodiment, the image decoding apparatus 100 may obtain determination order information of one or more reference coding units included in one or more processing blocks from a bitstream, and may determine a determination order for one or more reference coding units based on the obtained determination order information. The determination order information may be defined as an order or direction for determining the reference coding units in the processing block. That is, the determination order of the reference coding units may be determined independently for each processing block.
[0213] According to an embodiment, the image decoding apparatus 100 may obtain the determination order information of the reference coding unit from the bitstream according to each specific data unit. For example, the bitstream obtainer 160 may obtain the determination order information of the reference coding unit from the bitstream according to each data unit (such as an image, a sequence, a picture, a slice, a slice segment, or a processing block). Since the determination order information of the reference coding unit indicates the order of the reference coding unit in the processing block, the determination order information may be obtained for each specific data unit including an integer number of processing blocks.
[0214] According to an embodiment, the image decoding apparatus 100 may determine one or more reference coding units based on the determined order.
[0215] According to an embodiment, the bitstream obtainer 110 may obtain determination order information of reference coding units from the bitstream as information related to the processing blocks 1602 and 1612, and the image decoding apparatus 100 may determine the determination order of one or more reference coding units included in the processing blocks 1602 and 1612, and determine one or more reference coding units included in the picture 1600 based on the determination order. Fig.16, the image decoding apparatus 100 may respectively determine determination orders 1604 and 1614 of one or more reference coding units in the processing blocks 1602 and 1612. For example, when determination order information of the reference coding units is obtained for each processing block, different types of determination order information of the reference coding units may be obtained for the processing blocks 1602 and 1612. When the determination order 1604 of the reference coding units in the processing block 1602 is a raster scan order, the reference coding units included in the processing block 1602 may be determined according to the raster scan order. On the contrary, when the determination order 1614 of the reference coding units in another processing block 1612 is a reverse raster scan order, the reference coding units included in the processing block 1612 may be determined according to the reverse raster scan order.
[0216] According to an embodiment, the image decoding apparatus 100 may decode the determined one or more reference coding units. The image decoding apparatus 100 may decode the image based on the reference coding units determined as described above. The method of decoding the reference coding units may include various image decoding methods.
[0217] According to an embodiment, the image decoding device 100 may obtain block shape information indicating the shape of the current coding unit or division shape pattern information indicating a division method of the current coding unit from a bitstream, and may use the obtained information. The division shape pattern information may be included in a bitstream associated with various data units. For example, the image decoding device 100 may use the division shape pattern information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, or a slice segment header. In addition, the image decoding device 100 may obtain a syntax element corresponding to the block shape information or the division shape pattern information from a bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and may use the obtained syntax element.
[0218] A method of determining a division rule according to an embodiment of the present disclosure will be described in detail.
[0219] The image decoding apparatus 100 may determine a division rule of an image. The division rule may be predetermined between the image decoding apparatus 100 and the image encoding apparatus 200. The image decoding apparatus 100 may determine a division rule of an image based on information obtained from a bitstream. The image decoding apparatus 100 may determine a division rule based on information obtained from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, or a slice segment header. The image decoding apparatus 100 may determine a division rule differently according to a frame, a slice, a temporal layer, a maximum coding unit, or a coding unit.
[0220] The image decoding device 100 may determine the division rule based on the block shape of the coding unit. The block shape may include the size, shape, ratio between width and height, and direction of the coding unit. The image encoding device 200 and the image decoding device 100 may predetermine the division rule based on the block shape of the coding unit. However, the present disclosure is not limited to this. Based on information obtained from the bit stream received from the image encoding device 200, the image decoding device 100 may determine the division rule.
[0221] The shape of the coding unit may include a square shape and a non-square shape. When the width and height of the coding unit are the same, the image decoding apparatus 100 may determine that the shape of the coding unit is a square shape. In addition, when the width and height of the coding unit are different, the image decoding apparatus 100 may determine that the shape of the coding unit is a non-square shape.
[0222] The size of the coding unit may include various sizes such as 4×4, 8×4, 4×8, 8×8, 16×4, 16×8, ..., and 256×256. The size of the coding unit may be classified according to the length of the long side, the length of the short side, or the area of the coding unit. The image decoding device 100 may apply the same division rule to the coding units belonging to the same group. For example, the image decoding device 100 may classify the coding units whose long sides are the same length as coding units having the same size. In addition, the image decoding device 100 may apply the same division rule to the coding units whose long sides are the same length.
[0223] The ratio between 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, 1:32, or 32:1. In addition, the direction of the coding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate a case where the width length of the coding unit is greater than the height length of the coding unit. The vertical direction may indicate a case where the width length of the coding unit is less than the height length of the coding unit.
[0224] The image decoding apparatus 100 may adaptively determine the division rule based on the size of the coding unit. The image decoding apparatus 100 may determine the allowable division shape mode differently based on the size of the coding unit. For example, the image decoding apparatus 100 may determine whether to allow division based on the size of the coding unit. The image decoding apparatus 100 may determine the division direction according to the size of the coding unit. The image decoding apparatus 100 may determine the allowable division type according to the size of the coding unit.
[0225] Determining the division rule based on the size of the coding unit may be a division rule predetermined between the image encoding apparatus 200 and the image decoding apparatus 100. Also, the image decoding apparatus 100 may determine the division rule based on information obtained from a bitstream.
[0226] The image decoding apparatus 100 may adaptively determine a split rule based on a location of a coding unit. The image decoding apparatus 100 may adaptively determine a split rule based on a location of a coding unit in an image.
[0227] In addition, the image decoding apparatus 100 may determine a division rule so that the coding units generated using different division paths do not have the same block shape. However, the present disclosure is not limited thereto, and the coding units generated using different division paths may have the same block shape. The coding units generated using different division paths may have different decoding processing orders. Fig.12 The decoding process order is described, and therefore a detailed explanation thereof will not be provided here.
[0228] Fig.17 Illustrations of coding units that may be determined for each picture when a combination of shapes into which a coding unit may be divided is different for each picture according to an embodiment.
[0229] Reference Fig.17 , the image decoding apparatus 100 may determine the combination of shapes into which the coding unit may be divided differently for each picture. For example, the image decoding apparatus 100 may decode the image by using a picture 1700 that may be divided into 4 coding units, a picture 1710 that may be divided into 2 or 4 coding units, and a picture 1720 that may be divided into 2, 3, or 4 coding units, among one or more pictures included in the image. In order to divide the picture 1700 into a plurality of coding units, the image decoding apparatus 100 may use only the division shape pattern information indicating that the picture 1700 is divided into 4 square coding units. In order to divide the picture 1710, the image decoding apparatus 100 may use only the division shape pattern information indicating that the picture 1710 is divided into 2 or 4 coding units. In order to divide the picture 1720, the image decoding apparatus 100 may use only the division shape pattern information indicating that the picture 1720 is divided into 2, 3, or 4 coding units. Since such a combination of division shapes is merely an embodiment for describing the operation of the image decoding apparatus 100 , the combination of division shapes should not be construed as being limited to the embodiment, but various combinations of division shapes may be used according to predetermined data units.
[0230] According to an embodiment, the bitstream obtainer 110 of the image decoding apparatus 100 may obtain a bitstream including an index indicating a combination of division shape information according to a predetermined data unit (e.g., a sequence, a picture, or a slice). For example, the bitstream obtainer 110 may obtain an index indicating a combination of division shape information from a sequence parameter set, a picture parameter set, or a slice header. The image decoding apparatus 100 may determine a combination of division shapes into which a coding unit may be divided according to a predetermined data unit by using the obtained index, and thus may use different combinations of division shapes according to the predetermined data unit.
[0231] Fig.18 Various shapes of coding units that may be determined based on division shape pattern information that may be represented as a binary code according to an embodiment are illustrated.
[0232] According to an embodiment, the image decoding apparatus 100 may split the coding unit into various shapes by using the block shape information and the division shape pattern information obtained by the bitstream obtainer 110. The shapes into which the coding unit may be split may correspond to various shapes including the shapes described with reference to the above embodiments.
[0233] Reference Fig.18 , based on the division shape pattern information, the image decoding apparatus 100 may divide the square coding unit in at least one of a horizontal direction and a vertical direction and may divide the non-square coding unit in a horizontal direction or a vertical direction.
[0234] According to an embodiment, when the image decoding apparatus 100 is capable of dividing a square coding unit in the horizontal direction and the vertical direction to obtain 4 square coding units, the number of division shapes that may be indicated by the division shape pattern information about the square coding unit may be 4. According to an embodiment, the division shape pattern information may be represented as a 2-bit binary code, and the binary code may be assigned to each division shape. For example, when the coding unit is not divided, the division shape pattern information may be represented as (00)b; when the coding unit is divided in the horizontal direction and the vertical direction, the division shape pattern information may be represented as (01)b; when the coding unit is divided in the horizontal direction, the division shape pattern information may be represented as (10)b; and when the coding unit is divided in the vertical direction, the division shape pattern information may be represented as (11)b.
[0235] According to an embodiment, when the image decoding apparatus 100 splits a non-square coding unit in a horizontal direction or a vertical direction, the type of the split shape that may be indicated by the split shape pattern information may be determined according to the number of coding units into which the coding unit is split. Fig.18, according to an embodiment, the image decoding device 100 may divide the non-square coding unit into a maximum of 3 coding units. The image decoding device 100 may divide the coding unit into two coding units, and in this case, the division shape pattern information may be represented as (10)b. The image decoding device 100 may divide the coding unit into three coding units, and in this case, the division shape pattern information may be represented as (11)b. The image decoding device 100 may determine not to divide the coding unit, and in this case, the division shape pattern information may be represented as (0)b. That is, in order to use a binary code indicating the division shape pattern information, the image decoding device 100 may use variable length coding (VLC) instead of fixed length coding (FLC).
[0236] According to the embodiment, referring to Fig.18 , the binary code of the division shape mode information indicating that the coding unit is not divided can be represented as (0)b. When the binary code of the division shape mode information indicating that the coding unit is not divided is set to (00)b, even if there is no division shape mode information set to (01)b, all 2 bits of the binary code of the division shape mode information must be used. However, if Fig.18 As shown in , when three division shapes are used for non-square coding units, even by using a 1-bit binary code (0)b as the division shape pattern information, the image decoding apparatus 100 can determine not to divide the coding unit, thereby efficiently using the bitstream. However, the division shape of the non-square coding unit indicated by the division shape pattern information should not be interpreted as being limited to Fig.18 The three shapes shown in FIG. 1 and FIG. 2 should be interpreted as including various shapes of the above embodiments.
[0237] Fig.19 Other shapes of coding units that may be determined based on division shape pattern information that may be represented as a binary code according to an embodiment are illustrated.
[0238] Reference Fig.19 , based on the division shape pattern information, the image decoding device 100 may divide the square coding unit in the horizontal direction or the vertical direction and may divide the non-square coding unit in the horizontal direction or the vertical direction. That is, the division shape pattern information may indicate that the square coding unit is divided in one direction. In this case, the binary code of the division shape pattern information indicating that the square coding unit is not divided may be represented as (0)b. When the binary code of the division shape pattern information indicating that the coding unit is not divided is set to (00)b, even though there is no division shape pattern information set to (01)b, all 2 bits of the binary code of the division shape pattern information must be used. However, as Fig.19As shown in , when three division shapes are used for a square coding unit, even by using a 1-bit binary code (0)b as the division shape pattern information, the image decoding apparatus 100 can determine not to divide the coding unit, thereby efficiently using the bit stream. However, the division shape of the square coding unit indicated by the division shape pattern information should not be interpreted as being limited to Fig.19 The three shapes shown in FIG. 1 and FIG. 2 should be interpreted as including various shapes of the above embodiments.
[0239] According to an embodiment, block shape information or division shape pattern information may be represented by using a binary code, and such information may be immediately generated as a bitstream. Alternatively, block shape information or division shape pattern information that may be represented as a binary code may not be immediately generated as a bitstream, and block shape information or division shape pattern information that may be represented as a binary code may be used as a binary code input during context adaptive binary arithmetic coding (CABAC).
[0240] According to an embodiment, a process of obtaining syntax about block shape information or division shape mode information by CABAC performed by the image decoding device 100 will be described. A bitstream including a binary code for the syntax may be obtained by the bitstream obtainer 110. The image decoding device 100 may detect a syntax element indicating block shape information or division shape mode information by debinarizing a binary bit string included in the obtained bitstream. According to an embodiment, the image decoding device 100 may obtain a set of binary bit strings corresponding to the syntax element to be decoded and may decode each binary bit by using probability information, and the image decoding device 100 may repeatedly perform this process until a binary bit string including such decoded binary bits is identical to one of the previously obtained binary bit strings. The image decoding device 100 may determine the syntax element by debinarizing the binary bit string.
[0241] According to an embodiment, the image decoding apparatus 100 may determine the syntax about the binary bit string by performing a decoding process of adaptive binary arithmetic coding, and may update the probability model for the binary bit obtained by the bitstream obtainer 110. Fig.18According to an embodiment, the bitstream obtainer 110 of the image decoding device 100 may obtain a bitstream indicating a binary code, wherein the binary code indicates the division shape mode information. The image decoding device 100 may determine the syntax about the division shape mode information by using the obtained binary code of 1 bit or 2 bits. In order to determine the syntax about the division shape mode information, the image decoding device 100 may update the probability of each of the 2 bits of the binary code. That is, the image decoding device 100 may update the probability that the value of the next binary bit during encoding is 0 or 1 according to whether the value of the first binary bit of the 2 bits of the binary code is 0 or 1.
[0242] According to an embodiment, when determining the syntax, the image decoding device 100 may update the probability of the binary bits used in the process of decoding the binary bits of the binary bit string used for the syntax, and the image decoding device 100 may determine that specific bits in the binary bit string have the same probability without updating the probability.
[0243] Reference Fig.18 , when determining the syntax by using a binary bit string indicating the division shape pattern information about the non-square coding unit, when the non-square coding unit is not divided, the image decoding apparatus 100 may determine the syntax about the division shape pattern information by using one binary bit having a value of 0. That is, when the block shape information indicates that the current coding unit has a non-square shape, the first binary bit of the binary bit string for the division shape pattern information may be 0 when the non-square coding unit is not divided, and the first binary bit of the binary bit string for the division shape pattern information may be 1 when the non-square coding unit is divided into two or three coding units. Therefore, the probability that the first binary bit of the binary bit string for the division shape pattern information about the non-square coding unit is 0 may be 1 / 3, and the probability that the first binary bit of the binary bit string for the division shape pattern information about the non-square coding unit is 1 may be 2 / 3. As described above, since the division shape pattern information indicating that the non-square coding unit is not divided may represent only a binary bit string of 1 bit having a value of 0, the image decoding apparatus 100 may determine the syntax about the division shape pattern information by determining whether the second binary bit is 0 or 1 only when the first binary bit of the division shape pattern information is 1. According to an embodiment, when the first binary bit for the division shape pattern information is 1, the image decoding apparatus 100 may decode the binary bit by determining that a probability that the second binary bit is 0 is the same as a probability that the second binary bit is 1.
[0244] According to an embodiment, the image decoding apparatus 100 may use various probabilities for each binary bit when determining the binary bit string for the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may differently determine the probability of the binary bit for the division shape pattern information according to the direction of the non-square block. According to an embodiment, the image decoding apparatus 100 may differently determine the probability of the binary bit for the division shape pattern information according to the area or the long side length of the current coding unit. According to an embodiment, the image decoding apparatus 100 may differently determine the probability of the binary bit for the division shape pattern information according to at least one of the shape and the long side length of the current coding unit.
[0245] According to an embodiment, the image decoding apparatus 100 may determine that the probability of the binary bits of the division shape pattern information is the same for coding units having a predetermined size or larger. For example, the image decoding apparatus 100 may determine that the probability of the binary bits of the division shape pattern information is the same for coding units having a size equal to or larger than 64 samples based on the length of the long side of each coding unit.
[0246] According to an embodiment, the image decoding apparatus 100 may determine initial probabilities of bins constituting a bin string of division shape pattern information based on a slice type (eg, I slice, P slice, B slice, etc.).
[0247] Fig. 20 is a block diagram of an image encoding and decoding system 2000 for performing loop filtering.
[0248] The encoding end 2010 of the image encoding and decoding system 2000 transmits an encoded bit stream of an image, and the decoding end 2050 receives the bit stream and decodes the bit stream and outputs a reconstructed image. The encoding end 2010 may have a configuration similar to that of the image encoding apparatus 200 to be described below, and the decoding end 2050 may have a configuration similar to that of the image decoding apparatus 100.
[0249] At the encoding end 2010, the prediction encoder 2015 outputs a reference image through inter-frame prediction and intra-frame prediction, and the transformer and quantizer 2020 transforms and quantizes the residual data between the reference image and the current input image into quantized transform coefficients and outputs the quantized transform coefficients. The entropy encoder 2025 encodes the quantized transform coefficients into a bit stream and outputs the bit stream. The quantized transform coefficients are reconstructed into data in the spatial domain through the inverse quantizer and inverse transformer 2030, and the reconstructed data in the spatial domain is output as a reconstructed image through the deblocking filter 2035 and the loop filter 2040. The reconstructed image can be used as a reference image of the next input image through the prediction encoder 2015.
[0250] The encoded image data in the bit stream received by the decoding end 2050 is reconstructed as residual data in the spatial domain through the entropy decoder 2055 and the inverse quantizer and inverse transformer 2060. As the residual data and the reference image output from the prediction decoder 2075 are combined, the image data in the spatial domain is formed, and the deblocking filter 2065 and the loop filter 2070 can filter the image data in the spatial domain and can output a reconstructed image for the current original image. The reconstructed image can be used as a reference image for the next original image through the prediction decoder 2075.
[0251] The loop filter 2040 of the encoding end 2010 performs loop filtering by using filter information input according to user input or system setting. The filter information used by the loop filter 2040 is output to the entropy encoder 2025 and is sent to the decoding end 2050 together with the encoded image data. The loop filter 2070 of the decoding end 2050 can perform loop filtering based on the filter information input from the encoding end 2010.
[0252] The above various embodiments are for describing operations related to the image decoding method performed by the image decoding apparatus 100. Operations of the image encoding apparatus 200 for performing an image encoding method corresponding to the reverse order process of the image decoding method will be described with reference to various embodiments.
[0253] Figure 2 is a block diagram of an image encoding apparatus 200 for encoding an image based on at least one of block shape information and division shape mode information according to an embodiment.
[0254] The image encoding apparatus 200 may include an encoder 220 and a bitstream generator 210. The encoder 220 may receive an input image and may encode the input image. The encoder 220 may encode the input image and may 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 quantization coefficient, a coding block mode, a coding block flag, an intra prediction mode, a direction flag, a merge flag, a differential QP (delta QP), a reference index, a prediction direction, and a transform index. The encoder 220 may determine a context model based on block shape information including at least one of a shape, a direction, a ratio between a width and a height, and a size of a coding unit.
[0255] The bitstream generator 210 may generate a bitstream based on the encoded input image. For example, the bitstream generator 210 may generate a bitstream by entropy encoding a syntax element based on a context model. In addition, the image encoding apparatus 200 may transmit the bitstream to the image decoding apparatus 100.
[0256] According to an embodiment, the encoder 220 of the image encoding apparatus 200 may determine the shape of the coding unit. For example, the coding unit may have a square shape or a non-square shape, and information indicating the shape may be included in the block shape information.
[0257] According to an embodiment, the encoder 220 may determine which shape the coding unit will be divided into. The encoder 220 may determine the shape of at least one coding unit included in the coding unit, and the bitstream generator 210 may generate a bitstream including division shape pattern information, wherein the division shape pattern information includes information about the shape of the coding unit.
[0258] According to an embodiment, the encoder 220 may determine whether the coding unit is divided or not divided. When the encoder 220 determines that only one coding unit is included in the coding unit or the coding unit is not divided, the bitstream generator 210 may generate a bitstream including division shape pattern information indicating that the coding unit is not divided. In addition, the encoder 220 may divide the coding unit into a plurality of coding units, and the bitstream generator 210 may generate a bitstream including division shape pattern information indicating that the coding unit is divided into the plurality of coding units.
[0259] According to an embodiment, information indicating the number of coding units into which the coding unit will be divided or the direction in which the coding unit will be divided may be included in the division shape pattern information. For example, the division shape pattern information may indicate that the coding unit is divided in at least one of the vertical direction and the horizontal direction or that the coding unit is not divided.
[0260] The image encoding apparatus 200 determines the division shape pattern information based on the division shape pattern of the coding unit. The image encoding apparatus 200 determines the context model based on at least one of the shape, direction, ratio between width and height, and size of the coding unit. The image encoding apparatus 200 generates the division shape pattern information for dividing the coding unit as a bitstream based on the context model.
[0261] In order to determine the context model, the image encoding apparatus 200 may obtain an arrangement for corresponding at least one of the shape, direction, ratio between width and height, and size of the coding unit to the index of the context model. The image encoding apparatus 200 may obtain the index of the context model based on at least one of the shape, direction, ratio between width and height, and size of the coding unit in the arrangement. The image encoding apparatus 200 may determine the context model based on the index of the context model.
[0262] In order to determine the context model, the image encoding device 200 may also determine the context model based on block shape information, wherein the block shape information includes at least one of the shape, direction, ratio between width and height, and size of a neighboring coding unit adjacent to the coding unit. In addition, the neighboring coding unit may include at least one coding unit located at the lower left, left side, upper left side, upper side, upper right side, right side, or lower right side of the coding unit.
[0263] In addition, in order to determine the context model, the image encoding apparatus 200 may compare the width length of the upper adjacent coding unit with the width length of the coding unit. In addition, the image encoding apparatus 200 may compare the height lengths of the left adjacent coding unit and the right adjacent coding unit with the height length of the coding unit. In addition, the image encoding apparatus 200 may determine the context model based on the comparison result.
[0264] Operation and reference of the image encoding device 200 Figures 3 to 20 The operation of the described image decoding device 100 is similar, and therefore a detailed explanation thereof is not provided here.
[0265] Will refer to Figures 21 to 37 The image decoding apparatus 2100 and the image encoding apparatus 3600 according to the embodiment are described.
[0266] Fig.21 is a block diagram of an image decoding apparatus 2100 according to an embodiment.
[0267] Reference Fig.21 , the image decoding apparatus 2100 according to an embodiment may include an obtainer 2110 and a motion information decoder 2130 .
[0268] The image decoding apparatus 2100 may obtain a bitstream generated as a result of encoding an image, and may decode motion information for inter prediction based on information included in the bitstream.
[0269] The image decoding apparatus 2100 according to an embodiment may include a central processor (not shown) for controlling the obtainer 2110 and the motion information decoder 2130. Alternatively, the obtainer 2110 and the motion information decoder 2130 may be operated by their own processors (not shown), and the image decoding apparatus 2100 may operate as the processor (not shown) operates systematically. Alternatively, the obtainer 2110 and the motion information decoder 2130 may be controlled by an external processor (not shown) of the image decoding apparatus 2100.
[0270] The image decoding apparatus 2100 may include one or more data memories (not shown) storing input / output data of the obtainer 2110 and the motion information decoder 2130. The image decoding apparatus 2100 may include a memory controller (not shown) for controlling data input / output to / from the data memory (not shown).
[0271] In order to reconstruct an image through image decoding, the image decoding device 2100 may perform an image decoding operation including prediction in conjunction with an internal video decoding processor or an external video decoding processor. The internal video decoding processor of the image decoding device 2100 according to an embodiment may perform basic image decoding operations as a separate processor, or a central processing unit or a graphics processor may include an image decoding processing module and may perform basic image decoding operations.
[0272] The image decoding apparatus 2100 may be included in the image decoding apparatus 100. For example, the obtainer 2110 may be included in Figure 1 The motion information decoder 2130 may be included in the bitstream obtainer 110 of the image decoding apparatus 100 , and the motion information decoder 2130 may be included in the decoder 120 of the image decoding apparatus 100 .
[0273] The obtainer 2110 receives a bitstream generated as a result of encoding an image. The bitstream may include information for determining a motion vector for inter prediction of a current block. The current block, which is a block generated by dividing an image according to a tree structure, may correspond to, for example, a maximum coding unit, a coding unit, or a transformation unit.
[0274] The obtainer 2110 may determine the current block based on the block shape information and / or the partition shape mode information included in at least one of the following items: a sequence parameter set, a picture parameter set, a video parameter set, a slice header, and a slice segment header. In addition, the obtainer 2110 may obtain a syntax element corresponding to the block shape information or the partition shape mode information from the bitstream for each maximum coding unit, a reference coding unit, or a processing block, and may use the syntax element to determine the current block.
[0275] The bitstream may include information indicating a prediction mode of the current block, and according to the present disclosure, the prediction mode of the current block may include at least one of an intra mode, an inter mode, a merge mode, a direct mode, a skip mode, and a preset mode. The preset mode may be a mode for determining a prediction motion vector of the current block from prediction motion vector candidates classified according to a disparity distance and a disparity direction.
[0276] In an embodiment, the bitstream may include at least one of the following information: information indicating whether a preset mode is applied to a current block, information indicating a base motion vector of the current block, information indicating a predicted motion vector of the current block, information indicating a disparity distance for determining a predicted motion vector candidate from base motion vector candidates, information indicating a disparity direction for determining a predicted motion vector candidate from base motion vector candidates, information indicating a priority of base motion vector candidates, information indicating a priority of a disparity distance, and information indicating a priority of a disparity direction.
[0277] The obtainer 2110 may obtain information included in a bitstream at a level corresponding to at least one of a coding unit, a transformation unit, a maximum coding unit, a slice unit, and a picture unit.
[0278] The motion information decoder 2130 determines a motion vector of the current block based on information included in a bitstream.
[0279] The motion information decoder 2130 may check whether the preset mode is applied to the current block based on information included in the bitstream. The information indicating whether the preset mode is applied may include a flag or an index.
[0280] For example, when it is first checked that a prediction mode different from a preset mode is applied to the current block, the obtainer 2110 may obtain information indicating whether the preset mode is applied to the current block. For example, when a skip mode is applied to the current block or a direct mode is applied to the current block, information indicating whether the preset mode is applied may be extracted from the bitstream.
[0281] In an example, the motion information decoder 2130 may not extract information indicating whether the preset mode is applied from the bitstream, and may determine whether the 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 the preset mode is applied by using the same standard as that of the image encoding apparatus 3600.
[0282] When a preset mode is applied to the current block, the motion information decoder 2130 may determine a prediction motion vector candidate for one or more base motion vector candidates. The motion information decoder 2130 may determine one or more prediction motion vector candidates that are changed according to a predetermined disparity distance and a predetermined disparity direction from each of the one or more base motion vector candidates. One or more prediction motion vector candidates determined for one or more base motion vector candidates may be classified according to the disparity distance and the disparity direction.
[0283] The disparity distance is a value determined based on a basic pixel unit (e.g., a 1 / 4 pixel unit). The disparity distance may indicate how many basic pixel units correspond to the difference. For example, when the disparity distance between the base motion vector candidate and the predicted motion vector candidate is 1, it may mean that the predicted motion vector candidate differs from the base motion vector candidate by a pixel distance corresponding to a 1 / 4 pixel unit. The disparity distance may be a value corresponding to an integer, a rational number, or an irrational number.
[0284] When the minimum pixel unit that may be indicated by the motion vector of the current block is the same as the basic pixel unit, the motion information decoder 2130 may determine a prediction motion vector candidate according to a predetermined disparity distance.
[0285] However, when the minimum pixel unit that can be indicated by the motion vector of the current block is different from the basic pixel unit, the motion information decoder 2130 may scale the predetermined disparity distance and then determine a predicted motion vector candidate for each of one or more base motion vector candidates based on the scaled disparity distance.
[0286] When the motion vector of the current block can indicate pixels corresponding to integer pixel units, 1 / 2 pixel units, 1 / 4 pixel units, and 1 / 8 pixel units, the minimum pixel unit that can be indicated by the motion vector of the current block is the 1 / 8 pixel unit. When the basic pixel unit is the 1 / 4 pixel unit, the motion information decoder 2130 can enlarge the disparity distance used to determine the prediction motion vector candidate.
[0287] In an example, the motion information decoder 2130 may scale the disparity distance according to a ratio between a minimum pixel unit that may be indicated by a motion vector of the current block and a basic pixel unit.
[0288] In an example, when the basic pixel unit is larger than a minimum pixel unit that may be indicated by a motion vector of the current block, the motion information decoder 2130 may enlarge the disparity distance.
[0289] The following will refer to Fig.26 A process of determining a prediction motion vector candidate based on the scaled disparity distance is described.
[0290] In an embodiment, one or more base motion vector candidates of the current block may be determined based on motion vectors of neighboring blocks spatially and temporally related to the current block. Neighboring blocks spatially and temporally related to the current block may include blocks decoded before the current block.
[0291] The neighboring blocks spatially related to the current block may include, but are not limited to, blocks located on the left side of the current block and blocks located on the upper side of the current block. In addition, the neighboring blocks temporally related to the current block may include, for example, blocks co-located with the current block among blocks included in a reference picture different from the current picture including the current block, and blocks spatially adjacent to the blocks co-located with the current block.
[0292] In an embodiment, the motion information decoder 2130 may determine the motion vector of the neighboring block related to the current block as one or more base motion vector candidates. Alternatively, the motion information decoder 2130 may determine one or more base motion vector candidates by changing the motion vector of the neighboring block related to the current block. Alternatively, the motion information decoder 2130 may determine one or more base motion vector candidates by combining the motion vectors of the neighboring blocks related to the current block according to a predetermined equation.
[0293] In an embodiment, the motion information decoder 2130 may determine a motion vector of a neighboring block related to the current block having a picture order count (POC) difference of a reference picture between motion vectors equal to or greater than a preset value as a base motion vector candidate.
[0294] In an embodiment, the motion information decoder 2130 may determine one or more base motion vector candidates in the same manner as a method of determining a candidate list of a motion vector predictor in an adaptive motion vector prediction (AMVP) mode or a merge mode of HEVC.
[0295] In an embodiment, the motion information decoder 2130 may determine a zero motion vector having a component of 0 as one or more base motion vector candidates.
[0296] When one or more base motion vector candidates are determined, the motion information decoder 2130 may determine a base motion vector of the current block from among the one or more base motion vector candidates based on information included in a bitstream.
[0297] The information indicating the base motion vector of the current block may be encoded by using a fixed length coding (FLC) method, a unary coding method, or a truncated unary coding method, and may be included in a bitstream.
[0298] In an embodiment, when the number of base motion vector candidates is 1, the obtainer 2110 may not extract information for determining the base motion vector of the current block from the bitstream. In this case, the motion information decoder 2130 may determine the one base motion vector candidate as the base motion vector of the current block.
[0299] In an embodiment, the motion information decoder 2130 may not parse information indicating a base motion vector from a bitstream, and may determine a base motion vector of the current block from one or more base motion vector candidates based on information related to at least one of a 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 base motion vector by using the same standard as that of the image encoding apparatus 3600.
[0300] When the base motion vector of the current block is determined, the motion information decoder 2130 may determine a prediction motion vector of the current block from one or more prediction motion vector candidates determined based on the base motion vector.
[0301] The obtainer 2110 can obtain information indicating at least one of the disparity distance and the disparity direction from the bitstream, and based on the information indicating at least one of the disparity distance and the disparity direction, the motion information decoder 2130 can determine the predicted motion vector of the current block from one or more predicted motion vector candidates related to the base motion vector.
[0302] When the minimum pixel unit that can be indicated by the motion vector of the current block is the same as the basic pixel unit, the motion information decoder 2130 may determine a prediction motion vector candidate corresponding to the disparity distance and the disparity direction verified from the bitstream as the prediction motion vector of the current block.
[0303] However, in an embodiment, when the minimum pixel unit that can be indicated by the motion vector of the current block is different from the basic pixel unit, the motion information decoder 2130 may scale the disparity distance verified from the bitstream, and then may determine a predicted motion vector candidate corresponding to the scaled disparity distance and the disparity direction as the predicted motion vector of the current block.
[0304] For example, the motion information decoder 2130 may scale the disparity distance verified from the bitstream according to the ratio between the minimum pixel unit that may be indicated by the motion vector of the current block and the basic pixel unit. When the basic pixel unit (e.g., 1 / 4 pixel unit) is larger than the minimum pixel unit (e.g., 1 / 8 pixel unit) that may be indicated by the motion vector of the current block, the motion information decoder 2130 may enlarge the disparity distance verified from the bitstream.
[0305] The scaled disparity distance may indicate how many minimum pixel units correspond to the difference. For example, when the minimum pixel unit that can be indicated by the motion vector of the current block is a 1 / 8 pixel unit and the scaled disparity distance is 2, the motion information decoder 2130 may determine a prediction motion vector candidate that differs from the base motion vector by a pixel distance corresponding to two 1 / 8 pixel units as the prediction motion vector of the current block.
[0306] As described above, the disparity distance predetermined based on the basic pixel unit is used to determine the prediction motion vector candidate based on one or more base motion vector candidates. Since information indicating the disparity distance predetermined based on the basic pixel unit is transmitted by a bitstream signal, the motion information decoder 2130 having sufficiently high accuracy to indicate the minimum pixel unit different from the basic pixel unit can scale the disparity distance transmitted by the bitstream signal according to the minimum pixel unit.
[0307] The pixel distance corresponding to the disparity distance determined based on the basic pixel unit and the pixel distance corresponding to the disparity distance scaled based on the minimum pixel unit may be the same. However, when the minimum pixel unit is smaller than the basic pixel unit (that is, when the accuracy of the motion vector is higher) and the disparity distance determined based on the basic pixel unit is not scaled, a predicted motion vector different from the predicted motion vector determined by the image encoding apparatus 3600 may be determined as the predicted motion vector of the current block.
[0308] In an embodiment, information indicating a minimum pixel unit that may be indicated by a motion vector of the current block may be included in a bitstream.The obtainer 2110 may obtain the information indicating the minimum pixel unit from a bitstream corresponding to a level of at least one of a block, a slice, and a picture.
[0309] At least one of information indicating a disparity distance of a predicted motion vector for specifying a current block and information indicating a disparity direction may be obtained from a bitstream at a transform unit level, a coding unit level, a maximum coding unit level, a slice level, or a picture level.
[0310] Information indicating a disparity distance and a disparity direction for specifying a prediction motion vector of a current block may be encoded by using an FLC method, a unary encoding method, or a truncated unary encoding method and included in a bitstream.
[0311] The obtainer 2110 may decode information indicating the disparity direction (eg, at least one of the indexes indicating the disparity direction) from the bitstream by using the context model.
[0312] In an embodiment, the motion information decoder 2130 may not parse at least one of the information indicating the disparity distance and the information indicating the disparity direction from the bitstream, and may determine the predicted motion vector of the current block from one or more predicted motion vector candidates 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 the predicted motion vector by using the same standard as that of the image encoding apparatus 3600.
[0313] When the predicted motion vector of the current block is determined, the motion information decoder 2130 may determine the motion vector of the current block based on the predicted motion vector of the current block. In an embodiment, the motion information decoder 2130 may determine the predicted motion vector of the current block as the motion vector of the current block.
[0314] When the information indicating the differential motion vector is included in the bitstream, the motion information decoder 2130 may determine the differential motion vector of the current block based on the information indicating the differential motion vector. In an example, the information indicating the differential motion vector may be encoded by using an exponential Golomb coding method and may be included in the bitstream.
[0315] The obtainer 2110 may obtain information indicating a differential 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.
[0316] The motion information decoder 2130 may determine the motion vector of the current block by applying the differential motion vector to the predicted motion vector. In an example, the motion information decoder 2130 may determine the motion vector of the current block by adding the differential motion vector to the predicted motion vector.
[0317] In an embodiment, when the prediction direction of the current block is bidirectional, the differential motion vector may be included in the bitstream only for one direction. For example, information indicating the differential motion vector may be included in the bitstream only for one direction of the list 0 direction and the list 1 direction.
[0318] When the differential motion vector is included in the bitstream only for the list 0 direction, the motion information decoder 2130 may determine the motion vector for the list 0 direction of the current block by applying the differential motion vector for the list 0 direction to the predicted motion vector for the list 0 direction. The motion information decoder 2130 may determine the predicted motion vector for the list 1 direction as the 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 differential motion vector for the list 0 direction to the predicted motion vector for the list 1 direction.
[0319] Since the present disclosure is related to a method of representing a motion vector, the present disclosure can be used for various forms of motion vectors or various forms of differential motion vectors used in current encoding devices. That is, when the existing method includes encoding and transmitting a motion vector (or differential motion vector) (for example, a differential motion vector in AMVP mode or a differential motion vector in affine mode), the present disclosure applies a simple position indication method using distance and direction, thereby achieving high encoding efficiency.
[0320] Alternatively, the present disclosure may be additionally applied to existing modes and may represent more motion vectors (or differential motion vectors) to be considered. All algorithms for inter-frame prediction require the exact position of known blocks to perform motion compensation. In this case, when the method according to the present disclosure is applied, the probability of reference to adjacent blocks can be checked and encoded using a minimum number of bits. Therefore, the efficiency of encoding performance can be greatly improved. It can be determined whether the method according to the present disclosure is applied in the high-level syntax, thereby reducing the burden of signaling bits.
[0321] Will refer to Figure 22 to Figure 25 A method for determining a prediction motion vector candidate corresponding to a base motion vector candidate is described.
[0322] Figure 22 to Figure 25 Each of the prediction motion vector candidates determined according to the disparity distance is shown in a coordinate plane, wherein the disparity distance is predetermined based on a basic pixel unit corresponding to a 1 / 4 pixel unit.
[0323] Reference Figure 22 to Figure 25 , the motion information decoder 2130 may determine a candidate positioned according to a predetermined shape to determine a prediction motion vector candidate. The predetermined shape may be a polygonal shape such as a rhombus shape or a quadrilateral shape, or a shape similar to a circular shape.
[0324] The motion information decoder 2130 may determine a candidate at a specific disparity distance from a point corresponding to a base motion vector candidate as a predicted motion vector candidate. The motion information decoder 2130 may determine a predicted motion vector candidate at a first disparity distance from a preset point as a first candidate group, may determine a predicted motion vector candidate at a second disparity distance from the preset point as a second candidate group, and may determine a predicted motion vector candidate at an nth disparity distance from the preset point as an nth candidate group. The motion information decoder 2130 may determine a predicted motion vector candidate closest to the preset point as the first candidate group, and may determine a predicted motion vector candidate second closest to the preset point as the second candidate group. That is, as the disparity distance increases, the number (or index) of candidate groups may increase sequentially.
[0325] As the number of candidate groups increases, the disparity distance may increase at a logarithmic scale interval or a nonlinear interval. In addition, as the number of candidate groups increases, the disparity distance may increase at N intervals (N is an integer) (e.g., N, 2N, 3N, ...). In addition, as the number of candidate groups increases, the disparity distance may increase so that the difference between the disparity distance and the previous disparity distance is constant.
[0326] The disparity distance may be determined according to a user's definition. Alternatively, the motion information decoder 2130 may directly determine the disparity distance based on information related to the current block, the temporal layer, or the GOP, or may obtain information indicating the disparity distance for determining a prediction motion vector candidate through a bitstream.
[0327] The motion information decoder 2130 may determine a disparity distance for determining a prediction motion vector candidate of the current block according to a disparity distance determined at a level higher than a level corresponding to the current block.
[0328] The number of prediction motion vector candidates may be determined independently for each candidate group.The motion information decoder 2130 may determine the number of prediction motion vector candidates for each candidate group of the current block according to the number information determined at a level higher than the level corresponding to the current block.
[0329] Fig. 22 and Fig.23 The case where the number of motion vector prediction candidates in each candidate group is 4 is shown. Fig. 22 and Fig.23 The number of candidate groups in is 3, but the number of candidate groups is not limited to 3.
[0330] Reference Fig. 22 , the motion information decoder 2130 may determine a prediction motion vector candidate having a diamond distribution based on the basic motion vector candidate (x, y) 2201 .
[0331] The motion information decoder 2130 may determine prediction motion vector candidates (x+1, y) 2202 , (x−1, y) 2203 , (x, y+1) 2204 , and (x, y−1) 2205 whose disparity distance from the base motion vector candidate (x, y) 2201 is 1 as a first candidate group.
[0332] The motion information decoder 2130 may determine prediction motion vector candidates (x+2,y) 2206 , (x−2,y) 2207 , (x,y+2) 2208 , and (x,y−2) 2209 having a disparity distance of 2 from the base motion vector candidate (x,y) 2201 as a second candidate group.
[0333] The motion information decoder 2130 may determine prediction motion vector candidates (x+4,y) 2210 , (x−4,y) 2211 , (x,y+4) 2212 , and (x,y−4) 2213 having a disparity distance of 4 from the base motion vector candidate (x,y) 2201 as a third candidate group.
[0334] Reference Fig.23 , the motion information decoder 2130 may determine a prediction motion vector candidate having a quadrilateral distribution based on the basic motion vector candidate (x, y) 2201 .
[0335] The motion information decoder 2130 may determine predicted motion vector candidates (x+1, y+1) 2221, (x+1, y-1) 2222, (x-1, y+1) 2223, and (x-1, y-1) 2224 having a disparity distance of approximately 1 from the base motion vector candidate (x, y) 2201 as the first candidate group.
[0336] The motion information decoder 2130 may determine predicted motion vector candidates (x+2, y+2) 2225, (x+2, y-2) 2226, (x-2, y+2) 2227, and (x-2, y-2) 2228 having a disparity distance of approximately 2 from the base motion vector candidate (x, y) 2201 as the second candidate group.
[0337] The motion information decoder 2130 may determine predicted motion vector candidates (x+4, y+4) 2229, (x+4, y-4) 2230, (x-4, y+4) 2231, and (x-4, y-4) 2232 having a disparity distance of approximately 4 from the base motion vector candidate (x, y) 2201 as a third candidate group.
[0338] Reference Fig.24 , the motion information decoder 2130 may determine the number of prediction motion vector candidates included in at least one candidate group among the plurality of candidate groups to be different from the number of prediction motion vector candidates of the other candidate groups.
[0339] In detail, the motion information decoder 2130 can determine eight predicted motion vector candidates (x+1,y)2202, (x-1,y)2203, (x,y+1)2204, (x,y-1)2205, (x+1,y+1)2221, (x+1,y-1)2222, (x-1,y+1)2223 and (x-1,y-1)2224 whose disparity distance from the base motion vector candidate (x,y)2201 is approximately 1 as the first candidate group.
[0340] In addition, the motion information decoder 2130 can determine eight predicted motion vector candidates (x+2,y)2206, (x-2,y)2207, (x,y+2)2208, (x,y-2)2209, (x+2,y+2)2225, (x+2,y-2)2226, (x-2,y+2)2227 and (x-2,y-2)2228 whose disparity distance from the base motion vector candidate (x,y)2201 is approximately 2 as the second candidate group.
[0341] The motion information decoder 2130 may determine four predicted motion vector candidates (x+4,y)2210, (x-4,y)2211, (x,y+4)2212, and (x,y-4)2213 having a disparity distance of approximately 4 from the base motion vector candidate (x,y)2201 as a third candidate group.
[0342] Reference Fig.25 , the motion information decoder 2130 may determine the distribution shape of the prediction motion vector candidates differently according to the candidate group. In an example, the motion information decoder 2130 may determine the prediction motion vector candidates (x+1, y) 2202, (x-1, y) 2203, (x, y+1) 2204, and (x, y-1) 2205 having a diamond distribution based on the base motion vector candidate (x, y) 2201 as the first candidate group.
[0343] In addition, the motion information decoder 2130 can determine the predicted motion vector candidates (x+2,y+2)2225, (x+2,y-2)2226, (x-2,y-2)2228 and (x-2,y+2)2227 having a quadrilateral distribution based on the basic motion vector candidate (x,y) 2201 as the second candidate group.
[0344] In addition, the motion information decoder 2130 may determine the prediction motion vector candidates (x+4, y) 2210, (x-4, y) 2211, (x, y+4) 2212, and (x, y-4) 2213 having a diamond distribution based on the base motion vector candidate (x, y) 2201 as a third candidate group. The distribution shape of the prediction motion vector candidates included in each candidate group is not limited to Fig.25 The distribution shape shown in , and may be any of various other distribution shapes.
[0345] In an embodiment, the motion information decoder 2130 may determine prediction motion vector candidates located at different disparity distances according to the base motion vector candidates. For example, a prediction motion vector candidate with a disparity distance of 1 may be determined for a first base motion vector candidate among a plurality of base motion vector candidates, and a prediction motion vector candidate with a disparity distance of 2 may be determined for a second base motion vector candidate among a plurality of base motion vector candidates. Alternatively, for example, a prediction motion vector candidate with a disparity distance of 1 and a prediction motion vector candidate with a disparity distance of 2 may be determined for the first base motion vector candidate, and a prediction motion vector candidate with a disparity distance of 4 and a prediction motion vector candidate with a disparity distance of 8 may be determined for the second base motion vector candidate.
[0346] When the disparity distance and the base motion vector candidates are mapped to each other in a 1:1 manner, the obtainer 2110 may obtain only information indicating the base motion vector of the current block or information indicating the disparity distance from the bitstream, and may determine the disparity distance for specifying the predicted motion vector of the current block and the base motion vector of the current block.
[0347] As described above, the disparity distance used to determine the predicted motion vector candidate can be determined based on the basic pixel unit, and when the minimum pixel unit that can be indicated by the motion vector of the current block is different from the basic pixel unit, the motion information decoder 2130 can scale the preset disparity distance used to configure the candidate group according to each basic motion vector candidate.
[0348] When the motion vector of the current block may indicate pixels corresponding to integer pixel units, 1 / 2 pixel units, 1 / 4 pixel units, and 1 / 8 pixel units, the minimum pixel unit that may be indicated by the motion vector of the current block is a 1 / 8 pixel unit. When the basic pixel unit is a 1 / 4 pixel unit, the motion information decoder 2130 may enlarge the disparity distance used to configure the candidate group. In an example, the motion information decoder 2130 may enlarge the disparity distance according to a ratio between the basic pixel unit and the minimum pixel unit that may be indicated by the motion vector of the current block. When the minimum pixel unit that may be indicated by the motion vector of the current block is an m pixel unit, the basic pixel unit is an n pixel unit, and the disparity distance corresponding to one candidate group is k, the motion information decoder 2130 may enlarge the disparity distance k to k*n / m.
[0349] Fig.26 It is shown that when the basic pixel unit is a 1 / 4 pixel unit and the minimum pixel unit of the motion vector of the current block is a 1 / 8 pixel unit, in reference Fig. 22 The described disparity distance is scaled and the predicted motion vector candidate is determined.
[0350] Reference Fig.26 , the motion information decoder 2130 may determine a prediction motion vector candidate having a diamond distribution based on the basic motion vector candidate (x, y) 2601 .
[0351] The motion information decoder 2130 may determine as the first candidate group the predicted motion vector candidates (x+2,y)2602, (x-2,y)2603, (x,y+2)2604 and (x,y-2)2605 which are a scaled disparity distance 2(1*(1 / 4) / (1 / 8)) away from the base motion vector candidate (x,y)2601.
[0352] The motion information decoder 2130 may determine as the second candidate group the predicted motion vector candidates (x+4,y)2606, (x-4,y)2607, (x,y+4)2608 and (x,y-4)2609 which are a scaled disparity distance of 4 (2*(1 / 4) / (1 / 8)) from the base motion vector candidate (x,y)2601.
[0353] The motion information decoder 2130 may determine as the third candidate group the predicted motion vector candidates (x+8,y)2610, (x-8,y)2611, (x,y+8)2612, and (x,y-8)2613 which are a scaled disparity distance 8 (4*(1 / 4) / (1 / 8)) from the base motion vector candidate (x,y)2601.
[0354] For a motion vector of a current block that may indicate a pixel unit different from a basic pixel unit, when a prediction motion vector candidate is configured by scaling a predetermined disparity distance, the motion information decoder 2130 may further scale the disparity distance corresponding to information obtained from a bitstream to determine the prediction motion vector of the current block, and then may determine the prediction motion vector of the current block according to the scaled disparity distance. For example, when Fig.26 When the predicted motion vector candidates are configured as shown and the disparity distance verified from the bitstream is 1, the motion information decoder 2130 can scale the verified disparity distance to 2 (1*(1 / 4) / (1 / 8)), and can determine at least one of the predicted motion vector candidates (x+2,y)2602, (x-2,y)2603, (x,y+2)2604 and (x,y-2)2605 that are changed by the disparity distance 2 from the base motion vector (x,y) as the predicted motion vector of the current block.
[0355] In an embodiment, when the minimum pixel unit that can be indicated by the base motion vector candidate and the minimum pixel unit that can be indicated by the motion vector of the current block are different from each other, the motion information decoder 2130 can change the base motion vector candidate according to the minimum pixel unit that can be indicated by the motion vector of the current block, and can determine the predicted motion vector candidate according to the disparity distance from the changed base motion vector candidate.
[0356] In an example, when the minimum pixel unit that can be indicated by a base motion vector candidate is smaller than the minimum pixel unit that can be indicated by the motion vector of the current block, the base motion vector candidate can be changed so that pixels corresponding to the minimum pixel unit that can be indicated by the motion vector of the current block are indicated by the base motion vector candidate.
[0357] Fig. 27A method of changing a base motion vector candidate when a minimum pixel unit that can be indicated by a motion vector of a current block is a 1 / 4 pixel unit and a pixel unit that can be indicated by a base motion vector candidate is a 1 / 8 pixel unit is shown.
[0358] exist Fig. 27 When the base motion vector candidate indicates a pixel of 1 / 8 pixel unit, the motion information decoder 2130 may change the base motion vector candidate to indicate pixels of 1 / 4 pixel unit around the pixel of 1 / 8 pixel unit indicated by the base motion vector candidate.
[0359] In an example, the motion information decoder 2130 may change the base motion vector candidate to indicate a pixel closest to the pixel P among pixels a, b, c, d, e, and f of a 1 / 4 pixel unit adjacent to the pixel P indicated by the base motion vector candidate. Alternatively, the motion information decoder 2130 may change the base motion vector candidate to indicate one pixel according to a predetermined criterion among pixels a, b, c, d, e, and f of a 1 / 4 pixel unit adjacent to the pixel P indicated by the base motion vector candidate.
[0360] When the base motion vector candidate is changed, the motion information decoder 2130 may determine a motion vector spaced apart from the changed base motion vector candidate by a disparity distance as a prediction motion vector candidate. When a minimum pixel unit that may be indicated by the motion vector of the current block is different from a basic pixel unit, the motion information decoder 2130 may determine a motion vector spaced apart from the changed base motion vector candidate by a scaled disparity distance as a prediction motion vector candidate.
[0361] Fig.28 is a diagram for describing an index indicating a prediction motion vector candidate according to an embodiment.
[0362] Reference Fig.28 , figure numeral 2801 may represent a bit representation corresponding to an index indicating a base motion vector candidate, figure numeral 2802 may represent a bit representation corresponding to an index indicating a disparity distance (or candidate group) of a predicted motion vector candidate, and figure numerals 2803 and 2804 may represent bit representations corresponding to indices indicating disparity directions of predicted motion vector candidates.
[0363] In order to determine the base motion vector of the current block based on the index indicating the base motion vector included in the bitstream, the motion information decoder 2130 may assign an index to each of the one or more base motion vector candidates. In addition, the motion information decoder 2130 may assign an index to each of the prediction motion vector candidates to determine the prediction motion vector of the current block based on the index indicating the disparity distance included in the bitstream.
[0364] Reference Fig.28 , index 0 may be assigned to base motion vector candidate 0, and index 10 may be assigned to base motion vector candidate 1. An index indicating each of the base motion vector candidates may be expressed by using a unary encoding method or a truncated unary encoding method.
[0365] The number of bits representing the index may increase from base motion vector candidate 0 to base motion vector candidate 4, and the priority between the base motion vector candidates for assigning the index may be set by using the same standard as that of the image encoding apparatus 3600 .
[0366] In an embodiment, information indicating the priority between base motion vector candidates for assigning indexes may be included in the bitstream, and in this case, the motion information decoder 2130 may assign an index to each of the base motion vector candidates according to the information indicating the priority obtained from the bitstream.
[0367] The information indicating the priority between the base motion vector candidates obtained from the bitstream may include information about a priority number that is changed compared to the priority between the base motion vector candidates determined in the previous block, the previous slice, or the previous picture. For example, when the priority number of the base motion vector candidate 0 is 1 in the previous block, the previous slice, or the previous picture, but is changed to 3 in relation to the current block, the current slice, or the current picture, information indicating that the priority number of the base motion vector candidate 0 is changed to 3 may be included in the bitstream. Alternatively, information indicating that the priority between the base motion vector candidates determined in the previous block, the previous slice, or the previous picture is not changed for the current block, the current slice, or the current picture may be included in the bitstream.
[0368] The predicted motion vector candidates determined based on one base motion vector candidate may be grouped into candidate groups according to a predetermined criterion. The predetermined criterion may be how much disparity distance the predicted motion vector candidate is spaced from the base motion vector candidate. The index of each candidate group may be represented by using a unary coding method or a truncated unary coding method. According to an embodiment, the index of each candidate group may be represented by using an FLC method.
[0369] Reference Fig.28 , the number of bits used to represent the index of the candidate group may increase from candidate group 0 corresponding to the first disparity distance to candidate group 7 corresponding to the eighth disparity distance, and the priority between the candidate groups for assigning indexes may be set by using the same standard as that of the image encoding device 3600.
[0370] In an embodiment, information indicating the priority between candidate groups for assigning indexes may be included in a bitstream, and in this case, the motion information decoder 2130 may assign an index to each of the candidate groups according to the information indicating the priority obtained from the bitstream. The information indicating the priority between candidate groups obtained from the bitstream may include information about a priority number that has been changed compared to the priority between candidate groups determined in a previous block, a previous strip, or a previous picture. For example, when the priority number of candidate group 0 is 1 in a previous block, a previous strip, or a previous picture, but is changed to 3 in relation to a current block, a current strip, or a current picture, information indicating that the priority number of candidate group 0 is changed to 3 may be included in the bitstream. Alternatively, information indicating that the priority between candidate groups determined in a previous block, a previous strip, or a previous picture is not changed for the current block, the current strip, or the current picture may be included in the bitstream.
[0371] Fig.28 The candidate group 0 of may include candidates whose disparity distance from the base motion vector candidate is 1, and in an embodiment, the candidate group 0 may include candidates whose disparity distance from the base motion vector candidate is 0. Since the candidate whose disparity distance from the base motion vector candidate is 0 is the base motion vector candidate itself, as shown in FIG. Figure 22 to Figure 25 As described, when the base motion vector candidate corresponds to (x, y), the predicted motion vector candidate becomes (x, y). In this case, when the information indicating the candidate group for specifying the predicted motion vector of the current block indicates candidate group 0, the base motion vector of the current block can be determined as the predicted motion vector of the current block without obtaining information indicating the disparity direction. When a base motion vector is determined for the current block and the information indicating the candidate group indicates candidate group 0, the base motion vector will be the motion vector of the current block unless there is a differential motion vector, and thus the merge mode or skip mode of the conventional HEVC can be replaced.
[0372] An index (or flag) indicating a disparity direction may be assigned to a prediction motion vector candidate included in one candidate group. In this case, the index indicating the disparity direction may be represented by using the FLC method. For example, when four prediction motion vector candidates are included in one candidate group, two bits may be assigned to indicate each of the four prediction motion vector candidates.
[0373] The motion information decoder 2130 may classify the prediction motion vector candidates included in one candidate group into groups according to positions in a coordinate plane, and may assign an index or a flag corresponding to each of the classified groups.
[0374] Reference Fig.28, depending on whether the predicted motion vector candidates (x+1,y), (x-1,y), (x,y+1) and (x,y-1) corresponding to candidate group 0 of base motion vector candidate 0 are changed from base motion vector candidate 0 along the x-axis direction or the y-axis direction, they can be assigned an index (or flag) of 0 or 1 as shown in bit representation 2803, and depending on whether the predicted motion vector candidates (x+1,y), (x-1,y), (x,y+1) and (x,y-1) are changed along the + direction or the - direction, they can be assigned an index (or flag) of 0 or 1 as shown in bit representation 2804.
[0375] In an embodiment, the obtainer 2110 may entropy decode the bit values included in the bitstream according to a predetermined context model to obtain at least one of information indicating a disparity distance and information indicating a disparity direction for specifying a predicted motion vector of a current block.
[0376] When two candidate groups corresponding to two disparity distances are configured for one base motion vector candidate, the obtainer 2110 may entropy decode the bit value included in the bitstream according to a predetermined context model to obtain information indicating the disparity distance of the predicted motion vector of the current block. In this case, the information indicating the disparity distance may be binarized according to the FLC method, and then may be entropy encoded and may be included in the bitstream.
[0377] In an embodiment, the obtainer 2110 may decode at least one of the indexes indicating the disparity direction from the bitstream by using a context model. For example, the obtainer 2110 may divide the four predicted motion vector candidates included in one candidate group into two groups including two candidates changed along the x-axis direction and two candidates changed along the y-axis direction based on the base motion vector candidate, and may decode the index (2803) indicating whether the candidate is changed along the x-axis direction or along the y-axis direction according to the context model. When it is determined that the candidate is changed along the x-axis direction or the y-axis direction, the obtainer 2110 may decode the index (2804) indicating whether the candidate is changed along the + direction or along the - direction according to the context model.
[0378] In an embodiment, the motion information decoder 2130 may cause candidates located only at preset points in the coordinate plane to be included in each candidate group. For example, the motion information decoder 2130 may cause candidates that change only along the x-axis or y-axis to be included in each candidate group based on information about at least one of a previous picture, a current picture, a previous slice, a current slice, a previous block, and a current block. Fig.28Among the candidates (x+1, y), (x-1, y), (x, y+1) and (x, y-1) included in candidate group 0, candidates (x+1, y) and (x-1, y) that change only along the x-axis may be included in candidate group 0, and an index corresponding to bit representation 2804 may be assigned to each candidate to divide the candidates (x+1, y) and (x-1, y), and the index corresponding to bit representation 2804 may be decoded according to the context model.
[0379] In an embodiment, when two base motion vector candidates of the current block are determined, the obtainer 2110 may obtain information indicating the base motion vector of the current block by entropy decoding the bit value included in the bitstream according to a predetermined context model. In this case, the information indicating the base motion vector may be binarized according to the FLC method, and then may be entropy encoded and may be included in the bitstream.
[0380] In an embodiment, when at least one of information indicating a base motion vector, information indicating a disparity distance, and information indicating a disparity direction is obtained by entropy decoding a bit value included in a bitstream, the obtainer 2110 may select a context model for at least one of the information indicating a base motion vector, information indicating a disparity distance, and information indicating a disparity direction from one or more context models based on information related to a neighboring block adjacent to the current block.
[0381] The neighboring blocks may include, but are not limited to, a left block adjacent to the left side of the current block and an upper block adjacent to the upper side of the current block.
[0382] The obtainer 2110 may select a context model based on information related to a neighboring block, wherein the neighboring block is a neighboring block decoded by applying the same mode as a preset mode applied to the current block among neighboring blocks adjacent to the current block.
[0383] In an example, obtainer 2110 may select a context model for the current block based on information related to a neighboring block to which a mode identical to a preset mode applied to the current block is applied (e.g., at least one of information indicating a base motion vector, information indicating a disparity distance, and information indicating a disparity direction).
[0384] In an embodiment, when the size of the motion vector of the upper block to which the preset mode is applied and the motion vector of the left block to which the preset mode is applied in the x-axis direction is greater than the reference value, the obtainer 2110 may select the first context model. In addition, when the size of the motion vector of the left block to which the preset mode is applied in the x-axis direction is greater than the reference value or the size of the motion vector of the upper block to which the preset mode is applied in the x-axis direction is greater than the reference value, the obtainer 2110 may select the second context model. In addition, when the size of the motion vector of the upper block to which the preset mode is applied and the motion vector of the left block to which the preset mode is applied in the x-axis direction is equal to or less than the reference value, the obtainer 2110 may select the third context model.
[0385] A method of determining a prediction motion vector candidate when a base motion vector candidate is a bidirectional motion vector will be described.
[0386] First, the bidirectional prediction motion information for the block is described in Fig.29 The case where bidirectional prediction is performed on a block in the AMVP mode of HEVC is shown.
[0387] The block 2910 may be unidirectionally predicted by using the reference picture 2930 included in List 0 or the reference picture 2950 included in List 1 , or may be bidirectionally predicted by using both reference pictures 2930 and 2950 included in List 0 and List 1 .
[0388] Reference Fig.29 When the prediction direction of the block 2910 is a unidirectional list 0 direction, the motion vector MV0 of the list 0 direction of the block 2910 is determined based on the prediction motion vector MVP0 corresponding to the list 0 direction and the differential motion vector MVD0 for the list 0 direction. When the prediction direction of the block 2910 is a unidirectional list 1 direction, the motion vector MV1 of the list 1 direction of the block 2910 is determined based on the prediction motion vector MVP1 corresponding to the list 1 direction and the differential motion vector MVD1 for the list 1 direction.
[0389] When the prediction direction of block 2910 is bidirectional including a list 0 direction and a list 1 direction, the motion vector MV0 of the list 0 direction of block 2910 is determined based on the prediction motion vector MVP0 corresponding to the list 0 direction and the differential motion vector MVD0 for the list 0 direction, and the motion vector MV1 of the list 1 direction of block 2910 is determined based on the prediction motion vector MVP1 corresponding to the list 1 direction and the differential motion vector MVD1 for the list 1 direction.
[0390] That is, when a block is bidirectionally predicted, it may mean that the motion vector of the block includes the motion vector in the list 0 direction and the motion vector in the list 1 direction, and it may mean that the predicted motion vector of the block includes the predicted motion vector in the list 0 direction and the predicted motion vector in the list 1 direction.
[0391] In an embodiment of the present disclosure, when a base motion vector candidate corresponds to a bidirectional motion vector, the base motion vector candidates include base motion vector candidates in the direction of list 0 and base motion vector candidates in the direction of list 1, and a method for determining predicted motion vector candidates for the direction of list 0 and predicted motion vector candidates for the direction of list 1 will be described.
[0392] Fig.30 3030 indicated by a first unidirectional base motion vector candidate, a second reference picture 3050 indicated by a second unidirectional base motion vector candidate, and a current picture 3010 including a current block are shown as positions of each other when the base motion vector candidate corresponds to a bidirectional motion vector. Fig.30 , it is assumed that the distance between the current picture 3010 and the first reference picture 3030 is d1, and the distance between the current picture 3010 and the second reference picture 3050 is d2. The distance between pictures may refer to the POC value difference between pictures. In addition, the first unidirectional direction refers to the list 0 direction or the list 1 direction, and the second unidirectional direction refers to a direction different from the first unidirectional direction.
[0393] Reference Fig.30 , the current picture 3010 has POC B, and the first reference picture 3030 and the second reference picture 3050 have POC A and POC C, respectively. Fig.31 , the predicted motion vector candidates when POC B has a value between POC A and POC C are shown.
[0394] although Fig.28 The predicted motion vector candidates include candidates for list 0 or candidates for list 1 according to the direction of the base motion vector candidate, but when the base motion vector candidate is bidirectional, each predicted motion vector candidate may include candidates for list 0 and candidates for list 1.
[0395] When POC B has a value between POC A and POC C, each of the predicted motion vector candidates classified according to the disparity distance and the disparity direction may include a predicted motion vector candidate for the first unidirectional direction having a value with a size corresponding to the disparity distance (or a size corresponding to the scaled disparity distance), and a predicted motion vector candidate for the second unidirectional direction having an opposite sign and a value with a size corresponding to the disparity distance (or a size corresponding to the scaled disparity distance).
[0396] For example, in Fig.31 , the predicted motion vector candidate specified by the index 00 indicating the disparity direction among the predicted motion vector candidates included in the candidate group 0 may include (x+1, y) having a value of a size corresponding to the disparity distance (or a size corresponding to the scaled disparity distance) as a component and (x-1, y) (n is 1) having a value of the opposite sign as a component. (x+1, y) may correspond to a predicted motion vector candidate for a first unidirectional direction, and (x-1, y) may correspond to a predicted motion vector candidate for a second unidirectional direction. When the index 00 indicating the disparity direction is obtained from the bitstream, the motion information decoder 2130 may determine (x+1, y) as a predicted motion vector for the first unidirectional direction of the current block, and may determine (x-1, y) as a predicted motion vector for the second unidirectional direction of the current block.
[0397] here, Fig.31 The n shown in is a scaling factor for the parallax distance, and n is determined according to the distance between d1 and d2. For example, when the prediction motion vector candidate for the first unidirectional direction when d1 is 1 is (x+1, y), the prediction motion vector candidate for the second unidirectional direction when d2 is 2 may be determined as (x-1*2, y).
[0398] In the example, n (= d2 / d1) can be calculated as an integer (int) type, or according to an embodiment, can be calculated as a double precision floating point (double) type or a single precision floating point (float) type. Optionally, according to an embodiment, n can be converted by a shift operator (<<, >>), can be rounded, and can then be calculated by applying the shift operator again.
[0399] Fig.31 It is shown that n (= d2 / d1) is applied to determine the prediction motion vector candidate for the second unidirectional direction, which may correspond to the case where d2 is greater than d1. When d1 is greater than d2, n (= d1 / d2) may be applied to determine the prediction motion vector candidate for the first unidirectional direction. For example, Fig.31 The prediction motion vector candidate specified by index 00 in candidate group 0 may include (x+1*n, y) as a prediction motion vector candidate for the first unidirectional direction and (x-1, y) as a prediction motion vector candidate for the second unidirectional direction.
[0400] Fig.32 3 shows a positional relationship between a first reference picture 3230 indicated by a first unidirectional base motion vector candidate, a second reference picture 3250 indicated by a second unidirectional base motion vector candidate, and a current picture 3210 including a current block when the base motion vector candidate corresponds to a bidirectional motion vector. Fig.32, it is assumed that the distance between the current picture 3210 and the first reference picture 3230 is d1, and the distance between the current picture 3210 and the second reference picture 3250 is d2.
[0401] Reference Fig.32 , the current picture 3210 has POC A, and the first reference picture 3230 and the second reference picture 3250 have POC B and POC C, respectively. Fig.33 The predicted motion vector candidates when POC A is smaller than POC B and POC C are shown in FIG. The predicted motion vector candidates when POC A is larger than POC B and POC C can be Fig.33 The predicted motion vector candidates are the same.
[0402] Each of the prediction motion vector candidates classified according to the disparity distance and the disparity direction may include a candidate for the first single direction and a candidate for the second single direction.
[0403] When POC A is greater than or less than POC B and POC C, each of the predicted motion vector candidates classified according to the disparity distance and the disparity direction may include a predicted motion vector candidate for the first unidirectional direction having a value having a size corresponding to the disparity distance (or a size corresponding to the scaled disparity distance) and a predicted motion vector candidate for the second unidirectional direction having the same sign and a value having a size corresponding to the disparity distance (or a size corresponding to the scaled disparity distance) as components.
[0404] For example, refer to Fig.32 , the predicted motion vector candidate specified by the index 00 indicating the disparity direction among the predicted motion vector candidates included in the candidate group 0 may include a predicted motion vector candidate (x+1,0) for the first unidirectional direction and a predicted motion vector candidate (x+1,0) for the second unidirectional direction having a value having a size corresponding to the disparity distance (or a size corresponding to the scaled disparity distance) (n is 1).
[0405] Here, n is a scaling factor for the parallax distance, and n is determined according to the distance between d1 and d2. For example, when the prediction motion vector candidate for the first unidirectional direction when d1 is 1 is (1,0), the prediction motion vector candidate for the second unidirectional direction when d2 is 2 may be determined as (1*2,0).
[0406] In the example, n (= d2 / d1) can be calculated as an integer (int) type, or according to an embodiment, can be calculated as a double precision floating point (double) type or a single precision floating point (float) type. Optionally, according to an embodiment, n can be converted by a shift operator (<<, >>), can be rounded, and can then be calculated by applying the shift operator again.
[0407] Fig.33 It is shown that n (= d2 / d1) is applied to determine the prediction motion vector candidate for the second unidirectional direction, which may correspond to the case where d2 is greater than d1. When d1 is greater than d2, n (= d1 / d2) may be applied to determine the prediction motion vector candidate for the first unidirectional direction. For example, Fig.33 The prediction motion vector candidate specified by index 00 in candidate group 0 may include (x+1*n, y) as a prediction motion vector candidate for the first unidirectional direction and (x+1, y) as a prediction motion vector candidate for the second unidirectional direction.
[0408] about Fig.31 and Fig.33 For each of the scaling factors n shown in , when the disparity distance before scaling is a, the basic pixel unit is p1, the minimum pixel unit of the motion vector of the current block is p2, and d2 is greater than d1, the scaling factor n can be calculated as int((a*p1 / p2+1 / 2) / d1)*d2. On the contrary, when d1 is greater than d2, the scaling factor n can be calculated as int((a*p1 / p2+1 / 2) / d2)*d1.
[0409] A method of determining a motion vector of a current block considering a prediction direction of the current block and a direction of a base motion vector will be described.
[0410] In an embodiment, the obtainer 2110 may extract information (eg, an index) indicating a use direction of the base motion vector from the bitstream. The information indicating the use direction of the base motion vector may correspond to a prediction direction of the current block.
[0411] In an example, when the direction of use of the base motion vector is the list 0 direction, the current block can be unidirectionally predicted in the list 0 direction, and when the direction of use of the base motion vector is the list 1 direction, the current block can be unidirectionally predicted in the list 1 direction. In addition, when the direction of use of the base motion vector is bidirectional, the current block can be bidirectionally predicted.
[0412] For example, when the base motion vector is bidirectional, a bit value of 0 may indicate that the direction of use of the base motion vector is bidirectional, a bit value of 10 may indicate that the direction of use of the base motion vector is list 0 direction, and a bit value of 11 may indicate that the direction of use of the base motion vector is list 1 direction.
[0413] In addition, for example, when the base motion vector is in the first unidirectional direction of list 0 direction or list 1 direction, a bit value of 0 may indicate that the direction of use of the base motion vector is the first unidirectional direction, a bit value of 10 may 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 may indicate that the direction of use of the base motion vector is bidirectional.
[0414] The direction in which the base motion vector is used may also be changed corresponding to the bit value.
[0415] When the base motion vector is bidirectional and the direction of use of the base motion vector is bidirectional
[0416] The motion information decoder 2130 may determine a motion vector of the list 0 direction of the current block by using a predicted motion vector corresponding to the disparity distance and the disparity direction for the list 0 direction. The motion information decoder 2130 may determine a motion vector of the list 1 direction of the current block by using a predicted motion vector corresponding to the disparity distance and the disparity direction for the list 1 direction.
[0417] When the base motion vector is bidirectional, the direction of use of the base motion vector is bidirectional, and only information indicating the disparity distance and disparity direction for the list 0 direction is included in the bitstream, the motion information decoder 2130 can determine the disparity distance and disparity direction for the list 1 direction based on the information indicating the disparity distance and disparity direction for the list 0 direction.
[0418] The motion information decoder 2130 may determine the disparity distance and disparity direction for the list 1 direction considering 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.
[0419] In an 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 decoder 2130 may determine the disparity distance and disparity direction for the list 1 direction by changing the disparity direction for the list 0 direction to the opposite direction and scaling the value of the disparity distance for the list 0 direction according to the ratio between d1 (the distance between the current picture and the reference picture in the list 0 direction) and d2 (the distance between the current picture and the reference picture in the list 1 direction). For example, when the predicted motion vector for the list 0 direction is (x+1, y+1), d1 is 1 and d2 is 2, the predicted motion vector for the list 1 direction may be determined as (x-2, y-2).
[0420] 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 decoder 2130 may determine the disparity distance and the disparity direction for the list 1 direction by maintaining the disparity direction for the list 0 direction and scaling the disparity distance for the list 0 direction according to the ratio between d1 and d2. For example, when the predicted motion vector for the list 0 direction is (x+1, y+1), d1 is 1 and d2 is 2, the predicted motion vector for the list 1 direction may be determined as (x+2, y+2).
[0421] When the base motion vector is bidirectional and the direction of use of the base motion vector is unidirectional
[0422] When the base motion vector is bidirectional and the use direction of the base motion vector is the list 0 direction or the list 1 direction, the motion information decoder 2130 can obtain information indicating the disparity distance and disparity direction for the list 0 direction or the list 1 direction from the bit stream, and can determine the motion vector of the current block in the list 0 direction or the list 1 direction by using the predicted motion vector corresponding to the obtained information.
[0423] When the direction used by the basic motion vector is the first unidirectional direction, but only information indicating the disparity distance and disparity direction for the second unidirectional direction is included in the bitstream, the motion information decoder 2130 may consider the positional relationship and distance between the current picture, the reference picture in the direction of list 0, and the reference picture in the direction of list 1 as described above, and determine the disparity distance and disparity direction for the first unidirectional direction from the disparity distance and disparity direction for the second unidirectional direction.
[0424] When the basic motion vector is unidirectional and the direction in which the basic motion vector is used is unidirectional:
[0425] When the basic motion vector is in a first direction in the list 0 direction or the list 1 direction, the use direction of the basic motion vector is a second direction different from the first direction, and only information indicating the disparity distance and disparity direction for the first direction is included in the bitstream, the motion information decoder 2130 can determine the basic motion vector for the second direction based on the basic motion vector for the first direction, and can determine the disparity distance and disparity direction for the second direction based on the disparity distance and disparity direction for the first direction.
[0426] First, the motion information decoder 2130 may determine a second reference picture located in an opposite direction to the first reference picture based on the current picture, considering d1 (the distance between the current picture and the first reference picture indicated by the first unidirectional basic motion vector).
[0427] In an example, a second reference picture spaced apart by the same distance as d1 may be determined. In this case, since d1 is the same as d2 (the distance between the current picture and the second reference picture) and the current picture is located between the first reference picture and the second reference picture, the motion information decoder 2130 may generate a base motion vector for the second direction by changing the sign of the base motion vector for the first direction to be opposite, and may determine a disparity direction for the second direction by changing the disparity direction for the first direction to be opposite. The disparity distance for the first direction may be determined as the disparity distance for the second direction.
[0428] When there is no picture separated by the same distance as d1, a picture that is located in the opposite direction to the first reference picture and is located closest to the current picture may be determined as the second reference picture. In this case, although the current picture is located between the first reference picture and the second reference picture, d1 and d2 are different from each other. The motion information decoder 2130 may generate a second unidirectional basic motion vector by changing the sign of the first unidirectional basic motion vector to the opposite and scaling the first unidirectional basic motion vector according to the ratio between d1 and d2. In addition, the motion information decoder 2130 may determine the disparity distance and disparity direction for the second unidirectional by changing the disparity direction of the first unidirectional to the opposite direction and scaling the disparity distance for the first unidirectional according to the ratio between d1 and d2.
[0429] When the current picture corresponds to the last picture of the picture group (GOP), the motion information decoder 2130 may determine a picture located in the same direction as the first reference picture with respect to the current picture as the second reference picture. The picture closest to the first reference picture or the current picture may be determined as the second reference picture. In this case, since the current picture is located after the first reference picture and the second reference picture, the motion information decoder 2130 may generate a second unidirectional basic motion vector by scaling the value of the first unidirectional basic motion vector according to the ratio between d1 and d2 (without changing the sign). In addition, the motion information decoder 2130 may determine the disparity distance for the second unidirectional by scaling the disparity distance for the first unidirectional according to the ratio between d1 and d2.
[0430] In the example, when the current frame corresponds to the last frame of the GOP and the first reference frame itself is determined as the second reference frame, the motion information decoder 2130 can determine the basic motion vector of the first unidirectional as the basic motion vector of the second unidirectional, and can determine the disparity distance and disparity direction for the first unidirectional as the disparity distance and disparity direction for the second unidirectional.
[0431] When the predicted motion vector for the second unidirectional direction is determined, the motion information decoder 2130 may determine the motion vector of the second unidirectional direction of the block by using the predicted motion vector of the second unidirectional direction.
[0432] When the base motion vector is unidirectional and the used direction of the base motion vector is bidirectional:
[0433] When the basic motion vector is in a first unidirectional direction in the list 0 direction or the list 1 direction, the use direction of the basic motion vector is bidirectional, and only information indicating the disparity distance and disparity direction for the first unidirectional direction is included in the bitstream, the motion information decoder 2130 can generate a second unidirectional basic motion vector based on the basic motion vector for the first unidirectional direction, and can determine the disparity distance and disparity direction for the second unidirectional direction based on the disparity distance and disparity direction for the first unidirectional direction.
[0434] First, the motion information decoder 2130 may determine a second reference picture located in an opposite direction to the first reference picture based on the current picture, considering d1 (the distance between the current picture and the first reference picture indicated by the first unidirectional basic motion vector).
[0435] In an example, a second reference picture spaced apart by the same distance as d1 may be determined. In this case, since d1 is the same as d2 (the distance between the current picture and the second reference picture) and the current picture is located between the first reference picture and the second reference picture, the motion information decoder 2130 may generate a base motion vector for the second direction by changing the sign of the base motion vector for the first direction to be opposite, and may determine a disparity direction for the second direction by changing the disparity direction for the first direction to be opposite. The disparity distance for the first direction may be determined as the disparity distance for the second direction.
[0436] When there is no picture separated by the same distance as d1, a picture that is located in the opposite direction of the first reference picture and is located closest to the current picture may be determined as the second reference picture. In this case, although the current picture is located between the first reference picture and the second reference picture, d1 and d2 are different from each other. The motion information decoder 2130 may generate a base motion vector for the second direction by changing the sign of the base motion vector of the first direction to be opposite and scaling the base motion vector of the first direction according to the ratio between d1 and d2. In addition, the motion information decoder 2130 may determine the disparity direction for the second direction by changing the disparity direction for the first direction to be opposite, and may determine the disparity distance for the second direction by scaling the disparity distance for the first direction according to the ratio between d1 and d2.
[0437] When the current picture corresponds to the last picture of the GOP, the motion information decoder 2130 may determine a picture located in the same direction as the first reference picture with respect to the current picture as the second reference picture. The picture closest to the first reference picture or the current picture may be determined as the second reference picture. In this case, since the current picture is located after the first reference picture and the second reference picture, the motion information decoder 2130 may generate a second unidirectional basic motion vector by scaling the value of the first unidirectional basic motion vector according to the ratio between d1 and d2 (without changing the sign). In addition, the motion information decoder 2130 may generate a disparity distance for the second unidirectional by scaling the disparity distance for the first unidirectional according to the ratio between d1 and d2.
[0438] In the example, when the current picture corresponds to the last picture of the GOP and the first reference picture is determined as the second reference picture, the motion information decoder 2130 may determine the base motion vector of the first unidirectional as the base motion vector of the second unidirectional, and may determine the disparity distance and disparity direction for the first unidirectional as the disparity distance and disparity direction for the second unidirectional.
[0439] When the second unidirectional predicted motion vector is generated, the motion information decoder 2130 may determine the second unidirectional motion vector of the current block based on the second unidirectional predicted motion vector, and may determine the first unidirectional motion vector of the current block based on the first unidirectional predicted motion vector.
[0440] In an embodiment, the obtainer 2110 may obtain information indicating whether the current block is multi-pass encoded and information about a prediction mode applied to the current block when multi-pass encoding is applied from the bitstream. The term "multi-pass encoding" may refer to a method of encoding a block in two different prediction modes and then finally selecting a prediction mode with higher efficiency to encode the block.
[0441] When it is checked that the current block is multi-pass encoded, the obtainer 2110 may obtain information (eg, a flag) indicating a prediction mode in which the current block is encoded among two prediction modes.
[0442] When it is checked that the current block to which multi-channel encoding is applied is encoded in a preset mode according to the present disclosure, the motion information decoder 2130 may decode the motion information of the current block based on the information indicating the base motion vector of the current block and the information indicating the predicted motion vector. When it is checked that the current block to which multi-channel encoding is applied is encoded in a mode other than the preset mode (for example, merge mode, skip mode, direct mode, or AMVP mode), the motion information decoder 2130 may decode the motion information according to the checked mode.
[0443] The current block according to the present invention may correspond to the first sub-block divided from the parent block. When information indicating that the parent block is divided is included in the bitstream, the motion information decoder 2130 may divide the parent block into a first sub-block corresponding to the current block and a second sub-block. Optionally, the motion information decoder 2130 may consider at least one of the size, horizontal length, and vertical length of the parent block, and divide the parent block into a first sub-block corresponding to the current block and a second sub-block. For example, when the horizontal length of the parent block is greater than the vertical length, the motion information decoder 2130 may determine two sub-blocks by dividing the horizontal length of the parent block by two, and when the vertical length of the parent block is greater than the horizontal length, the motion information decoder 2130 may determine two sub-blocks by dividing the vertical length of the parent block by two. The parent block may refer to a basic block for 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 sub-block, a second sub-block, and a third sub-block corresponding to the current block, that is, three sub-blocks.
[0444] Furthermore, the shape of the sub-block may include not only a square shape or a rectangular shape but also a triangular shape or a trapezoidal shape.
[0445] When the preset mode according to the present disclosure is applied to the first subblock, the motion information decoder 2130 may determine the motion vector of the first subblock according to the above method.
[0446] In order to determine the motion vector of the second sub-block, as for the first sub-block, the motion information decoder 2130 may determine the base motion vector of the second sub-block and the predicted motion vector of the second sub-block based on the information indicating the base motion vector and the information indicating the predicted motion vector obtained from the bitstream, and may determine the motion vector of the second sub-block based on the predicted motion vector. In this case, the base motion vector candidate and the predicted motion vector candidate determined for the parent block may also be used for the first sub-block and the second sub-block. In other words, the base motion vector candidate and the predicted motion vector candidate may be determined at the parent block level, and the motion vector of the first sub-block may be determined based on the information indicating the base motion vector and the information indicating the predicted motion vector of the first sub-block, and the motion vector of the second sub-block may be determined based on the information indicating the base motion vector and the information indicating the predicted motion vector of the second sub-block.
[0447] As another example, the motion vector determined for the first subblock may be determined as a base motion vector for the second subblock, and only information indicating a predicted motion vector for the second subblock may be obtained to determine the predicted motion vector for the second subblock. The motion information decoder 2130 may determine the motion vector for the second subblock based on the predicted motion vector for the second subblock.
[0448] As another example, at least one of the information indicating the base motion vector, the information indicating the disparity distance, and the information indicating the disparity direction obtained from the bitstream about the first subblock may be shared with the second subblock. In this case, the motion information decoder 2130 may determine the predicted motion vector of the second subblock based on the information shared with the second subblock among the information indicating the base motion vector, the information indicating the disparity distance, and the information indicating the disparity direction obtained from the bitstream about the first subblock and the remaining information obtained from the bitstream about the second subblock.
[0449] In addition, information indicating the differential motion vector may be included only in the bitstream associated with one of the first subblock and the second subblock. For example, when the differential motion vector is determined for the first subblock, the motion information decoder 2130 may also apply the differential motion vector of the first subblock to the second subblock.
[0450] In an embodiment, the first subblock may be encoded according to a preset mode according to the present disclosure, and the second subblock may be encoded according to a mode different from the preset mode applied to the first subblock. In this case, the motion information decoder 2130 may decode the first subblock and the second subblock according to the modes applied to the first subblock and the second subblock, respectively.
[0451] When the motion vectors of the first sub-block and the second sub-block are determined, a first prediction block corresponding to the first sub-block and a second prediction block corresponding to the second sub-block may be determined by inter-frame prediction. Smoothing filtering may be performed on the boundary between the first prediction block and the second prediction block, the residual block may be added to the final prediction block generated as a result of the filtering, and the parent block may be finally reconstructed. For smoothing filtering, an N-tap filter may be used or an overlapped block motion compensation (OBMC) method may be used. A weight may be applied to the overlapping portion between the first prediction block and the second prediction block according to the OBMC method. Although the weight of the boundary area may be 0.5:0.5, the weight may increase as the area moves away from the boundary.
[0452] Fig.34 A process of parsing a bit stream performed by the image decoding apparatus 2100 according to an embodiment is illustrated.
[0453] First, when the skip flag indicating whether the skip mode is applied to the current block indicates 1 or the direct flag indicating whether the direct mode is applied to the current block indicates 1, the image decoding apparatus 2100 parses the UMVE flag indicating whether the preset mode according to the present disclosure is applied to the current block. When the skip flag is 1, the skip mode is applied to the current block, and when the direct flag is 1, the direct mode is applied to the current block.
[0454] When the identical_list0_list1 flag is not 1, the group IDX is parsed. When the reference picture included in list0 and the reference picture included in list1 are the same, the identical_list0_list1 flag may be set to 1. In addition, the group IDX indicates a use direction of a base motion vector.
[0455] When the identical_list0_list1 flag is 1, the group IDX is set to 0. In an embodiment, when the group IDX is 0, it may mean that the use direction of the base motion vector is the same as the direction of the base motion vector. For example, when the base motion vector is bidirectional and the group IDX is 0, the use direction of the base motion vector may also be bidirectional. The use direction of the base motion vector may be set to the prediction direction of the current block.
[0456] Next, the image decoding apparatus 2100 may parse a base candidate IDX indicating a base motion vector of the current block, and may parse a distance IDX indicating a disparity distance of a predicted motion vector of the current block and a direction IDX indicating a disparity direction of the predicted motion vector.
[0457] The image decoding apparatus 2100 may determine a motion vector of a current block based on the group IDX, the base candidate IDX, the distance IDX, and the direction IDX.
[0458] In an embodiment, a base motion vector corresponding to the base candidate IDX, a disparity distance corresponding to the distance IDX, and a disparity direction corresponding to the direction IDX may be as shown in Table 1, Table 2, and Table 3.
[0459] [Form 1]
[0460] Base candidate IDX 0 1 2 3 Nth MVP 1st MVP 2nd MVP No.3MVP 4th MVP
[0461] [Form 2]
[0462] Distance from IDX 0 1 2 3 4 5 6 7 Parallax distance 1 2 4 8 16 32 64 128
[0463] [Form 3]
[0464] Directions to IDX 00 01 10 11 x-axis + - N / A N / A y-axis N / A N / A + -
[0465] In Table 1, the base candidate IDX of 0 indicates the first base motion vector candidate among the base motion vector candidates, and the base candidate IDX of 1 indicates the second base motion vector candidate among the base motion vector candidates.
[0466] In Table 2, the disparity distance corresponding to the distance IDX is determined based on the basic pixel unit, and the disparity distance 1 corresponding to the distance IDX 0 may indicate a 1 / 4 pixel distance, and the disparity distance 2 corresponding to the distance IDX 1 may indicate a 1 / 2 pixel distance. As described above, when the minimum pixel unit that may be indicated by the motion vector of the current block is smaller than the basic pixel unit, the disparity distance may be scaled according to the ratio between the minimum pixel unit and the basic pixel unit. For example, when the basic pixel unit is a 1 / 4 pixel unit and the minimum pixel unit is a 1 / 8 pixel unit, and the index indicating the disparity distance obtained from the bitstream is 0, the disparity distance 1 corresponding to the index 0 may be enlarged to 2.
[0467] Furthermore, in Table 3, direction IDX of 00 indicates a predicted motion vector changed along the x-axis direction and the + direction based on the base motion vector, and direction IDX of 11 indicates a predicted motion vector changed along the y-axis and the - direction based on the base motion vector.
[0468] Fig.35 is a flowchart for describing an image decoding method according to an embodiment.
[0469] In operation S3510, the image decoding apparatus 2100 obtains information indicating a disparity distance for determining a predicted motion vector of a current block. The disparity distance may be a value determined based on a basic pixel unit.
[0470] The image decoding apparatus 2100 may obtain information indicating a disparity distance for determining a predicted motion vector of a current block from a bitstream. Alternatively, the image decoding apparatus 2100 may directly determine the disparity distance for determining a predicted motion vector of a current block based on information related to at least one of a current block, a previously decoded block, a current slice, a previously decoded slice, a current picture, and a previously decoded picture.
[0471] As described above, before obtaining information indicating the disparity distance used to determine the predicted motion vector of the current block, the image decoding device 2100 may determine one or more predicted motion vector candidates that are changed from each of one or more base motion vector candidates of the current block according to a predetermined disparity distance (or a disparity distance scaled from a predetermined disparity distance according to a minimum pixel unit) and a predetermined disparity direction.
[0472] In operation S3520, the image decoding apparatus 2100 scales the disparity distance based on a comparison result of a basic pixel unit and a minimum pixel unit that may be indicated by a motion vector of the current block.
[0473] When the basic pixel unit and the minimum pixel unit that can be indicated by the motion vector of the current block are the same, the image decoding device 2100 may not scale the disparity distance, and when the minimum pixel unit that can be indicated by the motion vector of the current block is smaller than the basic pixel unit, the image decoding device 2100 may enlarge the disparity distance.
[0474] In operation S3530, the image decoding apparatus 2100 determines a prediction motion vector candidate, which is changed by the scaled disparity distance from a base motion vector of the current block, among the one or more prediction motion vector candidates, as a prediction motion vector of the current block.
[0475] Due to the difference between the basic pixel unit and the minimum pixel unit, when one or more predicted motion vector candidates are determined by scaling a predetermined disparity distance, the image decoding device 2100 can also scale the disparity distance obtained to determine the predicted motion vector of the current block, and then can determine the predicted motion vector of the current block.
[0476] In operation S3540, the image decoding apparatus 2100 may determine a motion vector of the current block by using the predicted motion vector of the current block.
[0477] When information indicating a differential motion vector is included in a bitstream, the image decoding apparatus 2100 may determine a motion vector of a current block by applying the differential motion vector to a predicted motion vector.
[0478] Fig.36 is a block diagram of an image encoding apparatus 3600 according to an embodiment.
[0479] Reference Fig.36 , the image encoding apparatus 3600 according to an embodiment may include a motion information encoder 3610 and a generator 3630 .
[0480] The image encoding apparatus 3600 may encode an image, and may generate a bitstream including information generated as a result of the encoding.
[0481] The image encoding apparatus 3600 according to an embodiment may include a central processor (not shown) for controlling the motion information encoder 3610 and the generator 3630. Alternatively, the motion information encoder 3610 and the generator 3630 may be operated by their own processors (not shown), and the image encoding apparatus 3600 may operate as the processor (not shown) operates systematically. Alternatively, the motion information encoder 3610 and the generator 3630 may be controlled by an external processor (not shown).
[0482] The image encoding apparatus 3600 may include one or more data memories (not shown) storing input / output data of the motion information encoder 3610 and the generator 3630. The image encoding apparatus 3600 may include a storage controller (not shown) for controlling data input / output to / from the data memory (not shown).
[0483] In order to encode the image, the image encoding device 3600 may perform an image encoding operation including prediction in conjunction with an internal video encoding processor or an external video encoding processor. The internal video encoding processor of the image encoding device 3600 according to the embodiment may perform basic image encoding operations as a separate processor, or the central processing unit or the graphics processing unit may include an image encoding processing module and may perform basic image encoding operations.
[0484] The image encoding apparatus 3600 may be included in the image encoding apparatus 200. For example, the generator 3630 may be included in Figure 2 In the bitstream generator 210 of the image encoding apparatus 200 , the motion information encoder 3610 may be included in the encoder 220 of the image encoding apparatus 200 .
[0485] The motion information encoder 3610 encodes a motion vector of the current block. The current block generated by dividing the image according to the tree structure may correspond to, for example, a maximum coding unit, a coding unit, or a transformation unit. The motion information encoder 3610 may determine a prediction mode to be applied to the current block. According to the present disclosure, the prediction mode may include, for example, at least one of an intra mode, an inter mode, a merge mode, a direct mode, a skip mode, and a preset mode.
[0486] The generator 3630 generates a bitstream including information generated as a result of encoding the motion vector of the current block. In an embodiment, the bitstream may include at least one of the following information: information indicating whether a preset mode is applied to the current block, information indicating a base motion vector of the current block, information indicating a predicted motion vector of the current block, information indicating a disparity distance for determining a predicted motion vector candidate from a base motion vector candidate, information indicating a disparity direction for determining a predicted motion vector candidate from a base motion vector candidate, information indicating a priority of the base motion vector candidate, information indicating a priority of a disparity distance, and information indicating a priority of a disparity direction.
[0487] The generator 3630 may cause the information to be included in a bitstream corresponding to at least one of a coding unit level, a transform unit level, a maximum unit level, a slice unit level, and a picture unit level.
[0488] The motion information encoder 3610 may determine whether a preset mode is applied to the current block.
[0489] Based on information related to at least one of a current block, a previously encoded block, a current slice, a previously encoded slice, a current picture, and a previously encoded picture, the motion information encoder 3610 may determine whether a preset mode is applied to the current block.
[0490] In an example, the motion information encoder 3610 may determine whether the preset mode is applied to the current block in consideration of statistical information about the prediction mode in a previous slice or a previous picture. The motion information encoder 3610 may determine that the preset mode is not applied to the current block based on the statistical information.
[0491] In an example, the motion information encoder 3610 may determine that a preset mode is applied to the current block based on a cost corresponding to each of various prediction modes applicable to the current block. A rate-distortion cost may be used during cost calculation.
[0492] In an example, the motion information encoder 3610 may first determine that a prediction mode different from a preset mode is applied to the current block, and then may determine whether the preset mode is applied to the current block. For example, the motion information encoder 3610 may determine that a skip mode or a direct mode is applied to the current block, and then may determine whether the preset mode is applied.
[0493] When a preset mode is applied to the current block, the motion information encoder 3610 may determine one or more prediction motion vector candidates for each of one or more base motion vector candidates. The one or more prediction motion vector candidates may be classified according to a disparity distance and a disparity direction.
[0494] The motion information encoder 3610 may determine one or more prediction motion vector candidates each of which is changed by a disparity distance predetermined based on a basic pixel unit from one or more base motion vector candidates. The motion information encoder 3610 may determine the disparity distance for determining the one or more prediction motion vector candidates according to a predetermined standard. In an embodiment, information indicating the disparity distance for determining the one or more prediction motion vector candidates may be transmitted to the image decoding device 2100 by a signal through a bitstream, or the image decoding device 2100 may determine the disparity distance for determining the one or more prediction motion vector candidates by using the same standard as that of the image encoding device 3600.
[0495] In an embodiment, the motion information encoder 3610 may scale a predetermined disparity distance according to a ratio between a basic pixel unit and a minimum pixel unit that may be indicated by a motion vector of the current block, and may determine one or more prediction motion vector candidates according to the scaled disparity distance.
[0496] Already referred to Figure 22 to Figure 26 A process of determining a prediction motion vector candidate according to a predetermined disparity distance or a scaled disparity distance is described, and thus a detailed description thereof will not be provided here.
[0497] As described above, when the minimum pixel unit that can be indicated by the base motion vector candidate and the minimum pixel unit that can be indicated by the motion vector of the current block are different from each other, the motion information encoder 3610 can change the base motion vector candidate and then determine the predicted motion vector candidate based on the changed base motion vector candidate.
[0498] In an embodiment, one or more base motion vector candidates of the current block may be determined based on motion vectors of neighboring blocks spatially and temporally related to the current block. The neighboring blocks spatially and temporally related to the current block may include blocks encoded earlier than the current block.
[0499] In an embodiment, the motion information encoder 3610 may determine the motion vector of the neighboring block related to the current block as one or more base motion vector candidates. Alternatively, the motion information encoder 3610 may change the motion vector of the neighboring block related to the current block, and may determine one or more base motion vector candidates. Alternatively, the motion information encoder 3610 may determine one or more base motion vector candidates by combining the motion vectors of the neighboring blocks related to the current block according to a predetermined equation.
[0500] In an embodiment, the motion information encoder 3610 may determine a motion vector of a neighboring block related to the current block, for which a POC difference of a reference picture between motion vectors is equal to or greater than a preset value, as a base motion vector candidate.
[0501] In an embodiment, the motion information encoder 3610 may determine one or more base motion vector candidates in the same manner as a method of determining a candidate list of a motion vector predictor in the AMVP mode or merge mode of HEVC.
[0502] In an embodiment, the motion information encoder 3610 may determine a zero motion vector having a component of 0 as one or more base motion vector candidates.
[0503] When the prediction motion vector candidates are determined, the motion information encoder 3610 may determine the prediction motion vector of the current block from the determined prediction motion vector candidates. After determining the motion vector of the current block, the motion information encoder 3610 may compare the determined motion vector with the prediction motion vector candidates, and may determine the prediction motion vector candidate closest to the motion vector of the current block as the prediction motion vector of the current block.
[0504] In an example, the motion information encoder 3610 may determine the prediction motion vector of the current block considering statistical information in a previous slice or a previous picture. In another example, the motion information encoder 3610 may determine the prediction motion vector of the current block based on a cost between prediction motion vector candidates.
[0505] When the predicted motion vector of the current block is determined, the generator 3630 may generate a bitstream including information indicating a base motion vector of the current block and information indicating a predicted motion vector. When the number of base motion vector candidates of the current block is 1, the information indicating the base motion vector may not be included in the bitstream.
[0506] The information indicating the predicted motion vector may include at least one of information indicating a disparity distance for specifying the predicted motion vector of the current block and information indicating a disparity direction for specifying the predicted motion vector of the current block.
[0507] In an embodiment, the disparity distance for specifying the predicted motion vector of the current block may be a value determined based on a basic pixel unit. For example, due to the difference between the basic pixel unit and the minimum pixel unit that can be indicated by the motion vector of the current block, when the predicted motion vector candidate is determined after the predetermined disparity distance is scaled, the disparity distance for specifying the predicted motion vector of the current block may correspond to the disparity distance before being scaled. In other words, when the minimum pixel unit that can be indicated by the motion vector of the current block is a 1 / 8 pixel unit, the basic pixel unit is a 1 / 4 pixel unit, and the predicted motion vector candidate is determined based on a disparity distance 2 that is scaled to twice the predetermined disparity distance 1, although the predicted motion vector of the current block corresponds to the scaled disparity distance 2, information indicating the disparity distance 1 may be included in the bitstream.
[0508] The information indicating the base motion vector of the current block may be encoded by using the FLC method, the unary encoding method, or the truncated unary encoding method, and may be included in a bitstream.
[0509] In an embodiment, the generator 3630 may generate a bitstream including information indicating a minimum pixel unit that may be indicated by a motion vector of the current block. The generator 3630 may include the information indicating the minimum pixel unit in a bitstream corresponding to a level of at least one of a block, a slice, and a picture.
[0510] In an embodiment, at least one of information indicating a disparity distance of a predicted motion vector for specifying a current block and information indicating a disparity direction may be included in a bitstream at a transform unit level, a coding unit level, a maximum coding unit level, a slice level, or a picture level.
[0511] Information indicating the disparity distance and disparity direction of a predicted motion vector for specifying a current block may be encoded by using an FLC method, a unary encoding method, or a truncated unary encoding method, and the information indicating the disparity distance and disparity direction of a predicted motion vector for specifying a current block may be included in a bitstream.
[0512] The generator 3630 may encode information indicating the disparity direction (eg, at least one of the indexes indicating the disparity direction) by using a context model.
[0513] When the predicted motion vector of the current block is determined, the motion information encoder 3610 may determine the differential motion vector of the current block by using the predicted motion vector of the current block and the motion vector of the current block. In an embodiment, the motion information encoder 3610 may determine the difference between the motion vector of the current block and the predicted motion vector of the current block as the differential motion vector.
[0514] The generator 3630 may cause the information indicating the differential motion vector to be included in the bitstream. In an example, the information indicating the differential motion vector may be encoded by using an exponential Golomb coding method, and the information indicating the differential motion vector may be included in the bitstream.
[0515] In an embodiment, when the prediction direction of the current block is bidirectional, the differential motion vector may be included in the bitstream only for one direction. For example, information indicating the differential motion vector may be included in the bitstream for one direction in the list 0 direction and the list 1 direction.
[0516] The generator 3630 may encode an index indicating a predicted motion vector of the current block and may cause the encoded index to be included in a bitstream, and for this purpose, the motion information encoder 3610 may assign the index to one or more base motion vector candidates and one or more predicted motion vector candidates.
[0517] Reference Fig.28 , figure numeral 2801 may represent a bit representation corresponding to an index indicating a base motion vector candidate, figure numeral 2802 may represent a bit representation corresponding to an index indicating a disparity distance (or candidate group) of a predicted motion vector candidate, and figure numerals 2803 and 2804 may represent bit representations corresponding to indices indicating disparity directions of predicted motion vector candidates.
[0518] In order to specify the base motion vector of the current block, the motion information encoder 3610 may assign an index to each of one or more base motion vector candidates. In addition, the motion information encoder 3610 may assign an index to each of the prediction motion vector candidates to specify the prediction motion vector of the current block.
[0519] Reference Fig.28 , index 0 may be assigned to base motion vector candidate 0, and index 10 may be assigned to base motion vector candidate 1. An index indicating each of the base motion vector candidates may be expressed by using a unary encoding method or a truncated unary encoding method.
[0520] The number of bits representing the index may increase from base motion vector candidate 0 to base motion vector candidate 4, and priorities between base motion vector candidates for allocating the index may be determined according to a preset criterion.
[0521] In an embodiment, the motion information encoder 3610 may determine the priority among the base motion vector candidates of the current block in consideration of the ratio or number of times that the base motion vector candidate among the base motion vector candidates is selected as the base motion vector in the previous slice or the previous picture. For example, when the base motion vector candidate 3 is most selected as the base motion vector of the block in the previous slice or the previous picture, the motion information encoder 3610 may assign index 0 to the base motion vector candidate 3.
[0522] Furthermore, in an embodiment, the motion information encoder 3610 may determine the priority between base motion vector candidates of the current block considering the size of the current block, the temporal layer of the current picture, the GOP size, and the POC difference between the current picture and the reference picture.
[0523] In an embodiment, information indicating the priority between base motion vector candidates for assigning indexes may be included in a bitstream. The information indicating the priority between base motion vector candidates may include information about a priority number that has been changed compared to the priority between base motion vector candidates determined in a previous block, a previous slice, or a previous picture. Alternatively, in an embodiment, the image decoding device 2100 may determine the priority by using the same standard as that of the image encoding device 3600, instead of including the information indicating the priority between base motion vector candidates in a bitstream.
[0524] The predicted motion vector candidates determined to correspond to one base motion vector candidate may be grouped into candidate groups according to a predetermined criterion. The predetermined criterion may be how much disparity distance the predicted motion vector candidate is spaced from the base motion vector candidate. The index of each candidate group may be represented by using a unary coding method or a truncated unary coding method. According to an embodiment, the index of each candidate group may be represented by using an FLC method.
[0525] Reference Fig.28 , the number of bits used to represent the index of the candidate group may be from candidate group 0 corresponding to the disparity distance 1 to candidate group 7 corresponding to the disparity distance 8, and the priority between the candidate groups for assigning the index may be determined according to a preset standard.
[0526] In an embodiment, the motion information encoder 3610 may determine the priority between the candidate groups of the current block in consideration of the ratio or number of times the prediction motion vector candidate is selected from the candidate group to specify the prediction motion vector in the previous slice or the previous picture. For example, when the prediction motion vector candidate included in the candidate group 3 is most selected as the prediction motion vector of the block in the previous slice or the previous picture, the motion information encoder 3610 may assign index 0 to the candidate group 3.
[0527] Furthermore, in an embodiment, the motion information encoder 3610 may determine the priority among the candidate groups of the current block considering the size of the current block, the temporal layer of the current picture, the GOP size, and the POC difference between the current picture and the reference picture.
[0528] In an embodiment, information indicating the priority between candidate groups for assigning indexes may be included in a bitstream. The information indicating the priority between candidate groups may include information about a priority number that has been changed compared to the priority between candidate groups determined in a previous block, a previous slice, or a previous picture. Alternatively, in an embodiment, the image decoding device 2100 may determine the priority by using the same standard as that of the image encoding device 3600, instead of including the information indicating the priority between candidate groups in a bitstream.
[0529] Fig.28 The candidate group 0 of may include a candidate separated from the base motion vector candidate by a disparity distance of 1, and in an embodiment, the candidate group 0 may include a candidate separated from the base motion vector candidate by a disparity distance of 0. Since the candidate separated from the base motion vector candidate by a disparity distance of 0 is the base motion vector candidate itself, as shown in FIG. Figure 22 to Figure 25 As described, when the base motion vector candidate corresponds to (x, y), the prediction motion vector candidate becomes (x, y). When the prediction motion vector of the current block is included in the candidate group 0, the generator 3630 may not include information indicating the disparity direction in the bitstream.
[0530] When one base motion vector is determined for the current block and the information indicating the candidate group indicates candidate group 0, the base motion vector is the motion vector of the current block unless there is a differential motion vector, and thus the merge mode or skip mode of the conventional HEVC can be replaced.
[0531] An index (or flag) indicating a disparity direction may be assigned to a prediction motion vector candidate included in one candidate group. The index indicating the disparity direction may be represented by using the FLC method. For example, when four prediction motion vector candidates are included in one candidate group, two bits may be assigned to indicate each of the four prediction motion vector candidates.
[0532] The motion information encoder 3610 may classify the prediction motion vector candidates included in one candidate group into groups according to positions in a coordinate plane, and may assign an index or a flag corresponding to each of the classified groups.
[0533] Reference Fig.28 , depending on whether the predicted motion vector candidates (x+1,y), (x-1,y), (x,y+1) and (x,y-1) corresponding to candidate group 0 of base motion vector candidate 0 are changed from base motion vector candidate 0 along the x-axis direction or along the y-axis direction, the index (or flag) 0 or 1 can be assigned as shown in bit representation 2803, and depending on whether the predicted motion vector candidates (x+1,y), (x-1,y), (x,y+1) and (x,y-1) are changed along the + direction or along the - direction, the index (or flag) 0 or 1 can be assigned as shown in bit representation 2804.
[0534] In an embodiment, the generator 3630 may entropy encode at least one of information indicating a disparity distance and information indicating a disparity direction for specifying a predicted motion vector of a current block according to a predetermined context model.
[0535] When two candidate groups corresponding to two disparity distances are configured for one base motion vector candidate, the generator 3630 may entropy encode information indicating the disparity distance of the prediction motion vector of the current block according to a predetermined context model. In this case, the information indicating the disparity distance may be binarized according to the FLC method, and then may be entropy encoded and may be included in the bitstream.
[0536] In an embodiment, the generator 3630 may encode at least one of the indexes indicating the disparity direction by using a context model. For example, the generator 3630 may divide the four predicted motion vector candidates included in one candidate group into two groups including two candidates changed along the x-axis direction and two candidates changed along the y-axis direction based on the base motion vector candidate, and may encode the index (2803) indicating whether the candidate is changed along the x-axis direction or along the y-axis direction according to the context model. When it is determined that the candidate is changed along the x-axis direction or along the y-axis direction, the generator 3630 may encode the index (2804) indicating whether the candidate is changed along the + direction or along the - direction according to the context model.
[0537] In an embodiment, the motion information encoder 3610 may include in each candidate group only candidates located at preset points in the coordinate plane. For example, the motion information encoder 3610 may include in each candidate group only candidates that change along the x-axis or candidates that change along the y-axis based on information about at least one of the previous picture, the current picture, the previous slice, the current slice, the previous block, and the current block. Fig.28Among the candidates (x+1, y), (x-1, y), (x, y+1) and (x, y-1) included in candidate group 0, candidates (x+1, y) and (x-1, y) that change only along the x-axis may be included in candidate group 0, and an index corresponding to bit representation 2804 may be assigned to each candidate to divide the candidates (x+1, y) and (x-1, y), and the index corresponding to bit representation 2804 may be decoded according to the context model.
[0538] In an embodiment, when two base motion vector candidates of the current block are determined, the generator 3630 may entropy encode information indicating the base motion vector of the current block according to a predetermined context model, and may cause the information to be included in the bitstream. In this case, the information indicating the base motion vector may be binarized according to the FLC method, and then may be entropy encoded and may be included in the bitstream.
[0539] In an embodiment, when at least one of information indicating a base motion vector, information indicating a disparity distance, and information indicating a disparity direction is to be entropy encoded, the generator 3630 may select a context model for at least one of information indicating a base motion vector, information indicating a disparity distance, and information indicating a disparity direction from one or more context models based on information related to a neighboring block adjacent to the current block.
[0540] The neighboring blocks may include, but are not limited to, a left block adjacent to the left side of the current block and an upper block adjacent to the upper side of the current block.
[0541] The generator 3630 may select a context model based on information related to a neighboring block, wherein the neighboring block is a neighboring block encoded by applying the same mode as the preset mode applied to the current block among neighboring blocks adjacent to the current block.
[0542] In an example, the generator 3630 may select a context model for the current block based on information related to a neighboring block to which a mode identical to a preset mode applied to the current block is applied (e.g., at least one of information indicating a base motion vector, information indicating a disparity distance, and information indicating a disparity direction).
[0543] In an embodiment, when the size of the motion vector of the upper block to which the preset mode is applied and the motion vector of the left block to which the preset mode is applied in the x-axis direction is greater than the reference value, the generator 3630 may select the first context model. In addition, when the size of the motion vector of the left block to which the preset mode is applied in the x-axis direction is greater than the reference value or the size of the motion vector of the upper block to which the preset mode is applied in the x-axis direction is greater than the reference value, the generator 3630 may select the second context model. In addition, when the size of the motion vector of the upper block to which the preset mode is applied and the motion vector of the left block to which the preset mode is applied in the x-axis direction is equal to or less than the reference value, the generator 3630 may select the third context model.
[0544] When the base motion vector candidate is a bidirectional motion vector, the motion information encoder 3610 may cause each of the prediction motion vector candidates classified according to the disparity distance and the disparity direction to include a prediction motion vector candidate for a list 0 direction and a prediction motion vector candidate for a list 1 direction. A method of determining a prediction motion vector candidate for bidirectional is the same as that performed with respect to the image decoding apparatus 2100, and thus a detailed description thereof will not be provided.
[0545] In an embodiment, when a base motion vector of a current block is determined, the motion information encoder 3610 may determine a use direction of the base motion vector, and the generator 3630 may cause information indicating the use direction of the base motion vector to be included in a bitstream.
[0546] The base motion vector may correspond to a motion vector for a list 0 direction, a motion vector for a list 1 direction, or a motion vector for both directions, and the motion information encoder 3610 may determine a use direction of the base motion vector to improve encoding efficiency of the motion vector of the current block.
[0547] The information indicating the use direction of the base motion vector may include an index. For example, when 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.
[0548] In addition, for example, when the base motion vector is in the first unidirectional direction of the list 0 direction or the list 1 direction, a bit value of 0 may indicate that the use direction of the base motion vector is the first unidirectional direction, a bit value of 10 may indicate that the use direction of the base motion vector is the second unidirectional direction different from the first unidirectional direction, and a bit value of 11 may indicate that the use direction of the base motion vector is bidirectional. The use direction of the base motion vector corresponding to the bit value may also be changed.
[0549] In an example, when it is determined that the base motion vector is bidirectional and the use direction of the base motion vector is bidirectional, the motion information encoder 3610 may determine the disparity distance and disparity direction of the prediction motion vector indicating the list 0 direction of the current block and the disparity distance and disparity direction of the prediction motion vector indicating the list 1 direction. The generator 3630 may cause information indicating the bidirectional base motion vector, information indicating the disparity distance and disparity direction of the list 0 direction for the current block, and information indicating the disparity distance and disparity direction of the list 1 direction for the current block to be included in the bitstream.
[0550] In another example, when it is determined that the base motion vector is bidirectional and the use direction of the base motion vector is bidirectional, although the motion information encoder 3610 may determine the disparity distance and disparity direction of the predicted motion vector indicating the list 0 direction of the current block and the disparity distance and disparity direction of the predicted motion vector indicating the list 1 direction, the generator 3630 may cause information indicating the disparity distance and disparity direction for one of the list 0 direction and the list 1 direction and information indicating the bidirectional base motion vector to be included in the bitstream.
[0551] In another embodiment, when the base motion vector is bidirectional and the use direction of the base motion vector is the first unidirectional direction of list 0 or list 1, the motion information encoder 3610 may determine the disparity distance and disparity direction of the predicted motion vector indicating the first unidirectional direction of the current block, and the generator 3630 may cause information indicating the base motion vector and information indicating the disparity distance and disparity direction for the first unidirectional direction to be included in the bitstream.
[0552] In another embodiment, when the base motion vector is bidirectional and the use direction of the base motion vector is a first unidirectional direction of list 0 or list 1, the motion information encoder 3610 may determine the disparity distance and disparity direction of a predicted motion vector indicating a second unidirectional direction of the current block that is different from the first unidirectional direction, and the generator 3630 may cause information indicating the base motion vector and information indicating the disparity distance and disparity direction for the second unidirectional direction to be included in the bitstream.
[0553] In another embodiment, when the base motion vector is in a first unidirectional direction of list 0 direction or list 1 direction and the use direction of the base motion vector is a second unidirectional direction different from the first unidirectional direction, the motion information encoder 3610 may determine the disparity distance and disparity direction of the predicted motion vector indicating the first unidirectional direction, and the generator 3630 may cause information indicating the base motion vector, information indicating the disparity distance for the first unidirectional direction, and information indicating the disparity direction for the first unidirectional direction to be included in the bitstream.
[0554] In another example, when the base motion vector is in a first unidirectional direction of list 0 direction or list 1 direction and the use direction of the base motion vector is bidirectional, the motion information encoder 3610 may determine the disparity distance and disparity direction of the predicted motion vector indicating the first unidirectional direction, and the generator 3630 may enable information indicating the base motion vector, information indicating the disparity distance for the first unidirectional direction, and information indicating the disparity direction for the first unidirectional direction to be included in the bitstream.
[0555] In an embodiment, the motion information encoder 3610 may determine whether multi-channel encoding is to be applied to the current block. The motion information encoder 3610 may encode the current block according to two different prediction modes, and may select a prediction mode based on the cost. The generator 3630 may cause information indicating whether the current block is multi-channel encoded and information about the prediction mode applied to the current block when multi-channel encoding is applied to be included in the bitstream.
[0556] The two different prediction modes may include one of an AMVP mode, a merge mode, a direct mode, and a skip mode, as well as a preset mode according to the present disclosure.
[0557] In an embodiment, the motion information encoder 3610 may determine whether the parent block is split, and may split the parent block into a first sub-block corresponding to the current block and a second sub-block adjacent to the first sub-block. According to an embodiment, the motion information encoder 3610 may determine whether the parent block is split, and may split the parent block into a first sub-block corresponding to the current block and a second sub-block and a third sub-block adjacent to the first sub-block.
[0558] The motion information encoder 3610 may encode the first subblock according to a preset mode, and the generator 3630 may generate a bitstream including information generated as a result of encoding the first subblock.
[0559] In order to encode the second sub-block, as for the first sub-block, the motion information encoder 3610 may encode the second sub-block based on a preset mode according to the present disclosure. In this case, the base motion vector candidate and the predicted motion vector candidate determined for the parent block may also be used for the first sub-block and the second sub-block. In other words, the base motion vector candidate and the predicted motion vector candidate may be determined at the parent block level, the base motion vector of the first sub-block and the base motion vector of the second sub-block in the base motion vector candidate may be determined independently, and the predicted motion vector of the first sub-block and the predicted motion vector of the second sub-block in the predicted motion vector candidate may be determined independently.
[0560] In another example, the motion information encoder 3610 may determine the motion vector determined for the first subblock as a base motion vector of the second subblock, and may determine a predicted motion vector of the second subblock from the predicted motion vector candidates corresponding to the base motion vector. The generator 3630 may cause information indicating the base motion vector of the second subblock not to be included in the bitstream, and conversely, may cause information indicating the predicted motion vector of the second subblock to be included in the bitstream.
[0561] In another example, at least one of the base motion vector, the disparity distance, and the disparity direction determined for the first subblock may be applied to the second subblock. In this case, the motion information encoder 3610 may encode the motion vector of the second subblock by using at least one of the base motion vector, the disparity distance, and the disparity direction determined for the first subblock.
[0562] Also, the motion information encoder 3610 may determine a differential motion vector associated with one of the first subblock and the second subblock, and the generator 3630 may cause information indicating the determined differential motion vector to be included in a bitstream.
[0563] In an embodiment, the motion information encoder 3610 may encode the first subblock in a preset mode according to the present disclosure, and may encode the second subblock in a mode different from the preset mode applied to the first subblock.
[0564] Fig.37 is a flowchart for describing an image encoding method according to an embodiment.
[0565] In operation S3710, the image encoding apparatus 3600 scales one or more disparity distances predetermined based on a basic pixel unit, based on a minimum pixel unit that may be indicated by a motion vector of a current block.
[0566] When the minimum pixel unit is smaller than the basic pixel unit, the image encoding apparatus 3600 may enlarge one or more predetermined disparity distances.
[0567] In operation S3720, the image encoding apparatus 3600 determines, according to each of the one or more base motion vector candidates, one or more prediction motion vector candidates changed from the base motion vector candidate according to the scaled one or more disparity distances.
[0568] In operation S3730, the image encoding apparatus 3600 determines a prediction motion vector of a current block from among one or more prediction motion vector candidates.
[0569] The image encoding apparatus 3600 may determine a base motion vector of a current block from one or more base motion vector candidates, and then may determine a prediction motion vector of the current block from one or more prediction motion vector candidates corresponding to the determined base motion vector.
[0570] The image encoding apparatus 3600 may determine a prediction motion vector candidate that is most similar to a motion vector of the current block as a prediction motion vector of the current block.
[0571] In operation S3740, the image encoding apparatus 3600 generates a bitstream including information indicating a disparity distance for specifying a prediction motion vector candidate determined as a prediction motion vector of a current block. The disparity distance corresponding to the information included in the bitstream may be a disparity distance before being scaled.
[0572] In addition, the image encoding apparatus 3600 may cause at least one of information indicating a base motion vector of the current block and information indicating a disparity direction for specifying a prediction motion vector of the current block to be further included in the bitstream.
[0573] The bitstream may include at least one of the following information: information indicating whether a preset mode is applied to a current block, information indicating a base motion vector of the current block, information indicating a predicted motion vector of the current block, information indicating a disparity distance for determining a predicted motion vector candidate from a base motion vector candidate, information indicating a disparity direction for determining a predicted motion vector candidate from a base motion vector candidate, information indicating a priority of a base motion vector candidate, information indicating a priority of a disparity distance, and information indicating a priority of a disparity direction. The image encoding apparatus 3600 may cause the information to be included in a bitstream corresponding to at least one of a coding unit level, a transform unit level, a maximum coding unit level, a slice unit level, and a picture unit level.
[0574] The embodiments may be implemented as a computer-executable program, and the program may be stored in a medium.
[0575] The medium may store the computer executable program continuously, or may temporarily store the computer executable program to execute or download the computer executable program. In addition, the medium may be any of a variety of recording tools or storage tools including a single hardware or a combination of multiple hardware, and may be distributed in a network, without being limited to a medium directly connected to a computer system. The medium may be configured to store program instructions, and examples of the medium may include magnetic media (such as a hard disk, a floppy disk, or a magnetic tape), optical recording media (such as a compact disk read-only memory (CD-ROM) or a digital versatile disk (DVD)), magneto-optical media (such as a floppy disk, ROM, random access memory (RAM), and flash memory). In addition, other examples of the medium may include recording media and storage media managed by an application store that publishes applications or a website or server that supplies or publishes various other software.
[0576] While the present disclosure has been particularly shown and described with reference to embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present disclosure as defined by the claims.
Claims
1. A method for decoding motion information, the method include: Obtaining information about the smallest pixel unit that can be indicated from the bit stream; obtaining information indicating a disparity distance for a current block from the bitstream; obtaining, from the bitstream, information indicating a disparity direction for the current block; If the minimum pixel unit that can be indicated is a basic pixel unit, determining a first parallax distance based on the obtained information indicating the parallax distance; If the minimum pixel unit that can be indicated is not the basic pixel unit, determining a second parallax distance based on the obtained information indicating the parallax distance; and If the current block is bidirectionally predicted, the following operations are performed: determining a first motion vector for the first list of the current block by changing a first base motion vector for the first list by a first offset, wherein the first offset has a size corresponding to the first disparity distance or the second disparity distance, and a sign of the first offset corresponds to the information indicating the disparity direction; determining a second offset by scaling the first offset based on a picture order count (POC) of the 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; and determining a second motion vector for the second list of the current block by changing a second base motion vector for the second list by a second offset, wherein the second parallax distance is greater than the first parallax distance, and At least one of the first parallax distance and the second parallax distance has a value that is a power of 2.
2. A method for encoding motion information, the method include: Determine the smallest pixel unit that can be indicated; If the current block is bi-directionally predicted, determining a first base motion vector for the first list and a second base motion vector for the second list; determining a first offset corresponding to a difference between a first base motion vector and a first motion vector for the first list for the current block; and generating a bitstream, wherein the bitstream includes information about the minimum pixel unit that can be indicated, information indicating a disparity distance corresponding to a size of the first offset, and information indicating a disparity direction corresponding to a sign of the first offset, If the minimum pixel unit that can be indicated is a basic pixel unit, the information indicating the parallax distance indicates a first parallax distance; if the minimum pixel unit that can be indicated is not the basic pixel unit, the information indicating the parallax distance indicates a second parallax distance. wherein the second offset is determined by scaling the first offset based on a picture order count (POC) of the 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, wherein the second offset corresponds to a difference between a second base motion vector and a second motion vector for the second list of the current block, wherein the second parallax distance is greater than the first parallax distance, and At least one of the first parallax distance and the second parallax distance has a value that is a power of 2.
3. A non-transitory computer-readable medium for recording a bit stream generated by a method for encoding motion information, in, The method comprises: Determine the smallest pixel unit that can be indicated; If the current block is bi-directionally predicted, determining a first base motion vector for the first list and a second base motion vector for the second list; determining a first offset corresponding to a difference between a first base motion vector and a first motion vector for the first list of the current block; and generating the bitstream, wherein the bitstream includes information about the minimum pixel unit that can be indicated, information indicating a disparity distance corresponding to a size of the first offset, and information indicating a disparity direction corresponding to a sign of the first offset, Wherein, if the minimum pixel unit that can be indicated is a basic pixel unit, the information indicating the parallax distance indicates a first parallax distance; If the minimum pixel unit that can be indicated is not the basic pixel unit, the information indicating the parallax distance indicates a second parallax distance, wherein the second offset is determined by scaling the first offset based on a picture order count (POC) of the 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, wherein the second offset corresponds to a difference between a second base motion vector and a second motion vector for the second list of the current block, wherein the second parallax distance is greater than the first parallax distance, and At least one of the first parallax distance and the second parallax distance has a value that is a power of 2.
