Motion vector coding device and method, and motion vector decoding device and method

By selecting and utilizing available peripheral blocks to calculate motion vectors, the method improves prediction accuracy and reduces bitstream size in video encoding, addressing existing challenges in motion vector prediction and encoding.

JP2024163294AActive Publication Date: 2024-11-21SAMSUNG ELECTRONICS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2024158162
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-01-26
Filing Date
2024-09-12
Publication Date
2024-11-21
Estimated Expiration
2041-01-27

AI Technical Summary

Technical Problem

Existing video encoding and decoding technologies face challenges in improving the prediction accuracy of motion vectors and reducing the size of differential motion vectors in bitstreams.

Method used

A method for encoding and decoding motion vectors involves selecting available peripheral blocks adjacent to the current block, determining their prediction direction, and using their motion vectors to calculate the current block's motion vector, thereby reducing the size of differential motion vectors in the bitstream.

Benefits of technology

This approach enhances the prediction accuracy of motion vectors and reduces the size of differential motion vectors in bitstreams, improving video encoding efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024163294000001_ABST
    Figure 2024163294000001_ABST
Patent Text Reader

Abstract

To provide a motion vector coding device and method, and a motion vector decoding device and method.SOLUTION: A motion vector decoding method according an embodiment is disclosed, which includes the steps of: determining availability of a first peripheral block selected by information acquired from a bitstream, of peripheral blocks adjacent to a current block; when the first peripheral block is identified not to be available from information indicating the availability of the first peripheral block, or when a reference image index of the first peripheral block in a same prediction direction as a prediction direction of the current block is the same value as a value determined in advance, acquiring a predicted motion vector of the current block from a motion vector of a second peripheral block adjacent to the current block and at a position determined in advance; and joining the predicted motion vector of the current block and a differential motion vector to each other to acquire a motion vector of the current block.SELECTED DRAWING: Figure 20
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the field of video encoding and decoding, and more particularly to an apparatus and method for encoding and decoding a current motion vector using neighboring motion vectors. [Background technology]

[0002] In encoding and decoding an image, an image is divided into blocks, and each block can be predictively encoded and predictively decoded through inter prediction or intra prediction.

[0003] The inter prediction is a method for compressing images by removing temporal redundancy between images, and motion estimation coding is a representative example. The motion estimation coding uses at least one reference image to predict a block of a current image. Using a predetermined evaluation function, a reference block most similar to the current block can be searched for within a predetermined search range. The current block is predicted based on the reference block, and the prediction block generated as a result of the prediction is subtracted from the current block to generate and code a residual block. In this case, in order to perform the prediction more accurately, an interpolation is performed on the reference image to generate pixels of sub-pel units smaller than an integer pel unit, and inter prediction can be performed based on the pixels of the sub-pel units.

[0004] In codecs such as H.264 AVC (Advanced Video Coding) and HEVC (High Efficiency Video Coding), the motion vector of a previously encoded block adjacent to the current block or a block included in a previously encoded image is used to predict the motion vector of the current block. A differential motion vector, which is the difference between the motion vector of the current block and the motion vector of the previously encoded block, is signaled to the decoder side through a predetermined method. Summary of the Invention [Problem to be solved by the invention]

[0005] A motion vector encoding apparatus and method, and a motion vector decoding apparatus and method according to an embodiment of the present invention aim to improve prediction accuracy of a motion vector of a current block.

[0006] In addition, a motion vector encoding device and method, and a motion vector decoding device and method according to an embodiment have a technical objective of reducing the size of a differential motion vector included in a bitstream. [Means for solving the problem]

[0007] A method for decoding a motion vector according to one embodiment also includes a step of selecting a first peripheral block from among peripheral blocks adjacent to a current block based on information obtained from a bitstream; if the first peripheral block is identified as available using information indicating the availability of the first peripheral block and there is no motion vector of the first peripheral block in the same prediction direction as the prediction direction of the current block, obtaining a predicted motion vector of the current block from a motion vector of a second peripheral block at a predetermined position adjacent to the current block; and obtaining a motion vector of the current block by combining the predicted motion vector of the current block and a differential motion vector. Effect of the Invention

[0008] A motion vector encoding apparatus and method and a motion vector decoding apparatus and method according to an embodiment may improve prediction accuracy of a motion vector of a current block.

[0009] In addition, the motion vector encoding device and method, and the motion vector decoding device and method according to an embodiment can reduce the magnitude of the differential motion vector included in the bitstream.

[0010] However, the effects that can be achieved by the motion vector encoding device and method, and the motion vector decoding device and method according to one embodiment are not limited to those mentioned above, and other effects not mentioned will be clearly understood by those skilled in the art in the technical field to which the present disclosure pertains from the following description. [Brief description of the drawings]

[0011] In order to more fully understand the drawings referred to herein, a brief description of each drawing is provided. [Figure 1] FIG. 2 is a block diagram of a video decoding device according to an embodiment. [Diagram 2] 1 is a block diagram of a video encoding device according to an embodiment; [Diagram 3] 1 illustrates a process of dividing a current coding unit and determining at least one coding unit according to one embodiment. [Figure 4] 1 illustrates a process for dividing a coding unit having a non-square shape to determine at least one coding unit according to one embodiment. [Diagram 5] 1 is a diagram illustrating a process of splitting a coding unit based on at least one of block configuration information and partition configuration mode information according to an embodiment; [Figure 6]1 is a diagram illustrating a method for determining a predetermined coding unit among an odd number of coding units, according to one embodiment. [Figure 7] 1 is a diagram illustrating an order in which multiple coding units are processed when a current coding unit is divided to determine multiple coding units, according to one embodiment; [Figure 8] 11 is a diagram illustrating a process of determining that a current coding unit is to be divided into an odd number of coding units when coding units cannot be processed in a predetermined order, according to one embodiment. [Figure 9] 1 illustrates a process of splitting a first coding unit to determine at least one coding unit according to one embodiment. [Figure 10] 11 is a diagram illustrating that a form in which a non-square second coding unit determined by dividing a first coding unit may be divided is restricted if the non-square second coding unit satisfies a predetermined condition, according to an embodiment. [Figure 11] 11 is a diagram illustrating a process of dividing a square-shaped coding unit when division mode information cannot indicate division into four square-shaped coding units according to one embodiment. [Figure 12] 1 is a diagram illustrating a case in which a processing order between multiple coding units may differ depending on a division process of the coding units, according to an embodiment; [Figure 13] A diagram illustrating a process in which the depth of a coding unit is determined as the shape and size of the coding unit change when a coding unit is recursively divided and multiple coding units are determined according to one embodiment. [Figure 14] 1 is a diagram illustrating a depth that can be determined according to the type and size of a coding unit, and an index (PID: part index) for coding unit partitioning, according to one embodiment. [Figure 15] 1 is a diagram illustrating a plurality of coding units being determined according to a plurality of predetermined data units included in a picture, according to an embodiment; [Figure 16]11 is a diagram illustrating coding units that may be determined for each picture when the combination of ways in which coding units may be divided varies for each picture, according to an embodiment; FIG. [Figure 17] 1 is a diagram illustrating various types of coding units that can be determined based on partition mode information expressed by a binary code according to an embodiment; [Figure 18] 11 is a diagram illustrating another form of a coding unit that can be determined based on division mode information represented by a binary code according to one embodiment. FIG. [Figure 19] 1 is a block diagram showing a video encoding system and a video decoding system; [Figure 20] FIG. 1 is a block diagram illustrating a configuration of a video decoding device according to an embodiment. [Figure 21A] 1 is an example diagram illustrating the positions of neighboring blocks when a block to the left of a current block is available; [Figure 21B] 1 is an exemplary diagram illustrating the positions of neighboring blocks when a block to the left and a block to the right of a current block are available; [Figure 21C] 1 is a diagram illustrating the positions of neighboring blocks when a block to the right of a current block is available; [Figure 22] 11 is a diagram illustrating a mapping relationship between an index indicating a motion vector resolution, the motion vector resolution, and the position of a neighboring block. [Figure 23A] 11 is a diagram illustrating a case in which a reference image index of a first neighboring block having the same prediction direction as a prediction direction of a current block is not equal to a predetermined value. [Figure 23B] 11 is a diagram illustrating a case in which a reference image index of a first neighboring block having the same prediction direction as a prediction direction of a current block is equal to a predetermined value. [Figure 23C]This figure illustrates a case in which, when the prediction direction of the current block is bidirectional, one of the reference image index in the list 0 direction of the first neighboring block and the reference image index in the list 1 direction is equal to a predetermined value, and the other is not equal to a predetermined value. [Figure 24] 4 is a flowchart illustrating a method for decoding motion vectors according to one embodiment. [Diagram 25] 1 is a block diagram illustrating a configuration of a video encoding device according to one embodiment. [Figure 26] 4 is a flowchart illustrating a method for encoding motion vectors according to one embodiment. [Figure 27] FIG. 1 is a diagram illustrating a process of obtaining a predicted motion vector according to an embodiment. [Figure 28] FIG. 1 is a diagram illustrating a process of obtaining a predicted motion vector according to an embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0012] According to one embodiment, a method for decoding a motion vector also includes a step of selecting a first peripheral block from among peripheral blocks adjacent to a current block based on information obtained from a bitstream; if the first peripheral block is identified as available using information indicating the availability of the first peripheral block and there is no motion vector of the first peripheral block in the same prediction direction as the prediction direction of the current block, obtaining a predicted motion vector of the current block from a motion vector of a second peripheral block at a predetermined position adjacent to the current block; and combining the predicted motion vector of the current block and a differential motion vector to obtain a motion vector of the current block.

[0013] If the reference image index of the second neighboring block in the same prediction direction as the current block is −1, the motion vector of the first neighboring block in the same prediction direction as the current block does not exist.

[0014] The availability of the first peripheral block is also determined based on at least one of whether a tile including the first peripheral block and a tile including the current block are different from each other, whether the first peripheral block is located outside the current image, whether the first peripheral block is intra-predicted, and whether reconstruction of the first peripheral block is completed.

[0015] The step of obtaining a predicted motion vector of the current block also includes a step of obtaining a predicted motion vector of the current block from the motion vector of the first surrounding block if the first surrounding block is identified as available using information indicating the availability of the first surrounding block and a motion vector of the first surrounding block in the same prediction direction as the prediction direction of the current block exists.

[0016] The information obtained from the bitstream includes information indicating a motion vector resolution of the current block among a plurality of motion vector resolutions, and the plurality of motion vector resolutions are also mapped to neighboring blocks at different positions.

[0017] The location of the second peripheral block also differs depending on information indicating availability of left and right peripheral blocks of the current block.

[0018] The step of obtaining a predicted motion vector of the current block also includes a step of obtaining a predicted motion vector of the current block from the motion vector of the second peripheral block if the second peripheral block is identified as available using information indicating the availability of the second peripheral block, and if a reference image index of the second peripheral block in the same prediction direction as the prediction direction of the current block is the same as a reference image index of the current block, or if a motion vector of the second peripheral block in the same prediction direction as the prediction direction of the current block exists, obtaining a predicted motion vector of the current block from the motion vector of the second peripheral block.

[0019] The step of obtaining a predicted motion vector of the current block also includes a step of obtaining a predicted motion vector of the current block from a motion vector of a block decoded before the current block, if the second peripheral block is identified as unavailable using information indicating the availability of the second peripheral block or if there is no motion vector of the second peripheral block in the same prediction direction as the prediction direction of the current block.

[0020] The step of obtaining a predicted motion vector for the current block may also include obtaining a predicted motion vector for the current block from a motion vector of the second surrounding block if the first surrounding block is identified as unavailable.

[0021] According to one embodiment, the video decoding device also includes a motion vector prediction unit that selects a first peripheral block from among peripheral blocks adjacent to a current block based on information acquired from a bitstream, and, if the first peripheral block is identified as available using information indicating the availability of the first peripheral block and there is no motion vector of the first peripheral block in the same prediction direction as the prediction direction of the current block, obtains a predicted motion vector of the current block from a motion vector of a second peripheral block at a predetermined position adjacent to the current block, and a motion vector restoration unit that combines the predicted motion vector of the current block and a differential motion vector to obtain a motion vector of the current block.

[0022] According to one embodiment, a method for encoding a motion vector also includes a step of: if a first peripheral block selected from among peripheral blocks adjacent to a current block is identified as available and there is no motion vector of the first peripheral block in the same prediction direction as the prediction direction of the current block, obtaining a predicted motion vector of the current block from a motion vector of a second peripheral block at a predetermined position adjacent to the current block; and generating a bitstream including a differential motion vector between the motion vector of the current block and the predicted motion vector, and information for indicating the first peripheral block.

[0023] The present disclosure can be modified in various ways and can have various embodiments, but specific embodiments are illustrated in the drawings and will be described in detail through detailed descriptions thereof. However, they are not intended to limit the embodiments of the present disclosure, and the present disclosure should be understood to include all modifications, equivalents, or alternatives included in the spirit and technical scope of the various embodiments.

[0024] In the description of the present embodiment, if a detailed description of related prior art is deemed to unnecessarily obscure the gist of the present disclosure, the detailed description will be omitted. In addition, numbers (e.g., first, second, etc.) used in the description of the specification are merely identification symbols for distinguishing one component from other components.

[0025] In addition, when a component is referred to in this specification as being "coupled" or "connected" to another component, it should be understood that the component may be directly coupled or connected to the other component, but may also be coupled or connected via other components in between, unless otherwise specified to the contrary.

[0026] In addition, in this specification, components expressed as "units", "modules", etc. may be two or more components combined into one component, or one component may be further divided into two or more components according to function. In addition, each component described below may additionally perform some or all of the functions of other components in addition to its own main function, and it goes without saying that some of the main functions of each component may be exclusively performed by other components.

[0027] Also, as used herein, an "image" or "picture" may refer to a still or moving image (video).

[0028] In this specification, a "sample" or a "signal" refers to data assigned to a sampling position of an image and to data to be processed. For example, in a spatial domain image, a pixel value and a transform coefficient in a transform domain are also samples. A unit including at least one such sample can be defined as a block.

[0029] In the following, with reference to FIGS. 1 to 19, a video encoding method and apparatus therefor, and a video decoding method and apparatus therefor based on a tree-structured coding unit and a transform unit according to an embodiment are disclosed.

[0030] FIG. 1 illustrates a block diagram of a video decoder 100 according to one embodiment.

[0031] The video decoding device 100 also includes a bitstream obtaining unit 110 and a decoding unit 120. The bitstream obtaining unit 110 and the decoding unit 120 also include at least one processor. The bitstream obtaining unit 110 and the decoding unit 120 also include a memory that stores instructions executed by the at least one processor.

[0032] The bitstream acquisition unit 110 may receive a bitstream. The bitstream includes information obtained by encoding an image by the video encoding device 200 described below. The bitstream may be transmitted from the video encoding device 200. The video encoding device 200 and the video decoding device 100 may be connected to each other via a wire or wirelessly, and the bitstream acquisition unit 110 may receive the bitstream via a wire or wirelessly. The bitstream acquisition unit 110 may receive the bitstream from a recording medium such as an optical medium or a hard disk. The decoding unit 120 may restore an image based on information acquired from the received bitstream. The decoding unit 120 may acquire syntax elements for restoring an image from the bitstream. The decoding unit 120 may restore an image based on the syntax elements.

[0033] Describing the operation of the video decoding device 100 in detail, a bitstream obtaining unit 110 can receive a bitstream.

[0034] The video decoding apparatus 100 may perform an operation of acquiring a bin string corresponding to a partition mode of a coding unit from a bitstream. The video decoding apparatus 100 may then perform an operation of determining a partition rule for the coding unit. The video decoding apparatus 100 may also perform an operation of partitioning a coding unit into a plurality of coding units based on at least one of the partition rules and the bin string corresponding to the partition mode. To determine the partition rule, the video decoding apparatus 100 may determine a first allowable range of a size of the coding unit according to a ratio between a width and a height of the coding unit. To determine the partition rule, the video decoding apparatus 100 may determine a second allowable range of a size of the coding unit according to a partition mode of the coding unit.

[0035] In the following, the division of coding units according to one embodiment of the present disclosure will be described in detail.

[0036] First, a picture may be divided into one or more slices or one or more tiles. A slice or a tile may be a sequence of one or more largest coding units (CTUs). In one embodiment, a slice may include one or more tiles, and a slice may include one or more largest coding units. A slice including one or more tiles may be determined within a picture.

[0037] The concept of maximal coding unit (CTU) is contrasted with maximal coding block (CTB), which is an NxN block containing NxN samples (N is an integer). Each color component can be divided into one or more maximal coding blocks.

[0038] If a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), the largest coding unit (CTU) is a unit that includes the largest coded block of luma samples, the two largest coded blocks of corresponding chroma samples, and the syntax structure used to code the luma samples and chroma samples. If the picture is a monochrome picture, the largest coding unit is a unit that includes the largest coded block of monochrome samples and the syntax structure used to code the monochrome samples. If the picture is a picture coded into color planes separated by color components, the largest coding unit is a unit that includes the picture and the syntax structure used to code the samples of the picture.

[0039] One maximal coding block (CTB) may be divided into MxN coding blocks containing MxN samples (M, N are integers).

[0040] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) is a unit including a coding block of luma samples, two coding blocks of corresponding chroma samples, and a syntax structure used to code the luma samples and chroma samples. When the picture is a monochrome picture, a coding unit is a unit including a coding block of monochrome samples and a syntax structure used to code the monochrome samples. When the picture is a picture coded into color planes separated by color components, a coding unit is a unit including the picture and a syntax structure used to code the samples of the picture.

[0041] As described above, the largest coding block and the largest coding unit are distinct concepts, and the coding block and the coding unit are distinct concepts. That is, the (largest) coding unit refers to a data structure including a (largest) coding block including a sample and a syntax structure corresponding thereto. However, since a person skilled in the art can understand that the (largest) coding unit or the (largest) coding block refers to a block of a predetermined size including a predetermined number of samples, in the following description, the largest coding block and the largest coding unit, or the coding block and the coding unit, will be referred to without distinction unless there is a special reason.

[0042] The image may be divided into maximum coding units (CTUs), the size of which may also be determined based on information obtained from the bitstream, and the shape of the maximum coding units may have the same size as a square, but is not limited thereto.

