Method for encoding motion information, method for decoding, encoding device, decoding device, and recording medium.

By determining basic and primary residual motion vectors based on displacement distance and direction, the method addresses the challenge of representing motion information with fewer bits, improving video encoding and decoding efficiency.

JP7853487B2Active Publication Date: 2026-04-28SAMSUNG ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
SAMSUNG ELECTRONICS CO LTD
Filing Date
2025-04-22
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing video encoding and decoding methods face challenges in representing motion information and residual motion vectors with a small number of bits, leading to inefficiencies in compression and data transmission.

Method used

A method for encoding and decoding motion information involves determining a basic motion vector and primary residual motion vectors, which are divided by displacement distance and direction, to represent the motion vector of a current block efficiently.

Benefits of technology

This approach allows for representing motion information and residual motion vectors with a reduced number of bits, enhancing compression efficiency and data transmission in video encoding and decoding processes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007853487000001
    Figure 0007853487000001
  • Figure 0007853487000002
    Figure 0007853487000002
  • Figure 0007853487000003
    Figure 0007853487000003
Patent Text Reader

Abstract

To provide a method and an apparatus for encoding / decoding motion information to be used in encoding and decoding a video.SOLUTION: A method for decoding motion information includes the steps of: determining a base motion vector of a current block; determining a primary residual motion vector relating to the current block on the basis of information obtained from a bitstream from at least one primary residual motion vector candidate classified according to a displacement distance and a displacement direction; and applying the primary residual motion vector to the base motion vector to determine a motion vector of the current block.SELECTED DRAWING: Figure 32
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. More specifically, the present invention relates to a method for encoding motion information used in video encoding and decoding, an apparatus therefor, a method for decoding the same, and an apparatus therefor.

Background Art

[0002] In video encoding and decoding methods, in order to encode a video, one picture is divided into blocks, and each block can be prediction-encoded via inter prediction or intra prediction.

[0003] The inter prediction is a method of removing temporal redundancy between pictures and compressing a video, and motion estimation encoding is a typical example. The motion estimation encoding uses at least one reference picture to predict a block of a current picture. Using a predetermined evaluation function, a reference block most similar to the current block can be searched within a predetermined search range. The current block is predicted based on the reference block, a predicted block generated as a result of the prediction is subtracted from the current block, and a residual block is generated and encoded. At this time, in order to perform the prediction more accurately, interpolation is performed on the search range of the reference picture to generate pixels of a sub-pel unit smaller than an integer pel unit, and inter prediction can be performed based on the generated pixels of the sub-pel unit.