[0043] For example, information regarding a maximum size of a luma coding block may be obtained from a bitstream, where the maximum size of the luma coding block indicated by the information regarding the maximum size of the luma coding block may be one of 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, and 256x256.

[0044] For example, information on the maximum size of a luma coding block that can be divided into two and information on a luma block size difference may be obtained from a bitstream. The information on the luma block size difference may indicate a size difference between a luma maximum coding unit and a maximum luma coding block that can be divided into two. Thus, the size of the luma maximum coding unit may be determined by combining the information on the maximum size of a luma coding block that can be divided into two obtained from the bitstream and the information on the luma block size difference. The size of the chroma maximum coding unit may also be determined by using the size of the luma maximum coding unit. For example, if the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chroma block is half the size of the luma block, and similarly, the size of the chroma maximum coding unit is half the size of the luma maximum coding unit.

[0045] According to an embodiment, since information on the maximum size of a luma coding block that can be binary split is acquired from a bitstream, the maximum size of a luma coding block that can be binary split may be variably determined. In contrast, the maximum size of a luma coding block that can be ternary split may be fixed. For example, in an I picture, the maximum size of a luma coding block that can be ternary split is 32x32, and in a P picture or B picture, the maximum size of a luma coding block that can be ternary split is 64x64.

[0046] Also, the maximum coding unit may be hierarchically divided into coding units based on partition mode information acquired from the bitstream, where the partition mode information may be at least one of information indicating whether or not a quad split is performed, information indicating whether or not a multi-partition is performed, partition direction information, and partition type information acquired from the bitstream.

[0047] For example, the information indicating whether or not a current coding unit is quad-split may indicate whether or not the current coding unit is quad-split (QUAD_SPLIT) or not.

[0048] If the current coding unit is not split into quads, the information indicating whether or not the current coding unit is to be split further may indicate whether the current coding unit is not to be split further (NO_SPLIT) or whether or not the current coding unit is to be split into binary / ternary.

[0049] If the current coding unit is binary-divided or ternary-divided, the division direction information indicates that the current coding unit is divided in one of the horizontal and vertical directions.

[0050] If the current coding unit is split horizontally or vertically, the split type information indicates that the current coding unit is split by binary split or ternary split.

[0051] The partition mode of the current coding unit may be determined according to the partition direction information and the partition type information. If the current coding unit is binary partitioned horizontally, the partition mode may be determined as binary horizontal partition (SPLIT_BT_HOR), if the current coding unit is ternary partitioned horizontally, the partition mode may be determined as ternary horizontal partition (SPLIT_TT_HOR), if the current coding unit is binary partitioned vertically, the partition mode may be determined as binary vertical partition (SPLIT_BT_VER), and if the current coding unit is ternary partitioned vertically, the partition mode may be determined as ternary vertical partition (SPLIT_TT_VER).

[0052] The video decoding device 100 can obtain partition mode information from a bin string from a bitstream. The format of the bitstream received by the video decoding device 100 can include a fixed length binary code, a unary code, a truncated unary code, a predetermined binary code, and the like. The bin string indicates information as a sequence of binary numbers. The bin string is also composed of at least one bit. The video decoding device 100 can obtain partition mode information corresponding to the bin string based on a partition rule. The video decoding device 100 can determine whether to partition a coding unit into quads, whether not to partition it, or a partition direction and partition type based on a bin string.

[0053] The coding unit may be smaller than or equal to the maximum coding unit. For example, the maximum coding unit is also a coding unit having a maximum size, and is therefore also one of the coding units. If the division mode information related to the maximum coding unit indicates that the coding unit is not divided, the coding unit determined in the maximum coding unit has the same size as the maximum coding unit. If the division mode information related to the maximum coding unit indicates that the coding unit is divided, the maximum coding unit is also divided into coding units. Also, if the division mode information related to the coding unit indicates division, the coding unit may be further divided into coding units of smaller sizes. However, the division of the image is not limited thereto, and the maximum coding unit and the coding unit are not distinguished from each other. The division of the coding unit will be described in more detail with reference to FIG. 3 to FIG. 16.

[0054] Also, one or more prediction blocks for prediction may be determined from the coding unit, where the prediction blocks are the same as or smaller than the coding unit, and one or more transform blocks for transformation may be determined from the coding unit, where the transform blocks are the same as or smaller than the coding unit.

[0055] The shapes and sizes of the transform block and the prediction block are independent of each other.

[0056] In another embodiment, prediction may be performed using the coding unit as a prediction block, and transformation may be performed using the coding unit as a transform block.

[0057] The division of the coding unit will be described in more detail in FIG. 3 to FIG. 16. The current block and the neighboring blocks of the present disclosure may indicate one of the largest coding unit, the coding unit, the prediction block, and the transformation block. The current block or the current coding unit is a block currently being decoded or coded, or a block currently being divided. The neighboring blocks may also be blocks that have been restored before the current block. The neighboring blocks may be spatially or temporally adjacent to the current block. The neighboring blocks may be located at one of the lower left side, the left side, the upper left side, the upper side, the upper right side, the right side, and the lower right side of the current block.

[0058] FIG. 3 illustrates a process in which the video decoding device 100 divides a current coding unit and determines at least one coding unit, according to an embodiment.

[0059] The block shape may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N, where N is a positive integer. The block shape information is information indicating at least one of the shape, direction, width-height ratio, or size of a coding unit.

[0060] The shape of the coding unit may be square or non-square. If the width and height of the coding unit are the same (i.e., the block shape of the coding unit is 4Nx4N), the video decoding device 100 may determine that the block shape information of the coding unit is square. The video decoding device 100 may determine that the shape of the coding unit is non-square.

[0061] When the width and height of a coding unit are different (i.e., when the block shape of the coding unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the video decoding device 100 may determine that the block shape information of the coding unit is non-square. When the block shape information of the coding unit is non-square, the video decoding device 100 may determine that the ratio of the width to the height in the block shape information of the coding unit is 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. Based on the width and height of the coding unit, the video decoding device 100 may determine whether the coding unit is horizontal or vertical. Furthermore, the video decoding apparatus 100 may determine the size of the coding unit based on at least one of the width, height, and width of the coding unit.

[0062] According to an embodiment, the video decoding device 100 may determine the type of the coding unit using the block type information, and may determine the type in which the coding unit is to be partitioned using the partition type mode information. That is, depending on what block type the block type information used by the video decoding device 100 indicates, a partitioning method of the coding unit indicated by the partition type mode information may be determined.

[0063] The video decoding device 100 may acquire partition mode information from a bitstream. However, the present invention is not limited thereto, and the video decoding device 100 and the video encoding device 200 may determine partition mode information agreed upon in advance based on the block format information. The video decoding device 100 may determine partition mode information agreed upon in advance for the maximum coding unit or the minimum coding unit. For example, the video decoding device 100 may determine partition mode information as quad partition for the maximum coding unit. Also, the video decoding device 100 may determine partition mode information as "no partition" for the minimum coding unit. Specifically, the video decoding device 100 may determine the size of the maximum coding unit as 256x256. The video decoding device 100 may determine partition mode information agreed upon in advance as quad partition. The quad partition is a partition mode in which both the width and height of the coding unit are divided into two equal parts. Based on the partition mode information, the video decoding device 100 can obtain a coding unit of 128x128 size from the maximum coding unit of 256x256 size. Also, the video decoding device 100 can determine the size of the minimum coding unit to be 4x4. The video decoding device 100 can obtain partition mode information indicating "no partition" for the minimum coding unit.

[0064] According to an embodiment, the video decoding apparatus 100 may use block shape information indicating that the current coding unit is square. For example, the video decoding apparatus 100 may determine whether to not split the square coding unit, to split it vertically, to split it horizontally, or to split it into four coding units, according to the partition shape mode information. Referring to FIG. 3, when the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may not split the coding unit 310a having the same size as the current coding unit 300 according to the partition shape mode information indicating no partition, or may determine the divided coding units 310b, 310c, 310d, 310e, and 310f according to the partition shape mode information indicating a predetermined partition method.

[0065] Referring to FIG. 3, the video decoding device 100 may determine two coding units 310b obtained by dividing the current coding unit 300 in the vertical direction based on the partition mode information indicating division in the vertical direction, according to an embodiment. The video decoding device 100 may determine two coding units 310c obtained by dividing the current coding unit 300 in the horizontal direction based on the partition mode information indicating division in the horizontal direction. The video decoding device 100 may determine four coding units 310d obtained by dividing the current coding unit 300 in the vertical and horizontal directions based on the partition mode information indicating division in the vertical and horizontal directions. The video decoding device 100 may determine three coding units 310e obtained by dividing the current coding unit 300 in the vertical direction based on the partition mode information indicating ternary division in the vertical direction, according to an embodiment. The video decoding device 100 may determine three coding units 310f obtained by dividing the current coding unit 300 in the horizontal direction based on the partition mode information indicating ternary division in the horizontal direction. However, the division patterns into which the square coding unit may be divided are not limited to the above-mentioned patterns, but may include various patterns that may be indicated by the division pattern mode information. The predetermined division patterns into which the square coding unit may be divided will be described in detail below through various embodiments.

[0066] FIG. 4 illustrates a process in which the video decoding device 100 divides a non-square coding unit to determine at least one coding unit, according to an embodiment.

[0067] According to an embodiment, the video decoding apparatus 100 may use block shape information indicating that the current coding unit is non-square. The video decoding apparatus 100 may determine whether to not split the non-square current coding unit or to split it in a predetermined manner according to the partition mode information. Referring to FIG. 4, when the block shape information of the current coding unit 400 or 450 indicates a non-square shape, the video decoding apparatus 100 may determine a coding unit 410 or 460 having the same size as the current coding unit 400 or 450 according to the partition mode information indicating no partition, or may determine partitioned coding units 420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, and 480c according to the partition mode information indicating a predetermined partition method. The predetermined partition method for partitioning a non-square coding unit will be described in detail below through various embodiments.

[0068] According to an embodiment, the video decoding device 100 may determine a form in which a coding unit is divided using the partition mode information, and in this case, the partition mode information may indicate the number of at least one coding unit to be generated by dividing the coding unit. Referring to FIG 4, when the partition mode information indicates that the current coding unit 400 or 450 is divided into two coding units, the video decoding device 100 may divide the current coding unit 400 or 450 based on the partition mode information and determine two coding units 420a, 420b or 470a, 470b included in the current coding unit.

[0069] According to an embodiment, when the video decoding device 100 divides the non-square shaped current coding unit 400 or 450 based on the division shape mode information, the video decoding device 100 may divide the current coding unit by considering a position of a long side of the non-square shaped current coding unit 400 or 450. For example, the video decoding device 100 may determine a plurality of coding units by dividing the current coding unit 400 or 450 in a direction that divides the long side of the current coding unit 400 or 450 by considering the shape of the current coding unit 400 or 450.

[0070] According to an embodiment, when the partition mode information indicates that the coding unit is to be partitioned into an odd number of blocks (ternary partitioning), the video decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450. For example, when the partition mode information indicates that the current coding unit 400 or 450 is to be partitioned into three coding units, the video decoding device 100 may partition the current coding unit 400 or 450 into three coding units 430a, 430b, 430c, 480a, 480b, and 480c.

[0071] According to an embodiment, the width-to-height ratio of the current coding unit 400 or 450 may be 4:1 or 1:4. When the width-to-height ratio is 4:1, the width is greater than the height, so the block shape information is also horizontal. When the width-to-height ratio is 1:4, the width is smaller than the height, so the block shape information is also vertical. The video decoding apparatus 100 may determine to divide the current coding unit into an odd number of blocks based on the partition shape mode information. In addition, the video decoding apparatus 100 may determine a partition direction of the current coding unit 400 or 450 based on the block shape information of the current coding unit 400 or 450. For example, when the current coding unit 400 is vertical, the video decoding apparatus 100 may divide the current coding unit 400 in the horizontal direction to determine coding units 430a, 430b, and 430c. Also, if the current coding unit 450 is horizontal, the video decoding device 100 may divide the current coding unit 450 vertically to determine coding units 480a, 480b, and 480c.

[0072] According to an embodiment, the video decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and the determined coding units may not all have the same size. For example, the size of a certain coding unit 430b or 480b among the determined odd number of coding units 430a, 430b, 430c, 480a, 480b, and 480c may be different from the other coding units 430a, 430c, 480a, and 480c. That is, the coding units that may be determined by dividing the current coding unit 400 or 450 may have a plurality of sizes, and in some cases, the odd number of coding units 430a, 430b, 430c, 480a, 480b, and 480c may have different sizes.

[0073] According to an embodiment, when the partition mode information indicates that a coding unit is partitioned into an odd number of blocks, the video decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and may further set a predetermined restriction on at least one of the odd number of coding units generated by partitioning. Referring to FIG 4, the video decoding device 100 may perform a decoding process for the central coding unit 430b, 480b among three coding units 430a, 430b, 430c, 480a, 480b, 480c generated by partitioning the current coding unit 400 or 450 differently from the other coding units 430a, 430c, 480a, 480c. For example, the video decoding device 100 may limit the centrally located coding units 430b and 480b from being further divided, unlike the other coding units 430a, 430c, 480a, and 480c, or may limit the coding units 430b and 480b to being divided only a predetermined number of times.

[0074] FIG. 5 illustrates a process in which the video decoding apparatus 100 divides a coding unit based on at least one of block configuration information and partition configuration mode information, according to an embodiment.

[0075] According to an embodiment, the video decoding device 100 may determine whether or not to divide the square-shaped first coding unit 500 into coding units based on at least one of the block shape information and the partition shape mode information. According to an embodiment, if the partition shape mode information indicates that the first coding unit 500 is to be partitioned in the horizontal direction, the video decoding device 100 may partition the first coding unit 500 in the horizontal direction to determine the second coding unit 510. According to an embodiment, the first coding unit, the second coding unit, and the third coding unit used are terms used to understand the partitioning context between the coding units. For example, if the first coding unit is partitioned, the second coding unit may be determined, and if the second coding unit is partitioned, the third coding unit may be determined. In the following, the relationship between the first coding unit, the second coding unit, and the third coding unit used may also be understood to be according to the above-mentioned characteristics.

[0076] According to an embodiment, the video decoding device 100 may determine whether or not to divide the determined second coding unit 510 into coding units based on the partition mode information. Referring to FIG. 5, the video decoding device 100 may divide the non-square second coding unit 510 determined by dividing the first coding unit 500 into at least one third coding unit 520a, 520b, 520c, 520d based on the partition mode information, or may not divide the second coding unit 510. The video decoding device 100 may acquire the partition mode information, and may divide the first coding unit 500 based on the acquired partition mode information, for example, into a plurality of second coding units 510 of various types, and the second coding units 510 may be divided according to the manner in which the first coding unit 500 is divided based on the partition mode information. According to an embodiment, when the first coding unit 500 is divided into the second coding unit 510 based on the division mode information related to the first coding unit 500, the second coding unit 510 may also be divided into, for example, the third coding units 520a, 520b, 520c, and 520d based on the division mode information related to the second coding unit 510. That is, the coding units may be divided recursively based on the division mode information related to each of the coding units. Thus, in a non-square coding unit, a square coding unit may be determined, and the square coding unit may be divided recursively to determine a non-square coding unit.

[0077] 5, among the odd number of third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510, a certain coding unit (e.g., a coding unit located in the middle or a square coding unit) may be divided recursively. According to an embodiment, the non-square third coding unit 520c, which is one of the odd number of third coding units 520b, 520c, and 520d, may be divided horizontally into a plurality of fourth coding units. The non-square fourth coding unit 530b or 530d, which is one of the plurality of fourth coding units 530a, 530b, 530c, and 530d, may be further divided into a plurality of coding units. For example, the non-square fourth coding unit 530b or 530d may be further divided into an odd number of coding units. Methods that may be used for the recursive division of coding units will be described below through various embodiments.

[0078] According to an embodiment, the video decoding device 100 may divide each of the third coding units 520a, 520b, 520c, and 520d into coding units based on the partition mode information. Also, the video decoding device 100 may determine not to partition the second coding unit 510 based on the partition mode information. According to an embodiment, the video decoding device 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The video decoding device 100 may set a predetermined restriction on a certain third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the video decoding device 100 may restrict the coding unit 520c located in the middle of the odd number of third coding units 520b, 520c, and 520d so that it is not further divided or that it must be divided a settable number of times.

[0079] 5, the video decoding apparatus 100 may restrict the coding unit 520c located in the middle of the odd number of third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to not be further divided or to be divided into a predetermined division form (e.g., to be divided into only four coding units or to be divided into a form corresponding to the division form of the second coding unit 510), or to be divided only a predetermined number of times (e.g., to be divided only n times (n>0)). However, the above restriction on the coding unit 520c located in the middle is merely an embodiment, and should not be construed as being limited to the above embodiment, but should be construed as including various restrictions that the coding unit 520c located in the middle may be decoded differently from the other coding units 520b and 520d.

[0080] According to an embodiment, the video decoding device 100 may obtain partition mode information used to partition the current coding unit at a predetermined position within the current coding unit.

[0081] FIG. 6 illustrates a method for the video decoding device 100 to determine a given coding unit from among an odd number of coding units according to one embodiment.

[0082] 6, the partition mode information of the current coding unit 600, 650 may be obtained from a sample at a predetermined position (e.g., samples 640, 690 located in the middle) among a plurality of samples included in the current coding unit 600, 650. However, the predetermined position in the current coding unit 600 from which at least one of the partition mode information may be obtained is not limited to the center position shown in FIG. 6, but may include various positions (e.g., top end, bottom end, left end, right end, top left end, bottom left end, top right end, or bottom right end) that are included in the current coding unit 600. The video decoding apparatus 100 may obtain the partition mode information obtained from the predetermined position and determine whether to partition the current coding unit into coding units of various types and sizes or not to partition the current coding unit.

[0083] According to an embodiment, when a current coding unit is divided into a predetermined number of coding units, the video decoding apparatus 100 may select one of the coding units. There are various methods for selecting one of the coding units, which will be described later through various embodiments.

[0084] According to an embodiment, the video decoding apparatus 100 may divide a current coding unit into a plurality of coding units and determine a coding unit at a predetermined position.

[0085] According to an embodiment, the video decoding apparatus 100 may use information indicating the positions of each of the odd coding units to determine a coding unit located in the middle among the odd coding units. Referring to FIG 6, the video decoding apparatus 100 may divide a current coding unit 600 or a current coding unit 650 to determine odd coding units 620a, 620b, and 620c or odd coding units 660a, 660b, and 660c. The video decoding apparatus 100 may determine the middle coding unit 620b or the middle coding unit 660b using information regarding the positions of the odd coding units 620a, 620b, and 620c or the odd coding units 660a, 660b, and 660c. For example, the video decoding device 100 can determine the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of predetermined samples included in the coding units 620a, 620b, and 620c to determine the coding unit 620b located in the middle. Specifically, the video decoding device 100 can determine the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of the upper left samples 630a, 630b, and 630c of the coding units 620a, 620b, and 620c to determine the coding unit 620b located in the middle.

[0086] According to an embodiment, the information indicating the positions of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, may also include information related to the positions or coordinates of the coding units 620a, 620b, and 620c in a picture. According to an embodiment, the information indicating the positions of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, may also include information indicating a width or height of the coding units 620a, 620b, and 620c included in the current coding unit 600, and such width or height may correspond to information indicating a difference between the coordinates of the coding units 620a, 620b, and 620c in a picture. That is, the video decoding device 100 can determine the coding unit 620b located in the middle by directly using information related to the positions or coordinates of the coding units 620a, 620b, and 620c within the picture, or by using information related to the width or height of the coding unit corresponding to the difference between the coordinates.

[0087] According to an embodiment, information indicating a position of the top left sample 630a of the top coding unit 620a may indicate (xa, ya) coordinates, information indicating a position of the top left sample 530b of the middle coding unit 620b may indicate (xb, yb) coordinates, and information indicating a position of the top left sample 630c of the bottom coding unit 620c may indicate (xc, yc) coordinates. The video decoding apparatus 100 may determine the middle coding unit 620b using the coordinates of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively. For example, when the coordinates of the top left samples 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b including the coordinates (xb, yb) of the middle sample 630b may be determined as the middle coding unit among the coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. However, the coordinates indicating the positions of the top left samples 630a, 630b, and 630c may indicate absolute positions within a picture, and further, the (dxb, dyb) coordinates indicating the relative position of the top left sample 630b of the middle coding unit 620b and the (dxc, dyc) coordinates indicating the relative position of the top left sample 630c of the bottom coding unit 620c may be used. In addition, the method of determining a coding unit at a predetermined position by using the coordinates of a sample as information indicating the position of the sample included in the coding unit should not be interpreted as being limited to the above-mentioned method, but should be interpreted by various arithmetic methods that can use the coordinates of the sample.

[0088] According to an embodiment, the video decoding device 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c, and may select a coding unit from the coding units 620a, 620b, and 620c according to a predetermined criterion. For example, the video decoding device 100 may select a coding unit 620b having a different size from the coding units 620a, 620b, and 620c.

[0089] According to an embodiment, the video decoding device 100 may determine the width or height of each of the coding units 620a, 620b, and 620c using (xa, ya) coordinates indicating the position of the top left sample 630a of the top coding unit 620a, (xb, yb) coordinates indicating the position of the top left sample 630b of the middle coding unit 620b, and (xc, yc) coordinates indicating the position of the top left sample 630c of the bottom coding unit 620c. The video decoding device 100 may determine the size of each of the coding units 620a, 620b, and 620c using (xa, ya), (xb, yb), and (xc, yc) coordinates indicating the positions of the coding units 620a, 620b, and 620c. According to an embodiment, the video decoding device 100 may determine the width of the top coding unit 620a as the width of the current coding unit 600. The video decoding apparatus 100 may determine the height of the top coding unit 620a as yb-ya. According to an embodiment, the video decoding apparatus 100 may determine the width of the middle coding unit 620b as the width of the current coding unit 600. The video decoding apparatus 100 may determine the height of the middle coding unit 620b as yc-yb. According to an embodiment, the video decoding apparatus 100 may determine the width or height of the bottom coding unit using the width or height of the current coding unit and the widths and heights of the top coding unit 620a and the middle coding unit 620b. The video decoding apparatus 100 may determine a coding unit having a different size from other coding units based on the determined widths and heights of the coding units 620a, 620b, and 620c. Referring to FIG. 6, the video decoding apparatus 100 may determine the middle coding unit 620b having a different size from the top coding unit 620a and the bottom coding unit 620c as a coding unit at a predetermined position. However, the above-mentioned process in which the video decoding device 100 determines a coding unit having a size different from other coding units is merely one embodiment of determining a coding unit at a predetermined position using the size of the coding unit determined based on sample coordinates, and various other processes may be used to determine a coding unit at a predetermined position by comparing the size of the coding unit determined based on predetermined sample coordinates.

[0090] The video decoding device 100 may determine the width or height of each of the coding units 660a, 660b, and 660c using the (xd, yd) coordinates indicating the position of the top left sample 670a of the left coding unit 660a, the (xe, ye) coordinates indicating the position of the top left sample 670b of the middle coding unit 660b, and the (xf, yf) coordinates indicating the position of the top left sample 670c of the right coding unit 660c. The video decoding device 100 may determine the size of each of the coding units 660a, 660b, and 660c using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.

[0091] According to an embodiment, the video decoding device 100 may determine the width of the left coding unit 660a as xe-xd. The video decoding device 100 may determine the height of the left coding unit 660a as the height of the current coding unit 650. According to an embodiment, the video decoding device 100 may determine the width of the middle coding unit 660b as xf-xe. The video decoding device 100 may determine the height of the middle coding unit 660b as the height of the current coding unit 600. According to an embodiment, the video decoding device 100 may determine the width or height of the right coding unit 660c using the width or height of the current coding unit 650 and the widths and heights of the left coding unit 660a and the middle coding unit 660b. The video decoding device 100 may determine a coding unit having a size different from other coding units based on the determined widths and heights of the coding units 660a, 660b, and 660c. 6, the video decoding apparatus 100 may determine a middle coding unit 660b having a size different from the sizes of the left coding unit 660a and the right coding unit 660c as a coding unit at a predetermined position. However, the above-described process of the video decoding apparatus 100 determining a coding unit having a size different from other coding units is merely one embodiment of determining a coding unit at a predetermined position using the size of the coding unit determined based on sample coordinates, and various processes of determining a coding unit at a predetermined position by comparing the size of the coding unit determined based on predetermined sample coordinates may be used.

[0092] However, the position of the sample considered to determine the position of the coding unit is not to be interpreted as being limited to the upper left end as mentioned above, but rather, it is also to be interpreted that information related to the position of any sample included in the coding unit may be used.

[0093] According to an embodiment, the video decoding apparatus 100 may select a coding unit at a predetermined position from among an odd number of coding units determined by dividing the current coding unit, taking into consideration the shape of the current coding unit. For example, if the current coding unit is a non-square shape in which the width is greater than the height, the video decoding apparatus 100 may determine a coding unit at a predetermined position along the horizontal direction. That is, the video decoding apparatus 100 may determine one of the coding units at different positions in the horizontal direction and set a restriction on the coding unit. If the current coding unit is a non-square shape in which the height is greater than the width, the video decoding apparatus 100 may determine a coding unit at a predetermined position along the vertical direction. That is, the video decoding apparatus 100 may determine one of the coding units at different positions in the vertical direction and set a restriction on the coding unit.

[0094] According to an embodiment, the video decoding apparatus 100 may use information indicating the positions of each of the even number of coding units to determine a coding unit at a predetermined position among the even number of coding units. The video decoding apparatus 100 may determine the even number of coding units by dividing (binary dividing) the current coding unit, and may determine the coding unit at a predetermined position by using information regarding the positions of the even number of coding units. A detailed process related to this process corresponds to the process of determining a coding unit at a predetermined position (e.g., a middle position) among the odd number of coding units described in FIG. 6, and therefore will not be described in detail.

[0095] According to an embodiment, when a non-square current coding unit is divided into a plurality of coding units, in order to determine a coding unit at a predetermined position among the plurality of coding units, the video decoding apparatus 100 may use predetermined information related to the coding unit at a predetermined position during the division process. For example, in order to determine a coding unit at a center among the plurality of coding units into which the current coding unit is divided, the video decoding apparatus 100 may use at least one of block shape information and partition shape mode information stored in a sample included in the center coding unit during the division process.

[0096] 6, the video decoding apparatus 100 may divide a current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on the partition mode information, and may determine a coding unit 620b located in the middle of the plurality of coding units 620a, 620b, and 620c. Furthermore, the video decoding apparatus 100 may determine the coding unit 620b located in the middle by considering a position where the partition mode information is acquired. That is, the partition mode information of the current coding unit 600 is acquired from a sample 640 located in the middle of the current coding unit 600, and when the current coding unit 600 is divided into a plurality of coding units 620a, 620b, and 620c based on the partition mode information, the coding unit 620b including the sample 640 may be determined as the coding unit located in the middle. However, information used to determine the coding unit located in the middle is not limited to the partition mode information, and various types of information may be used in the process of determining the coding unit located in the middle.

[0097] According to an embodiment, the predetermined information for identifying a coding unit at a predetermined position may be obtained from a predetermined sample included in a coding unit to be determined. Referring to FIG. 6, the video decoding device 100 may use partition mode information obtained from a sample at a predetermined position in the current coding unit 600 (e.g., a sample located at the center of the current coding unit 600) to determine a coding unit at a predetermined position (e.g., a coding unit located at the center of the coding units) among a plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. That is, the video decoding device 100 may determine the sample at the predetermined position by considering the block format of the current coding unit 600, and may determine a coding unit 620b including a sample from which predetermined information (e.g., partition mode information) can be obtained among a plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may set a predetermined restriction. 6, according to an embodiment, the video decoding device 100 may determine a sample 640 located in the middle of the current coding unit 600 as a sample from which certain information may be acquired, and may set a certain restriction in a decoding process for a coding unit 620b including such a sample 640. However, the position of the sample from which certain information may be acquired is not limited to the above position, but may be a sample at any position included in the coding unit 620b determined to set the restriction.

[0098] According to an embodiment, the position of a sample from which the predetermined information can be obtained may be determined according to the shape of the current coding unit 600. According to an embodiment, the block shape information may determine whether the shape of the current coding unit is square or non-square, and may determine the position of a sample from which the predetermined information can be obtained according to the shape. For example, the video decoding apparatus 100 may determine, using at least one of information related to the width and information related to the height of the current coding unit, a sample located on a boundary that divides at least one of the width and height of the current coding unit in half as a sample from which the predetermined information can be obtained. For another example, when the block shape information related to the current coding unit indicates that the current coding unit is non-square, the video decoding apparatus 100 may determine, as a sample from which the predetermined information can be obtained, one of the samples adjacent to a boundary that divides the long side of the current coding unit in half.

[0099] According to an embodiment, when the current coding unit is divided into a plurality of coding units, the video decoding apparatus 100 may use partition mode information to determine a coding unit at a predetermined position among the plurality of coding units. According to an embodiment, the video decoding apparatus 100 may acquire partition mode information from a sample at a predetermined position included in the coding unit, and may divide a plurality of coding units generated by dividing the current coding unit using partition mode information acquired from a sample at a predetermined position included in each of the plurality of coding units. That is, the coding units may be recursively divided using partition mode information acquired from a sample at a predetermined position included in each of the coding units. The recursive division process of the coding unit has been described with reference to FIG. 5, and therefore a detailed description thereof will not be repeated.

[0100] In one embodiment, the video decoding device 100 can divide the current coding unit and determine at least one coding unit, and can determine the order in which such at least one coding unit is decoded by a predetermined block (e.g., the current coding unit).

[0101] FIG. 7 illustrates an order in which multiple coding units are processed when the video decoding device 100 divides a current coding unit and determines multiple coding units, according to an embodiment.

[0102] According to one embodiment, the video decoding device 100 may, according to the partition mode information, partition the first coding unit 700 vertically to determine the second coding units 710a and 710b, partition the first coding unit 700 horizontally to determine the second coding units 730a and 730b, or partition the first coding unit 700 vertically and horizontally to determine the second coding units 750a, 750b, 750c, and 750d.

[0103] 7, the video decoding device 100 may determine an order such that second coding units 710a and 710b determined by dividing the first coding unit 700 in the vertical direction are processed in the horizontal direction 710c. The video decoding device 100 may determine a processing order of second coding units 730a and 730b determined by dividing the first coding unit 700 in the horizontal direction as the vertical direction 730c. The video decoding device 100 may determine second coding units 750a, 750b, 750c, and 750d determined by dividing the first coding unit 700 in the vertical and horizontal directions according to a predetermined order (e.g., a raster scan order or a z scan order 750e) in which a coding unit located in one row is processed and then a coding unit located in the next row is processed.

[0104] According to an embodiment, the video decoding apparatus 100 may recursively divide the coding units. Referring to FIG. 7, the video decoding apparatus 100 may divide the first coding unit 700 to determine a plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d, and may recursively divide each of the determined coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. A method of dividing the plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d corresponds to a method of dividing the first coding unit 700. Accordingly, the multiple coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d may be divided into multiple coding units independently. Referring to FIG 7, the video decoding apparatus 100 may divide the first coding unit 700 vertically to determine the second coding units 710a and 710b, and may further determine whether or not to divide each of the second coding units 710a and 710b independently.

[0105] According to one embodiment, the video decoding device 100 may horizontally divide the second coding unit 710a on the left side into third coding units 720a and 720b, while not dividing the second coding unit 710b on the right side.

[0106] According to an embodiment, the processing order of the coding units is also determined based on the division process of the coding units. In other words, the processing order of the divided coding units is also determined based on the processing order of the coding units immediately before the division. The video decoding apparatus 100 may determine the processing order of the third coding units 720a and 720b determined by dividing the second coding unit 710a on the left side, independently of the second coding unit 710b on the right side. Since the second coding unit 710a on the left side is divided in the horizontal direction and the third coding units 720a and 720b are determined, the third coding units 720a and 720b may be processed in the vertical direction 720c. In addition, since the processing order of the second coding unit 710a on the left side and the second coding unit 710b on the right side corresponds to the horizontal direction 710c, the third coding units 720a and 720b included in the second coding unit 710a on the left side may be processed in the vertical direction 720c, and then the right coding unit 710b may be processed. The above content is intended to explain the process in which the processing order of coding units is determined based on the coding units before they are divided, and should not be interpreted as being limited to the above embodiment, but rather should be interpreted as meaning that coding units determined by being divided into various forms are used in various ways in which they can be processed independently in a predetermined order.

[0107] FIG. 8 illustrates a process in which the video decoding apparatus 100 determines that a current coding unit is to be divided into an odd number of coding units when a predetermined ordered coding unit cannot be processed, according to an embodiment.

[0108] According to an embodiment, the video decoding device 100 may determine that the current coding unit is divided into an odd number of coding units based on the acquired division mode information. Referring to FIG. 8, a square-shaped first coding unit 800 may be divided into non-square-shaped second coding units 810a and 810b, and the second coding units 810a and 810b may be independently divided into third coding units 820a, 820b, 820c, 820d, and 820e. According to an embodiment, the video decoding device 100 may determine that the left coding unit 810a of the second coding unit is divided horizontally into a plurality of third coding units 820a and 820b, and the right coding unit 810b may be divided into an odd number of third coding units 820c, 820d, and 820e.

[0109] According to an embodiment, the video decoding device 100 may determine whether the third coding units 820a, 820b, 820c, 820d, and 820e can be processed in a predetermined order, and may determine whether there is an odd number of coding units. Referring to FIG. 8, the video decoding device 100 may recursively divide the first coding unit 800 to determine the third coding units 820a, 820b, 820c, 820d, and 820e. The video decoding device 100 may determine whether the first coding unit 800, the second coding unit 810a, 810b, or the third coding unit 820a, 820b, 820c, 820d, and 820e are divided into an odd number of coding units in a division form based on at least one of block form information and division form mode information. For example, in the second coding units 810a and 810b, the coding units located on the right side may be divided into an odd number of third coding units 820c, 820d, and 820e. The order in which the coding units included in the first coding unit 800 are processed may be a predetermined order (e.g., z scan order 830), and the video decoding apparatus 100 may determine whether the third coding units 820c, 820d, and 820e determined by dividing the right second coding unit 810b into an odd number of coding units satisfy a condition that they can be processed in the predetermined order.

[0110] According to an embodiment, the video decoding apparatus 100 may determine whether the third coding units 820a, 820b, 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition that they can be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the second coding units 810a and 810b is divided in half by the boundary of the third coding units 820a, 820b, 820c, 820d, and 820e. For example, the third coding units 820a and 820b determined by dividing the height of the non-square left second coding unit 810a in half may satisfy the condition. Since the boundaries of the third coding units 820c, 820d, and 820e determined by dividing the right second coding unit 810b into three coding units cannot divide the width or height of the right second coding unit 810b in half, it may be determined that the third coding units 820c, 820d, and 820e do not satisfy the condition. If such a condition is not satisfied, the video decoding device 100 may determine that there is a disconnection in the scanning order, and may determine that the right second coding unit 810b is to be divided into an odd number of coding units based on the determination result. According to an embodiment, the video decoding device 100 may set a predetermined restriction on a coding unit at a predetermined position among the divided coding units when the coding units are divided into an odd number of coding units, and the content of such a restriction or the predetermined position has been described through various embodiments, and detailed description thereof will be omitted.

[0111] FIG. 9 illustrates a process in which the video decoding device 100 divides a first coding unit 900 to determine at least one coding unit, according to an embodiment.

[0112] According to an embodiment, the video decoding apparatus 100 may divide the first coding unit 900 based on the partition mode information acquired via the bitstream acquiring unit 110. The square-shaped first coding unit 900 may be divided into four square-shaped coding units or into a plurality of non-square-shaped coding units. For example, referring to FIG. 9, if the first coding unit 900 is a square and the partition mode information indicates that the first coding unit 900 is to be divided into non-square coding units, the video decoding apparatus 100 may divide the first coding unit 900 into a plurality of non-square coding units. Specifically, when the division mode information indicates that the first coding unit 900 is to be divided horizontally or vertically to determine an odd number of coding units, the video decoding device 100 can divide the square-shaped first coding unit 900 into second coding units 910a, 910b, and 910c determined by dividing it vertically, or second coding units 920a, 920b, and 920c determined by dividing it horizontally, as an odd number of coding units.

[0113] According to an embodiment, the video decoding apparatus 100 may determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition that they can be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the first coding unit 900 is divided in half along the boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Referring to FIG. 9, since the boundary of the second coding units 910a, 910b, and 910c determined by dividing the square-shaped first coding unit 900 in the vertical direction does not divide the width of the first coding unit 900 in half, it may be determined that the first coding unit 900 does not satisfy the condition that they can be processed in a predetermined order. In addition, since the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in the horizontal direction do not divide the height of the first coding unit 900 in half, it may be determined that the first coding unit 900 does not satisfy the condition to be processed in a predetermined order. If such a condition is not satisfied, the video decoding device 100 may determine that there is a disconnection in the scanning order, and may determine that the first coding unit 900 is to be divided into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the video decoding device 100 may set a predetermined restriction on a coding unit at a predetermined position among the divided coding units, and the content of such a restriction or the predetermined position has been described through various embodiments, and detailed description thereof will be omitted.

[0114] According to an embodiment, the video decoding apparatus 100 may divide the first coding unit and determine various types of coding units.

[0115] 9, the video decoding apparatus 100 may divide a square-shaped first coding unit 900, a non-square-shaped first coding unit 930, or a non-square-shaped first coding unit 950 into various types of coding units.

[0116] FIG. 10 illustrates that, according to one embodiment, when a non-square second coding unit determined by a video decoding device 100 by dividing a first coding unit 1000 satisfies certain conditions, the manner in which the second coding unit may be divided is restricted.

[0117] According to an embodiment, the video decoding device 100 may determine to divide the square-shaped first coding unit 1000 into non-square-shaped second coding units 1010a, 1010b, 1020a, and 1020b based on the division mode information acquired via the bitstream acquiring unit 110. The second coding units 1010a, 1010b, 1020a, and 1020b may be divided independently. Thus, the video decoding device 100 may determine whether to divide the second coding units into a plurality of coding units or not to divide the coding units based on the division mode information related to each of the second coding units 1010a, 1010b, 1020a, and 1020b. According to an embodiment, the video decoding device 100 may determine the third coding units 1012a and 1012b by dividing the left non-square-shaped second coding unit 1010a, which is determined by dividing the first coding unit 1000 vertically, in the horizontal direction. However, when the left second coding unit 1010a is divided in the horizontal direction, the video decoding device 100 may restrict the right second coding unit 1010b so that it cannot be divided in the horizontal direction in the same direction as the left second coding unit 1010a is divided. If the right second coding unit 1010b is divided in the same direction and the third coding units 1014a and 1014b are determined, the left second coding unit 1010a and the right second coding unit 1010b may be divided independently in the horizontal direction to determine the third coding units 1012a, 1012b, 1014a, and 1014b. However, this is the same result as when the video decoding device 100 divides the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the division mode information, which is inefficient in terms of video decoding.

[0118] According to an embodiment, the video decoding device 100 may vertically divide the non-square second coding unit 1020a or 1020b, which is determined by dividing the first coding unit 1000 in the horizontal direction, to determine the third coding units 1022a, 1022b, 1024a, and 1024b. However, when the video decoding device 100 divides one of the second coding units (e.g., the top second coding unit 1020a) in the vertical direction, the video decoding device 100 may restrict the other second coding units (e.g., the bottom coding unit 1020b) from being divided vertically in the same direction as the top second coding unit 1020a, for the above-mentioned reasons.

[0119] FIG. 11 illustrates a process in which the video decoding apparatus 100 divides a square coding unit when the division mode information does not indicate division into four square coding units, according to an embodiment.

[0120] According to an embodiment, the video decoding device 100 may divide the first coding unit 1100 and determine the second coding units 1110a, 1110b, 1120a, and 1120b based on the division mode information. The division mode information may include information related to various types into which the coding unit may be divided, but the information related to the various types may not include information for dividing the coding unit into four square coding units. According to such division mode information, the video decoding device 100 may not divide the square first coding unit 1100 into four square second coding units 1130a, 1130b, 1130c, and 1130d. Based on the division mode information, the video decoding device 100 may determine the non-square second coding units 1110a, 1110b, 1120a, and 1120b.

[0121] According to an embodiment, the video decoding apparatus 100 may independently divide the non-square second coding units 1110a, 1110b, 1120a, and 1120b, respectively, by a recursive method, in which the second coding units 1110a, 1110b, 1120a, and 1120b are divided in a predetermined order, which is also a division method corresponding to the division method of the first coding unit 1100 according to the division mode information.

[0122] For example, the video decoding device 100 may divide the left second coding unit 1110a in the horizontal direction to determine square third coding units 1112a and 1112b, and may divide the right second coding unit 1110b in the horizontal direction to determine square third coding units 1114a and 1114b. Furthermore, the video decoding device 100 may divide both the left second coding unit 1110a and the right second coding unit 1110b in the horizontal direction to determine square third coding units 1116a, 1116b, 1116c, and 1116d. In this case, the coding units may be determined in the same form as when the first coding unit 1100 is divided into four square second coding units 1130a, 1130b, 1130c, and 1130d.

[0123] As another example, the video decoding device 100 may vertically divide the top second coding unit 1120a to determine square third coding units 1122a and 1122b, and may vertically divide the bottom second coding unit 1120b to determine square third coding units 1124a and 1124b. Furthermore, the video decoding device 100 may vertically divide both the top second coding unit 1120a and the bottom second coding unit 1120b to determine square third coding units 1126a, 1126b, 1126a, and 1126b. In this case, the coding units may be determined in the same form as when the first coding unit 1100 is divided into four square second coding units 1130a, 1130b, 1130c, and 1130d.

[0124] FIG. 12 illustrates that a processing order between multiple coding units may vary depending on a division process of the coding units, according to an embodiment.

[0125] According to an embodiment, the video decoding apparatus 100 may divide the first coding unit 1200 based on the partition mode information. When the block shape is a square and the partition mode information indicates that the first coding unit 1200 is partitioned in at least one of the horizontal and vertical directions, the video decoding apparatus 100 may divide the first coding unit 1200 to determine, for example, second coding units 1210a, 1210b, 1220a, and 1220b. Referring to FIG. 12, the non-square second coding units 1210a, 1210b, 1220a, and 1220b determined by partitioning the first coding unit 1200 only in the horizontal or vertical direction may be independently divided based on the partition mode information associated therewith. For example, the video decoding apparatus 100 may determine third coding units 1216a, 1216b, 1216c, and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 vertically, and may determine third coding units 1226a, 1226b, 1226c, and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 horizontally. The division process of the second coding units 1210a, 1210b, 1220a, and 1220b has been described with reference to FIG. 11, and a detailed description thereof will be omitted.

[0126] According to an embodiment, the video decoding device 100 may process the coding units in a predetermined order. The characteristics related to the processing of the coding units in a predetermined order have been described with reference to FIG. 7, and therefore detailed description thereof will be omitted. Referring to FIG. 12, the video decoding device 100 may divide the square-shaped first coding unit 1200 to determine four square-shaped third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d. According to an embodiment, the video decoding device 100 may determine a processing order of the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d according to the manner in which the first coding unit 1200 is divided.

[0127] According to one embodiment, the video decoding device 100 can horizontally divide the second coding units 1210a and 1210b generated by dividing them vertically to determine the third coding units 1216a, 1216b, 1216c, and 1216d, and the video decoding device 100 can process the third coding units 1216a, 1216b, 1216c, and 1216d in an order 1217 of first vertically processing the third coding units 1216a and 1216c included in the left second coding unit 1210a, and then vertically processing the third coding units 1216b and 1216d included in the right second coding unit 1210b.

[0128] According to one embodiment, the video decoding device 100 can vertically divide the second coding units 1220a and 1220b generated by dividing them horizontally to determine the third coding units 1226a, 1226b, 1226c, and 1226d, and the video decoding device 100 can process the third coding units 1226a, 1226b, 1226c, and 1226d in an order 1227 of first horizontally processing the third coding units 1226a and 1226b included in the upper second coding unit 1220a, and then horizontally processing the third coding units 1226c and 1226d included in the lower second coding unit 1220b.

[0129] 12, the second coding units 1210a, 1210b, 1220a, and 1220b are each divided to determine square-shaped third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d. The second coding units 1210a and 1210b determined by dividing in the vertical direction and the second coding units 1220a and 1220b determined by dividing in the horizontal direction are divided in different shapes, but the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d determined thereafter ultimately result in the first coding unit 1200 being divided into coding units of the same shape. As a result, the video decoding device 100 recursively divides the coding units through different processes based on the division mode information, and as a result, even if coding units of the same type are determined, the video decoding device 100 can perform different order processing on multiple coding units determined to be of the same type.

[0130] FIG. 13 illustrates a process of determining the depth of a coding unit according to one embodiment, when a coding unit is recursively divided to determine multiple coding units, as the shape and size of the coding unit change.

[0131] According to an embodiment, the video decoding apparatus 100 may determine the depth of the coding unit according to a predetermined criterion. For example, the predetermined criterion may be the length of the long side of the coding unit. The video decoding apparatus 100 may determine the depth of the coding unit according to a predetermined criterion. For example, the predetermined criterion may be the length of the long side of the current coding unit that is longer than the length of the long side of the coding unit before the division. n When the coding unit is divided by (n>0), it may be determined that the depth of the current coding unit is increased by n from the depth of the coding unit before the division. Hereinafter, the coding unit with the increased depth will be referred to as a coding unit of a lower depth.

[0132] 13, according to an embodiment, the video decoding apparatus 100 may divide the square-shaped first coding unit 1300 based on block shape information indicating a square shape (for example, the block shape information may indicate "0:SQUARE") to determine the second coding unit 1302, the third coding unit 1304, etc., of a lower depth. If the size of the square-shaped first coding unit 1300 is 2Nx2N, the second coding unit 1302 determined by dividing the width and height of the first coding unit 1300 by 1 / 2 may have a size of NxN. Furthermore, the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 by 1 / 2 may have a size of N / 2xN / 2. In this case, the width and height of the third coding unit 1304 correspond to 1 / 4 times that of the first coding unit 1300. If the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302, which is 1 / 2 the width and height of the first coding unit 1300, is also D+1, and the depth of the third coding unit 1304, which is 1 / 4 the width and height of the first coding unit 1300, is also D+2.

[0133] According to one embodiment, based on block shape information indicating a non-square shape (for example, the block shape information may indicate "1:NS_VER" indicating a non-square shape in which the height is greater than the width, or "2:NS_HOR" indicating a non-square shape in which the width is greater than the height), the video decoding device 100 may divide the first coding unit 1310 or 1320, which is non-square, and determine a second coding unit 1312 or 1322 and a third coding unit 1314 or 1324 of a lower depth.

[0134] The video decoding device 100 may divide at least one of the width and height of the first coding unit 1310 having a size of Nx2N to determine, for example, the second coding units 1302, 1312, and 1322. That is, the video decoding device 100 may divide the first coding unit 1310 in the horizontal direction to determine the second coding unit 1302 having a size of NxN or the second coding unit 1322 having a size of NxN / 2, or may divide the first coding unit 1310 in the horizontal and vertical directions to determine the second coding unit 1312 having a size of N / 2xN.

[0135] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the first coding unit 1320 having a size of 2NxN to determine, for example, the second coding units 1302, 1312, and 1322. That is, the video decoding device 100 may divide the first coding unit 1320 vertically to determine the second coding unit 1302 having a size of NxN or the second coding unit 1312 having a size of N / 2xN, and may divide the first coding unit 1320 horizontally and vertically to determine the second coding unit 1322 having a size of NxN / 2.

[0136] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the second coding unit 1302 having a size of NxN, to determine, for example, the third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1302 in the vertical and horizontal directions to determine the third coding unit 1304 having a size of N / 2xN / 2, the third coding unit 1314 having a size of N / 4xN / 2, or the third coding unit 1324 having a size of N / 2xN / 4.

[0137] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the second coding unit 1312 having a size of N / 2xN to determine, for example, the third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1312 in the horizontal direction to determine the third coding unit 1304 having a size of N / 2xN / 2 or the third coding unit 1324 having a size of N / 2xN / 4, or may divide the second coding unit 1312 in the vertical and horizontal directions to determine the third coding unit 1314 having a size of N / 4xN / 2.

[0138] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the second coding unit 1322 having a size of NxN / 2 to determine, for example, the third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1322 vertically to determine the third coding unit 1304 having a size of N / 2xN / 2 or the third coding unit 1314 having a size of N / 4xN / 2, or may divide the second coding unit 1322 vertically and horizontally to determine the third coding unit 1324 having a size of N / 2xN / 4.

[0139] According to an embodiment, the video decoding apparatus 100 may divide, for example, square-shaped coding units 1300, 1302, and 1304 in the horizontal or vertical direction. For example, the first coding unit 1300 having a size of 2Nx2N may be divided vertically to determine a first coding unit 1310 having a size of Nx2N, or may be divided horizontally to determine a first coding unit 1320 having a size of 2NxN. According to an embodiment, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by dividing the first coding unit 1300 having a size of 2Nx2N in the horizontal or vertical direction may be the same as the depth of the first coding unit 1300.

[0140] According to an embodiment, the width and height of the third coding unit 1314 or 1324 may be 1 / 4 times that of the first coding unit 1310 or 1320. When the depth of the first coding unit 1310 or 1320 is D, the depth of the second coding unit 1312 or 1322, which is 1 / 2 times the width and height of the first coding unit 1310 or 1320, is also D+1, and the depth of the third coding unit 1314 or 1324, which is 1 / 4 times the width and height of the first coding unit 1310 or 1320, is also D+2.

[0141] FIG. 14 illustrates a depth that may be determined according to the type and size of a coding unit, and an index (PID: part index) for coding unit partitions, according to one embodiment.

[0142] According to an embodiment, the video decoding device 100 may divide the square-shaped first coding unit 1400 to determine various types of second coding units. Referring to FIG 14, the video decoding device 100 may divide the first coding unit 1400 in at least one of a vertical direction and a horizontal direction according to the partition mode information to determine the second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d. That is, the video decoding device 100 may determine the second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d based on the partition mode information related to the first coding unit 1400.

[0143] According to an embodiment, the depths of the second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d determined by the partition mode information related to the square-shaped first coding unit 1400 may be determined based on the length of the long side. For example, since the length of one side of the square-shaped first coding unit 1400 is the same as the length of the long side of the non-square-shaped second coding units 1402a, 1402b, 1404a, and 1404b, the depths of the first coding unit 1400 and the non-square-shaped second coding units 1402a, 1402b, 1404a, and 1404b can be regarded as being the same as D. In contrast, when the video decoding device 100 divides the first coding unit 1400 into four square-shaped second coding units 1406a, 1406b, 1406c, and 1406d based on the division mode information, the length of one side of the square-shaped second coding units 1406a, 1406b, 1406c, and 1406d is 1 / 2 the length of one side of the first coding unit 1400, so the depth of the second coding units 1406a, 1406b, 1406c, and 1406d is also a depth of D+1, which is one depth lower than the depth D of the first coding unit 1400.

[0144] According to an embodiment, the video decoding device 100 may divide the first coding unit 1410, whose height is greater than its width, in the horizontal direction according to the partition mode information, and divide the first coding unit 1410 into a plurality of second coding units 1412a, 1412b, 1414a, 1414b, and 1414c. According to an embodiment, the video decoding device 100 may divide the first coding unit 1420, whose width is greater than its height, in the vertical direction according to the partition mode information, and divide the first coding unit 1420 into a plurality of second coding units 1422a, 1422b, 1424a, 1424b, and 1424c.

[0145] According to an embodiment, the depths of the second coding units 1412a, 1412b, 1414a, 1414b, 1414c, 1422a, 1422b, 1424a, 1424b, and 1424c determined by the partition mode information related to the non-square first coding unit 1410 or 1420 may be determined based on the length of the long side. For example, the length of one side of the square second coding units 1412a and 1412b is ½ times the length of one side of the non-square first coding unit 1410 whose height is greater than its width, so the depths of the square second coding units 1412a and 1412b are D+1, which is one depth lower than the depth D of the non-square first coding unit 1410.

[0146] Furthermore, the video decoding device 100 can divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the division mode information. The odd number of second coding units 1414a, 1414b, and 1414c can also include the non-square second coding units 1414a and 1414c and the square second coding unit 1414b. In this case, the length of the long side of the non-square second coding units 1414a and 1414c and the length of one side of the square second coding unit 1414b are 1 / 2 times the length of one side of the first coding unit 1410, so the depths of the second coding units 1414a, 1414b, and 1414c are also D+1, which is one depth lower than D, which is the depth of the first coding unit 1410. The video decoding device 100 may determine the depth of a coding unit associated with a non-square first coding unit 1420, whose width is greater than its height, in a manner corresponding to the above-mentioned manner for determining the depth of a coding unit associated with the first coding unit 1410.

[0147] According to an embodiment, the video decoding apparatus 100 may determine an index (PID) for partitioning the divided coding units based on a size ratio between the coding units when the coding units divided into an odd number of coding units are not the same size. Referring to FIG. 14, the coding unit 1414b located in the middle of the coding units 1414a, 1414b, and 1414c divided into an odd number of coding units has the same width as the other coding units 1414a and 1414c, but is twice as tall as the other coding units 1414a and 1414c. That is, the coding unit 1414b located in the middle in this case includes the other coding units 1414a and 1414c. Therefore, if the index (PID) of the coding unit 1414b located in the middle according to the scanning order is 1, the coding unit 1414c located next in the order has an index of 3, which is increased by 2. That is, discontinuity of index values ​​may exist. According to one embodiment, the video decoding device 100 can determine whether coding units divided into an odd number of parts are not the same size as each other based on whether there is a discontinuity in the index for partitioning between the coding units divided in this manner.

[0148] According to an embodiment, the video decoding apparatus 100 may determine whether the current coding unit is divided into a specific division type based on the value of an index for distinguishing the plurality of coding units determined by dividing the current coding unit. Referring to FIG. 14, the video decoding apparatus 100 may divide a first coding unit 1410 having a rectangular shape with a height greater than its width to determine an even number of coding units 1412a, 1412b or an odd number of coding units 1414a, 1414b, 1414c. The video decoding apparatus 100 may use an index (PID) indicating each coding unit to distinguish each of the plurality of coding units. According to an embodiment, the index (PID) may be obtained from a sample at a predetermined position (e.g., the top left sample) of each coding unit.

[0149] According to an embodiment, the video decoding apparatus 100 may determine a coding unit at a predetermined position among the coding units determined by dividing the coding units, using an index for dividing the coding units. According to an embodiment, when the division mode information related to the rectangular first coding unit 1410 whose height is greater than its width indicates that the first coding unit 1410 is divided into three coding units, the video decoding apparatus 100 may divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The video decoding apparatus 100 may assign an index related to each of the three coding units 1414a, 1414b, and 1414c. The video decoding apparatus 100 may compare the indexes related to each coding unit to determine a middle coding unit among the odd number of coding units. Based on the indexes of the coding units, the video decoding apparatus 100 may determine the coding unit 1414b having an index corresponding to a middle value among the indexes as a coding unit at a middle position among the coding units determined by dividing the first coding unit 1410. According to an embodiment, the video decoding apparatus 100 may determine an index for dividing the divided coding units based on a size ratio between the coding units when the coding units are not the same size. Referring to FIG. 14, a coding unit 1414b generated by dividing a first coding unit 1410 has the same width as other coding units 1414a and 1414c, but has a height twice as high as other coding units 1414a and 1414c. In this case, if the index (PID) of the middle coding unit 1414b is 1, the index of the next coding unit 1414c is 3, which is increased by 2.In such a case, when the indexes are uniformly increased but the increments are different, the video decoding device 100 may determine that the current coding unit is divided into a plurality of coding units including a coding unit having a different size from the other coding units. According to an embodiment, when the division mode information indicates that the current coding unit is divided into an odd number of coding units, the video decoding device 100 may divide the current coding unit into a form in which a coding unit at a predetermined position (e.g., a middle coding unit) among the odd number of coding units has a different size from the other coding units. In this case, the video decoding device 100 may determine the middle coding unit having a different size using an index (PID) related to the coding unit. However, the above index and the size or position of the coding unit at the predetermined position to be determined are specified for the purpose of explaining an embodiment, and should not be construed as being limited thereto, and various indexes, positions and sizes of coding units may be used.

[0150] According to one embodiment, the video decoding device 100 can use a predetermined data unit from which the recursive division of the coding unit begins.

[0151] FIG. 15 illustrates a number of coding units being determined according to a number of predetermined data units included in a picture, according to one embodiment.

[0152] According to an embodiment, the predetermined data unit is also defined as a data unit into which the coding unit starts to be recursively divided using the division mode information. That is, it may correspond to a coding unit of the highest depth used in the process of determining a plurality of coding units into which the current picture is divided. Hereinafter, for convenience of explanation, such a predetermined data unit will be referred to as a reference data unit.

[0153] According to one embodiment, the reference data unit may have a predetermined size and shape. According to one embodiment, the reference data unit may include MxN samples, where M and N may be equal to each other or may be integers expressed by a power of 2. That is, the reference data unit may have a square or non-square shape and may then be divided into an integer number of coding units.

[0154] According to an embodiment, the video decoding apparatus 100 may divide the current picture into a plurality of reference data units. According to an embodiment, the video decoding apparatus 100 may divide the reference data units into which the current picture is divided, using partition mode information associated with each of the reference data units. The division process of the reference data units may correspond to a division process using a quad-tree structure.

[0155] According to an embodiment, the video decoding apparatus 100 may determine in advance a minimum size that a reference data unit included in a current picture may have, and may determine reference data units of various sizes that are equal to or larger than the minimum size, and may determine at least one coding unit using partition mode information based on the determined reference data unit.

[0156] 15, the video decoding apparatus 100 may use a square-shaped reference coding unit 1500 or a non-square-shaped reference coding unit 1502. According to an embodiment, the shape and size of the reference coding unit may be determined according to various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, a maximum coding unit, etc.) that may include at least one reference coding unit.