[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 contained in a previously encoded picture, is used as the prediction motion vector for the current block in order to predict the motion vector of the current block. The differential motion vector, which is the difference between the motion vector of the current block and the prediction motion vector, is signaled by the decoder through a predetermined method. [Overview of the Initiative] [Problems that the invention aims to solve]

[0005] One embodiment of a method for encoding and decoding motion information, and a motion information encoding and decoding device, addresses the technical challenge of representing motion information with a small number of bits.

[0006] Furthermore, the method for encoding and decoding motion information, and the device for encoding and decoding motion information according to one embodiment, have the technical challenge of representing the residual motion vector with a small number of bits. [Means for solving the problem]

[0007] A method for decoding motion information according to one embodiment of the present disclosure may include the steps of: determining the basic motion vector of the current block; determining the primary residual motion vector relating to the current block from among at least one primary residual motion vector candidate, which is divided by displacement distance and displacement direction, based on information obtained from the bitstream; and applying the primary residual motion vector to the basic motion vector to determine the motion vector of the current block.

[0008] In one embodiment, the step of determining the motion vector of the current block may further include the steps of: obtaining information from the bitstream indicating a second-order residual motion vector relating to the current block; and applying the second-order residual motion vector determined based on the information indicating the second-order residual motion vector to the basic motion vector modified by applying the first-order residual motion vector, thereby determining the motion vector of the current block. [Effects of the Invention]

[0009] A motion information encoding method and decoding method, and a motion information encoding device and decoding device according to one embodiment, can represent motion information with a small number of bits.

[0010] Furthermore, the motion information encoding method and decoding method, and the motion information encoding device and decoding device according to one embodiment, can represent the residual motion vector with a small number of bits.

[0011] However, the effects that can be achieved by a motion information encoding method and decoding method, and a motion information encoding device and decoding device according to one embodiment are not limited to those mentioned above, and other effects not mentioned will be clearly understood by those skilled in the art in which this disclosure pertains from the following description. [Brief explanation of the drawing]

[0012] To further understand the drawings cited herein, a brief description of each drawing is provided. [Figure 1] This is a block diagram of a video decoding device according to one embodiment. [Figure 2] This is a block diagram of a video encoding device according to one embodiment. [Figure 3] This diagram illustrates the process by which an image decoding device according to one embodiment divides an encoding unit and determines at least one encoding unit. [Figure 4]This diagram illustrates the process by which an image decoding device according to one embodiment divides an encoding unit, which has a non-square shape, and determines at least one encoding unit. [Figure 5] This diagram illustrates the process by which an image decoding device according to one embodiment divides an encoding unit based on at least one of block form information and divided form mode information. [Figure 6] This diagram illustrates a method for determining a predetermined encoding unit from an odd number of encoding units in a video decoding device according to one embodiment. [Figure 7] This diagram illustrates the order in which multiple encoding units are processed when a video decoding device according to one embodiment divides an encoding unit and determines multiple encoding units. [Figure 8] This diagram illustrates the process by which a video decoding device according to one embodiment determines that, if the encoding units cannot be processed in a predetermined order, the current encoding unit is divided into an odd number of encoding units. [Figure 9] This diagram illustrates the process by which a video decoding device according to one embodiment divides a first coding unit and determines at least one coding unit. [Figure 10] This diagram illustrates that in a video decoding device according to one embodiment, when a non-square-shaped second coding unit determined by dividing the first coding unit satisfies predetermined conditions, the form in which the second coding unit can be divided is limited. [Figure 11] In one embodiment, when it is not possible to show that the divided mode information is divided into four square-shaped encoding units, this diagram illustrates the process by which the video decoding device divides the square-shaped encoding units. [Figure 12] This diagram illustrates, in one embodiment, that the processing order between multiple coding units differs depending on the coding unit division process. [Figure 13] This diagram illustrates the process by which the depth of a coding unit is determined when, according to one embodiment, a coding unit is recursively divided to determine multiple coding units, and the shape and size of the coding unit change. [Figure 14]A drawing illustrating the depth determined by the form and size of the coding unit, and the index (PID: part index) for coding unit division. [Figure 15] A drawing illustrating that a plurality of coding units are determined by a plurality of predetermined data units included in a picture. [Figure 16] A drawing illustrating a processing block serving as a reference for determining the order of determination of reference coding units included in a picture. [Figure 17] A drawing illustrating coding units that can be determined for each picture when the combinations of forms in which a coding unit can be divided are different for each picture. [Figure 18] A drawing illustrating various forms of coding units that can be determined based on division form mode information that can be expressed in binary code. [Figure 19] A drawing illustrating other forms of coding units that can be determined based on division form mode information that can be expressed in binary code. [Figure 20] A drawing showing a block diagram of a video encoding system and a decoding system that perform loop filtering. [Figure 21] A block diagram of a video decoding apparatus according to an embodiment. [Figure 22] A drawing showing primary residual motion vector candidates displayed on a coordinate plane. [Figure 23] A drawing showing primary residual motion vector candidates displayed on a coordinate plane. [Figure 24] A drawing showing primary residual motion vector candidates displayed on a coordinate plane. [Figure 25] A drawing showing primary residual motion vector candidates displayed on a coordinate plane. [Figure 26] A drawing for explaining an index indicating primary residual motion vector candidates according to an embodiment. [Figure 27] This diagram illustrates the motion information used for bidirectional prediction of blocks. [Figure 28] This diagram shows the positional relationship between the current picture and the two reference pictures. [Figure 29] This diagram shows candidate first-order residual motion vectors related to the current block, predicted in both directions. [Figure 30] This diagram shows the positional relationship between the current picture and the two reference pictures. [Figure 31] This diagram shows candidate first-order residual motion vectors related to the current block, predicted in both directions. [Figure 32] This is a flowchart illustrating a video decoding method according to one embodiment. [Figure 33] This is a block diagram of a video encoding device according to one embodiment. [Figure 34] This is a flowchart illustrating a video encoding method according to one embodiment. [Modes for carrying out the invention]

[0013] A method for decoding motion information according to one embodiment of the present disclosure may include the steps of: determining the basic motion vector of the current block; determining the primary residual motion vector relating to the current block from among at least one primary residual motion vector candidate, which is divided by displacement distance and displacement direction, based on information obtained from the bitstream; and applying the primary residual motion vector to the basic motion vector to determine the motion vector of the current block.

[0014] In one embodiment, the step of determining the motion vector of the current block may further include the steps of: obtaining information from the bitstream indicating a second-order residual motion vector relating to the current block; and applying the second-order residual motion vector determined based on the information indicating the second-order residual motion vector to the basic motion vector modified by applying the first-order residual motion vector, thereby determining the motion vector of the current block.

[0015] In one embodiment, the method for decoding motion information further includes the step of obtaining an index from the bitstream that indicates at least one of the displacement distance and displacement direction of the primary residual motion vector, and the step of determining the primary residual motion vector may include the step of determining, from among the at least one primary residual motion vector candidate, the primary residual motion vector candidate corresponding to the obtained index as the primary residual motion vector relating to the current block.

[0016] In one embodiment, the method for decoding the motion information may further include the step of determining one of at least one candidate basic motion vectors as the basic motion vector of the current block.

[0017] In one embodiment, the step of determining the motion vector of the current block may include the steps of: determining a primary residual motion vector for a second unidirectional based on the primary residual motion vector for the first unidirectional, if the basic motion vector of the current block corresponds to a bidirectional motion vector, the predicted direction of the current block corresponds to bidirectional, and the primary residual motion vector has been determined for a first unidirectional; applying the primary residual motion vector for the first unidirectional to the basic motion vector of the first unidirectional to determine the motion vector of the current block in the first unidirectional; and applying the primary residual motion vector for the second unidirectional to the basic motion vector of the second unidirectional to determine the motion vector of the current block in the second unidirectional.

[0018] In one embodiment, the step of determining the primary residual motion vector for the second unidirectional may include determining at least one of the magnitude and sign of the component values ​​of the primary residual motion vector for the second unidirectional based on the positional relationship between a reference picture corresponding to the basic motion vector for the first unidirectional, a reference picture corresponding to the basic motion vector for the second unidirectional, and the current picture including the current block.

[0019] In one embodiment, the step of determining the motion vector of the current block may include, if the basic motion vector of the current block corresponds to a motion vector of a first unidirectional direction and the predicted direction of the current block corresponds to a second unidirectional direction different from the first unidirectional direction, the steps of determining the basic motion vector of the second unidirectional direction based on the basic motion vector of the first unidirectional direction and determining the primary residual motion vector for the second unidirectional direction based on the primary residual motion vector for the first unidirectional direction, and the steps of applying the primary residual motion vector for the second unidirectional direction to the basic motion vector of the second unidirectional direction and determining the motion vector of the current block.

[0020] In one embodiment, the step of determining the motion vector of the current block may include, if the basic motion vector of the current block corresponds to a first unidirectional motion vector and the predicted direction of the current block corresponds to bidirectional, the steps of determining the second unidirectional basic motion vector based on the first unidirectional basic motion vector and determining the primary residual motion vector for the second unidirectional based on the primary residual motion vector for the first unidirectional; applying the primary residual motion vector for the first unidirectional to the basic motion vector of the first unidirectional to determine the first unidirectional motion vector of the current block; and applying the primary residual motion vector for the second unidirectional to the basic motion vector of the second unidirectional to determine the motion vector for the second unidirectional of the current block.

[0021] In one embodiment, the method for decoding the motion information may further include the step of entropy decoding at least a portion of the indices representing the first-order residual motion vectors from the bitstream using a context model.

[0022] In one embodiment, the motion information decoding method further includes the step of determining at least one primary residual motion vector candidate related to each of at least one basic motion vector candidates, wherein the primary residual motion vector candidate determined in relation to the bidirectional basic motion vector candidate may include a primary residual motion vector candidate in the List 0 direction containing values ​​of the same sign or opposite sign, and a primary residual motion vector candidate in the List 1 direction.

[0023] In one embodiment, the magnitude of at least one of the candidate primary residual motion vectors in the List 0 direction and the candidate primary residual motion vector in the List 1 direction may be scaled considering the distance between the first reference picture corresponding to the first unidirectional basic motion vector candidate, the current picture containing the current block, and the second reference picture corresponding to the second unidirectional basic motion vector candidate.

[0024] In one embodiment, the method for decoding the motion information may further include the steps of: determining the motion vector of the current block as the basic motion vector of the second child block when the current block corresponds to a first child block separated from the parent block; and applying the first-order residual motion vector determined for the second child block to the basic motion vector of the second child block to determine the motion vector of the second child block.

[0025] In one embodiment, the method for decoding motion information may further include the step of applying at least one of the information indicating the basic motion vector, the displacement distance, and the displacement direction, obtained in relation to the current block, to the second child block if the current block corresponds to a first child block separated from the parent block.

[0026] In one embodiment, the method for decoding motion information may further include a step of obtaining information indicating whether a predetermined encoding mode is applied to the current block, a basic motion vector relating to the current block, a primary residual motion vector relating to the current block, a priority order for displacement distance, and a priority order for displacement direction at at least one of the following levels: conversion unit level, encoding unit level, maximum encoding unit level, slice level, and picture level.

[0027] A method for encoding motion information according to one embodiment of the present disclosure may include the steps of: determining a basic motion vector of the current block; determining a primary residual motion vector relating to the current block from among at least one primary residual motion vector candidate, which is divided by displacement distance and displacement direction, based on the difference between the motion vector of the current block and the basic motion vector; and generating a bitstream that includes at least one of the information indicating the basic motion vector and the information indicating the primary residual motion vector.

[0028] This disclosure may be modified in various ways and may have a variety of embodiments, but specific embodiments are illustrated in the drawings and described in detail through the detailed description. However, this is not intended to limit the embodiments of this disclosure, and it should be understood that this disclosure includes all modifications, equivalents, or substitutions that fall within the concept and technical scope of various embodiments.

[0029] In describing this embodiment, if a specific explanation of related prior art is deemed to unnecessarily obscure the gist of this disclosure, such detailed explanation will be omitted. Furthermore, the numbers used in the description of the specification (e.g., 1st, 2nd, etc.) are merely identification symbols to distinguish one component from another.

[0030] Furthermore, in this specification, when one component is referred to as being "linked" or "connected" with another component, it should be understood that the component is either directly linked to or directly connected with the other component, or, unless otherwise stated, linked or connected through another component in between.

[0031] Furthermore, in this specification, components expressed as "~part (unit)" or "module" may be formed by combining two or more components into one, or by further subdividing one component into two or more components based on specific functions. In addition, each component described below may perform not only its own primary function but also some or all of the functions performed by other components, and it goes without saying that some of the primary functions of each component may be performed even if they are exclusively handled by other components.

[0032] Furthermore, in this specification, "image" or "picture" can refer to still images or moving images of a video, that is, the video itself.

[0033] Furthermore, in this specification, "sample" refers to data assigned to a sampling position in an image, and is the data subject to processing. For example, in an image in the spatial domain, pixel values ​​and transformation coefficients on the transformation domain are also samples. A unit containing at least one such sample can be defined as a block.

[0034] Furthermore, in this specification, "current block" means the largest encoding unit, encoding unit, prediction unit, or transformation unit block of the current video being encoded or decoded.

[0035] Furthermore, in this specification, a motion vector being in the direction of List 0 means that it is used to indicate a block in a reference picture included in List 0, and a motion vector being in the direction of List 1 means that it is used to indicate a block in a reference picture included in List 1. Also, a motion vector being unidirectional means that it is used to indicate a block in a reference picture included in List 0 or List 1, and a motion vector being bidirectional means that the motion vector includes both a motion vector in the direction of List 0 and a motion vector in the direction of List 1.

[0036] Hereinafter, with reference to Figures 1 to 20, a video encoding method and apparatus and a video decoding method and apparatus based on a tree structure encoding unit and conversion unit according to one embodiment are disclosed. The video encoding apparatus 200 and video decoding apparatus 100 described with reference to Figures 1 to 20 may each include a video encoding apparatus 3300 and a video decoding apparatus 2100 described with reference to Figures 21 to 34, respectively.

[0037] Figure 1 illustrates a block diagram of a video decoding device 100 according to one embodiment.

[0038] The video decoding device 100 may include a bitstream acquisition unit 110 and a decoding unit 120. The bitstream acquisition unit 110 and the decoding unit 120 may each include at least one processor. Furthermore, the bitstream acquisition unit 110 and the decoding unit 120 may include a memory for storing instruction words executed by at least one processor.

[0039] The bitstream acquisition unit 110 can receive a bitstream. The bitstream includes information encoded by the video encoding device 200, which will be described later. The bitstream can also be transmitted from the video encoding device 200. The video encoding device 200 and the video decoding device 100 are connected by wire or wireless, and the bitstream acquisition unit 110 can receive the bitstream via wire or wireless. The bitstream acquisition unit 110 can receive the bitstream from a recording medium such as optical media or a hard disk. The decoding unit 120 can reconstruct the video based on the information acquired from the received bitstream. The decoding unit 120 can acquire syntax elements from the bitstream for reconstructing the video. The decoding unit 120 can reconstruct the video based on the syntax elements.

[0040] To describe the operation of the video decoding device 100 in detail, the bitstream acquisition unit 110 can receive the bitstream.

[0041] The video decoder 100 can perform the operation of obtaining a binstring corresponding to the division mode of the encoded unit from the bitstream. The video decoder 100 can then perform the operation of determining the division rule of the encoded unit. Furthermore, the video decoder 100 can perform the operation of dividing the encoded unit into a plurality of encoded units based on at least one of the binstring corresponding to the division mode and the division rule. In order to determine the division rule, the video decoder 100 can determine a first acceptable range for the size of the encoded unit based on the ratio of the width and height of the encoded unit. In order to determine the division rule, the video decoder 100 can determine a second acceptable range for the size of the encoded unit based on the division mode of the encoded unit.

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

[0043] First, a single picture can be divided into one or more slices. A single slice is also a sequence of one or more coding tree units (CTUs). In contrast to the CTU, there is the concept of a coding tree block (CTB).

[0044] The largest coded block (CTB) is an NxN block containing NxN samples (where N is an integer). Each color component is also divided into one or more CTBs.

[0045] If a picture has three sample arrays (separate sample arrays for Y, Cr, and Cb components), the Maximum Encoded Unit (CTU) is a unit that includes the maximum encoded block of the luminal sample, the two corresponding maximum encoded blocks of the chroma sample, and the syntax structure used to encode the luminal and chroma samples. If the picture is a monochrome picture, the Maximum Encoded Unit is a unit that includes the maximum encoded block of the monochrome sample and the syntax structure used to encode the monochrome sample. If the picture is encoded into a color plane separated by color components, the Maximum Encoded Unit is a unit that includes the picture and the syntax structure used to encode the samples within the picture.

[0046] A single maximum coding block (CTB) can also be divided into MxN coding blocks containing MxN samples (where M and N are integers).

[0047] If a picture has sample arrays separated by Y, Cr, and Cb components, a coding unit (CU) is a unit that includes the coding block of the luminous sample, the two coding blocks of the corresponding chroma sample, and the syntax structure used to code the luminous and chroma samples. If a picture is a monochrome picture, a coding unit is a unit that includes the coding block of the monochrome sample and the syntax structure used to code the monochrome sample. If a picture is encoded into a color plane separated by color components, a coding unit is a unit that includes the picture and the syntax structure used to code the samples of the picture.

[0048] As stated above, the maximum coding block and the maximum coding unit are distinct concepts, and the coding block and the coding unit are also distinct concepts. That is, a (maximum) coding unit means a data structure that includes a (maximum) coding block containing the sample and the corresponding syntax structure. However, since a person skilled in the art can understand that a (maximum) coding unit or (maximum) coding block refers to a block of a predetermined size containing a predetermined number of samples, in this specification, unless there are special circumstances, the maximum coding block and the maximum coding unit, or the coding block and the coding unit will be referred to without distinction.

[0049] The video is also divided into Maximum Code Units (CTUs). The size of these CTUs is also determined based on information obtained from the bitstream. The form of a CTU can be a square of the same size, but is not limited to that.

[0050] For example, information relating to the maximum size of a Luma-coded block can be obtained from a bitstream. For instance, the maximum size of a Luma-coded block indicated by the information relating to the maximum size of a Luma-coded block is one of the following: 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, or 256x256.

[0051] For example, information relating to the maximum size of a divisible Luma-encoded block and the difference in Luma block sizes can be obtained from a bitstream. The information relating to the difference in Luma block sizes can indicate the size difference between the largest Luma-encoded unit and the largest divisible Luma-encoded block. Therefore, by combining the information relating to the maximum size of a divisible Luma-encoded block obtained from the bitstream and the information relating to the difference in Luma block sizes, the size of the largest Luma-encoded unit can be determined. Using the size of the largest Luma-encoded unit, the size of the largest chroma-encoded unit can also be determined. For example, if the Y:Cb:Cr ratio is 4:2:0 depending on the color format, the size of the chroma block is half the size of the Luma block, and similarly, the size of the largest chroma-encoded unit is half the size of the largest Luma-encoded unit.

[0052] In one embodiment, information relating to the maximum size of a Luma-coded block that can be binary split is obtained from the bitstream, so the maximum size of a Luma-coded block that can be binary split is determined to be variable. In contrast, the maximum size of a Luma-coded block that can be ternarily split can be fixed. For example, in an I-slice, the maximum size of a Luma-coded block that can be ternarily split is 32x32, and in a P-slice or B-slice, the maximum size of a Luma-coded block that can be ternarily split is 64x64.

[0053] Furthermore, the maximum encoding unit is also hierarchically divided into encoding units based on the splitting mode information obtained from the bitstream. As splitting mode information, at least one of the following is obtained from the bitstream: information indicating whether it is a quad split, information indicating whether it is a multi-split, splitting direction information, and splitting type information.

[0054] For example, information indicating whether or not a quad split is used can indicate whether or not the current encoding unit is being split into quads (QUAD_SPLIT).

[0055] If the current encoding unit is not quad-split, the information indicating whether it is multi-split can indicate whether the current encoding unit will not be further split (NO_SPLIT) or whether it will be binary / ternary-split.

[0056] If the current encoding unit is to be binary or ternary partitioned, the partitioning direction information indicates that the current encoding unit will be partitioned either horizontally or vertically.

[0057] If the current coding unit is to be divided horizontally or vertically, the division type information indicates that the current coding unit will be divided by binary division or ternary division.

[0058] The division mode of the current encoded unit is determined by the division direction information and division type information. If the current encoded unit is divided binary horizontally, the division mode is determined to be binary horizontal division (SPLIT_BT_HOR); if it is divided ternarily horizontally, the division mode is determined to be ternarily horizontal division (SPLIT_TT_HOR); if it is divided binary vertically, the division mode is determined to be binary vertical division (SPLIT_BT_VER); and if it is divided ternarily vertically, the division mode is determined to be ternarily vertical division (SPLIT_TT_VER).

[0059] The video decoder 100 can obtain segmentation mode information from a bitstream using a single binstring. The format of the bitstream received by the video decoder 100 may include fixed-length binary code, unary code, truncated unary code, a default binary code, etc. A binstring is a sequence of binary numbers representing the information. A binstring can consist of at least one bit. The video decoder 100 can obtain segmentation mode information corresponding to the binstring based on the segmentation rule. Based on a single binstring, the video decoder 100 can determine whether to segment the encoding unit into quads or not, or the segmentation direction and segmentation type.

[0060] An encoding unit is smaller than or equal to the largest encoding unit. For example, the largest encoding unit is also an encoding unit because it has the largest size. When the division mode information related to the largest encoding unit indicates that it will not be divided, the encoding unit determined as the largest encoding unit will have the same size as the largest encoding unit. When the division mode information related to the largest encoding unit indicates that it will be divided, the largest encoding unit will also be divided into encoding units. Furthermore, when the division mode information related to an encoding unit indicates division, the encoding unit will also be divided into even smaller encoding units. However, the division of video is not limited to these, and the largest encoding unit and encoding units are not distinguished. The division of encoding units will be explained in more detail in Figures 3 to 16.

[0061] Furthermore, one or more prediction blocks for prediction are determined from the coding unit. These prediction blocks are either the same as or smaller than the coding unit. Also, one or more transformation blocks for transformation are determined from the coding unit. These transformation blocks are either the same as or smaller than the coding unit.

[0062] The shape and size of the transformation block and the prediction block are independent of each other.

[0063] In another embodiment, a coding unit uses a coding unit as a prediction block to perform prediction. Furthermore, a coding unit uses a coding unit as a transformation block to perform transformation.

[0064] The partitioning of coding units is described in more detail in Figures 3 to 16. The current block and surrounding block in this disclosure can represent one of the maximum coding unit, coding unit, prediction block, and transformation block. The current block or current coding unit is the block that is currently being decoded or coded, or the block that is currently being partitioned. The surrounding block is also a block that was restored prior to the current block. The surrounding block can be spatially or temporally adjacent to the current block. The surrounding block can be located to the lower left, left, upper left, top, upper right, right, or lower right of the current block.

[0065] Figure 3 illustrates the process by which a video decoding device 100 according to one embodiment divides the current encoding unit and determines at least one encoding unit.

[0066] The block configuration may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N, where N is also a positive integer. The block configuration information is information indicating at least one of the following: the form, direction, width and height ratio, or size of the encoded unit.

[0067] The shape of the encoded unit may include square and non-square shapes. If the width and height of the encoded unit are the same (i.e., the block shape of the encoded unit is 4Nx4N), the video decoding device 100 can determine that the block shape information of the encoded unit is square. The video decoding device 100 can also determine that the shape of the encoded unit is non-square.

[0068] If the width and height of the coding unit are different (i.e., the block shape of the coding unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the video decoder 100 can determine that the block shape information of the coding unit is non-square. If the shape of the coding unit is non-square, the video decoder 100 can determine the ratio of width to height in the block shape information of the coding unit to be at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, or 32:1. Furthermore, based on the width and height of the coding unit, the video decoder 100 can determine whether the coding unit is horizontal or vertical. Furthermore, the video decoding device 100 can determine the size of the coding unit based on at least one of the width, height, or area of ​​the coding unit.

[0069] In one embodiment, the video decoding device 100 can determine the shape of the encoded unit using block shape information, and can determine how the encoded unit will be divided using division shape mode information. That is, the method of dividing the encoded unit indicated by the division shape mode information is determined by the block shape indicated by the block shape information used by the video decoding device 100.

[0070] The video decoder 100 can obtain segmentation mode information from the bitstream. However, it is not limited to this; the video decoder 100 and the video encoder 200 can determine predetermined segmentation mode information based on block format information. The video decoder 100 can determine predetermined segmentation mode information for the largest or smallest encoding unit. For example, the video decoder 100 can determine the segmentation mode information for the largest encoding unit to be quad segmentation. The video decoder 100 can also determine the segmentation mode information for the smallest encoding unit to be "not segmented". Specifically, the video decoder 100 can determine the size of the largest encoding unit to be 256x256. The video decoder 100 can determine the predetermined segmentation mode information to be quad segmentation. This quad segmentation is a segmentation mode in which both the width and height of the encoding unit are divided in half. The video decoding device 100 can obtain a 128x128 encoding unit from the largest encoding unit of 256x256 size based on the division mode information. The video decoding device 100 can also determine the size of the smallest encoding unit to be 4x4. The video decoding device 100 can obtain division mode information indicating "not to divide" for the smallest encoding unit.

[0071] In one embodiment, the video decoding device 100 can utilize block shape information indicating whether or not the current encoding unit is square-shaped. For example, the video decoding device 100 can determine, based on the division shape mode information, whether to leave the square encoding unit undivided, divide it vertically, divide it horizontally, or divide it into four encoding units. Referring to Figure 3, if the block shape information of the current encoding unit 300 indicates a square shape, the decoding unit 120 can determine, based on the division shape mode information indicating that it will not be divided, whether to leave the encoding unit 310a, which has the same size as the current encoding unit 300, undivided, or to determine the divided encoding units 310b, 310c, 310d, 310e, 310f, etc., based on the division shape mode information indicating a predetermined division method.

[0072] Referring to Figure 3, in one embodiment, the video decoding device 100 can determine two coding units 310b obtained by vertically dividing the current coding unit 300 based on division mode information indicating that it is divided vertically. The video decoding device 100 can determine two coding units 310c obtained by horizontally dividing the current coding unit 300 based on division mode information indicating that it is divided horizontally. The video decoding device 100 can determine four coding units 310d obtained by vertically and horizontally dividing the current coding unit 300 based on division mode information indicating that it is divided vertically and horizontally. In one embodiment, the video decoding device 100 can determine three coding units 310e obtained by vertically dividing the current coding unit 300 based on division mode information indicating that it is ternarily divided vertically. The video decoding device 100 can determine three coding units 310f obtained by horizontally dividing the current coding unit 300 based on division mode information indicating that it is ternarily divided horizontally. However, the division patterns into which a square coding unit can be divided are not limited to the patterns described above, but include a variety of patterns that can be indicated by the division pattern mode information. A predetermined division pattern into which a square coding unit is divided will be described in detail below through various embodiments.

[0073] Figure 4 illustrates the process by which a video decoding device 100 according to one embodiment divides an encoding unit that is in a non-square shape and determines at least one encoding unit.

[0074] In one embodiment, the video decoding device 100 can utilize block shape information indicating whether the current encoding unit is non-square in shape. The video decoding device 100 can determine, based on the division shape mode information, whether to divide the non-square current encoding unit or to divide it in a predetermined way. Referring to Figure 4, if the block shape information of the current encoding unit 400 or 450 indicates a non-square shape, the video decoding device 100 can determine an encoding unit 410 or 460 having the same size as the current encoding unit 400 or 450 based on the division shape mode information indicating that it will not be divided, or it can determine divided encoding units 420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, 480c based on the division shape mode information indicating a predetermined division method. The predetermined division method for dividing a non-square encoding unit will be specifically described below through various embodiments.

[0075] In one embodiment, the video decoding device 100 can determine the form in which an encoded unit is divided by utilizing the division mode information. In this case, the division mode information can indicate the number of at least one encoded unit generated by dividing the encoded unit. Referring to Figure 4, if the division mode information indicates that the current encoded unit 400 or 450 is divided into two encoded units, the video decoding device 100 can determine, based on the division mode information, the two encoded units (420a, 420b, or 470a, 470b) to be included in the current encoded unit after dividing the current encoded unit 400 or 450.

[0076] In one embodiment, when a video decoding device 100 divides a non-square current coding unit 400 or 450 based on the division mode information, the video decoding device 100 can divide the current coding unit by considering the position of the longer side of the non-square current coding unit 400 or 450. For example, the video decoding device 100 can consider the shape of the current coding unit 400 or 450 and divide the current coding unit 400 or 450 in a direction that divides the longer side of the current coding unit 400 or 450, thereby determining a plurality of coding units.

[0077] In one embodiment, if the division mode information indicates that the encoding unit is divided into an odd number of blocks (ternary division), the video decoding device 100 can determine the odd number of encoding units currently included in the encoding unit 400 or 450. For example, if the division mode information indicates that the current encoding unit 400 or 450 is divided into three encoding units, the video decoding device 100 can divide the current encoding unit 400 or 450 into three encoding units 430a, 430b, 430c, 480a, 480b, and 480c.

[0078] In one embodiment, the width-to-height ratio of the current encoding unit 400 or 450 is also 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 less than the height, so the block shape information is also vertical. The video decoding device 100 can decide to divide the current encoding unit into an odd number of blocks based on the division mode information. The video decoding device 100 can also determine the division direction of the current encoding unit 400 or 450 based on the block shape information of the current encoding unit 400 or 450. For example, if the current encoding unit 400 is vertical, the video decoding device 100 can divide the current encoding unit 400 horizontally and determine encoding units 430a, 430b, and 430c. Furthermore, if the current encoding unit 450 is in the horizontal direction, the video decoding device 100 can divide the current encoding unit 450 vertically and determine encoding units 480a, 480b, and 480c.

[0079] In one embodiment, the video decoding device 100 can determine an odd number of coding units currently included in coding unit 400 or 450, and the sizes of the determined coding units are not all the same. For example, among the determined odd number of coding units 430a, 430b, 430c, 480a, 480b, 480c, the size of a predetermined coding unit 430b or 480b may be different from the sizes of the other coding units 430a, 430c, 480a, 480c. That is, the coding units that can be determined by dividing the current coding unit 400 or 450 can have multiple types of sizes, and in some cases, the odd number of coding units 430a, 430b, 430c, 480a, 480b, 480c may each have different sizes from one another.

[0080] In one embodiment, if the division mode information indicates that the coding unit is divided into an odd number of blocks, the video decoding device 100 can determine the odd number of coding units currently included in the coding unit 400 or 450, and furthermore, the video decoding device 100 can impose a predetermined restriction on at least one of the odd number of coding units generated by the division. Referring to Figure 4, the video decoding device 100 can make the decoding process related to the central coding unit 430b, 480b among the three coding units 430a, 430b, 430c, 480a, 480b, 480c generated by the division of the current coding unit 400 or 450 different from that of the other coding units 430a, 430c, 480a, 480c. For example, the video decoding device 100 can restrict the centrally located coding units 430b and 480b from being further divided, unlike the other coding units 430a, 430c, 480a, and 480c, or it can restrict them to being divided a predetermined number of times.

[0081] Figure 5 illustrates the process by which a video decoding device 100 according to one embodiment divides an encoding unit based on at least one of block form information and divided form mode information.

[0082] In one embodiment, the video decoding device 100 can decide whether or not to divide a square-shaped first coding unit 500 into coding units based on at least one of the block shape information and the division shape mode information. In one embodiment, if the division shape mode information indicates that the first coding unit 500 is divided horizontally, the video decoding device 100 can divide the first coding unit 500 horizontally and determine the second coding unit 510. In one embodiment, the terms first coding unit, second coding unit, and third coding unit used are terms used to understand the before-and-after relationship between coding units. For example, if the first coding unit is divided, the second coding unit is determined, and if the second coding unit is divided, the third coding unit is determined. Hereinafter, the relationship between the first coding unit, second coding unit, and third coding unit used can be understood as being due to the aforementioned features.

[0083] In one embodiment, the video decoding device 100 can decide whether to divide the determined second coding unit 510 into coding units or not, based on the division mode information. Referring to Figure 5, the video decoding device 100 divides the second coding unit 510, which is determined to be a non-square shape by dividing the first coding unit 500, into at least one third coding unit 520a, 520b, 520c, 520d, or does not divide the second coding unit 510. The video decoding device 100 can acquire the division mode information, and based on the acquired division mode information, the video decoding device 100 can divide the first coding unit 500, for example, into multiple second coding units 510 of various shapes, and the second coding units 510 can also be divided in the same way that the first coding unit 500 was divided, based on the division mode information. In one embodiment, when a first coding unit 500 is divided into a second coding unit 510 based on the division mode information relating to the first coding unit 500, the second coding unit 510 is also divided into, for example, third coding units 520a, 520b, 520c, and 520d based on the division mode information relating to the second coding unit 510. That is, coding units are also recursively divided based on the division mode information relating to each coding unit. Consequently, in a non-square coding unit, a square coding unit is determined, and such a square coding unit is recursively divided to determine a non-square coding unit.

[0084] Referring to Figure 5, a non-square second coding unit 510 is divided to determine an odd number of third coding units 520b, 520c, 520d. A predetermined coding unit (e.g., a coding unit located in the middle, or a square coding unit) is also recursively divided. In one embodiment, a square third coding unit 520b, which is one of the odd number of third coding units 520b, 520c, 520d, is divided horizontally into multiple fourth coding units. A non-square fourth coding unit 530b or 530d, which is one of the multiple fourth coding units 530a, 530b, 530c, 530d, is further divided into multiple coding units. For example, a non-square fourth coding unit 530b or 530d is further divided into an odd number of coding units. The method used for the recursive division of coding units will be described later through various embodiments.

[0085] In one embodiment, the video decoding device 100 can divide each of the third coding units 520a, 520b, 520c, and 520d into coding units based on the division mode information. The video decoding device 100 can also decide not to divide the second coding unit 510 based on the division mode information. In one embodiment, the video decoding device 100 can divide a non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The video decoding device 100 can impose certain restrictions on a predetermined third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the video decoding device 100 can restrict the coding unit 520c located in the middle of the odd number of third coding units 520b, 520c, and 520d to either not be divided further, or to be divided up to a set number of times.

[0086] Referring to Figure 5, the video decoding device 100 can restrict the middle coding unit 520c among the odd number of third coding units 520b, 520c, and 520d contained in the non-square second coding unit 510 to not be further divided, or to be divided into a predetermined division pattern (for example, to be divided into only four coding units, or to be divided into a pattern corresponding to the division pattern of the second coding unit 510), or to be divided only a predetermined number of times (e.g., divided only n times, n>0). However, the above restrictions on the middle coding unit 520c are merely embodiments and should not be interpreted as being limited to the above embodiments, but rather as including a variety of restrictions that cause the middle coding unit 520c to be decoded differently from the other coding units 520b and 520d.

[0087] In one embodiment, the video decoding device 100 can acquire the division mode information used to divide the currently encoded unit at a predetermined position within the currently encoded unit.

[0088] Figure 6 illustrates a method by which a video decoding device 100 according to one embodiment determines a predetermined encoding unit from an odd number of encoding units.

[0089] Referring to Figure 6, the current division mode information of coding units 600 and 650 can be obtained from a sample at a predetermined position among multiple samples contained in the current coding units 600 and 650 (e.g., samples 640 and 690 located in the middle). However, the predetermined position within the current coding unit 600 from which at least one such division mode information can be obtained should not be interpreted as being limited to the middle position shown in Figure 6, but rather should be interpreted as including a variety of positions contained within the current coding unit 600 (e.g., top edge, bottom edge, left side, right side, upper left edge, lower left edge, upper right edge, or lower right edge). The video decoding device 100 can obtain the division mode information obtained from the predetermined position and decide whether to divide the current coding unit into coding units of various shapes and sizes, or not.

[0090] In one embodiment, the video decoding device 100 can select one encoding unit when the encoding unit is currently divided into a predetermined number of encoding units. There are various methods for selecting one of multiple encoding units, and such methods will be described later through the various embodiments described below.

[0091] In one embodiment, the video decoding device 100 can divide the currently encoded unit into multiple encoded units and determine the encoded unit at a predetermined position.

[0092] In one embodiment, the video decoding device 100 can utilize information indicating the position of each of the odd-numbered coding units in order to determine the coding unit located in the middle of the odd-numbered coding units. Referring to Figure 6, the video decoding device 100 can divide the current coding unit 600 or the current coding unit 650 and determine the odd-numbered coding units 620a, 620b, 620c or the odd-numbered coding units 660a, 660b, 660c. The video decoding device 100 can utilize information relating to the positions of the odd-numbered coding units 620a, 620b, 620c or the odd-numbered coding units 660a, 660b, 660c to determine the middle coding unit 620b or the middle coding unit 660b. For example, the video decoding device 100 can determine the middle coding unit 620b by determining the positions of coding units 620a, 620b, and 620c based on information indicating the positions of predetermined samples contained in coding units 620a, 620b, and 620c. Specifically, the video decoding device 100 can determine the middle coding unit 620b by determining the positions of coding units 620a, 620b, and 620c based on information indicating the positions of samples 630a, 630b, and 630c at the upper left end of coding units 620a, 620b, and 620c.

[0093] In one embodiment, the information indicating the position of the upper left-hand sample 630a, 630b, 630c included in the coding units 620a, 620b, 620c, respectively, may include information relating to the position or coordinates of the coding units 620a, 620b, 620c within the picture. In one embodiment, the information indicating the position of the upper left-hand sample 630a, 630b, 630c included in the coding units 620a, 620b, 620c, respectively, may also include information indicating the width or height of the coding units 620a, 620b, 620c currently included in coding unit 600, and such width or height also corresponds to information indicating the difference in coordinates between the coding units 620a, 620b, 620c within the picture. In other words, the video decoding device 100 can determine the middle coding unit 620b by directly using information relating to the position or coordinates of coding units 620a, 620b, and 620c within the picture, or by using information relating to the width or height of coding units corresponding to the difference between coordinates.

[0094] In one embodiment, information indicating the position of sample 630a at the upper left end of the upper coding unit 620a can be expressed in (xa,ya) coordinates, information indicating the position of sample 530b at the upper left end of the middle coding unit 620b can be expressed in (xb,yb) coordinates, and information indicating the position of sample 630c at the upper left end of the lower coding unit 620c can be expressed in (xc,yc) coordinates. The video decoding device 100 can determine the middle coding unit 620b by using the coordinates of the upper left end samples 630a, 630b, and 630c included in coding units 620a, 620b, and 620c, respectively. For example, when the coordinates of samples 630a, 630b, and 630c at the top left are sorted in ascending or descending order, the coding unit 620b containing the coordinates (xb,yb) of sample 630b located in the middle can be determined as the middle coding unit among the coding units 620a, 620b, and 620c determined by the division of the currently selected coding unit 600. However, the coordinates indicating the positions of samples 630a, 630b, and 630c at the top left can represent absolute positions within the picture. Furthermore, it is also possible to use the (dxb,dyb) coordinates, which indicate the relative position of sample 630b at the top left of the middle coding unit 620b, and the (dxc,dyc) coordinates, which indicate the relative position of sample 630c at the top left of the bottom coding unit 620c, based on the position of sample 630a at the top left of the top coding unit 620a. Furthermore, the method of determining the 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 method described above, but rather as a variety of arithmetic methods that can utilize the coordinates of a sample.

[0095] In one embodiment, the video decoding device 100 can divide the current encoding unit 600 into multiple encoding units 620a, 620b, and 620c, and can select an encoding unit 620a, 620b, or 620c according to a predetermined criterion. For example, the video decoding device 100 can select an encoding unit 620b of a different size from the encoding units 620a, 620b, or 620c.

[0096] In one embodiment, the video decoding device 100 can determine the width or height of each coding unit 620a, 620b, and 620c by using the (xa,ya) coordinates, which indicate the position of the sample 630a at the upper left end of the upper coding unit 620a; the (xb,yb) coordinates, which indicate the position of the sample 630b at the upper left end of the middle coding unit 620b; and the (xc,yc) coordinates, which indicate the position of the sample 630c at the upper left end of the lower coding unit 620c. The video decoding device 100 can determine the size of each coding unit 620a, 620b, and 620c by using the coordinates (xa,ya), (xb,yb), and (xc,yc), which indicate the positions of the coding units 620a, 620b, and 620c. In one embodiment, the video decoding device 100 can determine the width of the upper coding unit 620a as the width of the current coding unit 600. The video decoding device 100 can determine the height of the upper coding unit 620a as (yb-ya). In one embodiment, the video decoding device 100 can determine the width of the middle coding unit 620b as the width of the current coding unit 600. The video decoding device 100 can determine the height of the middle coding unit 620b as (yc-yb). In one embodiment, the video decoding device 100 can determine the width or height of the lower coding unit using the width or height of the current coding unit and the widths and heights of the upper coding unit 620a and the middle coding unit 620b. Based on the determined widths and heights of the coding units 620a, 620b, and 620c, the video decoding device 100 can determine a coding unit having a different size from the other coding units. Referring to Figure 6, the video decoding device 100 can determine the middle coding unit 620b, which has a different size from the upper coding unit 620a and the lower coding unit 620c, as the coding unit at a predetermined position. However, the process by which the aforementioned video decoding device 100 determines an encoding unit having a different size from other encoding units is merely one embodiment of determining an encoding unit at a predetermined position by utilizing the size of the encoding unit determined based on the sample coordinates. Therefore, various processes can be used to determine an encoding unit at a predetermined position by comparing the sizes of encoding units determined by predetermined sample coordinates.

[0097] The video decoding device 100 can determine the width or height of each coding unit 660a, 660b, and 660c by using the (xd,yd) coordinates, which indicate the position of sample 670a at the upper left edge of the left coding unit 660a; the (xe,ye) coordinates, which indicate the position of sample 670b at the upper left edge of the middle coding unit 660b; and the (xf,yf) coordinates, which indicate the position of sample 670c at the upper left edge of the right coding unit 660c. The video decoding device 100 can also determine the size of each coding unit 660a, 660b, and 660c by using the coordinates (xd,yd), (xe,ye), and (xf,yf), which indicate the positions of the coding units 660a, 660b, and 660c.

[0098] In one embodiment, the video decoding device 100 can determine the width of the left coding unit 660a as (xe-xd). The video decoding device 100 can determine the height of the left coding unit 660a as the height of the current coding unit 650. In one embodiment, the video decoding device 100 can determine the width of the middle coding unit 660b as (xf-xe). The video decoding device 100 can determine the height of the middle coding unit 660b as the height of the current coding unit 600. In one embodiment, the video decoding device 100 can determine the width or height of the right coding unit 660c using the width or height of the current coding unit 650 and the widths and heights of the left coding unit 660a and the middle coding unit 660b. Based on the determined widths and heights of the coding units 660a, 660b, and 660c, the video decoding device 100 can determine coding units that have a different size from the other coding units. Referring to Figure 6, the video decoding device 100 can determine the middle coding unit 660b, which has a different size from the left coding unit 660a and the right coding unit 660c, as the coding unit at a predetermined position. However, the process by which the video decoding device 100 determines a coding unit having a different size from other coding units is merely one embodiment of determining the coding unit at a predetermined position using the size of the coding unit determined based on the sample coordinates. Therefore, various processes can be used to determine the coding unit at a predetermined position by comparing the sizes of the coding units determined by predetermined sample coordinates.

[0099] However, the sample positions considered in determining the position of the coding unit are not limited to the upper left corner as described above, but rather information relating to the positions of any sample included in the coding unit is used.

[0100] In one embodiment, the video decoding device 100 can take into account the shape of the current coding unit and select a coding unit at a predetermined position from an odd number of coding units determined by dividing the current coding unit. For example, if the current coding unit is a non-square shape with a width greater than its height, the video decoding device 100 can determine a coding unit at a predetermined position along the horizontal direction. That is, the video decoding device 100 can determine one of coding units that are located at different positions in the horizontal direction and impose restrictions on that coding unit. If the current coding unit is a non-square shape with a height greater than its width, the video decoding device 100 can determine a coding unit at a predetermined position along the vertical direction. That is, the video decoding device 100 can determine one of coding units that are located at different positions in the vertical direction and impose restrictions on that coding unit.

[0101] In one embodiment, the video decoding device 100 can utilize information indicating the position of each of the even-numbered coding units to determine the coding unit at a predetermined position among an even-numbered coding unit. The video decoding device 100 can currently divide the coding unit (binary division) and determine an even-numbered coding unit, and can use information relating to the positions of the even-numbered coding units to determine the coding unit at a predetermined position. The specific process related to this is the same process as the process for determining the coding unit at a predetermined position (e.g., the middle position) among an odd-numbered coding unit as explained in Figure 6, so it will be omitted here.

[0102] In one embodiment, when a non-square current coding unit is divided into multiple coding units, predetermined information relating to the coding unit at a predetermined position can be used during the division process to determine the coding unit at a predetermined position among the multiple coding units. For example, the video decoding device 100 can use at least one of the block shape information and division shape mode information stored in the sample included in the middle coding unit during the division process to determine the coding unit located in the middle among the multiple coding units into which the current coding unit has been divided.

[0103] Referring to Figure 6, the video decoding device 100 can divide the current coding unit 600 into multiple coding units 620a, 620b, and 620c based on the division mode information, and can determine the coding unit 620b located in the middle of the multiple coding units 620a, 620b, and 620c. Furthermore, the video decoding device 100 can determine the coding unit 620b located in the middle by considering the position where the division mode information is acquired. That is, the division 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 if the current coding unit 600 is divided into multiple coding units 620a, 620b, and 620c based on the division mode information, the coding unit 620b containing the sample 640 can be determined as the coding unit located in the middle. However, the information used to determine the coding unit located in the middle is not limited to the division mode information, but various types of information are used in the process of determining the coding unit located in the middle.

[0104] In one embodiment, predetermined information for identifying an encoding unit at a predetermined location is also obtained from a predetermined sample included in the encoding unit to be determined. Referring to Figure 6, the video decoding device 100 can use segmentation mode information obtained from a sample at a predetermined location within the current encoding unit 600 (e.g., a sample located in the middle of the current encoding unit 600) in order to determine an encoding unit at a predetermined location among a plurality of encoding units 620a, 620b, 620c determined by the division of the current encoding unit 600 (e.g., an encoding unit located in the middle of a plurality of divided encoding units). That is, the video decoding device 100 can determine the sample at the predetermined location considering the block configuration of the current encoding unit 600, and the video decoding device 100 can determine an encoding unit 620b among a plurality of encoding units 620a, 620b, 620c determined by the division of the current encoding unit 600 that contains a sample from which predetermined information (e.g., segmentation mode information) can be obtained, and can set a predetermined restriction. Referring to Figure 6, in one embodiment, the video decoding device 100 can determine a sample 640 located in the middle of the encoding unit 600 as a sample from which predetermined information can be obtained, and the video decoding device 100 can impose a predetermined restriction on the encoding unit 620b containing such sample 640 during the decoding process. However, the position of the sample from which predetermined information can be obtained is not interpreted as being limited to the aforementioned position, but rather as a sample at any position included in the encoding unit 620b determined for the purpose of imposing the restriction.

[0105] In one embodiment, the location of a sample from which predetermined information can be obtained is also determined by the shape of the currently encoded unit 600. In one embodiment, block shape information can determine whether the shape of the currently encoded unit is square or not, and the location of a sample from which predetermined information can be obtained can be determined by the shape. For example, the video decoding device 100 can use at least one of the information relating to the width of the currently encoded unit and the information relating to the height to determine that a sample located on a boundary that divides at least one of the width and height of the currently encoded unit in half is a sample from which predetermined information can be obtained. To give another example, if the video decoding device 100 indicates whether the block shape information relating to the currently encoded unit is not square, it can determine that one of the samples adjacent to the boundary that divides the long side of the currently encoded unit in half is a sample from which predetermined information can be obtained.

[0106] In one embodiment, the video decoding device 100 can utilize division mode information to determine a predetermined location of an encoding unit when the current encoding unit is divided into multiple encoding units. The video decoding device 100 can obtain division mode information from a sample at a predetermined location included in the encoding unit, and the video decoding device 100 can divide the multiple encoding units generated by the division of the current encoding unit using the division mode information obtained from a sample at a predetermined location included in each of the multiple encoding units. That is, the encoding unit is also divided recursively using the division mode information obtained from a sample at a predetermined location included in each encoding unit. The recursive division process of the encoding unit has been explained in detail with reference to Figure 5, so a detailed explanation will be omitted here.

[0107] An image decoding device 100 according to one embodiment can divide the current encoding unit and determine at least one encoding unit, and can determine the order in which such at least one encoding unit is decoded by a predetermined block (e.g., the current encoding unit).

[0108] Figure 7 illustrates the order in which multiple encoding units are processed when a video decoding device 100 according to one embodiment divides the current encoding unit and determines multiple encoding units.

[0109] In one embodiment, the video decoding device 100 can, based on the division mode information, divide the first encoding unit 700 vertically to determine the second encoding units 710a and 710b, divide the first encoding unit 700 horizontally to determine the second encoding units 730a and 730b, or divide the first encoding unit 700 vertically and horizontally to determine the second encoding units 750a, 750b, 750c, and 750d.

[0110] Referring to Figure 7, the video decoding device 100 can determine the processing order of the second coding units 710a and 710b, which are determined by vertically dividing the first coding unit 700, so that they are processed horizontally (710c). The video decoding device 100 can also determine the processing order of the second coding units 730a and 730b, which are determined by horizontally dividing the first coding unit 700, so that they are processed vertically (730c). The video decoding device 100 can determine the processing order of the second coding units 750a, 750b, 750c, and 750d, which are determined by vertically and horizontally dividing the first coding unit 700, so that the coding units located in the next row are processed after the coding units located in the next row are processed (e.g., raster scan order or z scan order (750e)).

[0111] In one embodiment, the video decoding device 100 can recursively divide an encoding unit. Referring to Figure 7, the video decoding device 100 can divide the first encoding unit 700 and determine a plurality of encoding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d, and can recursively divide each of the determined plurality of encoding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. The method for dividing the plurality of encoding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d also corresponds to the method for dividing the first encoding unit 700. As a result, the multiple coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d are each independently divided into multiple coding units. Referring to Figure 7, the video decoding device 100 can vertically divide the first coding unit 700 to determine the second coding units 710a and 710b, and furthermore, it can decide whether to divide each of the second coding units 710a and 710b independently or not.

[0112] In one embodiment, the video decoding device 100 can divide the left-side second encoding unit 710a horizontally into third encoding units 720a and 720b, while the right-side second encoding unit 710b is not divided.

[0113] In one embodiment, the processing order of coding units is also determined based on the coding unit division process. In other words, the processing order of divided coding units is also determined based on the processing order of the coding unit immediately before division. The video decoding device 100 can determine the processing order of the third coding units 720a and 720b, which are determined when the left second coding unit 710a is divided, independently of the right second coding unit 710b. Since the left second coding unit 710a is divided horizontally and the third coding units 720a and 720b are determined, the third coding units 720a and 720b are processed vertically (720c). Furthermore, since the processing order of the left-side second coding unit 710a and the right-side second coding unit 710b corresponds to the horizontal direction (710c), the right-side coding unit 710b may be processed after the third coding units 720a and 720b included in the left-side second coding unit 710a are processed vertically (720c). The above description is intended to explain the process by which the processing order of coding units is determined by the coding units before division, and should not be interpreted as being limited to the above-described embodiment. Rather, it should be interpreted as being usable in various ways in which coding units determined by being divided into various forms are processed independently in a predetermined order.

[0114] Figure 8 illustrates the process by which a video decoding device 100 according to one embodiment determines that the current coding unit will be divided into an odd number of coding units if a predetermined sequential coding unit is not processed.

[0115] In one embodiment, the video decoding device 100 can determine that the current coding unit is divided into an odd number of coding units based on the acquired division mode information. Referring to Figure 8, the square-shaped first coding unit 800 is divided into non-square-shaped second coding units 810a and 810b, and the second coding units 810a and 810b are each independently divided into third coding units 820a, 820b, 820c, 820d, and 820e. In one embodiment, the video decoding device 100 can divide the left coding unit 810a of the second coding unit horizontally to determine multiple third coding units 820a and 820b, and the right coding unit 810b can be divided into an odd number of third coding units 820c, 820d, and 820e.

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

[0117] An image decoding device 100 according to one embodiment can determine whether the third coding units 820a, 820b, 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition that allows them to be processed in a predetermined order. This condition relates to whether at least one of the width and height of the second coding units 810a and 810b is divided in half along the boundary of the third coding units 820a, 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 can satisfy the condition. If the boundaries of the third coding units 820c, 820d, and 820e, which are determined by dividing the right-side second coding unit 810b into three coding units, cannot be halved in width or height, then the third coding units 820c, 820d, and 820e are also determined to be unable to satisfy the conditions. In such cases of unsatisfied conditions, the video decoding device 100 determines that there is a discontinuation in the scan order, and based on the determination result, it can determine that the right-side second coding unit 810b is divided into an odd number of coding units. In one embodiment, when the video decoding device 100 is divided into an odd number of coding units, it can place a predetermined restriction on the coding unit at a predetermined position among the divided coding units. Since the details of such restrictions or predetermined positions have been described in detail through various embodiments, a detailed explanation will be omitted here.

[0118] Figure 9 illustrates the process by which a video decoding device 100 according to one embodiment divides the first encoding unit 900 and determines at least one encoding unit.

[0119] In one embodiment, the video decoding device 100 can divide the first coding unit 900 based on the division mode information acquired via the bitstream acquisition unit 110. The square-shaped first coding unit 900 can be divided into four coding units having a square shape, or into a plurality of non-square coding units. For example, referring to Figure 9, if the first coding unit 900 is square and the division mode information indicates that it is divided into non-square coding units, the video decoding device 100 can divide the first coding unit 900 into a plurality of non-square coding units. Specifically, if the division mode information indicates that the first coding unit 900 is 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, 910c determined by vertical division as an odd number of coding units, or into second coding units 920a, 920b, 920c determined by horizontal division.

[0120] In one embodiment, the video decoding device 100 can determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy the condition that they can be processed in a predetermined order. This condition relates to whether at least one of the width and height of the first coding unit 900 is divided in half along the boundaries of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Referring to Figure 9, the boundaries of the second coding units 910a, 910b, and 910c, determined by vertically dividing the square-shaped first coding unit 900, cannot divide the width of the first coding unit 900 in half. Therefore, it is also determined that the first coding unit 900 cannot satisfy the condition that it can be processed in a predetermined order. Furthermore, since the boundaries of the second coding units 920a, 920b, and 920c, which are determined by horizontally dividing the square-shaped first coding unit 900, cannot divide the width of the first coding unit 900 in half, it is also determined that the first coding unit 900 cannot satisfy the condition that it can be processed in a predetermined order. In the event that such a condition is not satisfied, the video decoding device 100 determines that there is a discontinuation in the scan order, and based on this determination, it may decide that the first coding unit 900 is divided into an odd number of coding units. In one embodiment, when the video decoding device 100 is divided into an odd number of coding units, it may impose a predetermined restriction on the coding unit at a predetermined position among the divided coding units. Since the content of such restrictions or predetermined positions have been explained through various embodiments, a detailed explanation will be omitted here.

[0121] In one embodiment, the video decoding device 100 can divide the first encoding unit and determine various forms of encoding units.

[0122] Referring to Figure 9, the video decoding device 100 can divide the square-shaped first coding unit 900, the non-square-shaped first coding unit 930 or 950 into coding units of various shapes.

[0123] Figure 10 illustrates that in one embodiment of the video decoding device 100, if the non-square-shaped second coding unit determined by dividing the first coding unit 1000 satisfies predetermined conditions, the form in which the second coding unit can be divided is limited.

[0124] In one embodiment, the video decoding device 100 can 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 acquisition unit 110. The second coding units 1010a, 1010b, 1020a, and 1020b can also be divided independently. Based on the division mode information relating to each of the second coding units 1010a, 1010b, 1020a, and 1020b, the video decoding device 100 can determine whether to divide them into multiple coding units or not. In one embodiment, the video decoding device 100 can divide the non-square-shaped left-side second coding unit 1010a, which was determined by dividing the first coding unit 1000 vertically, horizontally to determine the third coding units 1012a and 1012b. However, if the left second coding unit 1010a is divided horizontally, the video decoding device 100 can restrict the right second coding unit 1010b from being divided horizontally in the same direction as the left second coding unit 1010a. If the right second coding unit 1010b is divided in the same direction and the third coding units 1014a and 1014b are determined, the left second coding unit 1010a and the right second coding unit 1010b are divided horizontally independently, thereby determining the third coding units 1012a, 1012b, 1014a, and 1014b. However, this is the same result as if the video decoding device 100 had divided the first coding unit 1000 into four square-shaped second coding units 1030a, 1030b, 1030c, and 1030d based on the division mode information, which is inefficient from a video decoding perspective.

[0125] In one embodiment, the video decoding device 100 can divide the non-square second coding unit 1020a or 1020b, which is determined by dividing the first coding unit 1000 horizontally, vertically to determine the third coding units 1022a, 1022b, 1024a, and 1024b. However, if the video decoding device 100 divides one of the second coding units (e.g., the upper second coding unit 1020a) vertically, for the reasons mentioned above, it can restrict the division of the other second coding units (e.g., the lower coding unit 1020b) so that they are not divided vertically in the same direction as the upper second coding unit 1020a.

[0126] Figure 11 illustrates the process by which the video decoding device 100 divides the square-shaped encoding units when it is not possible to show that the divided mode information is divided into four square-shaped encoding units according to one embodiment.

[0127] In one embodiment, the video decoding device 100 can divide the first coding unit 1100 based on the division mode information and determine the second coding units 1110a, 1110b, 1120a, and 1120b. The division mode information may include information relating to various forms in which the coding unit can be divided, but the information relating to various forms may not include information for dividing it into four square coding units. According to such division mode information, the video decoding device 100 cannot 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 can determine the non-square second coding units 1110a, 1110b, 1120a, and 1120b.

[0128] In one embodiment, the video decoding device 100 can independently divide the non-square second coding units 1110a, 1110b, 1120a, and 1120b. Each of the second coding units 1110a, 1110b, 1120a, and 1120b is divided in a predetermined order via a recursive method, which is also a division method corresponding to the method by which the first coding unit 1100 is divided based on division mode information.

[0129] For example, the video decoding device 100 can determine square-shaped third coding units 1112a and 1112b by horizontally dividing the left second coding unit 1110a, and can determine square-shaped third coding units 1114a and 1114b by horizontally dividing the right second coding unit 1110b. Furthermore, the video decoding device 100 can also determine square-shaped third coding units 1116a, 1116b, 1116c, and 1116d by horizontally dividing both the left second coding unit 1110a and the right second coding unit 1110b. In such a case, the coding units are determined in the same form as when the first coding unit 1100 is divided into four square-shaped second coding units 1130a, 1130b, 1130c, and 1130d.

[0130] To give another example, the video decoding device 100 can determine square-shaped third coding units 1122a and 1122b by vertically dividing the upper second coding unit 1120a, and can determine square-shaped third coding units 1124a and 1124b by vertically dividing the lower second coding unit 1120b. Furthermore, the video decoding device 100 can also determine square-shaped third coding units 1126a, 1126b, 1126a and 1126b by vertically dividing both the upper second coding unit 1120a and the lower second coding unit 1120b. In such a case, the coding units are determined in the same form as when the first coding unit 1100 is divided into four square-shaped second coding units 1130a, 1130b, 1130c and 1130d.

[0131] Figure 12 illustrates, in one embodiment, that the processing order between multiple coding units differs depending on the coding unit division process.

[0132] In one embodiment, the video decoding device 100 can divide the first coding unit 1200 based on the division mode information. If the block shape is square and the division mode information indicates that the first coding unit 1200 is divided in at least one direction, either horizontal or vertical, the video decoding device 100 can divide the first coding unit 1200 to determine, for example, second coding units 1210a, 1210b, 1220a, and 1220b. Referring to Figure 12, the non-square second coding units 1210a, 1210b, 1220a, and 1220b, which are determined by dividing the first coding unit 1200 only in the horizontal or vertical direction, can also be divided independently based on the division mode information associated with each unit. For example, the video decoding device 100 can determine third coding units 1216a, 1216b, 1216c, and 1216d by dividing the second coding units 1210a and 1210b, which are generated by dividing the first coding unit 1200 vertically, horizontally, and can determine third coding units 1226a, 1226b, 1226c, and 1226d by dividing the second coding units 1220a and 1220b, which are generated by dividing the first coding unit 1200 horizontally, horizontally. The division process of such second coding units 1210a, 1210b, 1220a, and 1220b has been explained in detail in relation to Figure 11, so a detailed explanation will be omitted here.

[0133] In one embodiment, the video decoding device 100 can process coding units in a predetermined order. The features related to the processing of coding units in a predetermined order have been explained in detail with reference to Figure 7, so a detailed explanation will be omitted here. Referring to Figure 12, the video decoding device 100 can divide a square-shaped first coding unit 1200 and determine four square-shaped third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d. In one embodiment, the video decoding device 100 can determine the processing order of the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d depending on how the first coding unit 1200 is divided.

[0134] In one embodiment, the video decoding device 100 can divide the second coding units 1210a and 1210b, which are generated by vertical division, horizontally and determine the third coding units 1216a, 1216b, 1216c, and 1216d. The video decoding device 100 can process the third coding units 1216a, 1216b, 1216c, and 1216d in the order (1217) of first processing the third coding units 1216a and 1216c contained in the left second coding unit 1210a vertically, and then processing the third coding units 1216b and 1216d contained in the right second coding unit 1210b vertically.

[0135] In one embodiment, the video decoding device 100 can divide the second coding units 1220a and 1220b, which are generated by dividing them horizontally, vertically, and determine the third coding units 1226a, 1226b, 1226c, and 1226d. The video decoding device 100 can process the third coding units 1226a, 1226b, 1226c, and 1226d in the order (1227) of first processing the third coding units 1226a and 1226b contained in the upper second coding unit 1220a horizontally, and then processing the third coding units 1226c and 1226d contained in the lower second coding unit 1220b horizontally.

[0136] Referring to Figure 12, the second coding units 1210a, 1210b, 1220a, and 1220b are each divided to determine the square-shaped third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d. The second coding units 1210a and 1210b determined by vertical division, and the second coding units 1220a and 1220b determined by horizontal division, are divided into different forms from each other. However, according to the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d determined thereafter, they are ultimately coding units of the same form, and are the result of the division of the first coding unit 1200. As a result, the video decoding device 100 can recursively divide the coding unit through different processes based on the division mode information, thereby determining coding units of the same form, and processing multiple coding units determined to be of the same form in different orders.

[0137] Figure 13 illustrates the process by which the depth of a coding unit is determined when, according to one embodiment, a coding unit is recursively divided and multiple coding units are determined, as the shape and size of the coding unit change.

[0138] In one embodiment, the video decoding device 100 can determine the depth of an encoding unit according to a predetermined criterion. For example, this predetermined criterion can also be the length of the long side of the encoding unit. The video decoding device 100 can determine that if the length of the long side of the current encoding unit is divided into 2n (n>0) times the length of the long side of the encoding unit before division, the depth of the current encoding unit is increased by n in depth compared to the depth of the encoding unit before division. Hereinafter, the encoding unit with increased depth will be referred to as the lower-depth encoding unit.

[0139] Referring to Figure 13, in one embodiment, based on block shape information indicating whether or not it is square (for example, the block shape information can indicate "0: SQUARE"), the video decoding device 100 can divide the square-shaped first coding unit 1300 and determine the lower-depth second coding unit 1302, third coding unit 1304, etc. If the size of the square-shaped first coding unit 1300 is 2N x 2N, then the second coding unit 1302, determined by dividing the width and height of the first coding unit 1300 by half, can have a size of N x N. Furthermore, the third coding unit 1304, determined by dividing the width and height of the second coding unit 1302 by half, can have a size of N / 2 x N / 2. In that case, the width and height of the third coding unit 1304 correspond to 1 / 4 of the first coding unit 1300. If the depth of the first coding unit 1300 is D, then the depth of the second coding unit 1302, which is half the width and height of the first coding unit 1300, is (D+1), and the depth of the third coding unit 1304, which is quarter the width and height of the first coding unit 1300, is (D+2).

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

[0141] The video decoding device 100 can divide at least one of the width and height of the first coding unit 1310, which is of size Nx2N, to determine, for example, second coding units 1302, 1312, and 1322. That is, the video decoding device 100 can divide the first coding unit 1310 horizontally to determine a second coding unit 1302 of size NxN or a second coding unit 1322 of size NxN / 2, or it can divide it horizontally and vertically to determine a second coding unit 1312 of size N / 2xN.

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

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

[0144] In one embodiment, the video decoding device 100 can also divide at least one of the width and height of the N / 2xN size second coding unit 1312 to determine, for example, third coding units 1304, 1314, and 1324. That is, the video decoding device 100 can divide the second coding unit 1312 horizontally to determine a third coding unit 1304 of N / 2xN / 2 size or a third coding unit 1324 of N / 2xN / 4 size, or divide it vertically and horizontally to determine a third coding unit 1314 of N / 4xN / 2 size.

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

[0146] In one embodiment, the video decoding device 100 can divide, for example, square-shaped coding units 1300, 1302, and 1304 horizontally or vertically. For example, a first coding unit 1300 of size 2Nx2N can be divided vertically to determine a first coding unit 1310 of size Nx2N, or it can be divided horizontally to determine a first coding unit 1320 of size 2NxN. In one embodiment, if the depth is determined based on the longest side length of the coding unit, the depth of the coding unit determined by dividing the first coding unit 1300 of size 2Nx2N horizontally or vertically is the same as the depth of the first coding unit 1300.

[0147] In one embodiment, the width and height of the third coding unit 1314 or 1324 are 1 / 4 times that of the first coding unit 1310 or 1320. If the depth of the first coding unit 1310 or 1320 is D, then the depth of the second coding unit 1312 or 1322, which is 1 / 2 the width and height of the first coding unit 1310 or 1320, is (D+1), and the depth of the third coding unit 1314 or 1324, which is 1 / 4 the width and height of the first coding unit 1310 or 1320, is (D+2).

[0148] Figure 14 illustrates, in one embodiment, the depth, which is also determined by the shape and size of the coding unit, and the index (PID: part index) for the coding unit division.

[0149] In one embodiment, the video decoding device 100 can divide a square-shaped first coding unit 1400 and determine second coding units of various shapes. Referring to Figure 14, the video decoding device 100 can divide the first coding unit 1400 in at least one direction, either vertical or horizontal, based on the division shape mode information, and determine second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d. That is, the video decoding device 100 can determine second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d based on the division shape mode information relating to the first coding unit 1400.

[0150] In one embodiment, the depth of the second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d, which are determined by the division mode information relating to the square-shaped first coding unit 1400, is determined based on the length of the longer 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 longer side of the non-square-shaped second coding units 1402a, 1402b, 1404a, and 1404b, the depth of the first coding unit 1400 and the non-square-shaped second coding units 1402a, 1402b, 1404a, and 1404b can be considered to be the same as D. Conversely, 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 side length of each square-shaped second coding unit 1406a, 1406b, 1406c, and 1406d is half the side length of the first coding unit 1400. Therefore, the depth of the second coding units 1406a, 1406b, 1406c, and 1406d is one depth lower (D+1) than the depth D of the first coding unit 1400.

[0151] In one embodiment, the video decoding device 100 can divide a first coding unit 1410, which has a height greater than its width, horizontally according to the division mode information, and divide it into a plurality of second coding units 1412a, 1412b, 1414a, 1414b, and 1414c.

[0152] In one embodiment, the video decoding device 100 can vertically divide a first encoding unit 1420, which has a width greater than its height, according to the division mode information, and divide it into a plurality of second encoding units 1422a, 1422b, 1424a, 1424b, and 1424c.

[0153] In one embodiment, the depth of the second coding units 1412a, 1412b, 1414a, 1414b, 1414c, 1422a, 1422b, 1424a, 1424b, 1424c, determined by the division mode information relating to the non-square first coding unit 1410 or 1420, is determined based on the length of the longer side. For example, since the side length of the square second coding units 1412a, 1412b is half the side length of the non-square first coding unit 1410, whose height is greater than its width, the depth of the square second coding units 1412a, 1412b is one depth lower (D+1) than the depth D of the non-square first coding unit 1410.

[0154] Furthermore, the video decoding device 100 can divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the division mode information. The odd number of second coding units 1414a, 1414b, and 1414c may include non-square second coding units 1414a and 1414c, and a square second coding unit 1414b. In that case, the length of the longer 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 the length of one side of the first coding unit 1410, so the depth of the second coding units 1414a, 1414b, and 1414c is also a depth of (D+1), which is one depth lower than the depth D of the first coding unit 1410. The video decoding device 100 can determine the depth of an encoding unit related to a non-square first encoding unit 1420, in a manner corresponding to the method for determining the depth of an encoding unit related to the first encoding unit 1410.

[0155] In one embodiment, the video decoding device 100 can determine the index (PID) for the division of divided coding units based on the ratio of the sizes of the coding units when the odd number of divided coding units are not the same size. Referring to Figure 14, among the odd number of divided coding units 1414a, 1414b, and 1414c, the middle coding unit 1414b has the same width as the other coding units 1414a and 1414c, but its height is different, and the middle coding unit 1414b is twice the height of the other coding units 1414a and 1414c. In other words, in this case, the middle coding unit 1414b may contain both of the other coding units 1414a and 1414c. Therefore, depending on the scan order, if the index (PID) of the middle coding unit 1414b is 1, then the next coding unit 1414c in the sequence will have an index of 3, which is an increase of 2. In other words, there is a discontinuity in the index values. In one embodiment, the video decoding device 100 can determine whether an odd number of divided coding units are of the same size as each other, based on the presence or absence of discontinuities in the indices for the divisions between such divided coding units.

[0156] In one embodiment, the video decoding device 100 can determine whether or not a plurality of coding units, which have been divided and determined from the current coding unit, have been divided into a specific division pattern, based on the value of an index used to distinguish them. Referring to Figure 14, the video decoding device 100 can divide a rectangular first coding unit 1410, where the height is greater than the width, and determine an even number of coding units 1412a, 1412b, or an odd number of coding units 1414a, 1414b, 1414c. The video decoding device 100 can use an index (PID) that represents each coding unit to distinguish each of the plurality of coding units. In one embodiment, the PID is also obtained from a sample at a predetermined position in each coding unit (e.g., the upper left sample).

[0157] In one embodiment, the video decoding device 100 can determine a coding unit at a predetermined position from among the coding units determined by division using an index for the division of coding units. In one embodiment, if the division mode information relating to a rectangular first coding unit 1410, whose height is greater than its width, indicates that it is divided into three coding units, the video decoding device 100 can divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The video decoding device 100 can assign an index relating to each of the three coding units 1414a, 1414b, and 1414c. The video decoding device 100 can compare the indices relating to each coding unit in order to determine the middle coding unit among the odd number of coding units divided into. Based on the index of the coding units, the video decoding device 100 can determine the coding unit 1414b, which has an index corresponding to the middle value among the indices, as the coding unit at the middle position among the coding units determined by division of the first coding unit 1410. In one embodiment, the video decoding device 100 can determine the index for the division of a divided coding unit based on the size ratio between the coding units when the coding units are not the same size. Referring to Figure 14, the coding unit 1414b, which is generated when the first coding unit 1410 is divided, has the same width as the other coding units 1414a and 1414c, but its height is different, and the coding unit 1414b is twice the height of the coding units 1414a and 1414c. In that case, if the index (PID) of the coding unit 1414b located in the middle is 1, then the coding unit 1414c located in the next order will have an index that is 2 higher, which is 3.In cases like that, where the index increases uniformly but the magnitude of the increase differs, the video decoding device 100 can determine that the code has been divided into multiple coding units, including coding units having different sizes from other coding units. In one embodiment, when the division mode information indicates that the code is divided into an odd number of coding units, the video decoding device 100 can divide the current coding unit into a form in which, among the odd number of coding units, the coding unit at a predetermined position (e.g., the middle coding unit) has a different size from the other coding units. In that case, the video decoding device 100 can use the index (PID) related to the coding unit to determine the middle coding unit having a different size. However, the aforementioned index, the size of the coding unit at the predetermined position to be determined, or the position are specified for the purpose of explaining one embodiment and should not be interpreted as being limited to them, but rather as various indices, coding unit positions, and sizes can be used.

[0158] In one embodiment, the video decoding device 100 can utilize a predetermined data unit in which the recursive division of the encoding unit begins.

[0159] Figure 15 illustrates how, in one embodiment, multiple encoding units are determined by multiple predetermined data units contained in a picture.

[0160] In one embodiment, a predetermined data unit is also defined as a data unit from which an encoded unit recursively begins to divide using division mode information. That is, it corresponds to the highest-depth encoded unit used in the process of determining the multiple encoded units that currently divide the picture. For the sake of explanation, such a predetermined data unit will be referred to as the reference data unit below.

[0161] In one embodiment, the reference data unit can exhibit a predetermined size and shape. In one embodiment, the reference coding unit may contain MxN samples, where M and N are identical to each other and are integers expressed as powers of 2. That is, the reference data unit can exhibit a square or non-square shape and can subsequently be divided into an integer number of coding units.

[0162] In one embodiment, the video decoding device 100 can divide the current picture into multiple reference data units. In one embodiment, the video decoding device 100 can divide the current picture into multiple reference data units using the division mode information related to each reference data unit. Such a division process of reference data units corresponds to a division process using a quad-tree structure.

[0163] In one embodiment, the video decoding device 100 can predetermine the minimum size that a reference data unit currently included in a picture can have. This allows the video decoding device 100 to determine reference data units of various sizes that are larger than or equal to the minimum size, and to determine at least one encoding unit using the determined reference data unit as a reference and utilizing the segmentation mode information.

[0164] Referring to Figure 15, the video decoding device 100 can utilize a square-shaped reference coding unit 1500, or it can utilize a non-square-shaped reference coding unit 1502. In one embodiment, the shape and size of the reference coding unit can also be determined by a variety of data units (e.g., sequence, picture, slice, slice segment, maximum coding unit, etc.) that include at least one reference coding unit.

[0165] In one embodiment, the bitstream acquisition unit 110 of the video decoding device 100 can acquire at least one of the following from the bitstream for each of the various data units: information relating to the shape of the reference coding unit and information relating to the size of the reference coding unit. The process by which at least one coding unit included in the square-shaped reference coding unit 1500 is determined is explained through the process by which the current coding unit 300 is divided in Figure 3, and the process by which at least one coding unit included in the non-square-shaped reference coding unit 1502 is determined is explained in detail through the process by which the current coding unit 400 or 450 is divided in Figure 4, so a detailed explanation will be omitted.

[0166] In one embodiment, the video decoding device 100 can use an index to identify the size and shape of a reference coding unit in order to determine the size and shape of a reference coding unit based on a subset of data units predetermined based on predetermined conditions. That is, the bitstream acquisition unit 110 can acquire only an index for identifying the size and shape of a reference coding unit from the bitstream, for each slice, slice segment, maximum coding unit, etc., as data units that satisfy predetermined conditions (e.g., data units having a size smaller than or equal to a slice) from among the various data units (e.g., sequence, picture, slice, slice segment, maximum coding unit, etc.). By using the index, the video decoding device 100 can determine the size and shape of a reference data unit for each data unit that satisfies the predetermined conditions. If information relating to the shape of the reference coding unit and information relating to the size of the reference coding unit are acquired and used from the bitstream for each relatively small data unit, the bitstream utilization efficiency will not be good. Therefore, instead of directly acquiring information relating to the shape of the reference coding unit and information relating to the size of the reference coding unit, only the index can be acquired and used. In that case, at least one of the sizes and shapes of the reference coding units corresponding to the index indicating the size and shape of the reference coding unit is also a default. That is, the video decoding device 100 can determine at least one of the sizes and shapes of the reference coding units included in the data unit that serves as the basis for index acquisition by selecting at least one of the default sizes and shapes of the reference coding units using the index.

[0167] In one embodiment, the video decoding device 100 can utilize at least one reference coding unit contained within a single maximum coding unit. That is, the maximum coding unit that divides the video contains at least one reference coding unit, and coding units are determined through a recursive division process of each reference coding unit. In one embodiment, at least one of the width and height of the maximum coding unit is an integer multiple of at least one of the width and height of the reference coding unit. In one embodiment, the size of the reference coding unit is also the size obtained by dividing the maximum coding unit n times using a quad-tree structure. That is, the video decoding device 100 can divide the maximum coding unit n times using a quad-tree structure to determine the reference coding unit, and in various embodiments, the reference coding unit can be divided based on at least one of block form information and division form mode information.

[0168] Figure 16 illustrates a processing block that serves as a criterion for determining the order in which reference coding units are included in picture 1600, according to one embodiment.

[0169] An image decoding device 100 according to one embodiment can determine at least one processing block for dividing a picture. This processing block is a data unit that includes at least one reference coding unit for dividing the image, and the at least one reference coding unit included in the processing block is determined in a specific order. That is, the order in which the at least one reference coding unit determined in each processing block is determined corresponds to one of a variety of orders in which the reference coding unit is determined, and the order in which the reference coding unit is determined differs for each processing block. The order in which the reference coding unit is determined for each processing block is one of a variety of orders such as raster scan, Z-scan, N-scan, up-right diagonal scan, horizontal scan, and vertical scan, but the order in which it can be determined is not limited to the scan order.

[0170] A video decoding device 100 according to one embodiment can acquire information relating to the size of a processing block and determine the size of at least one processing block contained in the video. The video decoding device 100 can acquire information relating to the size of a processing block from a bitstream and determine the size of at least one processing block contained in the video. The size of such a processing block is also a predetermined size of the data unit indicated by the information relating to the size of the processing block.

[0171] In one embodiment, the bitstream acquisition unit 110 of the video decoding device 100 can acquire information relating to the size of processing blocks from the bitstream for each specific data unit. For example, the information relating to the size of processing blocks is a data unit such as video, sequence, picture, slice, or slice segment, and is also acquired from the bitstream. That is, the bitstream acquisition unit 110 can acquire information relating to the size of processing blocks from the bitstream for each of the aforementioned data units, and the video decoding device 100 can use the acquired information relating to the size of processing blocks to determine the size of at least one processing block that divides a picture, and the size of such a processing block is also an integer multiple of the reference coding unit.

[0172] In one embodiment, the video decoding device 100 can determine the size of processing blocks 1602 and 1612 contained in the picture 1600. For example, the video decoding device 100 can determine the size of a processing block based on information related to the size of a processing block obtained from a bitstream. Referring to Figure 16, in one embodiment, the video decoding device 100 can determine the horizontal size of processing blocks 1602 and 1612 to be four times the horizontal size of the reference coding unit, and the vertical size to be four times the vertical size of the reference coding unit. The video decoding device 100 can determine the order in which at least one reference coding unit is determined within at least one processing block.

[0173] In one embodiment, the video decoding device 100 can determine each processing block 1602, 1612 contained in the picture 1600 based on the size of the processing block, and can determine the order in which at least one reference coding unit contained in the processing blocks 1602, 1612 is determined. In one embodiment, the determination of the reference coding unit may include determining the size of the reference coding unit.

[0174] In one embodiment, the video decoding device 100 can obtain information from the bitstream relating to the determination order of at least one reference coding unit contained in at least one processing block, and can determine the order in which at least one reference coding unit is determined based on the obtained information relating to the determination order. The information relating to the determination order is also defined as the order or direction in which the reference coding unit is determined within the processing block. That is, the order in which the reference coding unit is determined can also be determined independently for each processing block.

[0175] In one embodiment, the video decoding device 100 can acquire information relating to the determination order of reference coding units from the bitstream for each specific data unit. For example, the bitstream acquisition unit 110 can acquire information relating to the determination order of reference coding units from the bitstream for each data unit such as video, sequence, picture, slice, slice segment, and processing block. Since the information relating to the determination order of reference coding units indicates the determination order of reference coding units within a processing block, the information relating to the determination order can be acquired for each specific data unit containing an integer number of processing blocks.

[0176] In one embodiment, the video decoding device 100 can determine at least one reference coding unit based on the determined order.

[0177] In one embodiment, the bitstream acquisition unit 110 can acquire information relating to the reference coding unit determination order as information relating to processing blocks 1602 and 1612 from the bitstream, and the video decoding device 100 can determine the order in which to determine at least one reference coding unit included in the processing blocks 1602 and 1612, and determine at least one reference coding unit included in the picture 1600 based on the coding unit determination order. Referring to Figure 16, the video decoding device 100 can determine the determination order (1604, 1614) of at least one reference coding unit relating to each processing block 1602 and 1612. For example, if information relating to the determination order of reference coding units is acquired for each processing block, the reference coding unit determination order relating to each processing block 1602 and 1612 will differ for each processing block. If the reference coding unit determination order (1604) related to processing block (1602) is the raster scan order, the reference coding units included in processing block 1602 are also determined by the raster scan order. Conversely, if the reference coding unit determination order (1614) related to another processing block 1612 is the reverse of the raster scan order, the reference coding units included in processing block 1612 are also determined by the reverse of the raster scan order.

[0178] The video decoding device 100 can decode at least one determined reference coding unit according to one embodiment. The video decoding device 100 can decode video based on the reference coding unit determined through the above-described embodiment. The method for decoding the reference coding unit may include a variety of methods for decoding video.

[0179] In one embodiment, the video decoding device 100 can acquire and utilize block configuration information indicating the current encoding unit configuration, or partition configuration mode information indicating a method for partitioning the current encoding unit, from the bitstream. This partition configuration mode information is included in the bitstream related to various data units. For example, the video decoding device 100 can utilize partition configuration mode information included in a sequence parameter set, picture parameter set, video parameter set, slice header, or slice segment header. Furthermore, for each maximum encoding unit, reference encoding unit, and processing block, the video decoding device 100 can acquire and utilize syntax elements corresponding to the block configuration information or partition configuration mode information from the bitstream.

[0180] The method for determining division rules according to one embodiment of this disclosure is described in detail below.

[0181] The video decoder 100 can determine a video segmentation rule. This segmentation rule is also a default between the video decoder 100 and the video encoder 200. The video decoder 100 can determine a video segmentation rule based on information obtained from the bitstream. The video decoder 100 can determine a segmentation rule based on information obtained from at least one of the following: a sequence parameter set, a picture parameter set, a video parameter set, a slice header, or a slice segment header. The video decoder 100 can determine the segmentation rule differently depending on the frame, slice, temporal layer, maximum encoding unit, or encoding unit.

[0182] The video decoder 100 can determine a division rule based on the block configuration of the encoding unit. This block configuration may include the size, shape, width and height ratios, and orientation of the encoding unit. The video encoder 200 and the video decoder 100 can, but are not limited to, determining a division rule based on the block configuration of the encoding unit. The video decoder 100 can determine a division rule based on information obtained from the bitstream received from the video encoder 200.

[0183] The shape of the encoded unit may include both square and non-square shapes. If the width and height of the encoded unit are the same, the video decoding device 100 can determine that the shape of the encoded unit is square. If the width and height of the encoded unit are not the same, the video decoding device 100 can determine that the shape of the encoded unit is non-square.

[0184] The size of the coding unit may include a variety of sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ..., 256x256. The size of the coding unit can be classified by the length of its long side, the length of its short side, or its width. The video decoder 100 can apply the same division rule to coding units classified into the same group. For example, the video decoder 100 can classify coding units having the same long side length into the same size. Furthermore, the video decoder 100 can apply the same division rule to coding units having the same long side length.

[0185] The width-to-height ratio of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, or 1:32, etc. The orientation of the coding unit may also include horizontal and vertical directions. The horizontal direction can indicate when the width of the coding unit is greater than the height. The vertical direction can indicate when the width of the coding unit is less than the height.

[0186] The video decoding device 100 can adaptively determine the division rule based on the size of the coding unit. The video decoding device 100 can determine different acceptable division modes based on the size of the coding unit. For example, the video decoding device 100 can determine whether or not division is permitted based on the size of the coding unit. The video decoding device 100 can determine the division direction based on the size of the coding unit. The video decoding device 100 can determine the acceptable division type based on the size of the coding unit.

[0187] Determining the division rule based on the size of the encoding unit is also a default division rule between the video encoding device 200 and the video decoding device 100. Furthermore, the video decoding device 100 can determine the division rule based on information obtained from the bitstream.

[0188] The video decoding device 100 can adaptively determine the division rule based on the position of the encoded unit. The video decoding device 100 can adaptively determine the division rule based on the position of the encoded unit in the video.

[0189] Furthermore, the video decoding device 100 can determine a division rule such that coded units generated in different division paths do not have the same block shape. However, it is not limited to this, and coded units generated in different division paths may have the same block shape. Coded units generated in different division paths may have different decoding processing orders. The decoding processing order has been explained with reference to Figure 12, so a detailed explanation is omitted here.

[0190] Figure 17 illustrates, in one embodiment, the possible encoding units determined for each picture when the combinations of forms in which the encoding unit can be divided differ from picture to picture.

[0191] Referring to Figure 17, the video decoding device 100 can determine different combinations of division patterns in which encoding units can be divided for each picture. For example, the video decoding device 100 can decode a video using picture 1700, which is divided into four encoding units from at least one picture contained in the video; picture 1710, which is divided into two or four encoding units; and picture 1720, which is divided into two, three, or four encoding units. To divide picture 1700 into multiple encoding units, the video decoding device 100 can use only division pattern information indicating that it is divided into four square encoding units. To divide picture 1710, the video decoding device 100 can use only division pattern information indicating that it is divided into two or four encoding units. To divide picture 1720, the video decoding device 100 can use only division pattern information indicating that it is divided into two, three, or four encoding units. The aforementioned combinations of division patterns are merely embodiments for explaining the operation of the video decoding device 100. Therefore, the aforementioned combinations of division patterns should not be interpreted as being limited to the aforementioned embodiments, but rather as being able to utilize a variety of combinations of division patterns for each predetermined data unit.

[0192] In one embodiment, the bitstream acquisition unit 110 of the video decoding device 100 can acquire a bitstream containing an index indicating a combination of division pattern information for each predetermined data unit (e.g., sequence, picture, slice, etc.). For example, the bitstream acquisition unit 110 can acquire an index indicating a combination of division pattern information in a sequence parameter set, picture parameter set, or slice header. The video decoding device 100 can use the acquired index to determine a combination of division patterns into which an encoded unit can be divided for each predetermined data unit, thereby enabling the use of different division pattern combinations for each predetermined data unit.

[0193] Figure 18 illustrates, in one embodiment, various forms of coding units determined based on segmentation mode information that can be represented in binary code.

[0194] In one embodiment, the video decoding device 100 can divide an encoded unit into various forms by utilizing block form information and division form mode information acquired via the bitstream acquisition unit 110. The forms of the encoded unit that can be divided include a variety of forms, including those described through the above-mentioned embodiment.

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

[0196] In one embodiment, when the video decoding device 100 can divide a square encoding unit horizontally and vertically into four square encoding units, the division mode information relating to the square encoding unit can represent four types of divisions. In one embodiment, the division mode information is also represented as a two-digit binary code, and a binary code is assigned to each division mode. For example, when the encoding unit is not divided, the division mode information is also represented as (00b); when the encoding unit is divided horizontally and vertically, the division mode information is also represented as (01)b; when the encoding unit is divided horizontally, the division mode information is also represented as (10)b; and when the encoding unit is divided vertically, the division mode information is also represented as (11)b.

[0197] In one embodiment, when a non-square encoding unit is divided horizontally or vertically, the type of division mode information that can be indicated by the division mode information is also determined by how many encoding units it is divided into. Referring to Figure 18, in one embodiment, the video decoding device 100 can divide a non-square encoding unit into up to three. The video decoding device 100 can divide an encoding unit into two encoding units, in which case the division mode information is also expressed as (10)b. The video decoding device 100 can divide an encoding unit into three encoding units, in which case the division mode information is also expressed as (11)b. The video decoding device 100 can decide not to divide the encoding unit, in which case the division mode information is also expressed as (0)b. That is, in order to use the binary code that indicates the division mode information, the video decoding device 100 can use variable length coding (VLC) instead of fixed length coding (FLC).

[0198] In one embodiment, as shown in Figure 18, the binary code of the division mode information indicating that the encoding unit is not divided is also expressed as (0)b. If the binary code of the division mode information indicating that the encoding unit is not divided is set to (00b), then both of the 2-bit binary codes of the division mode information must be used, even though there is no division mode information set to (01)b. However, as illustrated in Figure 18, if three types of division patterns relating to a non-square encoding unit are used, the video decoding device 100 can determine that the encoding unit is not divided even if it uses a 1-bit binary code (0)b as the division mode information, and thus can efficiently utilize the bitstream. However, the division patterns of a non-square encoding unit indicated by the division mode information should not be interpreted as being limited to only the three types shown in Figure 18, but should be interpreted as being in a variety of forms, including the embodiments described above.

[0199] Figure 19 illustrates another form of coding unit that can be determined based on segmentation mode information that can be represented in binary code, according to one embodiment.

[0200] Referring to Figure 19, the video decoder 100 can divide a square-shaped coding unit horizontally or vertically based on the division mode information, and can also divide a non-square-shaped coding unit horizontally or vertically. That is, the division mode information can indicate that a square-shaped coding unit is divided in one direction. In such cases, the binary code of the division mode information indicating that a square-shaped coding unit is not divided is also expressed as (0)b. If the binary code of the division mode information indicating that the coding unit is not divided is set to (00b), then both of the two-bit binary codes of the division mode information must be used, even though there is no division mode information set to (01)b. However, as illustrated in Figure 19, if three types of division modes related to a square-shaped coding unit are used, the video decoder 100 can determine that the coding unit is not divided even if it uses a one-bit binary code (0)b as the division mode information, thus enabling efficient use of the bitstream. However, the division patterns of the square-shaped coding units indicated by the division pattern mode information should not be interpreted as being limited to only the three patterns shown in Figure 19, but should be interpreted as being in a variety of patterns, including the embodiments described above.

[0201] In one embodiment, block-type information or segmented-type mode information can also be represented using binary code, and such information is immediately generated in a bitstream. Furthermore, block-type information or segmented-type mode information, also represented by binary code, is not immediately generated in a bitstream but is also used as binary code input via CABAC (context adaptive binary arithmetic coding).

[0202] The process of acquiring syntax related to block-type information or segmented-type mode information via CABAC in one embodiment of the video decoding device 100 will be described. A bitstream containing binary code related to the syntax can be acquired via the bitstream acquisition unit 110. The video decoding device 100 can inversely encode the bin strings contained in the acquired bitstream and detect syntax elements that indicate block-type information or segmented-type mode information. The video decoding device 100 in one embodiment can find a set of binary bin strings corresponding to the syntax element to be decoded, and decode each bin using probability information. The video decoding device 100 can iterate until the bin string composed of such decoded bins is the same as one of the previously obtained bin strings. The video decoding device 100 can perform inversely encode the bin strings and determine the syntax element.

[0203] In one embodiment, the video decoding device 100 can perform the decoding process of adaptive binary arithmetic coding to determine the syntax related to the bin string, and the video decoding device 100 can update the probability model related to the bin acquired via the bitstream acquisition unit 110. Referring to Figure 18, in one embodiment, the bitstream acquisition unit 110 of the video decoding device 100 can acquire a bitstream showing a binary code indicating segmentation mode information. Using the acquired binary code having a size of 1 or 2 bits, the video decoding device 100 can determine the syntax related to the segmentation mode information. In order to determine the syntax related to the segmentation mode information, the video decoding device 100 can update the probability related to each bit of the 2-bit binary code. That is, the video decoding device 100 can update the probability of the next bin having a value of 0 or 1 when decoding, depending on whether the value of the first bin in the 2-bit binary code is 0 or 1.

[0204] In one embodiment, the video decoding device 100 can update the probability related to the bins used in the process of decoding the bins of the binstring related to the syntax during the process of determining the syntax, and the video decoding device 100 can determine that a specific bit in the binstring has the same probability without updating the probability.

[0205] Referring to Figure 18, in the process of determining the syntax using a binstring indicating the division mode information related to a non-square coding unit, the video decoding device 100 can determine the syntax related to the division mode information by using one bin with a value of 0 if the non-square coding unit is not divided. That is, if the block shape information indicates whether the current coding unit is non-square or not, the first bin of the binstring related to the division mode information is 0 if the non-square coding unit is not divided, and 1 if it is divided into two or three coding units. Thus, the probability that the first bin of the binstring of the division 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, the video decoding device 100 can determine whether the second bin is 0 or 1 only when the first bin of the split-mode information is 1, and can then determine the syntax related to the split-mode information. In one embodiment, the video decoding device 100 can decode the bins by assuming that the probability of the second bin being 0 or 1 is the same when the first bin related to the split-mode information is 1.

[0206] In one embodiment, the video decoding device 100 can utilize a variety of probabilities for each bin in the process of determining the bins of the bin string related to the segmented mode information. In one embodiment, the video decoding device 100 can determine the probabilities of the bins related to the segmented mode information differently along the direction of the non-square block. In one embodiment, the video decoding device 100 can determine the probabilities of the bins related to the segmented mode information differently depending on the width or long side length of the currently encoded unit. In one embodiment, the video decoding device 100 can determine the probabilities of the bins related to the segmented mode information differently depending on at least one of the shape and long side length of the currently encoded unit.

[0207] In one embodiment, the video decoding device 100 can determine that the bin probabilities related to the segmented mode information are the same for coding units of a predetermined size or larger. For example, based on the length of the long side of the coding unit, it can be determined that the bin probabilities related to the segmented mode information are the same for coding units of 64 samples or larger.

[0208] In one embodiment, the video decoding device 100 determines the initial probability related to the bins constituting the bin string of segmented mode information based on the slice type (e.g., I slice, P slice, or B slice…).

[0209] Figure 20 is a block diagram showing the video encoding and decoding systems that perform loop filtering.

[0210] The encoding end 2010 of the video encoding and decoding system 2000 transmits the encoded bitstream of the video, and the decoding end 2050 receives the bitstream and decodes it to output the restored video. Here, the encoding end 2010 has a configuration similar to the video encoding device 200 described later, and the decoding end 2050 has a configuration similar to the video decoding device 100.

[0211] At the coding end 2010, the prediction coding unit 2015 outputs a reference image via inter-prediction and intra-prediction, and the conversion and quantization unit 2020 quantizes the residual data of the reference image and the current input image into quantized conversion coefficients and outputs them. The entropy coding unit 2025 encodes and converts the quantized conversion coefficients and outputs them as a bitstream. The quantized conversion coefficients are reconstructed into spatial domain data via the inverse quantization and inverse conversion unit 2030, and the reconstructed spatial domain data is output as reconstructed image via the deblocking filtering unit 2035 and the loop filtering unit 2040. This reconstructed image is also used as the reference image for the next input image via the prediction coding unit 2015.

[0212] In the bitstream received at the decoding end 2050, the encoded video data is restored to spatial domain residual data via the entropy decoding unit 2055 and the inverse quantization and inverse transformation unit 2060. The reference video output from the prediction decoding unit 2075 and the residual data are combined to form spatial domain video data, and the deblocking filtering unit 2065 and the loop filtering unit 2070 perform filtering on the spatial domain video data, enabling the output of the restored video related to the current original video. This restored video is also used by the prediction decoding unit 2075 as a reference video related to the next original video.

[0213] The loop filtering unit 2040 of the encoding terminal 2010 performs loop filtering using filter information input by user input or system settings. The filter information used by the loop filtering unit 2040 is output to the entropy encoding unit 2010 and transmitted to the decoding terminal 2050 along with the encoded video data. The loop filtering unit 2070 of the decoding terminal 2050 can perform loop filtering based on the filter information input from the decoding terminal 2050.

[0214] The various embodiments described above explain the operation related to the video decoding method performed by the video decoding device 100. Below, the operation of the video encoding device 200, which performs a video encoding method corresponding to the reverse process of such a video decoding method, will be described through various embodiments.

[0215] Figure 2 illustrates a block diagram of a video encoding device 200 that can encode video based on at least one of block configuration information and segmented configuration mode information according to one embodiment.

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

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

[0218] In one embodiment, the encoding unit 220 of the video encoding device 200 can determine the shape of the encoding unit. For example, the encoding unit may be square or have a non-square shape, and information indicating such a shape may be included in the block shape information.

[0219] In one embodiment, the encoding unit 220 can determine what form the encoding unit will be divided into. The encoding unit 220 can determine the form of at least one encoding unit included in the encoding unit, and the bitstream generation unit 210 can generate a bitstream that includes division form mode information relating to such encoding unit form.

[0220] In one embodiment, the encoding unit 220 can determine whether or not an encoding unit is divided. If the encoding unit 220 determines that the encoding unit contains only one encoding unit, or that the encoding unit is not divided, the bitstream generation unit 210 can generate a bitstream that includes division mode information indicating that the encoding unit is not divided. Alternatively, the encoding unit 220 can divide the encoding unit into multiple encoding units, and the bitstream generation unit 210 can generate a bitstream that includes division mode information indicating that the encoding unit is divided into multiple encoding units.

[0221] In one embodiment, the division mode information may include information indicating how many division units the encoding unit will be divided into, or in which direction the division will be performed. For example, the division mode information may indicate that the division will be performed in at least one of the vertical and horizontal directions, or that it will not be divided at all.

[0222] The video encoding device 200 determines information related to the division mode based on the division mode of the encoding unit. The video encoding device 200 determines a context model based on at least one of the following: the shape, direction, width and height ratio, or size of the encoding unit. Then, based on the context model, the video encoding device 200 generates a bitstream of information related to the division mode for dividing the encoding unit.

[0223] The video encoding device 200 can obtain an array for associating at least one of the shape, orientation, width and height ratio or size of the encoding unit with an index related to the context model in order to determine the context model. The video encoding device 200 can obtain an index related to the context model based on at least one of the shape, orientation, width and height ratio or size of the encoding unit in the array. The video encoding device 200 can determine the context model based on the index related to the context model.

[0224] The video encoding device 200 can determine a context model based on block morphology information that includes at least one of the following: shape, orientation, width and height ratio, or size of a peripheral encoding unit adjacent to the encoding unit. Furthermore, the peripheral encoding unit may include at least one of the encoding units located to the lower left, left, upper left, top, upper right, right, or lower right of the encoding unit.

[0225] Furthermore, the video encoding device 200 can compare the width size of the upper peripheral encoding unit with the width size of the encoding unit in order to determine the context model. The video encoding device 200 can also compare the height sizes of the left and right peripheral encoding units with the height size of the encoding unit. Based on the comparison results, the video encoding device 200 can determine the context model.

[0226] The operation of the video encoding device 200 is similar to that of the video decoding device 100 described in Figures 3 to 20, so a detailed explanation will be omitted.

[0227] Hereinafter, with reference to Figures 21 to 34, a video decoding device 2100 and a video encoding device 3300 according to one embodiment will be described.

[0228] Figure 21 is a block diagram of a video decoding device 2100 according to one embodiment.

[0229] Referring to Figure 21, the video decoding device 2100 according to one embodiment may include an acquisition unit 2110 and a motion information decoding unit 2130.

[0230] The video decoding device 2100 can acquire the bitstream generated as a result of video encoding and decode motion information for interpretation based on the information contained in the bitstream.

[0231] In one embodiment, the video decoding device 2100 may include a central processor (not shown) that controls the acquisition unit 2110 and the motion information decoding unit 2130. Alternatively, the acquisition unit 2110 and the motion information decoding unit 2130 may be operated by their respective own processors (not shown), and the video decoding device 2100 may operate as a whole through the organic interaction of these processors (not shown). Alternatively, the acquisition unit 2110 and the motion information decoding unit 2130 may be controlled by an external processor (not shown) of the video decoding device 2100.

[0232] The video decoding device 2100 may include one or more data storage units (not shown) in which input / output data from the acquisition unit 2110 and the motion information decoding unit 2130 are stored. The video decoding device 2100 may also include a memory control unit (not shown) that controls the input / output of data from the data storage units (not shown).

[0233] The video decoding device 2100 can perform video decoding operations, including prediction, by operating in conjunction with an internally mounted video decoding processor or an external video decoding processor in order to restore video through video decoding. In one embodiment, the internal video decoding processor of the video decoding device 2100 can be a separate processor, or a central processing unit or graphics processing unit can include a video decoding processing module to embody the basic video decoding operations.

[0234] The video decoding device 2100 may be included in the aforementioned video decoding device 100. For example, the acquisition unit 2110 may also be included in the bitstream acquisition unit 110 of the video decoding device 100 shown in Figure 1, and the motion information decoding unit 2130 may be included in the decoding unit 120 of the video decoding device 100.

[0235] The acquisition unit 2110 receives a bitstream generated as a result of encoding the video. The bitstream may include information for determining the motion vector used for interpretation of the current block. The current block is a block generated by dividing the video into a tree structure, and corresponds to, for example, the maximum encoding unit, encoding unit, or transformation unit.

[0236] The acquisition unit 2110 can determine the current block based on block configuration information and / or information relating to the segmentation mode included in at least one of the sequence parameter set, picture parameter set, video parameter set, slice header, and slice segment header. Furthermore, for each maximum encoding unit, reference encoding unit, and processing block, the acquisition unit 2110 can acquire syntax elements from the bitstream corresponding to block configuration information or information relating to the segmentation mode, and use them to determine the current block.

[0237] The bitstream may include information indicating the prediction mode of the current block, the prediction mode of the current block may include at least one of the intra-mode, inter-mode, merge mode, skip mode, and modes already defined in this disclosure. The aforementioned predefined modes are also modes that determine at least one primary residual motion vector candidate from among primary residual motion vector candidates separated by displacement distance and displacement direction as the primary residual motion vector relating to the current block. Primary residual motion vectors will be described in detail below.

[0238] In one embodiment, the bitstream may include information indicating at least one of the following: whether or not a previously set mode is applied to the current block; the basic motion vector of the current block; the primary residual motion vector of the current block; the priority order of displacement distances for classifying primary residual motion vector candidates; and the priority order of displacement directions for classifying primary residual motion vector candidates. The acquisition unit 2110 can acquire the information contained in the bitstream at a level corresponding to at least one unit from among the encoding unit, conversion unit, maximum encoding unit, slice unit, and picture unit.

[0239] The motion information decoding unit 2130 determines the motion vector of the current block based on the information contained in the bitstream.

[0240] The motion information decoding unit 2130 can determine, based on the information contained in the bitstream, whether or not a previously set mode has been applied to the current block. The information indicating whether or not a previously set mode has been applied may include a flag or an index.

[0241] The motion information decoding unit 2130 can obtain information indicating whether a pre-set mode is applied from a unit-level bitstream corresponding to the current block, and can decode the current block using the pre-set mode. It can also obtain information indicating whether a pre-set mode is applied from a unit-level bitstream corresponding to a higher-level block, slice, or picture, and can decode the blocks contained in the higher-level block, slice, or picture using the pre-set mode.

[0242] In one example, the motion information decoding unit 2130 can determine whether a previously set mode has been applied to the current block based on information relating to at least one of the following: the current block, previously decoded blocks, the current slice, previously decoded slices, the current picture, and previously decoded pictures. In that case, the motion information decoding unit 2130 can determine whether a previously set mode has been applied using the same criteria as the video encoding device 3300.

[0243] If a pre-configured mode is applied to the current block, the motion information decoding unit 2130 can determine a primary residual motion vector candidate related to at least one basic motion vector candidate. The primary residual motion vector candidate is also classified by displacement distance and displacement direction.

[0244] In one embodiment, at least one candidate basic motion vector for the current block is also determined based on the motion vectors of surrounding blocks that are spatially and temporally related to the current block. Surrounding blocks that are spatially and temporally related to the current block may include blocks that have been decoded before the current block. Surrounding blocks that are spatially related to the current block may include, but are not limited to, blocks located to the left of the current block and blocks located above the current block.

[0245] Furthermore, surrounding blocks that are temporally related to the current block may include, for example, blocks located at the same location as the current block, and blocks spatially adjacent to the block at the same location, among the blocks included in a reference picture different from the current picture that contains the current block.

[0246] In one embodiment, the motion information decoding unit 2130 can determine at least one basic motion vector candidate from the motion vectors of the current block and the surrounding blocks associated with it. Alternatively, the motion information decoding unit 2130 can change the motion vectors of the current block and the surrounding blocks associated with it to determine at least one basic motion vector candidate. Alternatively, the motion information decoding unit 2130 can combine the motion vectors of the current block and the surrounding blocks associated with it in a predetermined manner to determine at least one basic motion vector candidate.

[0247] In one embodiment, the motion information decoding unit 2130 can also determine at least one basic motion vector candidate in the same manner as the method for determining the candidate list of motion vector predictors in HEVC merge mode or AMVP mode.

[0248] In one embodiment, the motion information decoding unit 2130 can also determine a zero motion vector having 0 as a component as a candidate for the basic motion vector.

[0249] The motion information decoding unit 2130 can determine the basic motion vector of the current block based on the information contained in the bitstream, once at least one candidate basic motion vector has been determined. The information indicating the basic motion vector of the current block may include an index, but the index indicating the basic motion vector of the current block is also obtained from the bitstream corresponding to at least one level from among the transformation unit level, coding unit level, maximum coding unit level, slice level, or picture level.

[0250] In one embodiment, information indicating the basic motion vector of the current block may be encoded by fixed-length coding (FLC), unary coding, or truncated unary coding and included in the bitstream.

[0251] In one embodiment, the motion information decoding unit 2130 can also determine the basic motion vector of the current block from at least one candidate basic motion vector based on information relating to at least one of the current block, previously decoded blocks, current slice, previously decoded slice, current picture, and previously decoded picture. In this case, the motion information decoding unit 2130 can determine the basic motion vector using the same criteria as the video encoding device 3300.

[0252] Once the basic motion vectors related to the current block are determined, the motion information decoding unit 2130 can determine the primary residual motion vector of the current block from at least one candidate primary residual motion vector.

[0253] Currently, the candidate primary residual motion vectors of a block can be classified by displacement distance and displacement direction. The acquisition unit 2110 acquires information from the bitstream indicating at least one of the displacement distance and displacement direction, and the motion information decoding unit 2130 can determine the primary residual motion vector corresponding to the information indicating at least one of the displacement distance and displacement direction.

[0254] Currently, at least one of the following information for identifying the primary residual motion vector of a block—information indicating the displacement distance and information indicating the displacement direction—is also obtained from the bitstream at the transformation unit level, coding unit level, maximum coding unit level, slice level, or picture level.

[0255] Information indicating the displacement distance and displacement direction for identifying the current block's primary residual motion vector may be encoded by fixed-length coding (FLC), unary coding, or cutting unary coding and included in the bitstream. The acquisition unit 2110 can also decode information indicating the displacement direction, such as at least one of the displacement direction indices, from the bitstream using a context model.

[0256] In one embodiment, the motion information decoding unit 2130 can also determine the primary residual motion vector of the current block from among at least one primary residual motion vector candidate based on information relating to at least one of the current block, previously decoded blocks, current slice, previously decoded slice, current picture, and previously decoded picture. In that case, the motion information decoding unit 2130 can determine the primary residual motion vector using the same criteria as the video encoding device 3300.

[0257] Once the primary residual motion vector of the current block is determined, the motion information decoding unit 2130 can determine the motion vector of the current block by applying the primary residual motion vector to the basic motion vector of the current block. In one example, the motion information decoding unit 2130 can determine the motion vector of the current block by matching the primary residual motion vector to the basic motion vector of the current block.

[0258] The motion information decoding unit 2130 can determine the secondary residual motion vector of the current block based on the information indicating the secondary residual motion vector if the bitstream contains information indicating the secondary residual motion vector. The information indicating the secondary residual motion vector may be encoded by a method different from the encoding method for the information indicating the primary residual motion vector (e.g., fixed-length encoding, unary encoding, or cutting unary encoding) and included in the bitstream. For example, the information indicating the secondary residual motion vector may be encoded by the exponential golomb coding method and included in the bitstream. The acquisition unit 2110 can acquire the information indicating the secondary residual motion vector from the bitstream at the conversion unit level, encoding unit level, maximum encoding unit level, slice level, or picture level.

[0259] The motion information decoding unit 2130 can also determine the motion vector of the current block by applying the secondary residual motion vector to the basic motion vector which has been modified by applying the primary residual motion vector. In one example, the motion information decoding unit 2130 can determine the motion vector of the current block by combining the secondary residual motion vector with the basic motion vector which has been modified by applying the primary residual motion vector.

[0260] In one embodiment, if the prediction direction of the current block is bidirectional, the quadratic residual motion vector is also included in the bitstream for only one unidirectional direction. For example, information indicating the quadratic residual motion vector may be included in the bitstream for only one unidirectional direction, either the List 0 direction or the List 1 direction.

[0261] If the second-order residual motion vector is included in the bitstream only for the List 0 direction, the motion information decoding unit 2130 can determine the List 0 direction motion vector of the current block by applying the second-order residual motion vector for the List 0 direction to the base motion vector for the List 0 direction, which has been modified by applying the first-order residual motion vector for the List 0 direction. The motion information decoding unit 2130 can then determine the List 1 direction motion vector of the current block by applying the first-order residual motion vector for the List 1 direction to the base motion vector for the List 1 direction, or by applying the second-order residual motion vector for the List 0 direction to the result of applying the first-order residual motion vector for the List 1 direction to the base motion vector for the List 1 direction.

[0262] Comparing the pre-configured mode described in this disclosure with the AMVP mode of HEVC, in AMVP mode, the decoder determines the predicted motion vector and the residual motion vector, then combines these two to determine the block motion vector. In the pre-configured mode described in this disclosure, the basic motion vector performs a function similar to the predicted motion vector, and the first-order residual motion vector performs a function similar to the residual motion vector in AMVP mode. However, there is a difference in that in the pre-configured mode described in this disclosure, the first-order residual motion vector is divided by displacement distance and displacement direction and encoded by at least one of the following methods: fixed-length coding, unary coding, and cutting unary coding, whereas the residual motion vector in AMVP mode is encoded by the exponential golomb coding method. In addition, the pre-configured mode described in this disclosure can improve the accuracy of the block motion vector by coding / decoding the second-order residual motion vector.

[0263] The following describes a method for determining a candidate for the first-order residual motion vector corresponding to one of the candidate basic motion vectors, with reference to Figures 22 to 25.

[0264] Figures 22 to 25 are diagrams showing candidate linear residual motion vectors displayed on a coordinate plane.

[0265] Referring to Figures 22 to 25, the motion information decoding unit 2130 can determine the position of a candidate in the configuration of a first-order residual motion vector candidate based on a predetermined shape. The predetermined shape can be a polygon such as a rhombus or quadrilateral, or a shape similar to a circle.

[0266] The motion information decoding unit 2130 can determine candidates at a displacement distance determined at a previously set point (e.g., point (0,0)) as primary residual motion vector candidates. The motion information decoding unit 2130 can determine primary residual motion vector candidates at a first displacement distance at a previously set point as the first candidate group, primary residual motion vector candidates at a second displacement distance as the second candidate group, and primary residual motion vector candidates at an nth displacement distance as the nth candidate group. The motion information decoding unit 2130 can determine the primary residual motion vector candidate closest to the previously set point as the first candidate group, and the next closest primary residual motion vector candidate as the second candidate group. In other words, as the displacement distance increases, the candidate group numbers increase in order.

[0267] As the candidate group number increases, the interval of the displacement distance can also increase, such as a logarithmic scale interval or a nonlinear interval. Furthermore, as the candidate group number increases, the displacement distance can increase in intervals of integer N (e.g., N, 2N, 3N, ...). Additionally, as the number of candidate groups increases, the displacement distance can be determined such that the difference from the previous displacement distance increases at a constant rate.

[0268] The displacement distance can also be determined by user definition. Alternatively, the motion information decoding unit 2130 can directly determine the displacement distance based on information related to the current block, temporal layer, GOP, etc., or it can obtain information indicating the displacement distance for determining the candidate first-order residual motion vector via a bitstream.

[0269] The motion information decoding unit 2130 can also determine a displacement distance for determining a candidate for the first-order residual motion vector of the current block, based on the displacement distance determined at a higher high level corresponding to the current block.

[0270] The number of first residual motion vector candidates is determined independently for each candidate group. The motion information decoding unit 2130 can also determine the number of first residual motion vector candidates for each candidate group of the current block based on the number information determined at a higher level than the level corresponding to the current block.

[0271] FIGS. 22 and 23 illustrate the case where the number of first residual motion vector candidates within each candidate group is 4. FIGS. 22 and 23 also illustrate the case where there are 3 candidate groups, but the number of candidate groups is not limited to 3.

[0272] Referring to FIG. 22, the motion information decoding unit 2130 can determine first residual motion vector candidates having a rhombus-shaped distribution based on a preset point. The interval between each pixel corresponds to a 1 / 4 pixel distance. Hereinafter, for the sake of convenience, the component values of the vector candidates are scaled by 4 times and displayed. The 1 / 4 pixel distance corresponds to a transition distance of 1.

[0273] The motion information decoding unit 2130 can determine first residual motion vector candidates ((1, 0), (-1, 0), (0, 1), (0, -1)) at a 1 / 4 pixel distance from the preset point as the first candidate group.

[0274] The motion information decoding unit 2130 can determine first residual motion vector candidates ((2, 0), (-2, 0), (0, 2), (0, -2)) at a 1 / 2 pixel distance from the preset point as the second candidate group.

[0275] The motion information decoding unit 2130 can determine first residual motion vector candidates ((4, 0), (-4, 0), (0, 4), (0, -4)) at a 1 pixel distance from the preset point as the third candidate group.

[0276] Referring to FIG. 23, the motion information decoding unit 2130 can determine first residual motion vector candidates having a square-shaped distribution based on a preset point.

[0277] The motion information decoding unit 2130 can determine the first candidate group to be the first primary residual motion vector candidates ((1,1), (1,-1), (-1,1), (-1,-1)) that are located at a distance of approximately 1 / 4 pixel from a previously set point.

[0278] The motion information decoding unit 2130 can determine the first-order residual motion vector candidates ((2,2), (2,-2), (-2,2), (-2,-2)) located at a distance of approximately 1 / 2 pixel from a previously set point as the second candidate group.

[0279] The motion information decoding unit 2130 can determine the first-order residual motion vector candidates ((4,4), (4,-4), (-4,4), (-4,-4)) located at a distance of approximately 1 pixel from a previously set point as the third candidate group.

[0280] Referring to Figure 24, the motion information decoding unit 2130 can also determine that the number of first-order residual motion vector candidates included in at least one candidate group is different from that of the other candidate groups.

[0281] Specifically, the motion information decoding unit 2130 can determine eight candidate first-order residual motion vectors ((1,0), (-1,0), (0,1), (0,-1), (1,1), (1,-1), (-1,1), (-1,-1)) located at a distance of approximately 1 / 4 pixel from a previously set point as the first candidate group.

[0282] Furthermore, the motion information decoding unit 2130 can determine eight first-order residual motion vector candidates ((2,0), (-2,0), (0,2), (0,-2), (2,2), (2,-2), (-2,2), (-2,-2)) located at a distance of approximately 1 / 2 pixel from a previously set point as a second candidate group.

[0283] The motion information decoding unit 2130 can determine four first-order residual motion vector candidates ((4,0), (-4,0), (0,4), (0,-4)) located at a distance of approximately 1 pixel from a previously set point as the third candidate group.

[0284] Referring to Figure 25, the motion information decoding unit 2130 can determine a variety of distribution patterns for candidate primary residual motion vectors for each candidate group. As an example, the motion information decoding unit 2130 can determine the first candidate group to be primary residual motion vector candidates ((1,0), (-1,0), (0,1), (0,-1)) having a diamond-shaped distribution based on a previously set point.

[0285] Furthermore, the motion information decoding unit 2130 can determine a second candidate group of first-order residual motion vector candidates ((2,2), (-2,2), (2,-2), (-2,-2)) having a rectangular distribution based on previously set points.

[0286] Furthermore, the motion information decoding unit 2130 can determine a third candidate group of first-order residual motion vector candidates ((4,0), (-4,0), (0,4), (0,-4)) having a diamond-shaped distribution based on previously set points. The distribution patterns of the first-order residual motion vector candidates included in each candidate group can be diverse, in addition to the distribution patterns shown in Figure 25.

[0287] Figure 26 is a diagram illustrating an index showing a candidate for a first-order residual motion vector according to one embodiment.

[0288] As illustrated in Figure 26, reference numeral 2601 is a bit representation corresponding to an index indicating a candidate basic motion vector, reference numeral 2602 is a bit representation corresponding to an index indicating the displacement distance (or candidate group) of a candidate primary residual motion vector, and reference numerals 2603 and 2604 are also bit representations corresponding to an index indicating the displacement direction of a candidate primary residual motion vector.

[0289] The motion information decoding unit 2130 can assign an index to each of at least one candidate basic motion vectors in order to determine the basic motion vector of the current block, based on the index indicating the basic motion vector contained in the bitstream. Furthermore, the motion information decoding unit 2130 can assign an index to each of candidate primary residual motion vectors in order to determine the primary residual motion vector of the current block, based on the index indicating the primary residual motion vector contained in the bitstream.

[0290] Referring to Figure 26, candidate basic motion vector 0 is assigned the index 0, and candidate basic motion vector 1 is assigned the index 10. The indices representing each candidate basic motion vector can also be represented in a predetermined order by a unary coding method or a cutting unary coding method.

[0291] As you move from basic motion vector candidate 0 to basic motion vector candidate 4, the number of bits used to represent the index increases. However, the priority order among the basic motion vector candidates for assigning the index can be set to the same criteria as the video encoding device 3300.

[0292] In one embodiment, information indicating the priority order among basic motion vector candidates for indexing is included in the bitstream, in which case the motion information decoding unit 2130 can also assign an index to each basic motion vector candidate based on the priority order information obtained from the bitstream. The information indicating the priority order among basic motion vector candidates obtained from the bitstream may include information relating to the priority order that has changed compared to the priority order among basic motion vector candidates determined in a previous block, slice, or picture. For example, if the priority order of basic motion vector candidate 0 was rank 1 in a previous block, slice, or picture, but has changed to rank 3 in relation to the current block, slice, or picture, the bitstream may include information indicating that the priority order of basic motion vector candidate 0 has changed to rank 3. The bitstream may also include information indicating that no change in the priority order among basic motion vector candidates has occurred in the current block, slice, or picture compared to the priority order among basic motion vector candidates determined in a previous block, slice, or picture.

[0293] The first-order residual motion vector candidates determined for a single basic motion vector candidate are also grouped into candidate groups according to the determined criteria. Here, the determined criteria also include the displacement distance from a previously defined point. The index for each grouped candidate group can also be represented by unary coding or a cutting unary coding method. In concrete examples, the index for each grouped candidate group can also be represented by a fixed-length coding method.

[0294] As shown in Figure 26, the number of bits required to represent the index of a candidate group increases as you move from candidate group 0, which corresponds to a shift distance of 1, to candidate group 7, which corresponds to a shift distance of 8. However, the priority order among candidate groups for assigning an index is set to the same criteria as the video encoding device 3300.

[0295] In one embodiment, the information indicating the priority among candidate groups for assigning an index is included in the bit stream. In this case, the motion information decoding unit 2130 can assign an index to each candidate group according to the information indicating the priority obtained from the bit stream. The information indicating the priority among candidate groups obtained from the bit stream may compare with the priority among candidate groups determined in the previous block, previous slice or previous picture, and include information related to the changed ranking. For example, in the previous block, previous slice or previous picture, the priority of candidate group 0 was the first rank, but in relation to the current block, current slice or current picture, if the priority of candidate group 0 is changed to the third rank, the bit stream may include the information that the priority of candidate group 0 is changed to the third rank. Further, the bit stream may include the information that no change in the priority among candidate groups has occurred in the current block, current slice or current picture as compared with the priority among candidate groups determined in the previous block, previous slice or previous picture.

[0296] On the other hand, candidate group 0 shown in Figure 26 may include candidates located approximately 1 displacement away from the previously set point, but in one embodiment, candidate group 0 may also include candidates located approximately 0 displacement away from the previously set point. A candidate located approximately 0 displacement away from the previously set point means the previously set point itself, so as explained in Figures 22 to 25, if the previously set point corresponds to (0,0), the primary residual motion vector candidate will be (0,0). In that case, if the information indicating the candidate group for identifying the primary residual motion vector of the current block indicates candidate group 0, then, without needing to acquire information indicating the displacement direction, the basic motion vector of the current block will also become the motion vector of the current block, as long as there is no secondary residual motion vector. In other words, if one basic motion vector is determined for the current block, and the information indicating the candidate group indicates candidate group 0, then the basic motion vector becomes the motion vector of the current block, thus replacing the conventional HEVC merge mode or skip mode.

[0297] For each candidate linear residual motion vector included in any one candidate group, an index (or flag) indicating the direction of displacement is assigned. In this case, the index indicating the direction of displacement is also represented by a fixed-length coding method. For example, if any one candidate group contains four candidates linear residual motion vectors, two bits are required to represent each candidate linear residual motion vector.

[0298] The motion information decoding unit 2130 can divide the candidate first-order residual motion vectors included in one candidate group into groups based on their position on the coordinate plane, and assign an index or flag to each of the divided groups.

[0299] Referring to Figure 26, the candidate linear residual motion vectors (1,0), (-1,0), (0,1), and (0,-1) corresponding to candidate group 0 of the basic motion vector 0 are assigned an index (or flag) of 0 or 1, as shown in Figure 2603, depending on whether they are located on the x-axis or the y-axis, and an index (or flag) of 0 or 1, as shown in Figure 2604, depending on whether they are located in the + direction or the - direction.

[0300] As described above, the acquisition unit 2110 can decode at least one of the indices indicating the direction of displacement of the first-order residual motion vectors from the bitstream using the context model. For example, the acquisition unit 2110 can divide the four first-order residual motion vector candidates included in one candidate group into two groups, each containing two candidates located on the x-axis and two candidates located on the y-axis, and decode an index 2603 indicating whether a candidate is located on the x-axis or the y-axis using the context model. Once it is determined whether a candidate is located on the x-axis or the y-axis, the acquisition unit 2110 can decode an index 2604 indicating whether a candidate is in the + direction or the - direction using the context model.

[0301] In one embodiment, the motion information decoding unit 2130 includes only candidates located at previously set points on the coordinate plane in each candidate group. For example, the motion information decoding unit 2130 can include only candidates located on the x-axis or only candidates located on the y-axis in each candidate group based on information relating to at least one of the previous picture, current picture, previous slice, current slice, previous block, and current block. For example, in Figure 26, among the candidates (1,0), (-1,0), (0,1), and (0,-1) included in candidate group 0, only (1,0) and (-1,0) are included in candidate group 0, and only the index of reference numeral 2604 is assigned to each candidate as an index indicating the direction of displacement.

[0302] The following describes how to determine the candidate for the first-order residual motion vector when the candidate for the basic motion vector is a bidirectional motion vector.

[0303] First, Figure 27 is a diagram illustrating the motion information used for bidirectional block prediction, showing the case where blocks are predicted bidirectionally in HEVC's AMVP mode.

[0304] Block 2710 can be predicted unidirectionally using reference picture 2730 included in List 0 or reference picture 2750 included in List 1, or it can be predicted bidirectionally using two reference pictures 2730 and 2750 included in List 0 and List 1.

[0305] Referring to Figure 27, if the predicted direction of block 2710 is unidirectional in the direction of list 0, the motion vector MV0 of block 2710 in the direction of list 0 is determined based on the predicted motion vector MVP0 corresponding to the direction of list 0 and the residual motion vector MVD0 for the direction of list 0. Then, if the predicted direction of block 2710 is unidirectional in the direction of list 1, the motion vector MV1 of block 2710 in the direction of list 1 is determined based on the predicted motion vector MVP1 corresponding to the direction of list 1 and the residual motion vector MVD1 for the direction of list 1.

[0306] If the predicted direction of block 2710 is bidirectional, including the List 0 direction and the List 1 direction, the motion vector MV0 of block 2710 in the List 0 direction is determined based on the predicted motion vector MVP0 corresponding to the List 0 direction and the residual motion vector MVD0 for the List 0 direction, and the motion vector MV1 of block 2710 in the List 1 direction is determined based on the predicted motion vector MVP1 corresponding to the List 1 direction and the residual motion vector MVD1 for the List 1 direction.

[0307] In other words, if a block is predicted in both directions, it means that the motion vector of that block includes a motion vector in the direction of list 0 and a motion vector in the direction of list 1, and that the residual motion vector also includes a residual motion vector for the direction of list 0 and a residual motion vector for the direction of list 1.

[0308] In one embodiment of this disclosure, if any one of the basic motion vector candidates corresponds to a bidirectional motion vector, it will include a basic motion vector candidate for the List 0 direction and a basic motion vector candidate for the List 1 direction. The method for determining the primary residual motion vector candidate for the List 0 direction and the primary residual motion vector candidate for the List 1 direction is described below.

[0309] Figure 28 illustrates the positional relationship between the first reference picture 2830 indicated by the first unidirectional basic motion vector candidate, the second reference picture 2850 indicated by the second unidirectional basic motion vector candidate, and the current picture 2810 which includes the current block, when a certain basic motion vector candidate corresponds to a bidirectional motion vector. In Figure 28, let d1 be the distance between the current picture 2810 and the first reference picture 2830, and let d2 be the distance between the current picture 2810 and the second reference picture 2850. The distance between pictures refers to the difference in POC values ​​between the two pictures. The first unidirectional direction refers to the direction of list 0 or list 1, and the second unidirectional direction refers to a direction different from the first unidirectional direction.

[0310] Referring to Figure 28, currently picture 2810 has a POC of B, and the first reference picture 2830 and the second reference picture 2850 each have a POC of A and a POC of C. Candidate linear residual motion vectors when POC B has a value between POC A and POC C are illustrated in Figure 29.

[0311] The first-order residual motion vector candidates illustrated in Figure 26 above consist of residual candidates for list 0 or residual candidates for list 1 along the direction of the basic motion vector candidate. However, if the basic motion vector candidate is bidirectional, each first-order residual motion vector candidate may include residual candidates for list 0 and residual candidates for list 1.

[0312] If POC B has a value between POC A and POC C, each candidate for primary residual motion vector, separated by displacement distance and displacement direction, may include a candidate for primary residual motion vector for a first unidirectional direction having a magnitude value corresponding to the displacement distance, and a candidate for primary residual motion vector for a second unidirectional direction having a magnitude value corresponding to the displacement distance but with the opposite sign.

[0313] For example, referring to Figure 29, among the candidate primary residual motion vectors belonging to candidate group 0, the candidate primary residual motion vector identified by index 00 indicating the direction of displacement may include (1,0), which has a component with a magnitude corresponding to the displacement distance, and (-1,0), which has a component with the opposite sign. (1,0) corresponds to the candidate primary residual motion vector for the first unidirectional direction, and (-1,0) corresponds to the candidate primary residual motion vector for the second unidirectional direction. If the index indicating the direction of displacement is obtained as 00 from the bitstream, the motion information decoding unit 2130 can determine (1,0) as the primary residual motion vector for the first unidirectional direction of the current block, and (-1,0) as the primary residual motion vector for the second unidirectional direction of the current block.

[0314] In one embodiment, the distance between d1 and d2 scales the value of the candidate primary residual motion vector for either one unidirectional direction. For example, if the candidate primary residual motion vector for the first unidirectional direction is (1,0) when d1 is 1, then the candidate primary residual motion vector for the second unidirectional direction is also determined to be (-2,0) when d2 is 2.

[0315] In other words, if the candidate for the first unidirectional linear residual motion vector is (x,y), then the candidate for the second unidirectional linear residual motion vector is also determined to be ((d2 / d1)*(-x),(d2 / d1)*(-y)). In one example, d2 / d1 is calculated as an integer (int), or, as concrete examples show, as a double or float. Alternatively, as concrete examples show, d2 / d1 can be converted via bit shift operators (<<, >>), the converted value is rounded, and then the bit shift operators are applied again to calculate it.

[0316] Figure 30 illustrates the positional relationship between the first reference picture 2930 indicated by the first unidirectional basic motion vector candidate, the second reference picture 2950 indicated by the second unidirectional basic motion vector candidate, and the current picture 2910 which includes the current block, when a certain basic motion vector candidate corresponds to a bidirectional motion vector. In Figure 30, the distance between the current picture 2910 and the first reference picture 2930 is denoted as d1, and the distance between the current picture 2910 and the second reference picture 2950 is denoted as d2.

[0317] Referring to Figure 30, picture 2910 currently has POC A, and the first reference picture 2930 and the second reference picture 2950 each have POC B and POC C. Candidate first-order residual motion vectors when POC A is smaller than POC B and POC C are shown in Figure 31. Candidate first-order residual motion vectors when POC A is larger than POC B and POC C are the same as those shown in Figure 31.

[0318] Each of the candidate primary residual motion vectors, classified by displacement distance and displacement direction, may include a candidate residual for a first unidirectional direction and a candidate residual for a second unidirectional direction.

[0319] If POC A has a value greater than or less than POC B and POC C, each candidate for primary residual motion vector, separated by displacement distance and displacement direction, may include a candidate for primary residual motion vector for a first unidirectional direction having a magnitude value corresponding to the displacement distance, and a candidate for primary residual motion vector for a second unidirectional direction having components of the same sign with a magnitude corresponding to the displacement distance.

[0320] For example, referring to Figure 31, among the candidate primary residual motion vectors included in candidate group 0, the candidate primary residual motion vector specified by index 00 indicating the direction of displacement may include (1,0) having a component with a magnitude corresponding to the displacement distance, and (1,0) having a component with the same size and sign as (1,0).

[0321] In one embodiment, the distance between d1 and d2 scales the value of the candidate primary residual motion vector for either one unidirectional direction. For example, if the candidate primary residual motion vector for the first unidirectional direction is (1,0) when d1 is 1, then the candidate primary residual motion vector for the second unidirectional direction is also determined to be (2,0) when d2 is 2.

[0322] In other words, if the candidate for the first unidirectional linear residual motion vector is (x,y), then the candidate for the second unidirectional linear residual motion vector is also determined to be ((d2 / d1)*(x),(d2 / d1)*(y)). In one example, d2 / d1 can be calculated as an integer (int), or, as concrete examples show, d2 / d1 can be calculated as a double or a float. Alternatively, as concrete examples show, d2 / d1 can be converted via bit shift operators (<<, >>), the converted value can be rounded, and then the bit shift operators can be applied again to perform the calculation.

[0323] The following describes how to determine the current block's motion vector by considering the predicted direction of the current block and the direction of the basic motion vector.

[0324] If the predicted direction of the current block is the same as the direction of the current block's fundamental motion vector, the motion information decoding unit 2130 can apply the first-order residual motion vector to the current block's fundamental motion vector to determine the current block's motion vector.

[0325] In one embodiment, the acquisition unit 2110 can extract information indicating the direction of use of the basic motion vectors, such as an index, from the bitstream. The information indicating the direction of use of the basic motion vectors corresponds to the prediction direction of the current block. For example, if the direction of use of the basic motion vectors is in the direction of list 0, a unidirectional prediction in the direction of list 0 can be performed for the current block. If the direction of use of the basic motion vectors is in the direction of list 1, a unidirectional prediction in the direction of list 1 can be performed for the current block. Furthermore, if the direction of use of the basic motion vectors is bidirectional, a bidirectional prediction can be performed for the current block.

[0326] For example, if the basic motion vector is bidirectional, a bit value of 0 indicates that the direction of use of the basic motion vector is bidirectional, a bit value of 10 indicates that the direction of use of the basic motion vector is in the direction of list 0, and a bit value of 11 indicates that the direction of use of the basic motion vector is in the direction of list 1.

[0327] Furthermore, for example, if the basic motion vector is a first unidirectional vector in the direction of list 0 or list 1, a bit value of 0 indicates that the direction of use of the basic motion vector is the first unidirectional, a bit value of 10 indicates that the direction of use of the basic motion vector is a second unidirectional vector different from the first unidirectional, and a bit value of 11 indicates that the direction of use of the basic motion vector is bidirectional.

[0328] The direction of use of the basic motion vector corresponding to the aforementioned bit value may be changed.

[0329] When the basic motion vectors are bidirectional and the direction of use of the basic motion vectors is bidirectional The motion information decoding unit 2130 can determine the motion vector of the current block in the list 0 direction by applying the primary residual motion vector for the list 0 direction to the basic motion vector in the list 0 direction. Then, the motion information decoding unit 2130 can determine the motion vector of the current block in the list 1 direction by applying the primary residual motion vector for the list 1 direction to the basic motion vector in the list 1 direction.

[0330] If the basic motion vectors are bidirectional and the direction of use of the basic motion vectors is bidirectional, but the bitstream contains only information indicating the primary residual motion vector for the List 0 direction, the motion information decoding unit 2130 can generate a primary residual motion vector for the List 1 direction based on the primary residual motion vector for the List 0 direction.

[0331] The motion information decoding unit 2130 can generate a first-order residual motion vector for the List 1 direction by considering the positional relationship between the reference picture corresponding to the basic motion vector in the List 0 direction, the current picture including the current block, and the reference picture corresponding to the basic motion vector in the List 1 direction.

[0332] In one example, if the motion information decoding unit 2130 is located between a reference picture in the List 0 direction and a reference picture in the List 1 direction, it can reverse the sign of the value of the primary residual motion vector for the List 0 direction, scale the value of the primary residual motion vector for the List 0 direction by the ratio of d1 (the distance between the current picture and the reference picture in the List 0 direction) and d2 (the distance between the current picture and the reference picture in the List 1 direction), and determine the primary residual motion vector for the List 1 direction. For example, if the primary residual motion vector for the List 0 direction is (1,1) and d1 is 1 and d2 is 2, the primary residual motion vector for the List 1 direction can also be determined as (-2,-2).

[0333] In another example, the motion information decoding unit 2130 can determine the primary residual motion vector for the List 0 direction by maintaining the same sign for the value of the primary residual motion vector for the List 0 direction, scaling the value of the primary residual motion vector for the List 0 direction by the ratio of d1 and d2, if the current picture is located before or after the reference picture for the List 0 direction and the reference picture for the List 1 direction. For example, if the primary residual motion vector for the List 0 direction is (1,1) and d1 is 1 and d2 is 2, the primary residual motion vector for the List 1 direction is also determined to be (2,2).

[0334] When the basic motion vectors are bidirectional and the direction of use of the basic motion vectors is unidirectional If the basic motion vector is bidirectional and the direction of use of the basic motion vector is either the List 0 direction or the List 1 direction, the motion information decoding unit 2130 can apply the primary residual motion vector for the List 0 direction or the primary residual motion vector for the List 1 direction to the basic motion vector for the List 0 direction or the basic motion vector for the List 1 direction to determine the motion vector of the current block in either the List 0 direction or the List 1 direction.

[0335] If the direction of use of the basic motion vector is the first unidirectional, but the bitstream contains only information indicating the primary residual motion vector for the second unidirectional, the motion information decoding unit 2130 can, as described above, consider the positional relationship and distance between the current picture, the reference picture in the List 0 direction, and the reference picture in the List 1 direction, and determine the primary residual motion vector for the first unidirectional from the primary residual motion vector for the second unidirectional.

[0336] When the basic motion vector and the direction of use of the basic motion vector are unidirectional If the basic motion vector is a first unidirectional motion in either the List 0 direction or the List 1 direction, and the direction of use of the basic motion vector is a second unidirectional motion different from the first unidirectional motion, and the bitstream contains only information indicating the first unidirectional motion vector, then the motion information decoding unit 2130 can determine the basic motion vector for the second unidirectional motion based on the basic motion vector for the first unidirectional motion, and determine the first unidirectional motion vector for the second unidirectional motion based on the first unidirectional motion vector.

[0337] First, the motion information decoding unit 2130 considers d1 (the distance between the current picture and the first reference picture indicated by the first unidirectional basic motion vector) and can determine a second reference picture located in the opposite direction from the first reference picture, centered on the current picture.

[0338] In one example, a second reference picture can be determined that is separated by approximately the same distance as d1. In that case, since d1 and d2 (the distance between the current picture and the second reference picture) are the same, and the current picture is located between the first reference picture and the second reference picture, the motion information decoding unit 2130 can reverse the sign of the first unidirectional basic motion vector to generate the second unidirectional basic motion vector, reverse the sign of the first unidirectional linear residual motion vector to generate the second unidirectional linear residual motion vector.

[0339] If no picture exists that is as far away as d1, the second reference picture can be determined to be the picture that is closest to the current picture, while being located in the opposite direction from the first reference picture, with the current picture as the center. In this case, the current picture is located between the first reference picture and the second reference picture, but d1 and d2 are different from each other. The motion information decoding unit 2130 can reverse the sign of the first unidirectional basic motion vector, scale it according to the ratio of d1 and d2, and generate the second unidirectional basic motion vector. The motion information decoding unit 2130 can also reverse the sign of the first unidirectional linear residual motion vector, scale it according to the ratio of d1 and d2, and generate the second unidirectional linear residual motion vector.

[0340] If the current picture is the last picture in the GOP (group of picture), the motion information decoding unit 2130 can determine the second reference picture to be any one picture located in the same direction as the first reference picture, centered on the current picture. The picture located closest to either the first reference picture or the current picture is also determined to be the second reference picture. In this case, since the current picture is located after both the first and second reference pictures, the motion information decoding unit 2130 can scale the value of the first unidirectional basic motion vector by the ratio of d1 and d2 (without changing the sign) to generate the second unidirectional basic motion vector. The motion information decoding unit 2130 can also scale the value of the first unidirectional primary residual motion vector by the ratio of d1 and d2 (without changing the sign) to generate the second unidirectional primary residual motion vector.

[0341] For example, if the current picture corresponds to the last picture in the GOP, and the first reference picture itself is determined to be the second reference picture, the motion information decoding unit 2130 can also determine the first unidirectional basic motion vector as the second unidirectional basic motion vector, and as the first unidirectional primary residual motion vector.

[0342] Once the basic motion vector for the second unidirectional motion and the first-order residual motion vector are generated, the motion information decoding unit 2130 can apply the first-order residual motion vector for the second unidirectional motion to the basic motion vector for the second unidirectional motion to determine the second unidirectional motion vector of the current block.

[0343] When the basic motion vector is unidirectional and the direction of use of the basic motion vector is bidirectional If the basic motion vector is a first unidirectional motion in the direction of list 0 or list 1, the utilization direction of the basic motion vector is bidirectional, and the bitstream contains only information indicating the first unidirectional primary residual motion vector, the motion information decoding unit 2130 can generate a second unidirectional basic motion vector based on the first unidirectional basic motion vector, and generate a first unidirectional primary residual motion vector based on the first unidirectional primary residual motion vector.

[0344] First, the motion information decoding unit 2130 considers d1 (the distance between the current picture and the first reference picture indicated by the first unidirectional basic motion vector) and can determine a second reference picture located in the opposite direction from the first reference picture, centered on the current picture.

[0345] In one example, a second reference picture can be determined that is separated by approximately the same distance as d1. In that case, since d1 and d2 (the distance between the current picture and the second reference picture) are the same, and the current picture is located between the first reference picture and the second reference picture, the motion information decoding unit 2130 can reverse the sign of the first unidirectional basic motion vector to generate the second unidirectional basic motion vector, reverse the sign of the first unidirectional linear residual motion vector to generate the second unidirectional linear residual motion vector.

[0346] If no picture exists that is as far away as d1, the second reference picture can be determined to be the picture that is closest to the current picture, while being located in the opposite direction from the first reference picture, with the current picture as the center. In this case, the current picture is located between the first reference picture and the second reference picture, but d1 and d2 are different from each other. The motion information decoding unit 2130 can reverse the sign of the first unidirectional basic motion vector, scale it according to the ratio of d1 and d2, and generate the second unidirectional basic motion vector. The motion information decoding unit 2130 can also reverse the sign of the first unidirectional linear residual motion vector, scale it according to the ratio of d1 and d2, and generate the second unidirectional linear residual motion vector.

[0347] If the current picture is the last picture in the GOP, the motion information decoding unit 2130 can determine the second reference picture to be any one picture located in the same direction as the first reference picture, centered on the current picture. The picture located closest to either the first reference picture or the current picture is also determined to be the second reference picture. In this case, since the current picture is located after both the first and second reference pictures, the motion information decoding unit 2130 can scale the value of the first unidirectional basic motion vector by the ratio of d1 and d2 (without changing the sign) to generate the second unidirectional basic motion vector. The motion information decoding unit 2130 can also scale the value of the first unidirectional primary residual motion vector by the ratio of d1 and d2 (without changing the sign) to generate the second unidirectional primary residual motion vector.

[0348] For example, if the current picture corresponds to the last picture in the GOP, and the first reference picture itself is determined to be the second reference picture, the motion information decoding unit 2130 can also determine the first unidirectional basic motion vector as the second unidirectional basic motion vector, and as the first unidirectional primary residual motion vector.

[0349] Once the basic motion vector for the second unidirectional and the first-order residual motion vector are generated, the motion information decoding unit 2130 can apply the first-order residual motion vector for the second unidirectional to the basic motion vector for the second unidirectional to determine the motion vector for the current block in the second unidirectional, and apply the first-order residual motion vector for the first unidirectional to the basic motion vector for the first unidirectional to determine the motion vector for the current block in the first unidirectional.

[0350] On the other hand, in one embodiment, the acquisition unit 2110 can acquire from the bitstream information indicating whether or not the current block is multipass coded, and, if multipass coding is applied, information about the coding mode applied to the current block. Multipass coding means coding a block using two different coding modes, and then finally selecting the coding mode that is more efficient to code the block.

[0351] If the acquisition unit 2110 confirms that the current block has been multi-pass coded, it can acquire information, such as a flag, indicating which of the two coding modes was used to encode the current block.

[0352] If the motion information decoding unit 2130 confirms that the current block to which multipass coding has been applied was encoded in a previously defined mode according to this disclosure, it can decode the motion information of the current block based on information indicating the basic motion vector of the current block and information indicating the first-order residual motion vector. If the motion information decoding unit 2130 confirms that the current block that has been multipass coded was encoded in a mode other than the previously defined mode, such as merge mode, skip mode, or AMVP mode, it can decode the motion information according to the confirmed mode.

[0353] On the other hand, the current block in this disclosure corresponds to the first child block that has been split from the parent block. If the bitstream contains information indicating the splitting of the parent block, the motion information decoding unit 2130 can split the parent block into a first child block and a second child block that correspond to the current block. Alternatively, the motion information decoding unit 2130 can split the parent block into a first child block and a second child block that correspond to the current block, taking into consideration at least one of the parent block's size, width, and height. For example, if the width of the parent block is longer than its height, the motion information decoding unit 2130 can split the width of the parent block in half to determine two child blocks, and if the height of the parent block is longer than its width, it can split the height of the parent block in half to determine two child blocks. The parent block refers to a block that forms the basis of predictions, such as the prediction unit in HEVC. In this embodiment, the motion information decoding unit 2130 can also divide the parent block into a first child block, a second child block, and a third child block corresponding to the current block, that is, into three child blocks.

[0354] Furthermore, the shape of the child blocks may not be limited to squares or rectangles, but may also include triangular, trapezoidal, and other shapes.

[0355] When the pre-configured mode described herein is applied to the first child block, the motion information decoding unit 2130 can determine the motion vector of the first child block using the method described above.

[0356] As an example related to the method for determining the motion vector of the second child block, the motion information decoding unit 2130, similar to the first child block, determines the basic motion vector and the primary residual motion vector of the second child block based on information indicating the basic motion vector and information indicating the primary residual motion vector obtained from the bitstream. By combining the basic motion vector and the primary residual motion vector, the motion vector of the second child block can be determined. In this case, the candidate basic motion vector and the candidate primary residual motion vector determined for the parent block can be used identically for both the first and second child blocks. In other words, the candidate basic motion vector and the candidate primary residual motion vector are determined at the parent block level, the motion vector of the first child block is determined based on information indicating the basic motion vector and the information indicating the primary residual motion vector of the first child block, and the motion vector of the second child block is also determined based on information indicating the basic motion vector and the information indicating the primary residual motion vector of the second child block.

[0357] In another example, the motion vector determined for the first child block is determined as the basic motion vector for the second child block, and only the information indicating the primary residual motion vector of the second child block is obtained from the bitstream to determine the primary residual motion vector of the second child block. The motion information decoding unit 2130 can determine the motion vector of the second child block by matching the primary residual motion vector of the second child block with the basic motion vector of the second child block.

[0358] As another example, at least one of the information obtained from the bitstream in relation to the first child block—information indicating the basic motion vector, information indicating the displacement distance, and information indicating the displacement direction—may also be shared with the second child block. In that case, the motion information decoding unit 2130 can determine the basic motion vector and the first-order residual motion vector of the second child block based on the information obtained from the bitstream in relation to the first child block that is shared with the second child block, and the remaining information obtained from the bitstream in relation to the second child block.

[0359] Furthermore, information indicating the quadratic residual motion vector may be included only in the bitstream associated with either the first child block or the second child block mentioned above. For example, if the quadratic residual motion vector is determined in relation to the first child block, the motion information decoding unit 2130 can apply the quadratic residual motion vector of the first child block to the second child block as well.

[0360] In one embodiment, the first child block is encoded in a pre-configured mode according to this disclosure, and the second child block is encoded in a mode different from the mode applied to the first child block. In this case, the motion information decoding unit 2130 can decode the first child block and the second child block using the respective modes applied to the first child block and the second child block.

[0361] Once motion vectors are determined for both the first and second child blocks, interpretation determines the first predicted block corresponding to the first child block and the second predicted block corresponding to the second child block. The boundary between the first and second predicted blocks is then smoothed, and residual blocks are added to the final predicted block generated as a result of the filtering, ultimately restoring the parent block. For the smoothing filtering, an N-tap filter or the OBMC (overlapped block motion compensation) method can be applied. With the OBMC method, weights can be applied to the overlapping portion of the first and second predicted blocks. The weights for boundary regions are 0.5:0.5, but the weights increase the further away the region is from the boundary.

[0362] Figure 32 is a flowchart illustrating a video decoding method according to one embodiment.

[0363] In step S3210, the video decoder 2100 determines the basic motion vector of the current block. The video decoder 2100 can determine one of at least one candidate basic motion vectors as the basic motion vector of the current block.

[0364] The video decoder 2100 can determine the basic motion vector of the current block based on information indicating the basic motion vector contained in the bitstream. In one example, the video decoder 2100 can obtain information indicating the basic motion vector at the block level, slice level, or picture level.

[0365] In step S3220, the video decoding device 2100 determines the primary residual motion vector of the current block.

[0366] The video decoding device 2100 can determine a primary residual motion vector candidate for each of at least one basic motion vector candidates, obtain information from the bitstream indicating the displacement distance and displacement direction of the primary residual motion vector, and determine the primary residual motion vector for the current block from among the primary residual motion vector candidates.

[0367] The video decoding device 2100 can acquire at least one of the following: information indicating the displacement distance and information indicating the displacement direction, at the block level, slice level, or picture level.

[0368] In step S3230, the video decoding device 2100 can determine the motion vector of the current block by applying a first-order residual motion vector to the basic motion vector of the current block.

[0369] If the bitstream contains information indicating a secondary residual motion vector, the video decoder 2100 can also determine the motion vector of the current block by applying the secondary residual motion vector to the basic motion vector, which has been modified by applying the primary residual motion vector.

[0370] Figure 33 is a block diagram of a video encoding device 3300 according to one embodiment.

[0371] Referring to Figure 33, the video encoding device 3300 according to one embodiment of the present invention may include a motion information encoding unit 3310 and a generation unit 3330.

[0372] The video encoding device 3300 can encode video and generate a bitstream containing the information generated as a result of the encoding.

[0373] In one embodiment, the video encoding device 3300 may include a central processor (not shown) that controls the motion information encoding unit 3310 and the generation unit 3330. Alternatively, the motion information encoding unit 3310 and the generation unit 3330 may be operated by their respective own processors (not shown), and the video encoding device 3300 may operate as a whole through the organic interaction of these processors (not shown). Alternatively, the motion information encoding unit 3310 and the generation unit 3330 may be controlled by an external processor (not shown).

[0374] The video encoding device 3300 may include one or more data storage units (not shown) in which input / output data of the motion information encoding unit 3310 and the generation unit 3330 are stored. The video encoding device 3300 may also include a memory control unit (not shown) that controls the input / output of data in the data storage units (not shown).

[0375] The video encoding device 3300 can perform video encoding operations, including prediction, by operating in conjunction with an internally mounted video encoding processor or an external video encoding processor in order to encode video. In one embodiment, the internal video encoding processor of the video encoding device 3300 can be a separate processor, or a central processing unit or graphics processing unit can include a video encoding processing module to realize basic video encoding operations.

[0376] The video encoding device 3300 may be included in the aforementioned video encoding device 200. For example, the generation unit 3330 may also be included in the bitstream generation unit 210 of the video encoding device 200 shown in Figure 2, and the motion information encoding unit 3310 may be included in the encoding unit 220 of the video encoding device 200.

[0377] The motion information encoding unit 3310 encodes the motion vector of the current block. The current block corresponds to, for example, the maximum encoding unit, encoding unit, or transformation unit, as a block generated by dividing the video into a tree structure. The motion information encoding unit 3310 can determine a prediction mode to be applied to the current block. The prediction mode may include, for example, at least one of the intra mode, inter mode, merge mode, skip mode mode, and the pre-configured modes according to this disclosure.

[0378] The generation unit 3330 generates a bitstream containing information generated as an encoding result relating to motion vectors. In one embodiment, the bitstream may include information indicating at least one of the following: whether or not a pre-configured mode has been applied to the current block; the basic motion vector of the current block; the primary residual motion vector of the current block; the priority order of displacement distances for distinguishing primary residual motion vector candidates; and the priority order of displacement directions for distinguishing primary residual motion vector candidates. The generation unit 3330 may include the information in a bitstream corresponding to at least one level among the encoding unit level, the transformation unit level, the maximum encoding unit level, the slice unit level, and the picture unit level.

[0379] The motion information encoding unit 3310 can decide whether or not to apply a previously set mode to the current block.

[0380] The motion information encoding unit 3310 can determine whether or not to apply a previously set mode to the current block based on information relating to at least one of the following: the current block, a previously encoded block, the current slice, a previously encoded slice, the current picture, and a previously encoded picture.

[0381] In one example, the motion information coding unit 3310 may also consider statistical information relating to the prediction mode in a previous slice or picture to determine whether or not to apply a previously set mode to the current block. Based on the statistical information, the motion information coding unit 3310 may also decide not to apply a previously set mode to the current block.

[0382] In one example, the motion information encoding unit 3310 may decide to apply a pre-configured mode to the current block based on the cost corresponding to each of the many prediction modes applicable to the current block. A rate-distortion cost may be used when calculating the cost.

[0383] If a pre-configured mode is applied to the current block, the motion information encoding unit 3310 can determine a primary residual motion vector candidate related to at least one basic motion vector candidate. The primary residual motion vector candidates are also classified by displacement distance and displacement direction. The method for determining the primary residual motion vector candidates is the same as that described in relation to the video decoding device 2100, so a detailed explanation is omitted.

[0384] In one embodiment, at least one candidate basic motion vector for the current block is also determined based on the motion vectors of surrounding blocks that are spatially and temporally related to the current block. The surrounding blocks that are spatially and temporally related to the current block may include blocks that were encoded before the current block.

[0385] In one embodiment, the motion information encoding unit 3310 can determine the motion vectors of the surrounding blocks involved with the current block into at least one basic motion vector candidate. Alternatively, the motion information encoding unit 3310 can change the motion vectors of the surrounding blocks involved with the current block and determine at least one basic motion vector candidate. Alternatively, the motion information encoding unit 3310 can combine the motion vectors of the surrounding blocks involved with the current block in a predetermined manner and determine at least one basic motion vector candidate.

[0386] In one embodiment, the motion information coding unit 3310 may also determine at least one basic motion vector candidate in the same manner as the method for determining the candidate list of motion vector predictors in HEVC merge mode or AMVP mode.

[0387] In one embodiment, the motion information encoding unit 3310 can also determine a zero motion vector having 0 as a component as a candidate for the basic motion vector.

[0388] The motion information encoding unit 3310 can determine the basic motion vector of the current block from among at least one candidate basic motion vector once at least one candidate basic motion vector has been determined. The motion information encoding unit 3310 can determine the basic motion vector of the current block based on information relating to at least one of the following: the current block, a previously encoded block, the current slice, a previously encoded slice, the current picture, and a previously encoded picture.

[0389] In one example, the motion information encoding unit 3310 may determine the basic motion vector of the current block by considering statistical information from a previous slice or picture. In another example, the motion information encoding unit 3310 may determine the basic motion vector of the current block based on the cost between at least one candidate basic motion vector. A rate-distortion cost may be used when calculating the cost.

[0390] In one embodiment, information indicating the basic motion vector of the current block may be encoded by fixed-length coding (FLC), unary coding, or cutting unary coding and included in the bitstream.

[0391] Once the basic motion vectors for the current block are determined, the motion information encoding unit 3310 can determine the primary residual motion vector for the current block from at least one candidate primary residual motion vector.

[0392] The motion information encoding unit 3310 considers the difference between the motion vector of the current block and the basic motion vector of the current block, and can determine the primary residual motion vector of the current block from at least one candidate primary residual motion vector.

[0393] Information indicating the displacement distance and displacement direction for identifying the current block's primary residual motion vector may be encoded by at least one of the following methods: fixed-length coding, unary coding, and cutting unary coding, and included in the bitstream. The generator 3330 may encode information indicating the displacement direction, for example, at least one of the displacement direction indices, using a context model and include it in the bitstream.

[0394] In one embodiment, the motion information encoding unit 3310 can also determine the primary residual motion vector of the current block from among at least one primary residual motion vector candidate based on information relating to at least one of the current block, previously encoded block, current slice, previously encoded slice, current picture, and previously encoded picture.

[0395] Once the first-order residual motion vector of the current block is determined, the motion information encoding unit 3310 can apply the first-order residual motion vector to the current block's basic motion vector, compare the resulting value with the current block's motion vector, and determine the second-order residual motion vector. For example, the second-order residual motion vector corresponds to the value obtained by subtracting the sum of the current block's basic motion vector and the first-order residual motion vector from the current block's motion vector.

[0396] Once the quadratic residual motion vector is determined, the generation unit 3330 can generate a bitstream containing information indicating the quadratic residual motion vector of the current block. The generation unit 3330 can encode the information indicating the quadratic residual motion vector using a method different from the encoding method used for the information indicating the primary residual motion vector (e.g., fixed-length encoding, unary encoding, or cutting unary encoding) and include it in the bitstream. For example, the information indicating the quadratic residual motion vector may be encoded using the exponential golomb coding method and included in the bitstream. The generation unit 3330 can include the information indicating the quadratic residual motion vector in bitstreams corresponding to the transformation unit level, encoding unit level, maximum encoding unit level, slice level, or picture level.

[0397] In one embodiment, if the predicted direction of the current block is bidirectional, the generator 3330 may also include in the bitstream only information indicating a quadratic residual motion vector for one unidirectional direction, rather than a quadratic residual motion vector for both directions.

[0398] The generation unit 3330 can include indices indicating the basic motion vector of the current block and indices indicating the first-order residual motion vector in the bitstream. To this end, the motion information encoding unit 3310 can assign indices to at least one candidate basic motion vector and at least one candidate first-order residual motion vector.

[0399] As illustrated in Figure 26, drawing reference numeral 2601 corresponds to an index indicating a candidate basic motion vector, drawing reference numeral 2602 corresponds to an index indicating the displacement distance (or candidate group) of a candidate primary residual motion vector, and drawing reference numeral 2603 and drawing number 2604 correspond to an index indicating the displacement direction of a candidate primary residual motion vector.

[0400] Referring to Figure 26, candidate basic motion vector 0 is assigned the index 0, and candidate basic motion vector 1 is assigned the index 10. In other words, the indices representing each candidate basic motion vector can also be represented in a predetermined order by unary coding or cutting unary coding.

[0401] As you move from basic motion vector candidate 0 to basic motion vector candidate 4, the number of bits used to represent the index increases. However, the priority order among the basic motion vector candidates for assigning an index is also determined by a pre-set criterion.

[0402] In one embodiment, the motion information encoding unit 3310 can also determine the priority among the basic motion vector candidates for the current block by considering the number or ratio of times they were selected as basic motion vectors in previous slices or previous pictures. For example, if basic motion vector candidate 3 was selected most often as the basic motion vector for the block in previous slices or previous pictures, the motion information encoding unit 3310 can assign an index of 0 to basic motion vector candidate 3.

[0403] In one embodiment, information indicating the priority of basic motion vector candidates for indexing may be included in the bitstream. The information indicating the priority of basic motion vector candidates may include information relating to the order in which changes have occurred, compared with the priority of basic motion vector candidates determined in a previous block, previous slice, or previous picture.

[0404] The first-order residual motion vector candidates determined for a single basic motion vector candidate are also grouped into candidate groups according to the determined criteria. Here, the determined criteria also include how far away the displacement is from a previously defined point. The index for each grouped candidate group can also be represented by unary coding or cutting unary coding. In concrete examples, the index for each grouped candidate group can also be represented by fixed-length coding.

[0405] As shown in Figure 26, the number of bits required to represent the index of a candidate group increases as you move from candidate group 0, which corresponds to a shift distance of 1, to candidate group 7, which corresponds to a shift distance of 8. However, the priority order among candidate groups for assigning an index is also determined by pre-defined criteria.

[0406] In one embodiment, the motion information encoding unit 3310 may also determine the priority among candidate groups for the current block by considering the number or ratio of times each candidate group was selected for primary residual motion vector identification in previous slices or pictures. For example, if the primary residual motion vector candidates included in candidate group 3 were selected most frequently for the block's primary residual motion vector in previous slices or pictures, the motion information encoding unit 3310 may assign an index of 0 to candidate group 3.

[0407] In one embodiment, information indicating the priority among candidate groups for indexing may be included in the bitstream. The information indicating the priority among candidate groups may include information relating to the order in which changes have occurred, compared to the priority among candidate groups determined in a previous block, slice, or picture.

[0408] On the other hand, candidate group 0 shown in Figure 26 may include candidates that are separated by a displacement distance of approximately 1 from the previously set point. However, in one embodiment, candidate group 0 may also include candidates that are separated by a displacement distance of 0 from the previously set point. A candidate separated by a displacement distance of 0 from the previously set point means the previously set point itself, so as explained in Figures 22 to 25, if the previously set point corresponds to (0,0), the first-order residual motion vector candidate will be (0,0). In that case, if the information indicating the candidate group for identifying the first-order residual motion vector indicates candidate group 0, then, unless a second-order residual motion vector exists, the basic motion vector will also be the motion vector of the block. In other words, if the basic motion vector of the current block is the same as the motion vector of the current block, the motion information encoding unit 3310 can select candidate group 0 and include information indicating candidate group 0 in the bitstream. If candidate group 0 is selected, the basic motion vector becomes the motion vector of the current block, which can replace the conventional HEVC merge mode or skip mode.

[0409] For each candidate linear residual motion vector included in any one candidate group, an index (or flag) indicating the direction of displacement is assigned. In this case, the index indicating the direction of displacement is also represented by a fixed-length coding method. For example, if any one candidate group contains four candidates linear residual motion vectors, two bits are required to represent each candidate linear residual motion vector.

[0410] The motion information encoding unit 3310 can divide the candidate first-order residual motion vectors included in one candidate group into groups based on their position on the coordinate plane, and assign an index to each of the divided groups.

[0411] Referring to Figure 26, the candidate linear residual motion vectors (1,0), (-1,0), (0,1), and (0,-1) corresponding to candidate group 0 of the basic motion vector 0 are assigned an index (or flag) of 0 or 1, as shown in Figure 2603, depending on whether they are located on the x-axis or the y-axis, and an index (or flag) of 0 or 1, as shown in Figure 2604, depending on whether they are located in the + direction or the - direction.

[0412] As described above, the generation unit 3330 can encode at least one of the indices indicating the direction of displacement of the first-order residual motion vectors using a context model. For example, the generation unit 3330 can divide the four first-order residual motion vector candidates included in one candidate group into two groups, each containing two candidates located on the x-axis and two candidates located on the y-axis, and encode an index 2603 indicating whether a candidate is located on the x-axis or the y-axis using a context model. Once it is determined whether a candidate is located on the x-axis or the y-axis, the generation unit 3330 can encode an index 2604 indicating whether a candidate is in the + direction or the - direction using a context model.

[0413] In one embodiment, the motion information encoding unit 3310 may include only candidates located at a previously defined point on the coordinate plane in each candidate group. For example, the motion information encoding unit 3310 may include only candidates located on the x-axis or on the y-axis in each candidate group based on information relating to at least one of the previous picture, current picture, previous slice, current slice, previous block, and current block. For example, in Figure 26, among the candidates (1,0), (-1,0), (0,1), and (0,-1) included in candidate group 0, only (1,0) and (-1,0) are included in candidate group 0, and only the index of reference numeral 2704 is assigned to each candidate as an index indicating the direction of movement for identifying the candidate.

[0414] The motion information encoding unit 3310 can also configure the system so that, when the basic motion vector candidate is a bidirectional motion vector, each primary residual motion vector candidate, which is divided by the displacement distance and displacement direction, includes a primary residual motion vector candidate for the List 0 direction and a primary residual motion vector candidate for the List 1 direction. The method for determining the bidirectional primary residual motion vector candidates is the same as that described in relation to the video decoding device 2100, so a detailed explanation is omitted.

[0415] In one embodiment, once the basic motion vector of the current block is determined, the video encoding method determines the direction in which the basic motion vector will be used, and the generation unit 3330 can include information indicating the direction in which the basic motion vector will be used in the bitstream.

[0416] The basic motion vectors correspond to motion vectors for the List 0 direction, motion vectors for the List 1 direction, or motion vectors for both directions. However, this video encoding method can determine the direction of use of the basic motion vectors so as to improve the encoding efficiency of the motion vectors of the current block.

[0417] The information indicating the direction of use of the aforementioned basic motion vector may include an index. For example, if the basic motion vector is bidirectional, bit value 0 indicates that the direction of use of the basic motion vector is bidirectional, bit value 10 indicates that the direction of use of the basic motion vector is in the direction of list 0, and bit value 11 indicates that the direction of use of the basic motion vector is in the direction of list 1.

[0418] Furthermore, for example, if the basic motion vector is a first unidirectional vector in the direction of list 0 or list 1, bit value 0 indicates that the direction of use of the basic motion vector is the first unidirectional, bit value 10 indicates that the direction of use of the basic motion vector is a second unidirectional vector different from the first unidirectional, and bit value 11 indicates that the direction of use of the basic motion vector is bidirectional.

[0419] The direction in which the basic motion vectors corresponding to the aforementioned bit values ​​are used may also be changed.

[0420] In one example, if the basic motion vector is bidirectional and the direction of use of the basic motion vector is determined to be bidirectional, the motion information encoding unit 3310 can determine the primary residual motion vector for the List 0 direction of the current block and the primary residual motion vector for the List 1 direction. The generation unit 3330 can then include in the bitstream information indicating the bidirectional basic motion vector, and information indicating the primary residual motion vector for the List 0 direction and the primary residual motion vector for the List 1 direction of the current block.

[0421] As another example, if the basic motion vector is bidirectional and the direction of use of the basic motion vector is determined to be bidirectional, the motion information encoding unit 3310 can determine the primary residual motion vector for the List 0 direction and the primary residual motion vector for the List 1 direction of the current block. The generation unit 3330 can include in the bitstream information indicating only one of the primary residual motion vectors for the List 0 direction and the primary residual motion vector for the List 1 direction, and information indicating the basic motion vector.

[0422] As yet another example, if the basic motion vector is bidirectional and the direction of use of the basic motion vector is a first unidirectional direction, either in the direction of list 0 or list 1, the motion information encoding unit 3310 determines the first unidirectional primary residual motion vector for the current block, and the generation unit 3330 may include in the bitstream information indicating the basic motion vector and information indicating the first unidirectional primary residual motion vector.

[0423] As yet another example, if the basic motion vector is bidirectional and the direction of use of the basic motion vector is a first unidirectional, either in the direction of list 0 or the direction of list 1, the motion information encoding unit 3310 determines a primary residual motion vector for a second unidirectional different from the first unidirectional of the current block, and the generation unit 3330 may include in the bitstream information indicating the basic motion vector and information indicating the primary residual motion vector for the second unidirectional.

[0424] As yet another example, if the basic motion vector is a first unidirectional in the direction of list 0 or list 1, and the direction of use of the basic motion vector is a second unidirectional different from the first unidirectional, the motion information encoding unit 3310 determines the primary residual motion vector of the current block for the first unidirectional, and the generation unit 3330 can include in the bitstream information indicating the basic motion vector and information indicating the primary residual motion vector for the first unidirectional.

[0425] As yet another example, if the basic motion vector is a first unidirectional motion in either the list 0 direction or the list 1 direction, and the utilization direction of the basic motion vector is bidirectional, the motion information encoding unit 3310 determines the primary residual motion vector of the current block for the first unidirectional motion, and the generation unit 3330 may include in the bitstream information indicating the basic motion vector and information indicating the primary residual motion vector for the first unidirectional motion.

[0426] On the other hand, in one embodiment, the motion information encoding unit 3310 can decide whether or not to apply multipass coding to the current block. The motion information encoding unit 3310 can encode the current block using two different encoding modes and then select one of the encoding modes based on cost. The generation unit 3330 can include in the bitstream information indicating whether or not the current block has been multipass coded, and, if multipass coding has been applied, information about the encoding mode applied to the current block.

[0427] The two distinct encoding modes described above may include one of the AMVP mode, merge mode, and skip mode, and the pre-configured mode described herein.

[0428] In one embodiment, the motion information encoding unit 3310 can determine how to divide the parent block and divide the parent block into a first child block corresponding to the current block and a second child block adjacent to it. In another embodiment, the motion information encoding unit 3310 can determine how to divide the parent block and divide the parent block into a first child block corresponding to the current block, a second child block adjacent to it, and a third child block.

[0429] The motion information encoding unit 3310 encodes the first child block according to the previously set mode, and the generation unit 3330 can generate a bitstream containing the information generated as a result of encoding the first child block.

[0430] In relation to the encoding method for the second child block, as an example, the motion information encoding unit 3310 can encode the second child block using the pre-configured mode described herein, similar to the first child block. In this case, the basic motion vector candidates and primary residual motion vector candidates determined for the parent block can be used identically for both the first and second child blocks. In other words, the basic motion vector candidates and primary residual motion vector candidates are determined at the parent block level, and among the basic motion vector candidates, the basic motion vector of the first child block and the basic motion vector of the second child block are determined independently, and among the primary residual motion vector candidates, the primary residual motion vector of the first child block and the primary residual motion vector of the second child block are also determined independently.

[0431] In another example, the motion information encoding unit 3310 can determine the motion vector determined for the first child block as the basic motion vector for the second child block, and determine the primary residual motion vector for the second child block from among the candidates for primary residual motion vector. The generation unit 3330 can omit the information indicating the basic motion vector for the second child block from the bitstream, and instead include the information indicating the primary residual motion vector for the second child block in the bitstream.

[0432] As another example, at least one of the basic motion vector, displacement distance, and displacement direction determined in relation to the first child block can also be applied to the second child block. In that case, the motion information encoding unit 3310 can also encode the motion vector of the second child block using at least one of the basic motion vector, displacement distance, and displacement direction determined in relation to the first child block.

[0433] Furthermore, the motion information encoding unit 3310 can determine only the quadratic residual motion vector related to either the first child block or the second child block, and the generation unit 3330 can include information indicating the determined quadratic residual motion vector in the bitstream.

[0434] In one embodiment, the motion information encoding unit 3310 may encode the first child block in a pre-configured mode according to this disclosure, and encode the second child block in a mode different from the mode applied to the first child block.

[0435] Figure 34 is a flowchart illustrating a video encoding method according to one embodiment.

[0436] In step S3410, the video encoding device 3300 determines the basic motion vector of the current block. The video encoding device 3300 can determine one of at least one candidate basic motion vectors as the basic motion vector of the current block.

[0437] In step S3420, the video encoding device 3300 determines the first-order residual motion vector of the current block.

[0438] The video encoding device 3300 can determine a primary residual motion vector candidate for each of at least one basic motion vector candidates, and from among the primary residual motion vector candidates, it can determine the primary residual motion vector for the current block.

[0439] The video encoding device 3300 can also determine the primary residual motion vector candidate for the current block as the primary residual motion vector of the current block, which has a value most similar to the value obtained by subtracting the basic motion vector of the current block from the motion vector of the current block.

[0440] At step S3430, the video encoding device 3300 generates a bitstream that is generated as the encoding result for the current block.

[0441] The bitstream may include information indicating at least one of the following for the current block: whether a previously set mode has been applied; the basic motion vector of the current block; the primary residual motion vector of the current block; the priority order of displacement distances for distinguishing primary residual motion vector candidates; and the priority order of displacement directions for distinguishing primary residual motion vector candidates. The generation unit 3330 may include the information in a bitstream corresponding to at least one level among the encoding unit level, transformation unit level, maximum encoding unit level, slice unit level, and picture unit level.

[0442] On the other hand, the embodiments of the present disclosure described above can be created as programs that can be executed on a computer, and the created programs can be stored on a medium.

[0443] The medium is used to continuously store programs executable by a computer, or to temporarily store them for execution or download. It is also a diverse range of recording or storage means, often consisting of single or multiple hardware components, and is not limited to media directly connected to a computer system, but can also be distributed across a network. Examples of such media include magnetic media such as hard disks, floppy disks, and magnetic tapes; optical 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), and flash memory, which are configured to store program instructions. Other examples of media include application stores that distribute applications, and recording media managed by websites and servers that supply or distribute various other software.

[0444] Although the technical concept of this disclosure has been described in detail with reference to desirable embodiments, the technical concept of this disclosure is not limited to the embodiments described above, and various modifications and changes are possible within the scope of the technical concept of this disclosure by those skilled in the art.

[0445] (Note 1) In a method for decoding motion information, Currently, we are in the stage of determining the basic motion vector of the block, A step of determining the primary residual motion vector relating to the current block from among at least one primary residual motion vector candidate, which is divided by displacement distance and displacement direction, based on information obtained from the bitstream; A method for decoding motion information, characterized by including the step of applying the primary residual motion vector to the basic motion vector to determine the motion vector of the current block. (Note 2) The step of determining the motion vector of the current block is: The steps include obtaining information from the bitstream that shows the quadratic residual motion vector related to the current block, The method for decoding motion information according to Appendix 1, further comprising the steps of: applying the secondary residual motion vector determined based on the information indicating the secondary residual motion vector to the basic motion vector which has been modified by applying the primary residual motion vector, to determine the motion vector of the current block. (Note 3) The method for decoding the motion information is as follows: The process further includes obtaining an index from the bitstream that indicates at least one of the displacement distance and displacement direction of the first-order residual motion vector, The step of determining the first-order residual motion vector is as follows: The method for decoding motion information according to Appendix 1, characterized by including the step of determining, among the at least one candidate for the primary residual motion vector, the candidate for the primary residual motion vector corresponding to the acquired index as the primary residual motion vector relating to the current block. (Note 4) The method for decoding the motion information is as follows: The method for decoding motion information according to Appendix 1, further comprising the step of determining one of at least one candidate basic motion vectors as the basic motion vector of the current block. (Note 5) The step of determining the motion vector of the current block is: If the basic motion vector of the current block corresponds to a bidirectional motion vector, the predicted direction of the current block corresponds to bidirectional, and the primary residual motion vector has been determined for the first unidirectional direction, then the step of determining the primary residual motion vector for the second unidirectional direction based on the primary residual motion vector for the first unidirectional direction, The steps include: applying the first unidirectional basic motion vector to the first unidirectional basic motion vector to determine the first unidirectional motion vector of the current block; A method for decoding motion information according to Appendix 1, characterized by comprising the step of applying a first-order residual motion vector for the second unidirectional to the basic motion vector of the second unidirectional to determine the motion vector of the current block for the second unidirectional. (Note 6) The step of determining the first-order residual motion vector for the second unidirectional motion is: The method for decoding motion information according to Appendix 5, characterized by including a step of determining at least one of the magnitude and sign of the component values ​​of the first-order residual motion vector for the second unidirectional based on the positional relationship between a reference picture corresponding to a first unidirectional basic motion vector, a reference picture corresponding to a second unidirectional basic motion vector, and a current picture including the current block. (Note 7) The step of determining the motion vector of the current block is: If the basic motion vector of the current block corresponds to the motion vector of a first unidirectional direction, and the predicted direction of the current block corresponds to a second unidirectional direction different from the first unidirectional direction, the basic motion vector of the second unidirectional direction is determined based on the basic motion vector of the first unidirectional direction, and the primary residual motion vector for the second unidirectional direction is determined based on the primary residual motion vector for the first unidirectional direction. A method for decoding motion information according to Appendix 1, characterized by comprising the step of applying a first-order residual motion vector for the second unidirectional to the second unidirectional basic motion vector to determine the motion vector of the current block. (Note 8) The step of determining the motion vector of the current block is: If the basic motion vector of the current block corresponds to a first unidirectional motion vector and the predicted direction of the current block corresponds to bidirectional, the steps include determining a second unidirectional basic motion vector based on the first unidirectional basic motion vector and determining a primary residual motion vector for the second unidirectional based on the primary residual motion vector for the first unidirectional, The steps include: applying the first unidirectional basic motion vector to the first unidirectional basic motion vector to determine the first unidirectional motion vector of the current block; A method for decoding motion information according to Appendix 1, characterized by including the step of applying a first-order residual motion vector for the second unidirectional to the basic motion vector of the second unidirectional to determine the motion vector of the current block in the second unidirectional. (Note 9) The method for decoding the motion information is as follows: The method for decoding motion information according to Appendix 1, further comprising the step of entropy decoding at least a portion of the index representing the first-order residual motion vector from the bitstream using a context model. (Note 10) The method for decoding motion information is: The process further includes determining at least one candidate first-order residual motion vector related to at least one candidate basic motion vector, The method for decoding motion information according to Appendix 1, characterized in that, among the at least one primary residual motion vector candidate, the primary residual motion vector candidate determined in correspondence with the bidirectional basic motion vector candidate includes a primary residual motion vector candidate in the List 0 direction containing values ​​of the same sign or opposite sign, and a primary residual motion vector candidate in the List 1 direction. (Note 11) The magnitude of at least one of the candidate primary residual motion vectors in the direction of List 0 and the candidate primary residual motion vector in the direction of List 1 is: The method for decoding motion information according to Appendix 10, characterized in that the distance between a first reference picture corresponding to a first unidirectional basic motion vector candidate, a current picture including the current block, and a second reference picture corresponding to the second unidirectional basic motion vector candidate is taken into consideration and scaled. (Note 12) The method for decoding the motion information is as follows: If the current block corresponds to the first child block separated from the parent block, the step is to determine the motion vector of the current block as the basic motion vector of the second child block, The method for decoding motion information according to Appendix 1, further comprising the steps of: applying the first-order residual motion vector determined for the second child block to the basic motion vector of the second child block to determine the motion vector of the second child block. (Note 13) The method for decoding the motion information is as follows: The method for decoding motion information according to Appendix 1, further comprising the step of applying at least one of the information indicating the basic motion vector, the information indicating the displacement distance, and the information indicating the displacement direction, obtained in relation to the current block, to the second child block, if the current block corresponds to a first child block separated from the parent block. (Note 14) The method for decoding the motion information is as follows: The method for decoding motion information according to Appendix 1, further comprising the step of obtaining information indicating at least one of the following: whether or not a predetermined encoding mode is applied to the current block, a basic motion vector relating to the current block, a primary residual motion vector relating to the current block, a priority order of displacement distance, and a priority order of displacement direction, at at least one of the following levels: conversion unit level, encoding unit level, maximum encoding unit level, slice level, and picture level. (Note 15) In methods for encoding motion information, Currently, we are in the stage of determining the basic motion vector of the block, A step of determining the primary residual motion vector relating to the current block from among at least one primary residual motion vector candidate, which is classified by displacement distance and displacement direction, based on the difference between the motion vector of the current block and the basic motion vector, A method for encoding motion information, characterized by comprising the step of generating a bitstream that includes at least one of the information indicating the basic motion vector and the information indicating the first-order residual motion vector.

Claims

1. In a method for decoding motion information, The process involves purging the displacement distance index and displacement direction index from the bitstream, A step of obtaining a first motion vector difference for a first list from the displacement distance index and the displacement direction index, If the current block is predicted, the process involves deriving a second motion vector difference for the second list based on the first motion vector difference, the picture order count of the current picture, the picture order count of the first reference picture in the first list, and the picture order count of the second reference picture in the second list. A step of obtaining a first motion vector for the first list using the first motion vector difference and the first basic motion vector for the first list, A step of obtaining a second motion vector for the second list using the second motion vector difference and the second basic motion vector for the second list, The process includes the step of restoring the current block using the first motion vector, the first reference picture, the second motion vector, and the second reference picture, The aforementioned displacement distance index represents a value that is a power of 2, A method wherein if the difference between the POC of the current picture and the POC of the first reference picture is the same as the difference between the POC of the current picture and the POC of the second reference picture, then the second motion vector difference is the same as the first motion vector difference.

2. In a method for encoding motion information, The current step is to obtain the first motion vector difference for the first list using the first motion vector for the first list of the block and the first basic motion vector for the first list, If it is determined that the current block is bipredicted, the next step is to derive a second motion vector difference for the second list based on the first motion vector difference, the picture order count (POC) of the current picture, the POC of the first reference picture in the first list, and the POC of the second reference picture in the second list. The step includes generating a bitstream that includes a shift distance index and a shift direction index, The displacement distance index and the displacement direction index represent the difference in the first motion vector. The aforementioned displacement distance index represents a value that is a power of 2, A method wherein if the difference between the POC of the current picture and the POC of the first reference picture is the same as the difference between the POC of the current picture and the POC of the second reference picture, then the second motion vector difference is the same as the first motion vector difference.

3. A method for transmitting a bitstream generated by the method described in claim 2.

Citation Information

Patent Citations

  • Encoder and encoding method, and decoder and decoding method

    JP2006279573A

  • Image encoder, image encoding method and image encoding program

    JP2013034186A

  • Image decoding apparatus and image encoding apparatus

    JP2013223049A

  • Motion vector coding and BI-prediction in HEVC and its extensions

    WO2013138631A1

  • Video encoding device and video decoding device using high-precision skip encoding and method thereof

    WO2016068685A1