[0157] According to an embodiment, the bitstream acquiring unit 110 of the video decoding device 100 may acquire at least one of information related to the type of the base coding unit and information related to the size of the base coding unit from the bitstream for each of the various data units. The process of determining at least one coding unit included in the square-shaped base coding unit 1500 has been described through the process of dividing the current coding unit 300 in Fig. 3, and the process of determining at least one coding unit included in the non-square-shaped base coding unit 1502 has been described through the process of dividing the current coding unit 400 or 450 in Fig. 4, so detailed description thereof will be omitted.

[0158] According to an embodiment, the video decoding apparatus 100 may use an index for identifying the size and type of the reference coding unit in order to determine the size and type of the reference coding unit according to a certain data unit that is determined in advance based on a predetermined condition. That is, the bitstream acquiring unit 110 may acquire only an index for identifying the size and type of the reference coding unit for each slice, slice segment, tile, tile group, and maximum coding unit as a data unit that satisfies a predetermined condition (e.g., a data unit having a size equal to or smaller than a slice) among the various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, and a maximum coding unit) from the bitstream. The video decoding apparatus 100 may determine the size and type of the reference data unit for each data unit that satisfies the predetermined condition by using the index. When the information on the type of the reference coding unit and the information on the size of the reference coding unit are obtained from a bitstream for each data unit of a relatively small size and used, the efficiency of use of the bitstream is not desirable, so instead of directly obtaining the information on the type of the reference coding unit and the information on the size of the reference coding unit, only the index can be obtained and used. In this case, at least one of the size and type of the reference coding unit corresponding to the index indicating the size and type of the reference coding unit is also determined in advance. That is, the video decoding device 100 can determine at least one of the size and type of the reference coding unit included in the data unit that is the basis for obtaining the index by selecting at least one of the size and type of the reference coding unit determined in advance according to the index.

[0159] According to an embodiment, the video decoding apparatus 100 may use at least one reference coding unit included in one maximum coding unit. That is, the maximum coding unit into which a video is divided includes at least one reference coding unit, and coding units may be determined through a recursive division process of each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit 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 is a size obtained by dividing the maximum coding unit n times according to a quad tree structure. That is, the video decoding apparatus 100 may determine the reference coding unit by dividing the maximum coding unit n times according to a quad tree structure, and may divide the reference coding unit based on at least one of block configuration information and partition configuration mode information according to various embodiments.

[0160] According to an embodiment, the video decoding apparatus 100 may acquire and use block type information indicating a type of a current coding unit or partition type mode information indicating a method of dividing the current coding unit from a bitstream. The partition type mode information may be included in a bitstream related to various data units. For example, the video decoding apparatus 100 may use partition type mode information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, or a tile group header. Furthermore, the video decoding apparatus 100 may acquire and use a syntax element corresponding to the block type information or the partition type mode information from a bitstream for each maximum coding unit or each reference coding unit.

[0161] A method for determining the division rule according to one embodiment of the present disclosure will now be described in detail.

[0162] The video decoding device 100 may determine a partitioning rule for a video. The partitioning rule may be determined in advance between the video decoding device 100 and the video encoding device 200. The video decoding device 100 may determine the partitioning rule for a video based on information acquired from a bitstream. The video decoding device 100 may determine the partitioning rule based on information acquired from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, and a tile group header. The video decoding device 100 may determine the partitioning rule to be different depending on a frame, a slice, a tile, a temporal layer, a maximum coding unit, or a coding unit.

[0163] The video decoding device 100 may determine the partitioning rule based on the block type of the coding unit. The block type may include the size, shape, width-to-height ratio, and direction of the coding unit. The video encoding device 200 and the video decoding device 100 may determine in advance to determine the partitioning rule based on the block type of the coding unit. However, the present invention is not limited thereto. The video decoding device 100 may determine the partitioning rule based on information acquired from a bitstream received from the video encoding device 200.

[0164] The shape of the coding unit may include a square and a non-square. If the width and height of the coding unit are the same, the video decoding device 100 may determine the shape of the coding unit to be a square. If the width and height of the coding unit are not the same, the video decoding device 100 may determine the shape of the coding unit to be a non-square.

[0165] The size of the coding unit may include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ..., 256x256. The size of the coding unit may also be classified according to the length of the long side, the length of the short side, or the width of the coding unit. The video decoding device 100 may apply the same division rule to the coding units classified into the same group. For example, the video decoding device 100 may classify the coding units having the same long side length into the same size. In addition, the video decoding device 100 may apply the same division rule to the coding units having the same long side length.

[0166] The ratio of the width to the height of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, or 1:32, etc. The direction of the coding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate that the width of the coding unit is greater than the height. The vertical direction may indicate that the width of the coding unit is smaller than the height.

[0167] The video decoding device 100 may adaptively determine a partitioning rule based on the size of the coding unit. The video decoding device 100 may determine an allowable partitioning mode differently based on the size of the coding unit. For example, the video decoding device 100 may determine whether partitioning is allowed based on the size of the coding unit. The video decoding device 100 may determine a partitioning direction according to the size of the coding unit. The video decoding device 100 may determine an allowable partitioning type according to the size of the coding unit.

[0168] Determining the partitioning rule based on the size of the coding unit is also a partitioning rule determined in advance between the video encoding device 200 and the video decoding device 100. In addition, the video decoding device 100 can determine the partitioning rule based on information obtained from a bitstream.

[0169] The video decoding device 100 can adaptively determine the partitioning rule based on the position of the coding unit. The video decoding device 100 can adaptively determine the partitioning rule based on the position that the coding unit occupies in the video.

[0170] Furthermore, the video decoding device 100 may determine a division rule such that coding units generated by different division paths do not have the same block type. However, the present invention is not limited thereto, and coding units generated by different division paths may have the same block type. Coding units generated by different division paths may have different decoding process orders. The decoding process order has been described with reference to FIG. 12, and therefore will not be described in detail.

[0171] FIG. 16 illustrates coding units that may be determined for each picture when the combinations of ways in which the coding units may be divided vary from picture to picture, according to an embodiment.

[0172] Referring to FIG. 16, the video decoding apparatus 100 may determine different combinations of partition patterns into which the coding units may be divided for each picture. For example, the video decoding apparatus 100 may decode a video by using a picture 1600 that may be divided into four coding units, a picture 1610 that may be divided into two or four coding units, and a picture 1620 that may be divided into two, three, or four coding units in at least one picture included in the video. The video decoding apparatus 100 may use only the partition pattern information indicating that the picture 1600 is divided into four square coding units to divide the picture 1600 into a plurality of coding units. The video decoding apparatus 100 may use only the partition pattern information indicating that the picture 1610 is divided into two or four coding units to divide the picture 1610. The video decoding apparatus 100 may use only the partition pattern information indicating that the picture 1620 is divided into two, three, or four coding units to divide the picture 1620. The above-mentioned combinations of partition forms are merely embodiments for explaining the operation of video decoding device 100, and therefore the described combinations of partition forms should not be interpreted as being limited to the above-mentioned embodiments, but rather should be interpreted as various combinations of partition forms being available for each given data unit.

[0173] According to an embodiment, the bitstream acquisition unit 110 of the video decoding device 100 may acquire a bitstream including an index indicating a combination of partition type information for each predetermined data unit (e.g., a sequence, a picture, a slice, a slice segment, a tile, or a tile group, etc.). For example, the bitstream acquisition unit 110 may acquire an index indicating a combination of partition type information from a sequence parameter set, a picture parameter set, a slice header, or a tile header (or a tile group header). The video decoding device 100 of the video decoding device 100 may determine a combination of partition types into which a coding unit may be divided for each predetermined data unit using the acquired index, and may thereby use a combination of partition types different from each other for each predetermined data unit.

[0174] FIG. 17 illustrates various types of coding units that are determined based on partition mode information that may be expressed by a binary code, according to an embodiment.

[0175] According to an embodiment, the video decoding apparatus 100 may divide a coding unit into various types using block type information and partition type mode information acquired via the bitstream acquiring unit 110. The types of the coding unit that may be divided may correspond to various types including the types described in the above embodiments.

[0176] Referring to FIG. 17, the video decoding device 100 can divide a square-shaped coding unit in at least one of the horizontal and vertical directions based on the division mode information, and can divide a non-square-shaped coding unit in the horizontal or vertical direction.

[0177] According to an embodiment, when the video decoding device 100 can divide a square coding unit in the horizontal and vertical directions and divide the coding unit into four square coding units, the division mode information for the square coding unit may indicate four types of division modes. According to an embodiment, the division mode information may be expressed as a two-digit binary code, and a binary code may be assigned to each division mode. For example, when a coding unit is not divided, the division mode information may be expressed as (00)b, when the coding unit is divided in the horizontal and vertical directions, the division mode information may be expressed as (01)b, when the coding unit is divided in the horizontal direction, the division mode information may be expressed as (10)b, and when the coding unit is divided in the vertical direction, the division mode information may be expressed as (11)b.

[0178] According to an embodiment, when the video decoding apparatus 100 divides a non-square coding unit in the horizontal or vertical direction, the type of division form indicated by the division form mode information is determined depending on how many coding units are divided. Referring to FIG. 17, according to an embodiment, the video decoding apparatus 100 may divide a non-square coding unit into up to three coding units. The video decoding apparatus 100 may divide a coding unit into two coding units, in which case, the division form mode information may be expressed as (10)b. The video decoding apparatus 100 may divide a coding unit into three coding units, in which case, the division form mode information may be expressed as (11)b. The video decoding apparatus 100 may determine not to divide a coding unit, in which case, the division form mode information may be expressed as (0)b. That is, the video decoding apparatus 100 may use variable length coding (VLC) instead of fixed length coding (FLC) to use a binary code indicating the division form mode information.

[0179] According to an embodiment, referring to FIG. 17, the binary code of the partition mode information indicating that the coding unit is not divided may be expressed as (0)b. If the binary code of the partition mode information indicating that the coding unit is not divided is set to (00)b, the binary code of the 2-bit partition mode information must be used even if there is no partition mode information set to (01)b. However, as shown in FIG. 17, when three types of partition modes related to a non-square coding unit are used, the video decoding apparatus 100 can determine that the coding unit is not divided even if the 1-bit binary code (0)b is used as the partition mode information, and therefore, the bitstream can be efficiently used. However, the partition mode of the non-square coding unit indicated by the partition mode information should not be interpreted as being limited to the three types shown in FIG. 17, but should be interpreted as being various types including the above-mentioned embodiment.

[0180] FIG. 18 illustrates another form of a coding unit that is also determined based on partition mode information that may be represented by a binary code, according to one embodiment.

[0181] Referring to FIG. 18, the video decoding apparatus 100 may divide a square coding unit in the horizontal or vertical direction and may divide a non-square coding unit in the horizontal or vertical direction based on the partition mode information. That is, the partition mode information may indicate that a square coding unit is divided in one direction. In such a case, the binary code of the partition mode information indicating that the square coding unit is not divided may also be expressed as (0)b. If the binary code of the partition mode information indicating that the coding unit is not divided is set to (00)b, the binary code of the 2-bit partition mode information must be used even if there is no partition mode information set to (01)b. However, as shown in FIG. 18, in the case where three types of partition modes related to a square coding unit are used, the video decoding apparatus 100 may determine that the coding unit is not divided even if the 1-bit binary code (0)b is used as the partition mode information, and therefore the bitstream may be efficiently used. However, the division form of the square-shaped coding unit indicated by the division form mode information should not be interpreted as being limited to the three forms shown in FIG. 18, but should be interpreted as being in various forms including the above-mentioned embodiments.

[0182] According to an embodiment, the block configuration information or partition mode information may be expressed using a binary code, and such information may also be directly generated in the bitstream. Also, the block configuration information or partition mode information that may be expressed using a binary code may not be directly generated in the bitstream, but may be used as a binary code input in CABAC (context adaptive binary arithmetic coding).

[0183] According to an embodiment, the video decoding apparatus 100 may obtain a syntax related to block shape information or partition shape mode information through CABAC. A bitstream including a binary code related to the syntax may be obtained through the bitstream obtaining unit 110. The video decoding apparatus 100 may detect a syntax element indicating block shape information or partition shape mode information by debinarizing a bin string included in the obtained bitstream. According to an embodiment, the video decoding apparatus 100 may obtain a set of binary bin strings corresponding to a syntax element to be decoded and decode each bin using probability information, and may repeat the process until a bin string formed by the decoded bins is the same as one of the previously obtained bin strings. The video decoding apparatus 100 may determine a syntax element by debinarizing the bin string.

[0184] According to an embodiment, the video decoding apparatus 100 may determine a syntax related to a bin string by performing a decoding process of adaptive binary arithmetic coding, and may update a probability model related to the acquired bins via the bitstream acquisition unit 110. Referring to FIG. 17, the bitstream acquisition unit 110 of the video decoding apparatus 100 may acquire a bitstream indicating a binary code indicating partition mode information according to an embodiment. The video decoding apparatus 100 may determine a syntax related to the partition mode information using the acquired binary code having a size of 1 bit or 2 bits. The video decoding apparatus 100 may update a probability related to each bit in the 2-bit binary code to determine a syntax related to the partition mode information. That is, the video decoding apparatus 100 may update a probability of having a value of 0 or 1 when decoding a next bin depending on whether the value of the first bin is a value of 0 or 1 in the 2-bit binary code.

[0185] According to one embodiment, in the process of determining a syntax, the video decoding device 100 may update the probabilities associated with the bins used in the process of decoding the bins of a bin string associated with the syntax, and the video decoding device 100 may determine that a particular bit in the bin string has the same probability without updating the probability.

[0186] 17, in the process of determining a syntax using a bin string indicating partition mode information related to a non-square coding unit, the video decoding apparatus 100 may determine a syntax related to the partition mode information using one bin having a value of 0 when the non-square coding unit is not partitioned. That is, when the block topology information indicates that the current coding unit is non-square, the first bin of the bin string related to the partition mode information is 0 when the non-square coding unit is not partitioned, and is 1 when the non-square coding unit is partitioned into two or three coding units. Thus, the probability that the first bin of the bin string of the partition mode information related to the non-square coding unit is 0 is 1 / 3, and the probability that it is 1 is 2 / 3. As described above, since the partition mode information indicating that a non-square coding unit is not partitioned can be expressed only as a 1-bit bin string having a value of 0, the video decoding device 100 can determine whether the second bin is 0 or 1 only when the first bin of the partition mode information is 1, and can determine the syntax related to the partition mode information. According to an embodiment, when the first bin related to the partition mode information is 1, the video decoding device 100 can decode the bins by considering that the probability that the second bin is 0 or 1 is the same as each other.

[0187] According to an embodiment, the video decoding device 100 may use various probabilities associated with each bin in a process of determining bins of a bin string related to the partition mode information. According to an embodiment, the video decoding device 100 may determine the probabilities of bins related to the partition mode information differently along the direction of a non-square block. According to an embodiment, the video decoding device 100 may determine the probabilities of bins related to the partition mode information differently depending on the width or the length of a long side of a current coding unit. According to an embodiment, the video decoding device 100 may determine the probabilities of bins related to the partition mode information differently depending on at least one of the shape of the current coding unit and the length of a long side.

[0188] According to an embodiment, the video decoding apparatus 100 may determine that the probability of bins related to the partition mode information is the same for coding units having a predetermined size or more. For example, based on the length of the long side of the coding unit, the video decoding apparatus 100 may determine that the probability of bins related to the partition mode information is the same for coding units having a size of 64 samples or more.

[0189] According to an embodiment, the video decoding apparatus 100 also determines the initial probabilities associated with the bins constituting the bin string of the partition mode information based on the slice type (eg, I slice, P slice, or B slice).

[0190] FIG. 19 is a block diagram of a video encoding system and a video decoding system.

[0191] An encoder 1910 of the video encoding and decoding system 1900 transmits an encoded bitstream of video, and a decoder 1950 receives and decodes the bitstream to output a restored video. Here, the decoder 1950 has a similar configuration to the video decoding device 100.

[0192] In the encoder 1910, the inter prediction encoding unit 1905 generates motion information of a current block indicating a reference block of a reference picture temporally adjacent to the current picture when the prediction mode of the current block is the inter prediction mode. The inter prediction encoding unit 1905 may determine a prediction sample of the current block using a sample of the reference block. The intra prediction encoding unit 1910 may determine intra prediction information indicating a direction in which an adjacent sample similar to the current block is located or a manner of determining a prediction sample, so as to determine a prediction sample of the current block using adjacent samples spatially adjacent to the current block.

[0193] The inter-prediction coding unit 1905 can determine a reference sample to be used for prediction of a current block from among previously reconstructed samples stored in a DPB (Decoded Picture Buffer) 1948.

[0194] The transform unit 1920 performs transform on residual sample values ​​obtained by removing predicted samples generated by the inter prediction encoding unit 1905 or the intra prediction encoding unit 1910 from original samples of the current block, and outputs transform coefficients. The quantization unit 1925 quantizes the transform coefficients output from the transform unit 1920, and outputs quantized transform coefficients. The entropy encoding unit 1930 may encode the quantized transform coefficients into residual syntax elements including level values, and output the encoded residual syntax elements in the form of a bitstream.

[0195] The quantized transform coefficients output from the quantization unit 1925 may be inverse quantized and inverse transformed via the inverse quantization unit 1933 and the inverse transform unit 1935 to further generate residual sample values.

[0196] The adder 1915 adds the residual sample value and the predicted sample value to output a reconstructed sample value. The post-reconstruction filtering unit 1940 performs post-reconstruction filtering on the reconstructed sample, and the reconstructed sample value updated through the post-reconstruction filtering may be used as a reference sample value for intra prediction also performed in the intra prediction unit 1910. The post-reconstruction filtering unit 1940 may perform Hadamard transform domain filtering or bilateral filtering on the reconstructed sample value.

[0197] The in-loop filtering unit 1945 may perform at least one of deblocking filtering and adaptive loop filtering on the reconstructed samples updated through the post-reconstruction filtering. The reconstructed sample values ​​updated through the filtering of the in-loop filtering unit 1945 may also be stored in the DPB 1948 and used as reference sample values ​​for inter prediction performed by the inter prediction unit 1905.

[0198] The entropy decoding unit 1955 of the decoder 1950 can perform entropy decoding on the received bitstream and parse the residual syntax elements including the level values. The quantized transform coefficients can be restored from the residual syntax elements. The inverse quantization unit 1960 can perform inverse quantization on the quantized transform coefficients and output the transform coefficients, and the inverse transform unit 1965 can perform inverse transform on the transform coefficients and output the residual sample values.

[0199] The inter-prediction coding unit 1970 of the decoder 1950 may determine a reference picture that is temporally adjacent to the current picture and determine a reference block in the reference picture using the motion information of the current block parsed by the entropy decoding unit 1955. The inter-prediction coding unit 1970 may determine a prediction sample of the current block using a sample of the reference block. The intra-prediction coding unit 1975 of the decoder 1950 may use the motion information of the current block parsed by the entropy decoding unit 1955, determine a reference sample that is spatially adjacent to the current block using intra-prediction information, and determine a prediction sample of the current block using the determined adjacent sample.

[0200] The inter-prediction coding unit 1970 can determine a reference sample to be used for prediction of a current block from among previously reconstructed samples stored in a DPB (Decoded Picture Buffer) 1990.

[0201] The adder 1995 of the decoder 1950 adds the residual sample value and the predicted sample value to output a reconstructed sample value of the current block. The post-reconstruction filtering unit 1980 of the decoder 1950 may perform Hadamard transform domain filtering or bilateral filtering on the reconstructed sample value. The reconstructed sample value updated through the filtering of the post-reconstruction filtering unit 1980 may be used as a reference sample value for intra prediction performed by the intra prediction unit 1975.

[0202] The in-loop filtering unit 1985 of the decoder 1950 may perform at least one of deblocking filtering and adaptive loop filtering using the reconstructed samples updated through post-reconstruction filtering. The reconstructed sample values ​​updated through filtering by the in-loop filtering unit 1985 may be stored in the DPB 1990 and used as reference sample values ​​for inter prediction performed by the inter prediction unit 1970.

[0203] The above-described various embodiments have described operations related to a video decoding method performed by the video decoding device 100. Hereinafter, operations of the video encoding device 200 that performs a video encoding method corresponding to a reverse process of the video decoding method will be described through various embodiments.

[0204] FIG. 2 illustrates a block diagram of a video encoding device 200 capable of encoding video based on at least one of block configuration information and partition configuration mode information, according to one embodiment.

[0205] The video encoding device 200 also includes an encoding unit 220 and a bitstream generating unit 210. The encoding unit 220 may receive an input image and encode the input image. The encoding unit 220 may encode the input image and obtain at least one syntax element. The syntax element may include at least one of a skip flag, a prediction mode, a motion vector difference, a motion vector prediction method (or index), a transform quantized coefficient, a coded block pattern, a coded block flag, an intra prediction mode, a direct flag, a merge flag, a delta QP, a reference index, a prediction direction, and a transform index. The encoding unit 220 may determine a context model based on block shape information including at least one of a shape, a direction, a ratio of a width to a height, and a size of a coding unit.

[0206] The bitstream generator 210 may generate a bitstream based on the encoded input video. For example, the bitstream generator 210 may generate a bitstream by entropy encoding syntax elements based on a context model. The video encoding device 200 may also transmit the bitstream to the video decoding device 100.

[0207] According to an embodiment, the encoding unit 220 of the video encoding device 200 may determine a shape of the coding unit. For example, the coding unit may have a square or non-square shape, and information indicating such a shape may be included in the block shape information.

[0208] According to an embodiment, the encoding unit 220 may determine what form the coding unit is to be divided into. The encoding unit 220 may determine the form of at least one coding unit included in the coding unit, and the bitstream generating unit 210 may generate a bitstream including division form mode information including information related to the form of the coding unit.

[0209] According to an embodiment, the encoding unit 220 may determine whether the coding unit is divided or not divided. If the encoding unit 220 determines that the coding unit includes only one coding unit or that the coding unit is not divided, the bitstream generation unit 210 may generate a bitstream including division mode information indicating that the coding unit is not divided. Alternatively, the encoding unit 220 may divide the coding unit into a plurality of coding units included therein, and the bitstream generation unit 210 may generate a bitstream including division mode information indicating that the coding unit is divided into a plurality of coding units.

[0210] According to an embodiment, the division mode information may include information indicating how many coding units a coding unit is divided into or in which direction the coding unit is divided, for example, the division mode information may indicate division in at least one of the vertical direction and the horizontal direction, or may indicate no division.

[0211] The video encoding device 200 determines information related to a partition mode based on a partition mode of a coding unit. The video encoding device 200 determines a context model based on at least one of a shape, a direction, a width-height ratio, and a size of the coding unit. Then, the video encoding device 200 generates information related to a partition mode for partitioning the coding unit in a bitstream based on the context model.

[0212] In order to determine a context model, the video encoding apparatus 200 may obtain an array for associating at least one of a shape, a direction, a width-to-height ratio, and a size of a coding unit with an index related to the context model. The video encoding apparatus 200 may obtain an index related to the context model based on at least one of a shape, a direction, a width-to-height ratio, and a size of a coding unit in the array. The video encoding apparatus 200 may determine the context model based on the index related to the context model.

[0213] In order to determine the context model, the video encoding device 200 may determine the context model further based on block shape information including at least one of a shape, a direction, a width-height ratio, and a size of a neighboring coding unit adjacent to the coding unit, and the neighboring coding unit may include at least one of a coding unit located on the lower left side, the left side, the upper left side, the upper side, the upper right side, the right side, or the lower right side of the coding unit.

[0214] In addition, the video encoding device 200 may compare the width of the upper neighboring coding unit with the width of the coding unit to determine the context model. In addition, the video encoding device 200 may compare the height of the left and right neighboring coding units with the height of the coding unit. In addition, the video encoding device 200 may determine the context model based on the comparison result.

[0215] The operation of the video encoding device 200 includes contents similar to those of the video decoding device 100 described with reference to FIGS. 3 to 19, and therefore a detailed description thereof will be omitted.

[0216] FIG. 20 is a block diagram illustrating a configuration of a video decoding device 2000 according to one embodiment.

[0217] 20, a video decoding apparatus 2000 includes a bitstream obtaining unit 2010 and a prediction decoding unit 2030. The prediction decoding unit 2030 includes a motion vector predicting unit 2032 and a motion vector restoring unit 2034.

[0218] 20 may correspond to the bitstream obtaining unit 110 shown in FIG. 1, and the predictive decoding unit 2030 may correspond to the decoding unit 120 shown in FIG.

[0219] According to an embodiment, the bitstream obtaining unit 2010 and the predictive decoding unit 2030 may be implemented as at least one processor. The video decoding device 2000 may also include one or more memories (not shown) for storing input / output data of the bitstream obtaining unit 2010 and the predictive decoding unit 2030. The video decoding device 2000 may also include a memory control unit (not shown) for controlling data input / output of the memory (not shown).

[0220] The bitstream obtaining unit 2010 obtains a bitstream generated as a result of encoding an image. The bitstream obtaining unit 2010 obtains syntax elements for image decoding from the bitstream. Binary values ​​corresponding to the syntax elements are also included in the bitstream according to a hierarchical structure of an image. The bitstream obtaining unit 2010 can obtain the syntax elements by entropy decoding the binary values ​​included in the bitstream.

[0221] The bitstream may also include information related to a prediction mode of a current block in a current image. The current block may refer to a maximum coding unit, a coding unit, or a block of a transform unit divided from a current image to be decoded.

[0222] The prediction mode of the current block may include an intra prediction mode or an inter prediction mode. As described above, the inter prediction mode is a mode in which the current block is restored from a reference block indicated by a motion vector of the current block in a reference image.

[0223] The prediction decoding unit 2030 may reconstruct the current block using intra prediction or inter prediction depending on the prediction mode of the current block.

[0224] In the inter prediction mode, motion information may be used to reconstruct the current block. The motion information of the current block may include a prediction direction, a reference image index, and a motion vector of the current block. The prediction direction, the reference image index, and the motion vector of the current block may also be identified from information included in the bitstream.

[0225] The prediction direction of the current block is any one of list 0 direction, list 1 direction, and bidirectional. The prediction direction being list 0 direction means that a picture included in reference picture list 0 is used as a reference picture in the list 0 direction, and the prediction direction being list 1 direction means that a picture included in reference picture list 1 is used as a reference picture in the list 1 direction. In addition, the prediction direction being bidirectional means that a picture included in reference picture list 0 is used as a reference picture in the list 0 direction, and a picture included in reference picture list 1 is used as a reference picture in the list 1 direction.

[0226] The reference picture index indicates a picture used as a reference picture of a block among pictures included in reference picture list 0 and / or reference picture list 1. The reference picture index in the list 0 direction identifies a picture used as a reference picture in the list 0 direction among pictures included in reference picture list 0. Also, the reference picture index in the list 1 direction identifies a picture used as a reference picture in the list 1 direction among pictures included in reference picture list 1.

[0227] The motion vector specifies the position of a reference block in a reference picture. The motion vector in the list 0 direction means a motion vector indicating a reference block in a reference picture in the list 0 direction, and the motion vector in the list 1 direction means a motion vector indicating a reference block in a reference picture in the list 1 direction.

[0228] If the prediction direction of the current block is the list 0 direction, the motion information of the current block includes at least one of information that the prediction direction of the current block is the list 0 direction, a reference video index in the list 0 direction, and a motion vector in the list 0 direction. If the current block is the list 1 direction, the motion information of the current block includes at least one of information that the prediction direction of the current block is the list 1 direction, a reference video index in the list 1 direction, and a motion vector in the list 1 direction. If the current block is bidirectional, the motion information of the current block includes at least one of information that the prediction direction of the current block is bidirectional, a reference video index in the list 0 direction, a reference video index in the list 1 direction, a motion vector in the list 0 direction, and a motion vector in the list 1 direction.

[0229] In one embodiment, when the prediction mode of the current block is an inter prediction mode, the bitstream acquisition unit 2010 may acquire information indicating a prediction direction of the current block and a reference image index of the current block from the bitstream. The prediction decoding unit 2030 may acquire a differential motion vector of the current block from information included in the bitstream, and may acquire a motion vector of the current block by combining the predicted motion vector of the current block and the differential motion vector.

[0230] The prediction decoding unit 2030 may reconstruct the current block based on the prediction direction, the reference image index, and the motion vector of the current block.

[0231] The method in which the predictive decoding unit 2030 obtains the predicted motion vector of the current block will be described in detail below.

[0232] According to an embodiment, the motion vector prediction unit 2032 may obtain a predicted motion vector by using a motion vector of a neighboring block adjacent to the current block, where the neighboring block is a block at a predetermined position used to obtain a predicted motion vector of the current block and is included in the current image together with the current block.

[0233] The peripheral blocks also include A0 block, A1 block, B0 block, B1 block and B2 block at predetermined positions.

[0234] The motion vector prediction unit 2032 can identify the locations of the A0, A1, B0, B1, and B2 blocks based on the information indicating the availability of blocks to the left and right of the current block.

[0235] In a typical video codec, decoding of an image is performed in a raster scan direction, in which case the block to the left of the current block has been decoded before the current block and is available, while the block to the right of the current block has not been decoded and is not available.

[0236] In the present disclosure, the decoding direction of blocks divided from an image can be adaptively determined. That is, instead of collectively decoding blocks divided from the image along a raster scan direction, some blocks can be decoded from the right direction to the left direction to improve coding efficiency. Thus, the right block of the current block can be used and the left block of the current block cannot be used, or both the right block and the left block of the current block can be used.

[0237] Whether the left and right blocks are available is determined in the same manner as the determination of the availability of the first peripheral block, which will be described later.

[0238] The location of the neighboring blocks, which varies depending on the availability of the left and right blocks of the current block, will now be described with reference to FIGS. 21A to 21C.

[0239] FIG. 21A is an example drawing illustrating the positions of the neighboring blocks when the block to the left of the current block 2100 is available.

[0240] The positions of the surrounding blocks when the left block of the current block 2100 is available are also identical to the positions of the spatial surrounding blocks specified in the HEVC standard.

[0241] 21A, the neighboring blocks may include a left lower corner block A0, a left lower block A1, a right upper corner block B0, a right upper block B1, and a left upper corner block B2 of a current block 2100. As shown in FIG 21A, the left lower block A1 may be located above the left lower corner block A0, and the right upper block B1 may be located to the left of the right upper corner block B0.

[0242] FIG. 21B is an example diagram illustrating the locations of neighboring blocks when the blocks to the left and right of a current block 2100 are available.

[0243] 21B, the neighboring blocks may include an upper right corner block A0, a lower left block A1, an upper left block B0, a lower right block B1, and an upper left corner block B2 of the current block 2100. As shown in FIG 21B, the upper left corner block B2 may be located to the left of the upper left block B0.

[0244] FIG. 21C is a diagram illustrating the positions of the neighboring blocks when the block to the right of the current block 2100 is available.

[0245] 21C, the neighboring blocks may include a right lower corner block A0, a right lower block A1, a left upper corner block B0, a left upper block B1, and a right upper corner block B2 of the current block 2100. As shown in FIG 21C, the right lower block A1 may be located above the right lower corner block A0, and the left upper block B1 may be located to the right of the left upper corner block B0.

[0246] The positions of the peripheral blocks shown in FIGS. 21A to 21C are merely examples, and the positions and number of the peripheral blocks may be variously changed depending on the implementation.

[0247] The motion vector prediction unit 2032 determines the availability of the left and right blocks of the current block, and can identify the positions of the neighboring blocks to be used to obtain the predicted motion vector of the current block from information indicating the availability of the left and right blocks.

[0248] In one embodiment, the motion vector prediction unit 2032 selects a first peripheral block from the peripheral blocks based on information acquired from the bitstream, where the first peripheral block is any one of the A0, A1, B0, B1, and B2 blocks corresponding to the peripheral blocks.

[0249] In one embodiment, the information obtained from the bitstream is also information indicating a motion vector resolution of the current block. The motion vector prediction unit 2032 may check the motion vector resolution of the current block from among a plurality of pre-determined motion vector resolutions according to the information obtained from the bitstream, and may select a first neighboring block for obtaining a predicted motion vector.

[0250] The motion vector resolution may mean the accuracy of a pixel position that a motion vector determined through inter prediction can indicate among pixels included in a reference image (or an interpolated reference image). The motion vector resolution having N pixel units (N is a rational number) means that a motion vector can have an accuracy of N pixel units. For example, a motion vector resolution of 1 / 4 pixel units may mean that a motion vector may indicate a pixel of 1 / 4 pixel units (i.e., sub-pixel units) in an interpolated reference image, and a motion vector resolution of 1 pixel unit may mean that a motion vector may indicate a pixel corresponding to 1 pixel unit (i.e., integer pixel unit) in an interpolated reference image. Among various motion vector resolutions, a motion vector resolution capable of expressing a motion vector of a current block with a small number of bits may be adaptively determined.

[0251] In one embodiment, the information indicating the motion vector resolution obtained from the bitstream may indicate any one of various motion vector resolutions, and may also indicate any one of the first peripheral blocks at different positions.

[0252] FIG. 22 is a diagram illustrating a mapping relationship between an index indicating a motion vector resolution, the motion vector resolution, and the position of a neighboring block.

[0253] 22, it can be seen that the motion vector resolution and the neighboring block corresponding to the first neighboring block can be determined according to the value of the index (AMVR index). For example, if the index (AMVR index) is 0, the motion vector resolution of the current block can be selected to be 1 / 4 pixel unit (pel) and the first neighboring block can be selected to be the A1 block. Also, if the index (AMVR index) is 1, the motion vector resolution of the current block can be selected to be 1 / 2 pixel unit (pel) and the first neighboring block can be selected to be the B1 block.

[0254] In the existing HEVC standard, various neighboring blocks are included in a candidate list, and the motion vector of a neighboring block in the candidate list selected from information signaled through a bitstream is used as a predicted motion vector. However, in the present disclosure, the first neighboring block used to obtain the predicted motion vector of the current block may be specified by information obtained from the bitstream, i.e., information indicating the motion vector resolution of the current block. Therefore, separate information indicating any one of the neighboring blocks included in the candidate list (e.g., mvp_l0_flag, mvp_l1_flag in HEVC) is not included in the bitstream.

[0255] The motion vector prediction unit 2032 determines the availability of the first peripheral block selected according to the information indicating the motion vector resolution. Specifically, the motion vector prediction unit 2032 determines the availability of the first peripheral block according to at least one of whether a tile including the first peripheral block is different from a tile including a current block, whether the first peripheral block is located outside the current image, whether the first peripheral block is intra-predicted, and whether the reconstruction of the first peripheral block is completed.

[0256] For example, the motion vector prediction unit 2032 may determine that the first neighboring block is not available if any one of the following four conditions is satisfied:

[0257] (Condition 1) The tile including the first peripheral block and the tile including the current block are different from each other.

[0258] (Condition 2) The first surrounding block is located outside the current image.

[0259] (Condition 3) The first peripheral block is not restored.

[0260] (Condition 4) The first surrounding block is coded in an intra prediction mode or an Intra Block Copy (IBC) mode.

[0261] In the IBC mode, a prediction block corresponding to a current block is searched for in a current image. The prediction block can also be obtained through motion estimation for the current image. For example, a prediction block can be searched for in an integer pixel unit in the current image, and the positional relationship between the current block and the searched prediction block can be signaled to the decoder.

[0262] In one embodiment, the motion vector prediction unit 2032 may determine that the motion vector of the first peripheral block is usable as a predicted motion vector if the first peripheral block is identified as usable from the information indicating the availability of the first peripheral block and the reference image index of the first peripheral block having the same prediction direction as the prediction direction of the current block is not equal to a predetermined value (e.g., −1). If the motion vector of the first peripheral block is usable as a predicted motion vector, the motion vector prediction unit 2032 derives a predicted motion vector of the current block from the motion vector of the first peripheral block.

[0263] If the information indicating the availability of the first peripheral block indicates that the first peripheral block is not available, or if the information indicates that the first peripheral block is available, but the reference image index of the first peripheral block having the same prediction direction as the prediction direction of the current block is the same as a predetermined value, it may be determined that the motion vector of the first peripheral block is not available as a predicted motion vector. In this case, the motion vector prediction unit 2032 may obtain a default motion vector through a procedure for deriving a default motion vector, which will be described later, and obtain a predicted motion vector of the current block by using the default motion vector.

[0264] The reference image index of the first neighboring block having the same prediction direction as the prediction direction of the current block is not equal to a predetermined value, which may mean that there is a motion vector of the first neighboring block indicating a reference image having the same prediction direction as the prediction direction of the current block. Conversely, the reference image index of the first neighboring block having the same prediction direction as the prediction direction of the current block is equal to a predetermined value, which may mean that there is no motion vector of the first neighboring block indicating a reference image having the same prediction direction as the prediction direction of the current block.

[0265] The reference image index of the first peripheral block includes a reference image index in the list 0 direction and a reference image index in the list 1 direction, and the values ​​of the reference image index in the list 0 direction and the reference image index in the list 1 direction are also determined along the prediction direction of the first peripheral block.

[0266] For example, if the prediction direction of the first peripheral block is the list 0 direction, the reference picture index in the list 0 direction is set to the value of an index (e.g., ref_idx_l0) obtained from the bitstream, and the reference picture index in the list 1 direction is set to a predetermined value. Since the pictures included in the reference picture list have indexes from 0 to n (n is a natural number), the predetermined value may be a value different from 0 to n, for example, -1.

[0267] If the prediction direction of the first surrounding block is list 1 direction, the reference picture index in the list 1 direction is set to the value of an index (e.g., ref_idx_l1) obtained from the bitstream, and the reference picture index in the list 0 direction is set to a predetermined value.

[0268] If the prediction direction of the first surrounding block is bidirectional, the reference image index in the list 0 direction and the reference image index in the list 1 direction are both set to the values ​​of the indexes (e.g., ref_idx_l0, ref_idx_l1) obtained from the bitstream.

[0269] Hereinafter, a case where the reference image index of the first neighboring block having the same prediction direction as the prediction direction of the current block is equal to or not equal to a predetermined value will be described with reference to Figures 23A to 23C.

[0270] FIG. 23A is a diagram illustrating a case where a reference image index of a first neighboring block having the same prediction direction as that of a current block is not equal to a predetermined value.

[0271] 23A, the prediction directions of the current block 2312 and the first peripheral block 2314 are both in the list 0 direction. Thus, the motion vector MV of the first peripheral block 2314 indicates a reference block in the reference picture 2330 included in the reference picture list 0. The reference picture index of the first peripheral block 2314 in the list 0 direction is set according to information acquired from the bitstream, and the reference picture index of the first peripheral block 2314 in the list 1 direction is set to a predetermined value. The motion vector prediction unit 2032 obtains a predicted motion vector of the current block 2312 using the motion vector MV of the first peripheral block 2314 because the reference picture index of the first peripheral block 2314 in the same prediction direction as the prediction direction of the current block 2312, i.e., in the list 0 direction, is not the same as the predetermined value.

[0272] Similarly, when the prediction directions of the current block 2312 and the first surrounding block 2314 are both in the list 1 direction, the motion vector prediction unit 2032 obtains a predicted motion vector of the current block 2312 using the motion vector MV of the first surrounding block 2314, since the reference image index of the first surrounding block 2314 in the same prediction direction as the current block 2312, i.e., in the list 1 direction, is not the same as a predetermined value.

[0273] FIG. 23B is a diagram illustrating a case where a reference image index of a first neighboring block having the same prediction direction as that of a current block is equal to a predetermined value.

[0274] 23B, the prediction direction of the current block 2312 is the list 1 direction, and the prediction direction of the first peripheral block 2314 is the list 0 direction. A motion vector MV of the first peripheral block 2314 indicates a reference block in a reference picture 2330 included in reference picture list 0. A reference picture index of the first peripheral block 2314 in the list 0 direction is set according to information acquired from a bitstream, and a reference picture index of the first peripheral block 2314 in the list 1 direction is set to a predetermined value. The motion vector prediction unit 2032 obtains a predicted motion vector of the current block 2312 using a default motion vector, which will be described later, since the reference picture index of the first peripheral block 2314 in the list 1 direction, which is the same prediction direction as the prediction direction of the current block 2312, is the same as a predetermined value.

[0275] Similarly, if the prediction direction of the current block 2312 is the list 0 direction and the prediction direction of the first surrounding block 2314 is the list 1 direction, the motion vector prediction unit 2032 obtains a predicted motion vector of the current block 2312 using a default motion vector because the prediction direction of the current block 2312 and the reference image index of the first surrounding block 2314 in the list 0 direction, i.e., the reference image index of the first surrounding block 2314 in the list 0 direction, are the same as the prediction direction of the current block 2312, and are the same as a predetermined value.

[0276] Figure 23C is a diagram illustrating a case where, when the prediction direction of the current block is bidirectional, one of the reference image index in the list 0 direction and the reference image index in the list 1 direction of the first surrounding block is equal to a predetermined value, and the other is not equal to a predetermined value.

[0277] 23C, the prediction direction of the current block 2312 is bidirectional, and the prediction direction of the first surrounding block 2314 is list 1 direction. The motion vector MV of the first surrounding block 2314 indicates a reference block in a reference picture 2350 included in reference picture list 1. The reference picture index of the first surrounding block 2314 in the list 0 direction is set to a predetermined value, and the reference picture index in the list 1 direction is set according to information obtained from the bitstream. As described above, the prediction direction being bidirectional includes both the list 0 direction and the list 1 direction. The motion vector prediction unit 2032 obtains a predicted motion vector in the list 0 direction of the current block 2312 using a default motion vector because the reference image index in the list 0 direction of the first surrounding block 2314 is the same as a predetermined value, and obtains a predicted motion vector in the list 0 direction of the current block 2312 using the motion vector MV in the list 1 direction of the first surrounding block 2314 because the reference image index in the list 1 direction of the first surrounding block 2314 is not the same as a predetermined value.

[0278] If the prediction direction of the current block 2312 is bidirectional and the prediction direction of the first surrounding block 2314 is list 0 direction, the motion vector prediction unit 2032 uses the motion vector MV of the list 0 direction of the first surrounding block 2314 to obtain a predicted motion vector of the list 0 direction of the current block 2312, and uses a default motion vector to obtain a predicted motion vector of the list 1 direction of the current block 2312.

[0279] In the present disclosure, when a first neighboring block is available and the reference image index of the first neighboring block in the same prediction direction as the current block is not equal to a predetermined value, it is determined that the motion vector of the first neighboring block may be available as a predicted motion vector, and the predicted motion vector of the current block is obtained from the motion vector of the first neighboring block.

[0280] If it is determined that the motion vector of the first peripheral block is available as a predicted motion vector only under the condition that the first peripheral block must be available, the predicted motion vector of the current block may be set to a zero vector, i.e., (0,0). In other words, if the first peripheral block is available but there is no motion vector of the first peripheral block in the same prediction direction as the prediction direction of the current block, the motion vector of the first peripheral block cannot be used as the predicted motion vector of the current block. As a result, the predicted motion vector of the current block may be determined to be a zero vector, which ultimately increases the number of bits required to represent the difference motion vector.

[0281] In the present disclosure, if both the condition that the first surrounding block must be available and the condition that a motion vector of the first surrounding block having the same prediction direction as the prediction direction of the current block must exist are satisfied, the motion vector of the first surrounding block is used to obtain a predicted motion vector of the current block, thereby reducing the number of bits required to represent a differential motion vector.

[0282] In the following, a process of deriving a default motion vector when the motion vector of the first surrounding block is not available as a predicted motion vector will be described.

[0283] In one embodiment, when the motion vector of the first surrounding block is not available as a predicted motion vector, the motion vector prediction unit 2032 may set the motion vector of the second surrounding block at a predetermined position as a default motion vector. The number of the second surrounding blocks may be multiple, and in this case, the motion vector of any one of the second surrounding blocks may be set as the default motion vector through availability determination for the multiple second surrounding blocks.

[0284] The second peripheral block may correspond to at least one of the peripheral blocks. For example, the second peripheral block may include the A1 block and the B1 block. For another example, the location of the second peripheral block may be different from the locations of the A0 block, the A1 block, the B0 block, the B1 block, and the B2 block.

[0285] When the second peripheral block includes the A1 block and the B1 block, the positions of the A1 block and the B1 block also differ depending on the availability of the left and right blocks of the current block, as described above. Specifically, referring to FIG. 21A to FIG. 21C, if the left block of the current block is available, the A1 block may be located at the lower left part of the current block, and the B1 block may be located at the upper right part of the current block. Also, if both the left and right blocks of the current block are available, the A1 block may be located at the lower left part of the current block, and the B1 block may be located at the lower right part of the current block. Also, if the right block of the current block is available, the A1 block may be located at the lower right part of the current block, and the B1 block may be located at the upper left part of the current block.

[0286] The motion vector prediction unit 2032 determines the availability of the A1 block, and if the A1 block is identified as available based on the information indicating whether the A1 block is available, the motion vector prediction unit 2032 can determine the motion vector of the A1 block as a default motion vector. If the A1 block is not available, the motion vector prediction unit 2032 determines the availability of the B1 block, and if the B1 block is identified as available based on the information indicating whether the B1 block is available, the motion vector prediction unit 2032 can determine the motion vector of the B1 block as a default motion vector. That is, the motion vector prediction unit 2032 can check whether the motion vectors of the A1 block and the B1 block can be used as the default motion vector in the order of the A1 block → the B1 block.

[0287] The availability of the A1 block and the availability of the B1 block are also determined based on the four conditions for determining the availability of the first peripheral block described above.

[0288] In one embodiment, the motion vector prediction unit 2032 may set the motion vector of the second peripheral block to a default motion vector if the second peripheral block is identified as available from the information indicating the availability of the second peripheral block, and if the reference image index of the second peripheral block having the same prediction direction as the prediction direction of the current block is the same as the reference image index of the current block, or if the reference image index of the second peripheral block having the same prediction direction as the prediction direction of the current block is not the same as a predetermined value (i.e., if a motion vector of the second peripheral block having the same prediction direction as the prediction direction of the current block exists).

[0289] If the information indicating the availability of the second peripheral block identifies the second peripheral block as unavailable or if there is no motion vector of the second peripheral block having the same prediction direction as the prediction direction of the current block, the motion vector prediction unit 2032 can set the motion vector of a block decoded before the current block as a default motion vector.

[0290] The motion vector prediction unit 2032 may determine the motion vector of the first neighboring block or a default motion vector as a predicted motion vector of the current block.

[0291] When the motion vector of the first surrounding block is determined as the predicted motion vector, if the reference image index of the first surrounding block having the same prediction direction as the prediction direction of the current block is not the same as the reference image index of the current block, the motion vector prediction unit 2032 may update the predicted motion vector of the current block by scaling the predicted motion vector of the current block based on the distance between the current image and the reference image of the current block and the distance between the current image and the reference image of the first surrounding block.

[0292] In an embodiment, if a reference image index of a second neighboring block (or a block used to obtain a default motion vector and decoded before the current block) having the same prediction direction as the prediction direction of the current block is the same as a reference image index of the current block, the motion vector prediction unit 2032 may determine the default motion vector as a predicted motion vector of the current block. In addition, if a reference image index of a second neighboring block (or a block used to obtain a default motion vector and decoded before the current block) having the same prediction direction as the prediction direction of the current block is not the same as a reference image index of the current block, the motion vector prediction unit 2032 may scale the default motion vector according to a distance between the current image and the reference image of the current block and a distance between the current image and the reference image of the second neighboring block (or a block decoded before the current block), and determine the scaled default motion vector as a predicted motion vector of the current block.

[0293] After obtaining the predicted motion vector of the current block, the motion vector prediction unit 2032 may adjust the predicted motion vector of the current block if the motion vector resolution of the current block is different from a predetermined motion vector resolution (e.g., the minimum motion vector resolution among a plurality of motion vector resolutions). The reason for adjusting the predicted motion vector is to match the motion vector resolution of the current block with the resolution of the predicted motion vector.

[0294] The motion vector prediction unit 2032 can adjust the predicted motion vector represented by coordinates in an image interpolated by a minimum motion vector resolution to the motion vector resolution of the current block, by adjusting the predicted motion vector to point to a surrounding pixel instead of the pixel indicated by the predicted motion vector.

[0295] For example, if the minimum motion vector resolution is in 1 / 4 pixel units and the motion vector resolution of the current block is in 1 pixel units, the motion vector prediction unit 2032 may adjust the predicted motion vector of (19, 27) so that the predicted motion vector becomes (20, 28), because when the minimum motion vector resolution is in 1 / 4 pixel units, an integer pixel has coordinates of (4n, 4m) in the interpolated image.

[0296] In one embodiment, the motion vector prediction unit 2032 may adjust the predicted motion vector according to the motion vector resolution of the current block, so that the adjusted predicted motion vector indicates a pixel located at the top and right end of a pixel indicated by the predicted motion vector before being adjusted. In another embodiment, the motion vector prediction unit 2032 may adjust the adjusted predicted motion vector to indicate a pixel located at the top and left end, a pixel located at the bottom and left end, or a pixel located at the bottom and right end of a pixel indicated by the predicted motion vector before being adjusted.

[0297] To summarize the above content according to an embodiment, if the motion vector of the first peripheral block is available as a predicted motion vector, the motion vector of the first peripheral block is determined as a predicted motion vector of the current block. If the reference image index of the first peripheral block having the same prediction direction as the prediction direction of the current block is not the same as the reference image index of the current block, the predicted motion vector is scaled. If the motion vector resolution of the current block is not the same as a predetermined motion vector resolution among a plurality of motion vector resolutions, the predicted motion vector or the scaled predicted motion vector is adjusted according to the motion vector resolution of the current block.

[0298] Also, if the motion vector of the first neighboring block is not available as a predicted motion vector, a default motion vector is derived. If the reference image index of a block (used to derive the default motion vector) having the same prediction direction as the current block is not the same as the reference image index of the current block, the default motion vector is scaled, and the scaled default motion vector is determined as the predicted motion vector of the current block. If the motion vector resolution of the current block is not the same as a predetermined motion vector resolution among a plurality of motion vector resolutions, the predicted motion vector is adjusted according to the motion vector resolution of the current block.

[0299] The motion vector recovery unit 2034 combines the predicted motion vector of the current block with the differential motion vector acquired from the bitstream to obtain the motion vector of the current block. The motion vector recovery unit 2034 may add the predicted motion vector of the current block and the differential motion vector to obtain the motion vector of the current block.

[0300] The prediction decoding unit 2030 may perform inter prediction on the current block based on the prediction direction, the reference image index, and the motion vector of the current block, and reconstruct the current block.

[0301] FIG. 24 is a flow chart illustrating a method for decoding motion vectors according to one embodiment.

[0302] In operation S2410, the video decoding apparatus 2000 determines availability of a first neighboring block selected from neighboring blocks adjacent to a current block according to information acquired from a bitstream.

[0303] In one embodiment, the information obtained from the bitstream also includes information indicating a motion vector resolution of the current block among a plurality of motion vector resolutions.

[0304] In operation S2420, the video decoding apparatus 2000 determines whether a first neighboring block is available and whether a motion vector of the first neighboring block having the same prediction direction as the prediction direction of the current block exists.

[0305] At step S2430, if a first surrounding block is available and a motion vector of the first surrounding block having the same prediction direction as the prediction direction of the current block exists, the video decoding device 2000 obtains a predicted motion vector of the current block from the motion vector of the first surrounding block.

[0306] At step S2440, if the first surrounding block is not available or there is no motion vector of the first surrounding block having the same prediction direction as the prediction direction of the current block, the video decoding device 2000 obtains a predicted motion vector of the current block from the motion vector of the second surrounding block.

[0307] As mentioned above, if there is no availability of the second neighboring block, the predicted motion vector of the current block may be obtained from the motion vector of a block decoded before the current block.

[0308] In operation S2450, the video decoding apparatus 2000 combines the predicted motion vector of the current block with the differential motion vector to obtain a motion vector of the current block.

[0309] FIG. 25 is a block diagram illustrating a configuration of a video encoding device 2500 according to one embodiment.

[0310] 25, a video encoding device 2500 includes a predictive encoding unit 2510 and a bitstream generating unit 2530. The predictive encoding unit 2510 also includes a motion vector predictor 2512 and a motion vector encoder 2514.

[0311] 2. The predictive encoder 2510 may correspond to the encoder 220 in FIG. 2, and the bitstream generator 2530 may correspond to the bitstream generator 210 in FIG.

[0312] According to an embodiment, the predictive encoder 2510 and the bitstream generator 2530 may be implemented as at least one processor. The video encoder 2500 may also include one or more memories (not shown) for storing input and output data of the predictive encoder 2510 and the bitstream generator 2530. The video encoder 2500 may also include a memory controller (not shown) for controlling data input and output of the memory (not shown).

[0313] The predictive coding unit 2510 codes the image according to a predictive mode, and the bitstream generating unit 2530 generates a bitstream including information generated as a result of the image coding.

[0314] The predictive coding unit 2510 may determine a prediction mode of a current block in a current image. If the prediction mode of the current block is determined to be an inter prediction mode, the bitstream generation unit 2530 may include information indicating motion information of the current block in a bitstream.

[0315] The motion vector prediction unit 2512 predicts the motion vector of the current block to be coded in the inter prediction mode.

[0316] According to an embodiment, the motion vector prediction unit 2512 may obtain a predicted motion vector by using motion vectors of neighboring blocks adjacent to the current block. The positions of the neighboring blocks have been described above, and therefore will not be described in detail.

[0317] In one embodiment, the motion vector prediction unit 2512 selects a first peripheral block from the peripheral blocks, which is any one of the A0 block, the A1 block, the B0 block, the B1 block, and the B2 block corresponding to the peripheral blocks.

[0318] In one embodiment, the motion vector prediction unit 2512 may select a first neighboring block that is mapped to the motion vector resolution of the current block from among a plurality of motion vector resolutions.

[0319] The motion vector prediction unit 2512 determines the availability of the first peripheral block based on at least one of whether a tile including the first peripheral block is different from a tile including a current block, whether the first peripheral block is located outside the current image, whether the first peripheral block is intra-predicted, and whether the reconstruction of the first peripheral block is completed.

[0320] In one embodiment, the motion vector prediction unit 2512 may determine that the motion vector of the first peripheral block is usable as a predicted motion vector if the first peripheral block is identified as usable from the information indicating the availability of the first peripheral block and the reference image index of the first peripheral block having the same prediction direction as the prediction direction of the current block is not equal to a predetermined value (i.e., if there is a motion vector of the first peripheral block having the same prediction direction as the prediction direction of the current block). The predetermined value may be, for example, -1. If the motion vector of the first peripheral block is usable as a predicted motion vector, the motion vector prediction unit 2512 derives a predicted motion vector of the current block from the motion vector of the first peripheral block.

[0321] If the availability of the first peripheral block is identified as unavailable from the information indicating the availability of the first peripheral block, or if the reference image index of the first peripheral block in the same prediction direction as the prediction direction of the current block is the same as a predetermined value, it may be determined that the motion vector of the first peripheral block is unavailable as a predicted motion vector. In this case, the motion vector prediction unit 2512 may obtain a predicted motion vector of the current block using a default motion vector.

[0322] In one embodiment, when the motion vector of the first surrounding block is not available as a predicted motion vector, the motion vector prediction unit 2512 may set the motion vector of the second surrounding block at a predetermined position as a default motion vector. The number of the second surrounding blocks may be multiple, and in this case, the motion vector of any one of the second surrounding blocks may be set as the default motion vector through availability determination for the multiple second surrounding blocks.

[0323] When the second peripheral block includes the A1 block and the B1 block, the motion vector prediction unit 2512 determines the availability of the A1 block, and if the A1 block is identified as available according to the information indicating whether the A1 block is available, the motion vector prediction unit 2512 may determine the availability of the B1 block as a default motion vector if the B1 block is identified as available according to the information indicating whether the B1 block is available. That is, the motion vector prediction unit 2512 may check whether the motion vectors of the A1 block and the B1 block can be used as the default motion vector in the order of the A1 block → the B1 block.

[0324] In one embodiment, the motion vector prediction unit 2512 may set the motion vector of the second peripheral block to a default motion vector if the second peripheral block is identified as available from the information indicating the availability of the second peripheral block, and if the reference image index of the second peripheral block having the same prediction direction as the prediction direction of the current block is the same as the reference image index of the current block, or if the reference image index of the second peripheral block having the same prediction direction as the prediction direction of the current block is not the same as a predetermined value (i.e., if a motion vector of the second peripheral block having the same prediction direction as the prediction direction of the current block exists).

[0325] If the information indicating the availability of the second surrounding block identifies the second surrounding block as unavailable or the reference image index of the second surrounding block having the same prediction direction as the current block is equal to a predetermined value, the motion vector prediction unit 2512 can set the motion vector of the block coded before the current block as a default motion vector.

[0326] The motion vector prediction unit 2512 may determine the motion vector of the first neighboring block or a default motion vector as a predicted motion vector of the current block.

[0327] When the motion vector of the first surrounding block is determined as the predicted motion vector, if the reference image index of the first surrounding block having the same prediction direction as the prediction direction of the current block is not the same as the reference image index of the current block, the motion vector prediction unit 2512 may update the predicted motion vector of the current block by scaling the predicted motion vector of the current block based on the distance between the current image and the reference image of the current block and the distance between the current image and the reference image of the first surrounding block.

[0328] In an embodiment, when a default motion vector is obtained, if a reference image index of a second neighboring block (or a block used to obtain the default motion vector and decoded before the current block) having the same prediction direction as the current block is the same as a reference image index of the current block, the motion vector prediction unit 2512 may determine the default motion vector as a predicted motion vector of the current block. If a reference image index of a second neighboring block (or a block used to obtain the default motion vector and decoded before the current block) having the same prediction direction as the current block is not the same as a reference image index of the current block, the motion vector prediction unit 2512 may scale the default motion vector according to a distance between the current image and the reference image of the current block and a distance between the current image and the reference image of the second neighboring block (or a block decoded before the current block), and determine the scaled default motion vector as a predicted motion vector of the current block.

[0329] After the predicted motion vector of the current block is obtained, the motion vector prediction unit 2512 can adjust the predicted motion vector of the current block if the motion vector resolution of the current block is different from a predetermined motion vector resolution (e.g., the smallest motion vector resolution among multiple motion vector resolutions).

[0330] The motion vector encoding unit 2514 obtains a differential motion vector between the motion vector of the current block and the predicted motion vector. The motion vector encoding unit 2514 may obtain a differential motion vector by subtracting the predicted motion vector from the motion vector of the current block.

[0331] The bitstream generator 2530 generates a bitstream including information indicating a differential motion vector of the current block and information indicating a first peripheral block among the peripheral blocks. As described above, the information indicating the first peripheral block is also information indicating a motion vector resolution of the current block among a plurality of motion vector resolutions.

[0332] FIG. 26 is a flow chart illustrating a method for encoding motion vectors according to one embodiment.

[0333] In operation S2610, the image encoding device 2500 determines availability of a first neighboring block selected from the neighboring blocks adjacent to the current block. In one embodiment, the image encoding device 2500 may select the first neighboring block having a motion vector resolution corresponding to the motion vector resolution of the current block.

[0334] In operation S2620, the image encoding device 2500 determines whether a first neighboring block is available and whether a motion vector of the first neighboring block having the same prediction direction as the prediction direction of the current block exists.

[0335] In step S2630, if the first surrounding block is available and a motion vector of the first surrounding block having the same prediction direction as the prediction direction of the current block exists, the video encoding device 2500 obtains a predicted motion vector of the current block from the motion vector of the first surrounding block.

[0336] In step S2640, if the first surrounding block is not available or there is no motion vector of the first surrounding block having the same prediction direction as the prediction direction of the current block, the video encoding device 2500 obtains a predicted motion vector of the current block from the motion vector of the second surrounding block.

[0337] If there is no availability of the second neighboring block, the predicted motion vector of the current block may be obtained from the motion vector of a block coded before the current block.

[0338] In operation S2650, the video encoding device 2500 obtains a differential motion vector between the motion vector of the current block and the predicted motion vector, and generates a bitstream including information indicating the differential motion vector and information indicating a first peripheral block. The information indicating the first peripheral block is also information indicating a motion vector resolution of the current block among a plurality of motion vector resolutions.

[0339] 27 and 28 are diagrams illustrating a process of obtaining a predicted motion vector according to an embodiment.

[0340] 27 and 28 specifically illustrate an example of the above embodiment. In FIG. 27 and FIG. 28, LX included in mvpLX and mvLX indicates a prediction direction of a current block. That is, if the prediction direction of the current block is the L0 direction, X is 0, and if the prediction direction of the current block is the L1 direction, X is 1. If the prediction direction of the current block is bidirectional, X may have values ​​of 0 and 1 sequentially.

[0341] In S2710, a flag (mvpAvailFlag) indicating the availability of the motion vector predictor is set to 0.

[0342] In S2720, a block used to obtain a predicted motion vector of the current block is specified by information (amvr_idx) indicating the motion vector resolution of the current block. If amvr_idx is 1, the B1 block is selected. Then, a determination is made as to the availability of the B1 block. The availability of the B1 block is also determined based on the four conditions for determining the availability of the first peripheral block described above. In FIG. 27, in order to omit redundant description, only the process when amvr_idx is 1 is illustrated, but blocks at different positions are selected depending on the value of amvr_idx. For example, as illustrated in FIG. 22, a block mapped to amvr_idx may be selected.

[0343] In S2730, the B1 block is identified as available from information indicating the availability of the B1 block (availableB1), and if the reference video index (RefIdxLX) of the B1 block in the same prediction direction as the prediction direction of the current block is not equal to −1, a flag indicating the availability of the predicted motion vector (mvpAvailFlag) is set to 1, and the motion vector of the B1 block is set to the predicted motion vector (mvpLX).

[0344] In S2740, if the reference picture index (refIdxLX) of the current block and the reference picture index (RefIdxLX[xNbB1][yNbB1]) of the B1 block are not identical, the predicted motion vector (mvpLX) is scaled by the ratio (distScaleFactorLX) of the distance (currPocDiffLX) between the current picture (current picture) and the reference picture of the B1 block (RefPicListX[RefIdxLX[xNbB1][yNbB1]]) and the distance (targetPocDiffLX) between the current picture (current picture) and the reference picture (RefPicListX[refIdxLX]) of the current block.

[0345] In S2750, if amvr_idx is not 0, i.e., if the motion vector resolution of the current block is different from a predetermined motion vector resolution (e.g., the minimum motion vector resolution), the predicted motion vector (mvpLX) is adjusted. If amvr_idx is 0, i.e., if the predicted motion vector is obtained from the motion vector of the A1 block, the predicted motion vector adjustment process is not performed.

[0346] Next, referring to FIG. 28, in S2810, if the flag indicating the availability of the predicted motion vector (mvpAvailFlag) is 0, i.e., the information indicating the availability of the B1 block (availableB1) indicates that the B1 block is not available, or the reference image index (RefIdxLx[xNbB1][yNbB1]) of the B1 block having the same prediction direction as the prediction direction of the current block is equal to -1, the default motion vector derivation procedure of S2820 to S2890 is performed.

[0347] In S2820, the availability of the A1 block and the B1 block is determined. The availability of the A1 block and the B1 block is also determined based on the four conditions for determining the availability of the first peripheral block described above.

[0348] In S2830, both the x-axis component and the y-axis component of the default motion vector (DefaultMvLX) are set to zero.

[0349] In S2840, if the A1 block is identified as available from the information indicating the availability of the A1 block (availableA1), and the reference image index (refIdxLX) of the current block and the reference image index (RefIdxLX[xNbA1][yNbA1]) of the A1 block are identical, the motion vector of the A1 block is set to the default motion vector.

[0350] In S2850, if the conditions described in S2840 are not satisfied, the B1 block is identified as available from the information indicating the availability of the B1 block (availableB1), and the reference video index (refIdxLX) of the current block and the reference video index (RefIdxLX[xNbB1][yNbB1]) of the B1 block are identical, the motion vector of the B1 block is set to the default motion vector.

[0351] In S2860, if the conditions described in S2850 are not satisfied, the A1 block is identified as available from the information indicating the availability of the A1 block (availableA1), and the reference video index (RefIdxLx[xNbA1][yNbA1]) of the A1 block is not equal to -1, the motion vector of the A1 block is set to the default motion vector.

[0352] In S2870, if the conditions described in S2860 are not satisfied, the B1 block is identified as available from the information indicating the availability of the B1 block (availableB1), and the reference video index (RefIdxLx[xNbB1][yNbB1]) of the B1 block is not equal to -1, the motion vector of the B1 block is set to the default motion vector.

[0353] In S2880, if the motion vector of the A1 block or the motion vector of the B1 block is not set as the default motion vector, the motion vector of the block decoded before the current block is set as the default motion vector.

[0354] In S2890, if the reference image index (refIdxLX) of the current block and the default reference image index (DefaultRefIdxLX) are not the same, the default motion vector is scaled according to the ratio (distScaleFactorLX) of the distance (currPocDiffLX) between the current image and the image (RefPicListX[DefaultRefIdxLX]) indicated by the default reference image index and the distance (targetPocDiffLX) between the current image and the reference image (RefPicListX[refIdxLX]) of the current block. Here, the default reference image index (DefaultRefIdxLX) may refer to the reference image index of the block used to obtain the default motion vector.

[0355] In S2895, the default motion vector (DefaultMvLX) is set to the predicted motion vector (mvpLX) of the current block.

[0356] Although not shown in Figure 28, if amvr_idx is not 0, i.e., if the motion vector resolution of the current block is different from a predetermined motion vector resolution (e.g., the minimum motion vector resolution), adjustment of the predicted motion vector (mvpLX) is performed.

[0357] The above-described embodiment of the present disclosure can be created into a program that can be executed by a computer, and the created program can also be stored on a medium.

[0358] The medium may continuously store a computer-executable program or may temporarily store the program for execution or download. The medium may be a variety of recording or storage means in the form of a single or multiple pieces of hardware combined, but is not limited to a medium directly connected to a computer system, and may be distributed on a network. Examples of the medium include magnetic media such as hard disks, floppy disks, and magnetic tapes; optical recording media such as CD-ROMs (Compact Disc Read-Only Memory) and DVDs (Digital Versatile Discs); magnetic-optical media such as floptical disks; and ROMs (Read-Only Memory), RAMs (Random Access Memory), flash memories, etc., configured to store program instructions. Examples of other media include recording media or storage media managed by app stores that distribute applications, sites that supply or distribute various other software, and servers.

[0359] The above describes in detail the technical ideas of the present disclosure by citing preferred embodiments. However, the technical ideas of the present disclosure are not limited to the above-described embodiments, and various modifications and changes may be made by those skilled in the art within the scope of the technical ideas of the present disclosure.

Claims

1. A method for decoding a motion vector by a video decoding device, comprising: obtaining information indicating a motion vector resolution of a current block from a bitstream; selecting a first neighboring block from among a plurality of neighboring blocks adjacent to the current block using information indicating a motion vector resolution of the current block; determining a motion vector prediction of the current block using a motion vector of the first neighboring block if the current block refers to a reference picture in list 0 and the first neighboring block refers to a reference picture in list 0; determining a motion vector of a second peripheral block among the plurality of peripheral blocks as a default motion vector if the current block refers to a reference picture in the list 0 and the first peripheral block refers to a reference picture in the list 1, and determining the motion vector prediction of the current block using the default motion vector; adjusting the motion vector prediction based on information indicating a motion vector resolution of the current block; determining a motion vector for the current block using the adjusted motion vector prediction for the current block.

2. A motion vector encoding method by a video encoding device, comprising: determining a motion vector resolution of a current block; selecting a first neighboring block from among a plurality of neighboring blocks adjacent to the current block using a motion vector resolution of the current block; determining a motion vector prediction of the current block using a motion vector of the first neighboring block if the current block refers to a reference picture in list 0 and the first neighboring block refers to a reference picture in list 0; determining a motion vector of a second peripheral block among the plurality of peripheral blocks as a default motion vector if the current block refers to a reference picture in the list 0 and the first peripheral block refers to a reference picture in the list 1, and determining a motion vector prediction of the current block using the default motion vector; adjusting the motion vector prediction based on a motion vector resolution of the current block; generating a bitstream including information indicating a motion vector resolution of the current block.

3. A method for transmitting a bitstream generated by the motion vector encoding method of claim 2.

Citation Information

Patent Citations

  • Apparatus and method for encoding motion vector determined using adaptive motion vector resolution, and apparatus and method for decoding motion vector

    EP3618435A1

  • Method and device for encoding motion vectors, and method and device for decoding said vectors

    JP2013530660A

  • Apparatus and method for encoding motion vector, and apparatus and method for decoding motion vector

    JP7556979B2

  • Interframe prediction method and apparatus, and terminal device

    WO2019109955A1