Device and method for encoding and decoding image by using inter prediction
By constructing and rearranging motion vector predictor candidates using template matching costs, including zero motion vectors, the method addresses inefficiencies in predicting motion vectors, resulting in enhanced video compression and decoding performance.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SAMSUNG ELECTRONICS CO LTD
- Filing Date
- 2025-10-23
- Publication Date
- 2026-04-30
AI Technical Summary
Existing video encoding and decoding methods face inefficiencies in predicting motion vectors, particularly when using zero motion vectors, leading to suboptimal compression and decoding performance.
The method involves constructing and rearranging a list of motion vector predictor candidates based on template matching costs, including zero motion vectors, to improve the prediction accuracy and efficiency in inter-prediction processes.
This approach enhances the accuracy and efficiency of motion vector prediction, leading to improved video compression and decoding performance by optimizing the use of zero motion vectors.
Smart Images

Figure KR2025016875_30042026_PF_FP_ABST
Abstract
Description
Device and method for encoding and decoding images using inter-prediction
[0001] The present disclosure relates to the field of image encoding and decoding using inter-prediction, and specifically, to an apparatus and method for encoding and decoding an image by encoding and decoding a motion vector using a zero motion vector.
[0002] In video encoding and decoding, the video is divided into blocks, and each block can be predictively encoded and predictedly decoded through inter prediction or intra prediction.
[0003] Inter-prediction is a technique that compresses images by eliminating temporal redundancy between images. In inter-prediction, blocks of the current image can be predicted using a reference image. The reference block most similar to the current block can be searched within a predetermined search range in the reference image. The current block is predicted based on the reference block, and a residual block can be generated by subtracting the predicted block resulting from the prediction result from the current block.
[0004] In standards such as H.264 AVC (Advanced Video Coding) and HEVC (High Efficiency Video Coding), the motion vectors of previously encoded blocks adjacent to the current block or blocks included in a previously encoded video can be used as the motion vector predictor for the current block to predict the motion vector of the current block. The motion vector difference, which is the difference between the motion vector of the current block and the motion vector predictor, can be signaled to the decoder side through a predetermined method.
[0005] Intra prediction is a technique that compresses images by eliminating spatial redundancy within the image. In intra prediction, depending on the intra prediction mode, a prediction block can be generated based on the surrounding pixels of the current block. Additionally, a residual block can be generated by subtracting the prediction block from the current block.
[0006] Residual blocks generated through inter-prediction or intra-prediction can be passed to a decoder after undergoing transformation and quantization. The decoder can inversely quantize and inversely transform the residual blocks, and reconstruct the current block by combining the prediction block of the current block with the residual blocks. In certain cases, the decoder can filter the reconstructed current block to remove artifacts within it.
[0007] A decoding method for an image according to one embodiment may include the step of constructing a list of candidate initial motion vector predictors for the current block using motion vectors of surrounding blocks.
[0008] A decoding method for an image according to one embodiment may include the step of performing correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in an initial motion vector predictor candidate list.
[0009] A decoding method for an image according to one embodiment may include the step of constructing a final list of motion vector predictor candidates by rearranging a plurality of motion vector predictor candidates based on a template matching cost.
[0010] A decoding method for an image according to one embodiment may include the step of determining a motion vector predictor of the current block based on a final motion vector predictor candidate list.
[0011] A decoding method for an image according to one embodiment may include the step of determining the motion vector of the current block by summing the motion vector predictor of the current block and the motion vector difference of the current block.
[0012] A decoding method for an image according to one embodiment may include the step of generating a prediction block of the current block using the motion vector of the current block.
[0013] According to a decoding method for an image according to one embodiment, the final motion vector predictor candidate list may include zero motion vectors reordered based on a template matching cost.
[0014] An image decoding device according to one embodiment may include at least one memory storing at least one instruction; and at least one processor operating according to at least one instruction.
[0015] In one embodiment, at least one processor can construct a list of candidate initial motion vector predictors for the current block using motion vectors of surrounding blocks.
[0016] In one embodiment, at least one processor can perform correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in an initial motion vector predictor candidate list.
[0017] In one embodiment, at least one processor can construct a final list of motion vector predictor candidates by rearranging a plurality of motion vector predictor candidates based on template matching costs.
[0018] In one embodiment, at least one processor can determine the motion vector predictor of the current block based on the final motion vector predictor candidate list.
[0019] In one embodiment, at least one processor can determine the motion vector of the current block by summing the motion vector predictor of the current block and the motion vector difference of the current block.
[0020] In one embodiment, at least one processor can generate a prediction block of the current block using the motion vector of the current block.
[0021] According to an image decoding device according to one embodiment, the final motion vector predictor candidate list may include zero motion vectors reordered based on template matching costs.
[0022] An image encoding method according to one embodiment may include the step of constructing a list of initial motion vector predictor candidates for the current block using motion vectors of surrounding blocks.
[0023] An image encoding method according to one embodiment may include the step of performing correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in an initial motion vector predictor candidate list.
[0024] An image encoding method according to one embodiment may include the step of constructing a final motion vector predictor candidate list by rearranging a plurality of motion vector predictor candidates based on a template matching cost.
[0025] An image encoding method according to one embodiment may include the step of determining a motion vector predictor of the current block based on a final motion vector predictor candidate list.
[0026] An image encoding method according to one embodiment may include the step of determining the difference in motion vectors of a current block using a motion vector of a current block and a motion vector predictor of a current block.
[0027] A method for encoding an image according to one embodiment may include the step of encoding information for specifying motion vector differences into a bitstream.
[0028] An image encoding method according to one embodiment may include the step of generating a prediction block of the current block using the motion vector of the current block.
[0029] According to an image encoding method according to one embodiment, the final motion vector predictor candidate list may include zero motion vectors reordered based on template matching costs.
[0030] An image encoding device according to one embodiment may include at least one memory for storing at least one instruction; and at least one processor for operating according to at least one instruction.
[0031] In one embodiment, at least one processor can construct a list of candidate initial motion vector predictors for the current block using motion vectors of surrounding blocks.
[0032] In one embodiment, at least one processor can perform correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in an initial motion vector predictor candidate list.
[0033] In one embodiment, at least one processor can construct a final list of motion vector predictor candidates by rearranging a plurality of motion vector predictor candidates based on template matching costs.
[0034] In one embodiment, at least one processor can determine the motion vector predictor of the current block based on the final motion vector predictor candidate list.
[0035] In one embodiment, at least one processor can determine the difference in the motion vector of the current block using the motion vector of the current block and the motion vector predictor of the current block.
[0036] In one embodiment, at least one processor can encode information for specifying motion vector differences into a bitstream.
[0037] In one embodiment, at least one processor can generate a prediction block of the current block using the motion vector of the current block.
[0038] According to an image encoding device of one embodiment, the final motion vector predictor candidate list may include zero motion vectors reordered based on template matching costs.
[0039] In a computer-readable recording medium that records a bitstream according to one embodiment, the bitstream may include the encoding result of the current block.
[0040] In one embodiment, the encoding result of the current block may include information for specifying the motion vector difference.
[0041] In one embodiment, the encoding result of the current block can be generated by constructing a list of candidate initial motion vector predictors for the current block using the motion vectors of surrounding blocks.
[0042] In one embodiment, the encoding result of the current block can be generated by performing correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in an initial motion vector predictor candidate list.
[0043] In one embodiment, the encoding result of the current block can be generated by rearranging a plurality of motion vector predictor candidates based on template matching costs to form a final motion vector predictor candidate list.
[0044] In one embodiment, the encoding result of the current block can be generated by determining the motion vector predictor of the current block based on the final motion vector predictor candidate list.
[0045] In one embodiment, the encoding result of the current block can be generated by determining the difference in the motion vector of the current block using the motion vector of the current block and the motion vector predictor of the current block.
[0046] In one embodiment, the encoding result of the current block can be generated by encoding information for specifying the motion vector difference.
[0047] In one embodiment, the encoding result of the current block can be generated by generating a prediction block of the current block using the motion vector of the current block.
[0048] FIG. 1 is a block diagram of an image decoding device according to one embodiment.
[0049] FIG. 2 is a block diagram of an image encoding device according to one embodiment.
[0050] FIG. 3 illustrates a process of determining at least one encoding unit by dividing the current encoding unit according to one embodiment.
[0051] FIG. 4 illustrates a process of determining at least one encoding unit by dividing a encoding unit that is in the shape of a non-square according to one embodiment.
[0052] FIG. 5 illustrates a process of dividing a encoding unit based on at least one of block shape information and division shape mode information according to one embodiment.
[0053] FIG. 6 illustrates a method for determining a predetermined encoding unit among an odd number of encoding units according to one embodiment.
[0054] FIG. 7 illustrates the order in which a plurality of encoding units are processed when a current encoding unit is divided to determine a plurality of encoding units according to one embodiment.
[0055] FIG. 8 illustrates a process for determining that, according to one embodiment, when the encoding unit cannot be processed in a predetermined order, the current encoding unit is divided into an odd number of encoding units.
[0056] FIG. 9 illustrates a process of determining at least one encoding unit by dividing a first encoding unit according to one embodiment.
[0057] FIG. 10 illustrates that, according to one embodiment, the shape that can be divided is limited when a second encoding unit of a non-square shape determined by dividing a first encoding unit satisfies a predetermined condition.
[0058] FIG. 11 illustrates a process of dividing square-shaped encoding units when, according to one embodiment, the divided shape mode information cannot represent division into four square-shaped encoding units.
[0059] FIG. 12 illustrates that, according to one embodiment, the processing order between a plurality of encoding units may vary depending on the division process of the encoding unit.
[0060] FIG. 13 illustrates a process in which, according to one embodiment, a encoding unit is recursively divided to determine a plurality of encoding units, and the depth of the encoding unit is determined as the shape and size of the encoding unit change.
[0061] FIG. 14 illustrates a depth and part index (hereinafter PID) for distinguishing between coding units that can be determined according to the shape and size of the coding units according to one embodiment.
[0062] FIG. 15 illustrates that a plurality of encoding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment.
[0063] FIG. 16 illustrates the encoding units that can be determined for each picture when the combination of forms in which the encoding units can be divided according to one embodiment is different for each picture.
[0064] FIG. 17 illustrates various forms of encoding units that can be determined based on partitioned form mode information expressed as binary code according to one embodiment.
[0065] FIG. 18 illustrates another form of encoding unit that can be determined based on partitioned form mode information represented by binary code according to one embodiment.
[0066] FIG. 19 is a block diagram of an image encoding and decoding system that performs loop filtering according to one embodiment.
[0067] FIG. 20 is a block diagram illustrating the configuration of an image decoding device (2000) according to one embodiment.
[0068] FIG. 21 is a diagram illustrating a method for determining a motion vector according to one embodiment.
[0069] FIG. 22 is a diagram illustrating the process of inserting a motion vector of a spatially surrounding block into a motion vector predictor candidate list according to one embodiment.
[0070] FIG. 23 is a diagram illustrating the process of inserting a motion vector of a temporal surrounding block into a motion vector predictor candidate list according to one embodiment.
[0071] FIG. 24 is a drawing illustrating a temporal peripheral block according to one embodiment.
[0072] FIG. 25 is a diagram illustrating a method for constructing a candidate list using a zero motion vector according to one embodiment.
[0073] FIG. 26 is a diagram illustrating a method of constructing a candidate list using a zero motion vector according to one embodiment.
[0074] FIG. 27 is a diagram illustrating a method for adding a zero motion vector to a candidate list as a temporal candidate according to one embodiment.
[0075] FIG. 28 is a diagram illustrating a method of constructing a candidate list using a zero motion vector according to one embodiment.
[0076] FIG. 29 is a diagram illustrating a method for constructing a candidate list using a zero motion vector according to one embodiment.
[0077] FIG. 30 is a diagram illustrating a method of constructing a candidate list using a zero motion vector according to one embodiment.
[0078] FIG. 31 is a diagram illustrating a method for constructing a candidate list using a zero motion vector according to one embodiment.
[0079] FIG. 32 is a diagram illustrating a method of constructing a candidate list using a zero motion vector according to one embodiment.
[0080] FIG. 33 is a flowchart illustrating an image decoding method according to one embodiment.
[0081] FIG. 34 is a block diagram illustrating the configuration of an image encoding device according to one embodiment.
[0082] FIG. 35 is a flowchart illustrating an image encoding method according to one embodiment.
[0083] The present disclosure is capable of various modifications and may have various embodiments, and embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the embodiments of the present disclosure, and the present disclosure may include all modifications, equivalents, and substitutions that fall within the spirit and technical scope of the various embodiments.
[0084] In describing the embodiments, if it is determined that a detailed description of related prior art could unnecessarily obscure the gist of the present disclosure, such detailed description may be omitted. Additionally, numbers used in the description of the embodiments (e.g., first, second, etc.) may correspond to identification symbols to distinguish one component from another.
[0085] In the present disclosure, the expression “at least one of a, b, or c” may refer to “a”, “b”, “c”, “a and b”, “a and c”, “b and c”, “a, b, and c all”, or variations thereof.
[0086] In the present disclosure, when one component is described as being "connected" or "connected" to another component, the one component may be directly connected to or directly connected to another component, but unless specifically stated otherwise, it may be connected or connected through another component in between.
[0087] In this disclosure, components expressed as ‘~part (unit)’, ‘module’, etc. may consist of two or more components combined into a single component, or a single component may be divided into two or more more subdivided components. Additionally, each component described below may additionally perform some or all of the functions of other components in addition to the primary function it is responsible for, and some of the primary functions of each component may be exclusively performed by other components.
[0088] In the present disclosure, 'image' may refer to a picture, a still image, a frame, a video composed of a plurality of consecutive still images, or a video.
[0089] In the present disclosure, 'sample' may refer to data assigned to a sampling location of an image that is subject to processing. For example, a pixel within a frame in a spatial domain may correspond to a sample. A unit comprising a plurality of samples may be defined as a block.
[0090] Hereinafter, with reference to FIGS. 1 to 19, an image encoding method and apparatus based on a tree structure encoding unit and a conversion unit according to one embodiment, an image decoding method and apparatus are disclosed.
[0091] FIG. 1 illustrates a block diagram of an image decoding device (100) according to one embodiment.
[0092] 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 include at least one processor. Additionally, the bitstream acquisition unit (110) and the decoding unit (120) may include a memory that stores instructions to be executed by at least one processor.
[0093] The bitstream acquisition unit (110) can receive a bitstream. The bitstream contains information in which an image is encoded by an image encoding device (200) described later. Additionally, the bitstream can be transmitted from the image encoding device (200). The image encoding device (200) and the image decoding device (100) can be connected via wired or wireless connection, and the bitstream acquisition unit (110) can receive the bitstream via wired or wireless connection. The bitstream acquisition unit (110) can receive the bitstream from a storage medium such as an optical medium or a hard disk. The decoding unit (120) can restore the image based on information obtained from the received bitstream. The decoding unit (120) can obtain syntax elements for restoring the image from the bitstream. The decoding unit (120) can restore the image based on the syntax elements.
[0094] To explain in detail the operation of the video decoding device (100), the bitstream acquisition unit (110) can receive a bitstream.
[0095] The image decoder (100) can perform an operation of obtaining an empty string corresponding to a partitioning mode of the encoding unit from a bitstream. The image decoder (100) can also perform an operation of determining a partitioning rule for the encoding unit. Additionally, the image decoder (100) can perform an operation of partitioning the encoding unit into a plurality of encoding units based on at least one of the empty string corresponding to the partitioning mode and the partitioning rule. To determine the partitioning rule, the image decoder (100) can determine an allowable first range of the size of the encoding unit according to the ratio of the width and height of the encoding unit. To determine the partitioning rule, the image decoder (100) can determine an allowable second range of the size of the encoding unit according to the partitioning mode of the encoding unit.
[0096] In the following, the division of a encoding unit according to one embodiment of the present disclosure will be described in detail.
[0097] First, a picture may be divided into one or more slices or one or more tiles. A slice or a tile may be a sequence of one or more Coding Tree Units (CTUs). Depending on the embodiment, a slice may include one or more tiles, and a slice may include one or more Coding Tree Units. A slice containing one or more tiles may be determined within the picture.
[0098] In contrast to the Max Coding Unit (CTU), there is the Max Coding Tree Block (CTB). A Max Coding Tree Block (CTB) refers to an NxN block containing NxN samples (where N is an integer). Each color component can be divided into one or more Max Coding Tree Blocks.
[0099] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), the maximum encoding unit (CTU) is a unit that includes the maximum encoding block for luminance samples and two corresponding maximum encoding blocks for chroma samples, and the syntax structures used to encode the luminance samples and chroma samples. When a picture is a monochrome picture, the maximum encoding unit is a unit that includes the maximum encoding block for monochrome samples and the syntax structures used to encode the monochrome samples. When a picture is encoded into color planes separated by color components, the maximum encoding unit is a unit that includes the picture and the syntax structures used to encode the samples of the picture.
[0100] A single maximum coding block (CTB) can be divided into MxN coding blocks containing MxN samples (M and N are integers).
[0101] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) is a unit that includes a coding block for luminance samples and two coding blocks for corresponding chroma samples, and syntax structures used to encode the luminance samples and chroma samples. When a picture is a monochrome picture, a coding unit is a unit that includes a coding block for monochrome samples and syntax structures used to encode the monochrome samples. When a picture is a picture encoded in color planes separated by color components, a coding unit is a unit that includes the picture and syntax structures used to encode the samples of the picture.
[0102] As explained above, the maximum encoding block and the maximum encoding unit are distinct concepts, and the encoding block and the encoding unit are distinct concepts. That is, the (maximum) encoding unit refers to a data structure that includes the (maximum) encoding block containing the corresponding sample and the corresponding syntax structure. However, since a person skilled in the art can understand that the (maximum) encoding unit or the (maximum) encoding block refers to a block of a predetermined size containing a predetermined number of samples, the maximum encoding block and the maximum encoding unit, or the encoding block and the encoding unit, are referred to without distinction in the following specification unless there are special circumstances.
[0103] The image can be divided into Coding Tree Units (CTUs). The size of the CTU can be determined based on information obtained from the bitstream. The shape of the CTU can be a square of equal size, but it is not limited to this.
[0104] For example, information about the maximum size of a luma-encoded block can be obtained from a bitstream. For example, the maximum size of a luma-encoded block indicated by the information about the maximum size of a luma-encoded block may be one of 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, or 256x256.
[0105] For example, information regarding the maximum size of a two-divisionable luminance coding block and the difference in luminance block size can be obtained from a bitstream. The information regarding the difference in luminance block size may represent the size difference between the maximum luminance coding unit and the maximum two-divisionable luminance coding block. Therefore, by combining the information regarding the maximum size of the two-divisionable luminance coding block obtained from the bitstream with the information regarding the difference in luminance block size, the size of the maximum luminance coding unit can be determined. Using the size of the maximum luminance coding unit, the size of the maximum chroma coding unit can also be determined. For example, if the Y:Cb:Cr ratio according to the color format is 4:2:0, the size of the chroma block may be half the size of the luminance block, and similarly, the size of the maximum chroma coding unit may be half the size of the maximum luminance coding unit.
[0106] According to one embodiment, information regarding the maximum size of a binary splittable luminous encoding block is obtained from a bitstream, so the maximum size of the binary splittable luminous encoding block can be determined variably. Alternatively, the maximum size of a ternary splittable luminous encoding block can be fixed. For example, the maximum size of a ternary splittable luminous encoding block in picture I may be 32x32, and the maximum size of a ternary splittable luminous encoding block in picture P or picture B may be 64x64.
[0107] Additionally, the maximum encoding unit can be hierarchically divided into encoding units based on splitting mode information obtained from the bitstream. As splitting mode information, at least one of information indicating whether it is a quad split, information indicating whether it is a multi-split, splitting direction information, and splitting type information can be obtained from the bitstream.
[0108] For example, information indicating whether quad splitting is performed can indicate whether the current encoding unit will be quad split or not.
[0109] If the current encoding unit is not quad-splitting, information indicating multi-splitting can indicate whether the current encoding unit will no longer be split (NO_SPLIT) or whether it will be binary / ternary split.
[0110] If the current encoding unit is binary or binary split, the splitting direction information indicates that the current encoding unit is split in either the horizontal or vertical direction.
[0111] If the current encoding unit is split horizontally or vertically, the split type information indicates that the current encoding unit is split into binary or binary splits.
[0112] The splitting mode of the current encoding unit can be determined based on the splitting direction information and the splitting type information. The splitting mode when the current encoding unit is binary split in the horizontal direction can be determined as binary horizontal splitting (SPLIT_BT_HOR), when it is territorial split in the horizontal direction as territorial horizontal splitting (SPLIT_TT_HOR), when it is binary split in the vertical direction as binary vertical splitting (SPLIT_BT_VER), and when it is territorial split in the vertical direction as territorial vertical splitting (SPLIT_TT_VER).
[0113] The image decoding device (100) can obtain splitting mode information from a bitstream from a single empty string. The form of the bitstream received by the image decoding device (100) may include a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The empty string represents information as a sequence of binary numbers. The empty string may consist of at least one bit. The image decoding device (100) can obtain splitting mode information corresponding to the empty string based on a splitting rule. Based on the single empty string, the image decoding device (100) can determine whether to quad split the encoding unit, whether not to split it, or the splitting direction and splitting type.
[0114] A coding unit may be smaller than or equal to a maximum coding unit. For example, since the maximum coding unit is a coding unit having the maximum size, it is also a coding unit. If the segmentation mode information for the maximum coding unit indicates that it is not segmented, the coding unit determined from the maximum coding unit has the same size as the maximum coding unit. If the segmentation mode information for the maximum coding unit indicates that it is segmented, the maximum coding unit may be segmented into coding units. Additionally, if the segmentation mode information for a coding unit indicates segmentation, the coding units may be segmented into coding units of smaller size. However, the segmentation of the image is not limited to this, and the maximum coding unit and the coding unit may not be distinguished. The segmentation of coding units is explained in more detail in FIGS. 3 through 16.
[0115] Additionally, one or more prediction blocks for prediction may be determined from the coding unit. The prediction blocks may be equal to or smaller than the coding unit. Additionally, one or more transformation blocks for transformation may be determined from the coding unit. The transformation blocks may be equal to or smaller than the coding unit.
[0116] The shape and size of the transformation block and the prediction block may not be related to each other.
[0117] In another embodiment, prediction can be performed using the encoding unit as a prediction block. Additionally, conversion can be performed using the encoding unit as a conversion block.
[0118] The division of the encoding unit is described in more detail in FIGS. 3 through 16. The current block and surrounding block of the present disclosure may represent one of a maximum encoding unit, an encoding unit, a prediction block, and a transformation block. Additionally, the current block or the current encoding unit is a block currently undergoing decoding or encoding, or a block currently undergoing division. The surrounding block may be a block restored prior to the current block. The surrounding block may be spatially or temporally adjacent to the current block. The surrounding block may be located on one of the lower-left, left, upper-left, upper, upper-right, right, or lower-right sides of the current block.
[0119] FIG. 3 illustrates a process in which an image decoding device (100) divides a current encoding unit to determine at least one encoding unit according to one embodiment.
[0120] The block shape may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N. Here, N may be a positive integer. Block shape information is information indicating at least one of the shape, orientation, width, and height ratio or size of the encoding unit.
[0121] The shape of the encoding unit may include square and non-square. When the width and height of the encoding unit are the same (i.e., when the block shape of the encoding unit is 4Nx4N), the image decoder (100) may determine the block shape information of the encoding unit as square. The image decoder (100) may determine the shape of the encoding unit as non-square.
[0122] When the width and height of the encoding unit are different (i.e., when the block shape of the encoding unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the image decoder (100) can determine the block shape information of the encoding unit as non-square. When the shape of the encoding unit is non-square, the image decoder (100) can determine the ratio of the width and height among the block shape information of the encoding unit as 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. Additionally, based on the width and height of the encoding unit, the image decoding device (100) can determine whether the encoding unit is in a horizontal direction or a vertical direction. Additionally, based on at least one of the width, height, or width of the encoding unit, the image decoding device (100) can determine the size of the encoding unit.
[0123] According to one embodiment, the image decoding device (100) can determine the form of the encoding unit using block form information and can determine how the encoding unit is divided using division form mode information. That is, depending on what block form the block form information used by the image decoding device (100) represents, the method of dividing the encoding unit represented by the division form mode information can be determined.
[0124] The video decoder (100) can obtain split-form mode information from the bitstream. However, it is not limited thereto, and the video decoder (100) and the video encoding device (200) can determine pre-agreed split-form mode information based on block form information. The video decoder (100) can determine pre-agreed split-form mode information for a maximum encoding unit or a minimum encoding unit. For example, the video decoder (100) can determine the split-form mode information for the maximum encoding unit as quad split. Additionally, the video decoder (100) can determine the split-form mode information for the minimum encoding unit as "not split." Specifically, the video decoder (100) can determine the size of the maximum encoding unit to be 256x256. The video decoder (100) can determine the pre-agreed split-form mode information as quad split. Quad split is a split-form mode that divides both the width and height of the encoding unit into two equal parts. The image decoder (100) can obtain a 128x128 size encoding unit from a 256x256 size encoding unit based on the division mode information. Additionally, the image decoder (100) can determine the size of the minimum encoding unit to be 4x4. The image decoder (100) can obtain division mode information indicating "not divided" for the minimum encoding unit.
[0125] According to one embodiment, the image decoding device (100) may use block shape information indicating that the current encoding unit is in the shape of a square. For example, the image decoding device (100) may determine whether to not divide the square encoding unit, to divide it vertically, to divide it horizontally, or to divide it into four encoding units, etc., based on the division shape mode information. Referring to FIG. 3, when the block shape information of the current encoding unit (300) indicates a square shape, the decoding unit (120) may not divide the encoding unit (310a) having the same size as the current encoding unit (300) based on the division shape mode information indicating that it is not divided, or may determine the divided encoding units (310b, 310c, 310d, 310e, 310f, etc.) based on the division shape mode information indicating a predetermined division method.
[0126] Referring to FIG. 3, the image decoding device (100) can determine two encoding units (310b) that divide the current encoding unit (300) in the vertical direction based on splitting form mode information indicating that it is divided in the vertical direction according to one embodiment. The image decoding device (100) can determine two encoding units (310c) that divide the current encoding unit (300) in the horizontal direction based on splitting form mode information indicating that it is divided in the horizontal direction. The image decoding device (100) can determine four encoding units (310d) that divide the current encoding unit (300) in the vertical direction and the horizontal direction based on splitting form mode information indicating that it is divided in the vertical direction and the horizontal direction. The image decoding device (100) can determine three encoding units (310e) that divide the current encoding unit (300) in the vertical direction based on splitting form mode information indicating that it is divided ternary in the vertical direction according to one embodiment. The image decoding device (100) can determine three encoding units (310f) that divide the current encoding unit (300) horizontally based on division form mode information indicating horizontal division. However, the division form in which the square encoding unit can be divided should not be interpreted as being limited to the form described above, and may include various forms that the division form mode information can represent. The specific division forms in which the square encoding unit is divided will be described in detail below through various embodiments.
[0127] FIG. 4 illustrates a process in which, according to one embodiment, an image decoding device (100) divides a non-square-shaped encoding unit to determine at least one encoding unit.
[0128] According to one embodiment, the image decoding device (100) may use block shape information indicating that the current encoding unit is in a non-square shape. The image decoding device (100) may determine whether to not divide the current encoding unit of the non-square shape or to divide it in a predetermined way according to the division shape mode information. Referring to FIG. 4, when the block shape information of the current encoding unit (400 or 450) indicates a non-square shape, the image decoding device (100) may determine an encoding unit (410 or 460) having the same size as the current encoding unit (400 or 450) based on division shape mode information indicating that it is not divided, or determine divided encoding units (420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, 480c) based on division shape mode information indicating a predetermined division method. A predetermined division method in which a non-square encoding unit is divided will be specifically described below through various embodiments.
[0129] According to one embodiment, the image decoding device (100) can determine the form in which the encoding unit is divided using the division form mode information, and in this case, the division form mode information may indicate the number of at least one encoding unit generated by dividing the encoding unit. Referring to FIG. 4, when the division form mode information indicates that the current encoding unit (400 or 450) is divided into two encoding units, the image decoding device (100) can determine two encoding units (420a, 420b, or 470a, 470b) included in the current encoding unit by dividing the current encoding unit (400 or 450) based on the division form mode information.
[0130] According to one embodiment, when an image decoding device (100) divides a current encoding unit (400 or 450) in a non-square shape based on division shape mode information, the image decoding device (100) may divide the current encoding unit by considering the position of the long side of the current encoding unit (400 or 450) in a non-square shape. For example, the image decoding device (100) may determine a plurality of encoding units by dividing the current encoding unit (400 or 450) in a direction that divides the long side of the current encoding unit (400 or 450) by considering the shape of the current encoding unit (400 or 450).
[0131] According to one embodiment, when the segmentation mode information indicates that the encoding unit is divided into an odd number of blocks (terminal segmentation), the image decoder (100) can determine an odd number of encoding units included in the current encoding unit (400 or 450). For example, when the segmentation mode information indicates that the current encoding unit (400 or 450) is divided into three encoding units, the image decoder (100) can divide the current encoding unit (400 or 450) into three encoding units (430a, 430b, 430c, 480a, 480b, 480c).
[0132] According to one embodiment, the ratio of the width to the height of the current encoding unit (400 or 450) may be 4:1 or 1:4. When the ratio of the width to the height is 4:1, the block shape information may be in the horizontal direction because the width is longer than the height. When the ratio of the width to the height is 1:4, the block shape information may be in the vertical direction because the width is shorter than the height. The image decoder (100) may determine to divide the current encoding unit into an odd number of blocks based on the division shape mode information. Additionally, the image decoder (100) may 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 in a vertical direction, the image decoding device (100) can determine the encoding units (430a, 430b, 430c) by dividing the current encoding unit (400) in a horizontal direction. Also, if the current encoding unit (450) is in a horizontal direction, the image decoding device (100) can determine the encoding units (480a, 480b, 480c) by dividing the current encoding unit (450) in a vertical direction.
[0133] According to one embodiment, the image decoding device (100) may determine an odd number of encoding units included in the current encoding unit (400 or 450), and the sizes of the determined encoding units may not all be the same. For example, among the determined odd number of encoding units (430a, 430b, 430c, 480a, 480b, 480c), the size of a certain encoding unit (430b or 480b) may have a different size from the other encoding units (430a, 430c, 480a, 480c). That is, the current encoding unit (400 or 450) can be divided and determined as a encoding unit, and the encoding unit can have multiple types of sizes, and in some cases, an odd number of encoding units (430a, 430b, 430c, 480a, 480b, 480c) may each have different sizes.
[0134] According to one embodiment, if the segmentation mode information indicates that the encoding unit is divided into an odd number of blocks, the image decoding device (100) can determine the odd number of encoding units included in the current encoding unit (400 or 450), and furthermore, the image decoding device (100) can impose a predetermined limit on at least one encoding unit among the odd number of encoding units generated by the segmentation. Referring to FIG. 4, the image decoding device (100) can perform the decoding process for the central encoding unit (430b, 480b) among the three encoding units (430a, 430b, 430c, 480a, 480b, 480c) generated by the segmentation of the current encoding unit (400 or 450) differently from the other encoding units (430a, 430c, 480a, 480c). For example, the video decoding device (100) may restrict the centrally located encoding unit (430b, 480b) from being further divided unlike other encoding units (430a, 430c, 480a, 480c), or restrict it to being divided only a predetermined number of times.
[0135] FIG. 5 illustrates a process in which an image decoding device (100) divides a encoding unit based on at least one of block form information and division form mode information according to one embodiment.
[0136] According to one embodiment, the image decoding device (100) may determine whether to divide a square-shaped first encoding unit (500) into encoding units or not to divide it based on at least one of block shape information and division shape mode information. According to one embodiment, if the division shape mode information indicates that the first encoding unit (500) is divided in a horizontal direction, the image decoding device (100) may divide the first encoding unit (500) in a horizontal direction to determine a second encoding unit (510). The first encoding unit, the second encoding unit, and the third encoding unit used according to one embodiment are terms used to understand the relationship before and after division between the encoding units. For example, if the first encoding unit is divided, the second encoding unit may be determined, and if the second encoding unit is divided, the third encoding unit may be determined. In the following, the relationship between the first encoding unit, the second encoding unit, and the third encoding unit used may be understood as following the features described above.
[0137] According to one embodiment, the image decoding device (100) may determine whether to divide the determined second encoding unit (510) into encoding units or not to divide it based on the division shape mode information. Referring to FIG. 5, the image decoding device (100) may divide the determined non-square second encoding unit (510) into at least one third encoding unit (520a, 520b, 520c, 520d, etc.) by dividing the first encoding unit (500) based on the division shape mode information, or may not divide the second encoding unit (510). The image decoding device (100) can obtain segmentation mode information, and the image decoding device (100) can divide a first encoding unit (500) based on the obtained segmentation mode information to divide a plurality of second encoding units (e.g., 510) of various forms, and the second encoding units (510) can be divided according to the method in which the first encoding unit (500) was divided based on the segmentation mode information. According to one embodiment, when the first encoding unit (500) is divided into a second encoding unit (510) based on the segmentation mode information for the first encoding unit (500), the second encoding unit (510) can also be divided into a third encoding unit (e.g., 520a, 520b, 520c, 520d, etc.) based on the segmentation mode information for the second encoding unit (510). That is, the encoding unit can be recursively partitioned based on partitioning mode information associated with each encoding unit. Thus, a square encoding unit can be determined from a non-square encoding unit, and a non-square encoding unit can be determined by recursively partitioning this square encoding unit.
[0138] Referring to FIG. 5, among the odd number of third encoding units (520b, 520c, 520d) determined by dividing a second encoding unit (510) of a non-square shape, a predetermined encoding unit (e.g., a central encoding unit or a square encoding unit) may be recursively divided. According to one embodiment, a third encoding unit (520c) of a non-square shape, which is one of the odd number of third encoding units (520b, 520c, 520d), may be divided horizontally into a plurality of fourth encoding units. A fourth encoding unit (530b or 530d) of a non-square shape, which is one of the plurality of fourth encoding units (530a, 530b, 530c, 530d), may again be divided into a plurality of encoding units. For example, a non-square fourth encoding unit (530b or 530d) may be further divided into an odd number of encoding units. Methods that can be used for the recursive division of encoding units will be described later through various embodiments.
[0139] According to one embodiment, the image decoding device (100) may divide each of the third encoding units (520a, 520b, 520c, 520d, etc.) into encoding units based on the division shape mode information. Additionally, the image decoding device (100) may decide not to divide the second encoding unit (510) based on the division shape mode information. According to one embodiment, the image decoding device (100) may divide the non-square second encoding unit (510) into an odd number of third encoding units (520b, 520c, 520d). The image decoding device (100) may place a certain limit on a certain third encoding unit among the odd number of third encoding units (520b, 520c, 520d). For example, the video decoding device (100) may limit the encoding unit (520c) located in the middle of the odd number of third encoding units (520b, 520c, 520d) so that it is not further divided or is limited to being divided a set number of times.
[0140] Referring to FIG. 5, the image decoding device (100) may limit the middle encoding unit (520c) among the odd number of third encoding units (520b, 520c, 520d) included in the second encoding unit (510) of a non-square shape to no longer be divided, to be divided into a predetermined division form (e.g., divided into only 4 encoding units or divided into a form corresponding to the divided form of the second encoding unit (510)), or to be divided only a predetermined number of times (e.g., divided only n times, n > 0). However, the above limitation on the middle encoding unit (520c) is merely a simple example and should not be interpreted as being limited to the above-described examples, but should be interpreted as including various limitations that allow the middle encoding unit (520c) to be decoded differently from the other encoding units (520b, 520d).
[0141] According to one embodiment, the image decoding device (100) can obtain splitting form mode information used to split the current encoding unit at a predetermined location within the current encoding unit.
[0142] FIG. 6 illustrates a method for an image decoding device (100) to determine a predetermined encoding unit among an odd number of encoding units according to one embodiment.
[0143] Referring to FIG. 6, the segmentation mode information of the current encoding unit (600, 650) can be obtained from a sample at a specific location among a plurality of samples included in the current encoding unit (600, 650) (e.g., a sample located in the center (640, 690)). However, the specific location within the current encoding unit (600) where at least one of such segmentation mode information can be obtained should not be interpreted as being limited to the center location shown in FIG. 6, and should be interpreted as including various locations within the current encoding unit (600) (e.g., top, bottom, left, right, top-left, bottom-left, top-right, or bottom-right, etc.). The image decoding device (100) can obtain the segmentation mode information obtained from the specific location and decide whether to divide the current encoding unit into encoding units of various shapes and sizes or not to divide it.
[0144] According to one embodiment, the image decoding device (100) may select one of the encoding units when the current encoding unit is divided into a predetermined number of encoding units. There may be various methods for selecting one of the multiple encoding units, and such methods will be described later through various embodiments below.
[0145] According to one embodiment, the image decoding device (100) can divide the current encoding unit into a plurality of encoding units and determine the encoding unit at a predetermined position.
[0146] According to one embodiment, the image decoding device (100) may use information indicating the location of each of the odd number of encoding units to determine the encoding unit located in the middle among the odd number of encoding units. Referring to FIG. 6, the image decoding device (100) may divide the current encoding unit (600) or the current encoding unit (650) to determine the odd number of encoding units (620a, 620b, 620c) or the odd number of encoding units (660a, 660b, 660c). The image decoding device (100) may determine the middle encoding unit (620b) or the middle encoding unit (660b) by using information regarding the location of the odd number of encoding units (620a, 620b, 620c) or the odd number of encoding units (660a, 660b, 660c). For example, the image decoding device (100) can determine the centrally located encoding unit (620b) by determining the positions of the encoding units (620a, 620b, 620c) based on information indicating the positions of a predetermined sample included in the encoding units (620a, 620b, 620c). Specifically, the image decoding device (100) can determine the centrally located encoding unit (620b) by determining the positions of the encoding units (620a, 620b, 620c) based on information indicating the positions of the upper-left samples (630a, 630b, 630c) of the encoding units (620a, 620b, 620c).
[0147] According to one embodiment, information indicating the location of the upper-left sample (630a, 630b, 630c) included in each of the encoding units (620a, 620b, 620c) may include information regarding the location or coordinates within the picture of the encoding units (620a, 620b, 620c). According to one embodiment, information indicating the location of the upper-left sample (630a, 630b, 630c) included in each of the encoding units (620a, 620b, 620c) may include information indicating the width or height of the encoding units (620a, 620b, 620c) included in the current encoding unit (600), and such width or height may correspond to information indicating the difference between coordinates within the picture of the encoding units (620a, 620b, 620c). That is, the image decoding device (100) can determine the centrally located encoding unit (620b) by directly using information about the position or coordinates of the encoding units (620a, 620b, 620c) within the picture, or by using information about the width or height of the encoding unit corresponding to the difference value between the coordinates.
[0148] According to one embodiment, information indicating the location of the upper left sample (630a) of the upper encoding unit (620a) may be represented by the (xa, ya) coordinates, information indicating the location of the upper left sample (530b) of the middle encoding unit (620b) may be represented by the (xb, yb) coordinates, and information indicating the location of the upper left sample (630c) of the lower encoding unit (620c) may be represented by the (xc, yc) coordinates. The image decoding device (100) can determine the middle encoding unit (620b) using the coordinates of the upper left samples (630a, 630b, 630c) included in each of the encoding units (620a, 620b, 620c). For example, when the coordinates of the upper-left samples (630a, 630b, 630c) are sorted in ascending or descending order, the encoding unit (620b) containing the coordinates (xb, yb) of the sample (630b) located in the middle can be determined as the encoding unit located in the middle among the encoding units (620a, 620b, 620c) determined by dividing the current encoding unit (600). However, the coordinates indicating the position of the upper-left samples (630a, 630b, 630c) may represent absolute positions within the picture, and furthermore, based on the position of the upper-left sample (630a) of the upper-left of the upper-left of the middle encoding unit (620b), the (dxb, dyb) coordinates, which represent the relative position of the upper-left sample (630b) of the middle encoding unit (620b), and the (dxc, dyc) coordinates, which represent the relative position of the upper-left sample (630c) of the lower encoding unit (620c) may also be used. In addition, the method of determining the encoding unit of a predetermined position by using the coordinates of the corresponding sample as information indicating the position of the sample included in the encoding unit should not be interpreted as being limited to the method described above, but should be interpreted as various arithmetic methods that can utilize the coordinates of the sample.
[0149] According to one embodiment, the image decoding device (100) can divide the current encoding unit (600) into a plurality of encoding units (620a, 620b, 620c) and select an encoding unit among the encoding units (620a, 620b, 620c) according to a predetermined criterion. For example, the image decoding device (100) can select an encoding unit (620b) of a different size among the encoding units (620a, 620b, 620c).
[0150] According to one embodiment, the image decoding device (100) can determine the width or height of each of the encoding units (620a, 620b, 620c) using the (xa, ya) coordinates, which are information indicating the location of the upper left sample (630a) of the upper encoding unit (620a), the (xb, yb) coordinates, which are information indicating the location of the upper left sample (630b) of the middle encoding unit (620b), and the (xc, yc) coordinates, which are information indicating the location of the upper left sample (630c) of the lower encoding unit (620c). The image decoding device (100) can determine the size of each of the encoding units (620a, 620b, 620c) using the (xa, ya), (xb, yb), and (xc, yc) coordinates, which are information indicating the location of the encoding units (620a, 620b, 620c). According to one embodiment, the image decoding device (100) may determine the width of the upper encoding unit (620a) as the width of the current encoding unit (600). The image decoding device (100) may determine the height of the upper encoding unit (620a) as yb-ya. According to one embodiment, the image decoding device (100) may determine the width of the middle encoding unit (620b) as the width of the current encoding unit (600). The image decoding device (100) may determine the height of the middle encoding unit (620b) as yc-yb. According to one embodiment, the image decoding device (100) may determine the width or height of the lower encoding unit using the width or height of the current encoding unit and the width and height of the upper encoding unit (620a) and the middle encoding unit (620b). The video decoding device (100) can determine a encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (620a, 620b, 620c).Referring to FIG. 6, the image decoding device (100) can determine a middle encoding unit (620b) having a size different from that of the upper encoding unit (620a) and the lower encoding unit (620c) as the encoding unit of a predetermined position. However, since the process of the image decoding device (100) described above determining the encoding unit having a size different from other encoding units is merely one embodiment of determining the encoding unit of a predetermined position using the size of the encoding unit determined based on sample coordinates, various processes of determining the encoding unit of a predetermined position by comparing the size of the encoding unit determined according to the predetermined sample coordinates may be used.
[0151] The image decoding device (100) can determine the width or height of each of the encoding units (660a, 660b, 660c) using the (xd, yd) coordinates, which are information indicating the location of the upper-left sample (670a) of the left encoding unit (660a), the (xe, ye) coordinates, which are information indicating the location of the upper-left sample (670b) of the middle encoding unit (660b), and the (xf, yf) coordinates, which are information indicating the location of the upper-left sample (670c) of the right encoding unit (660c). The image decoding device (100) can determine the size of each of the encoding units (660a, 660b, 660c) using the (xd, yd), (xe, ye), and (xf, yf) coordinates, which are information indicating the location of the encoding units (660a, 660b, 660c).
[0152] According to one embodiment, the image decoding device (100) may determine the width of the left encoding unit (660a) as xe-xd. The image decoding device (100) may determine the height of the left encoding unit (660a) as the height of the current encoding unit (650). According to one embodiment, the image decoding device (100) may determine the width of the middle encoding unit (660b) as xf-xe. The image decoding device (100) may determine the height of the middle encoding unit (660b) as the height of the current encoding unit (600). According to one embodiment, the image decoding device (100) may determine the width or height of the right encoding unit (660c) using the width or height of the current encoding unit (650) and the width and height of the left encoding unit (660a) and the middle encoding unit (660b). The image decoding device (100) can determine a encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (660a, 660b, 660c). Referring to FIG. 6, the image decoding device (100) can determine a middle encoding unit (660b) having a different size from the left encoding unit (660a) and the right encoding unit (660c) as the encoding unit of a predetermined position. However, since the process of the image decoding device (100) described above determining a encoding unit having a different size from other encoding units is merely one embodiment of determining the encoding unit of a predetermined position using the size of the encoding unit determined based on sample coordinates, various processes of determining the encoding unit of a predetermined position by comparing the size of the encoding unit determined according to the predetermined sample coordinates may be used.
[0153] However, the sample location considered to determine the location of the encoding unit should not be interpreted as being limited to the upper left corner described above, and can be interpreted as allowing the use of information regarding the location of any sample included in the encoding unit.
[0154] According to one embodiment, the image decoding device (100) may select an encoding unit at a predetermined position among an odd number of encoding units determined by dividing the current encoding unit, taking into account the shape of the current encoding unit. For example, if the current encoding unit is a non-square shape where the width is longer than the height, the image decoding device (100) may determine an encoding unit at a predetermined position according to the horizontal direction. That is, the image decoding device (100) may determine one of the encoding units at different positions in the horizontal direction and place a restriction on that encoding unit. If the current encoding unit is a non-square shape where the height is longer than the width, the image decoding device (100) may determine an encoding unit at a predetermined position according to the vertical direction. That is, the image decoding device (100) may determine one of the encoding units at different positions in the vertical direction and place a restriction on that encoding unit.
[0155] According to one embodiment, the image decoding device (100) may use information indicating the location of each of the even number of encoding units to determine the encoding unit at a predetermined location among the even number of encoding units. The image decoding device (100) may determine the even number of encoding units by dividing (binary division) the current encoding unit and may determine the encoding unit at a predetermined location using information regarding the locations of the even number of encoding units. Since the specific process for this may correspond to the process of determining the encoding unit at a predetermined location (e.g., the middle location) among the odd number of encoding units described above in FIG. 6, it is omitted.
[0156] According to one embodiment, when a current encoding unit in a non-square shape is divided into a plurality of encoding units, certain information regarding the encoding unit at a certain position may be used during the division process to determine the encoding unit at a certain position among the plurality of encoding units. For example, the image decoding device (100) may use at least one of block shape information and division shape mode information stored in a sample included in the middle encoding unit during the division process to determine the encoding unit located in the middle among the encoding units into which the current encoding unit is divided into a plurality of encoding units.
[0157] Referring to FIG. 6, the image decoding device (100) can divide the current encoding unit (600) into a plurality of encoding units (620a, 620b, 620c) based on the division form mode information, and can determine the encoding unit (620b) located in the middle among the plurality of encoding units (620a, 620b, 620c). Furthermore, the image decoding device (100) can determine the encoding unit (620b) located in the middle by considering the location where the division form mode information is obtained. That is, the segmentation mode information of the current encoding unit (600) can be obtained from a sample (640) located in the middle of the current encoding unit (600), and based on the segmentation mode information, if the current encoding unit (600) is divided into a plurality of encoding units (620a, 620b, 620c), the encoding unit (620b) containing the sample (640) can be determined as the encoding unit located in the middle. However, the information used to determine the encoding unit located in the middle should not be interpreted as being limited to segmentation mode information, and various types of information may be used in the process of determining the encoding unit located in the middle.
[0158] According to one embodiment, a predetermined information for identifying a coding unit at a predetermined location may be obtained from a predetermined sample included in the coding unit to be determined. Referring to FIG. 6, an image decoding device (100) may use a segmentation mode information obtained from a sample at a predetermined location within the current coding unit (600) (for example, a sample at the center of the current coding unit (600)) to determine a coding unit at a predetermined location (for example, a coding unit located in the center of the multiple divided coding units) among a plurality of coding units (620a, 620b, 620c) determined by dividing the current coding unit (600). That is, the image decoding device (100) can determine a sample at the predetermined position by considering the block shape of the current encoding unit (600), and the image decoding device (100) can determine a encoding unit (620b) containing a sample from which certain information (e.g., division shape mode information) can be obtained among a plurality of encoding units (620a, 620b, 620c) from which the current encoding unit (600) is divided and determined, and can impose a certain limit. Referring to FIG. 6, according to one embodiment, the image decoding device (100) can determine a sample (640) located in the middle of the current encoding unit (600) as a sample from which certain information can be obtained, and the image decoding device (100) can impose a certain limit on the encoding unit (620b) containing such a sample (640) during the decoding process. However, the location of the sample from which the specified information can be obtained should not be interpreted as being limited to the location described above, but can be interpreted as samples at any location included in the encoding unit (620b) to be determined for the purpose of imposing a limitation.
[0159] According to one embodiment, the location of a sample from which a predetermined information can be obtained may be determined according to the shape of the current encoding unit (600). According to one embodiment, block shape information may determine whether the shape of the current encoding unit is square or non-square, and may determine the location of a sample from which a predetermined information can be obtained according to the shape. For example, the image decoding device (100) may determine a sample located on a boundary that divides at least one of the width and height of the current encoding unit in half using at least one of the information regarding the width and height of the current encoding unit as a sample from which a predetermined information can be obtained. As another example, if the block shape information related to the current encoding unit indicates that it is a non-square shape, the image decoding device (100) may determine one of the samples adjacent to the boundary that divides the long side of the current encoding unit in half as a sample from which a predetermined information can be obtained.
[0160] According to one embodiment, when the image decoding device (100) divides the current encoding unit into a plurality of encoding units, it may use division form mode information to determine the encoding unit at a predetermined position among the plurality of encoding units. According to one embodiment, the image decoding device (100) may obtain division form mode information from a sample at a predetermined position included in the encoding unit, and the image decoding device (100) may divide the plurality of encoding units generated by dividing the current encoding unit using the division form mode information obtained from a sample at a predetermined position included in each of the plurality of encoding units. That is, the encoding unit may be recursively divided using the division form mode information obtained from a sample at a predetermined position included in each of the encoding units. Since the recursive division process of the encoding unit has been described in detail through FIG. 5, a detailed explanation will be omitted.
[0161] According to one embodiment, the image decoding device (100) can determine at least one encoding unit by dividing the current encoding unit, and can determine the order in which the at least one encoding unit is decoded according to a predetermined block (e.g., the current encoding unit).
[0162] FIG. 7 illustrates the order in which a plurality of encoding units are processed when an image decoding device (100) divides a current encoding unit to determine a plurality of encoding units according to one embodiment.
[0163] According to one embodiment, the image decoding device (100) may determine a second encoding unit (710a, 710b) by dividing a first encoding unit (700) in a vertical direction according to the splitting form mode information, determine a second encoding unit (730a, 730b) by dividing the first encoding unit (700) in a horizontal direction, or determine a second encoding unit (750a, 750b, 750c, 750d) by dividing the first encoding unit (700) in both a vertical and a horizontal direction.
[0164] Referring to FIG. 7, the image decoding device (100) can determine the order of processing the determined second encoding units (710a, 710b) in the horizontal direction (710c) by dividing the first encoding unit (700) in the vertical direction. The image decoding device (100) can determine the processing order of the determined second encoding units (730a, 730b) in the vertical direction (730c) by dividing the first encoding unit (700) in the horizontal direction. The image decoding device (100) can determine the second encoding unit (750a, 750b, 750c, 750d) determined by dividing the first encoding unit (700) into vertical and horizontal directions, according to a predetermined order in which encoding units located in one row are processed and then encoding units located in the next row are processed (e.g., raster scan order or z scan order (750e), etc.).
[0165] According to one embodiment, the image decoding device (100) can recursively divide the encoding units. Referring to FIG. 7, the image decoding device (100) can divide the first encoding unit (700) to determine a plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d), and can recursively divide each of the determined plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d). A method of dividing multiple encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may be a method corresponding to a method of dividing the first encoding unit (700). Accordingly, the multiple encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may each be independently divided into multiple encoding units. Referring to FIG. 7, the image decoding device (100) may determine the second encoding units (710a, 710b) by dividing the first encoding unit (700) in a vertical direction, and furthermore, may determine whether to independently divide or not divide each of the second encoding units (710a, 710b).
[0166] According to one embodiment, the image decoding device (100) may divide the second encoding unit (710a) on the left side horizontally into third encoding units (720a, 720b), and may not divide the second encoding unit (710b) on the right side.
[0167] According to one embodiment, the processing order of the encoding units may be determined based on the process of dividing the encoding units. In other words, the processing order of the divided encoding units may be determined based on the processing order of the encoding units immediately before they are divided. The image decoding device (100) may determine the processing order of the third encoding units (720a, 720b), which are determined by dividing the second encoding unit (710a) on the left, independently of the second encoding unit (710b) on the right. Since the third encoding units (720a, 720b) are determined by dividing the second encoding unit (710a) on the left in a horizontal direction, the third encoding units (720a, 720b) may be processed in a vertical direction (720c). In addition, since the processing order of the second encoding unit (710a) on the left and the second encoding unit (710b) on the right corresponds to the horizontal direction (710c), the third encoding unit (720a, 720b) included in the second encoding unit (710a) on the left can be processed in the vertical direction (720c) before the right encoding unit (710b) is processed. The above description is intended to explain the process in which the processing order of the encoding units is determined according to the encoding unit before division, and therefore should not be interpreted as being limited to the above-described embodiment, but should be interpreted as being used in various ways in which encoding units determined by division in various forms can be processed independently according to a predetermined order.
[0168] FIG. 8 illustrates a process in which, according to one embodiment, an image decoding device (100) determines that the current encoding unit is divided into an odd number of encoding units when the encoding unit cannot be processed in a predetermined order.
[0169] According to one embodiment, the image decoding device (100) may determine that the current encoding unit is divided into an odd number of encoding units based on acquired segmentation mode information. Referring to FIG. 8, a square-shaped first encoding unit (800) may be divided into non-square-shaped second encoding units (810a, 810b), and the second encoding units (810a, 810b) may each be independently divided into third encoding units (820a, 820b, 820c, 820d, 820e). According to one embodiment, the image decoding device (100) can determine a plurality of third encoding units (820a, 820b) by dividing the left encoding unit (810a) among the second encoding units in a horizontal direction, and the right encoding unit (810b) can be divided into an odd number of third encoding units (820c, 820d, 820e).
[0170] According to one embodiment, the image decoding device (100) can determine whether there are an odd number of divided encoding units by determining whether the third encoding units (820a, 820b, 820c, 820d, 820e) can be processed in a predetermined order. Referring to FIG. 8, the image decoding device (100) can determine the third encoding units (820a, 820b, 820c, 820d, 820e) by recursively dividing the first encoding unit (800). The video decoding device (100) can determine whether the first encoding unit (800), the second encoding unit (810a, 810b), or the third encoding unit (820a, 820b, 820c, 820d, 820e) are divided into an odd number of encoding units based on at least one of block form information and division form mode information. For example, the encoding unit located on the right among the second encoding units (810a, 810b) may be divided into an odd number of third encoding units (820c, 820d, 820e). The order in which a plurality of encoding units included in the first encoding unit (800) are processed may be a predetermined order (e.g., z-scan order (830)), and the image decoding device (100) may determine whether the right second encoding unit (810b) is divided into an odd number of determined third encoding units (820c, 820d, 820e) can be processed according to the predetermined order.
[0171] According to one embodiment, the image decoding device (100) can determine whether the third encoding unit (820a, 820b, 820c, 820d, 820e) included in the first encoding unit (800) satisfies a condition that the third encoding unit (820a, 820b, 820c, 820d, 820e) can be processed in a predetermined order, and the condition relates to whether at least one of the width and height of the second encoding unit (810a, 810b) is divided in half according to the boundary of the third encoding unit (820a, 820b, 820c, 820d, 820e). For example, the third encoding unit (820a, 820b) determined by dividing the height of the left second encoding unit (810a) in a non-square shape in half can satisfy the condition. Since the boundaries of the third encoding units (820c, 820d, 820e), which are determined by dividing the right second encoding unit (810b) into three encoding units, do not divide the width or height of the right second encoding unit (810b) in half, the third encoding units (820c, 820d, 820e) may be determined not to satisfy the condition. In the case of such non-satisfaction of the condition, the image decoding device (100) determines that there is a disconnection in the scan order, and based on the result of the determination, the right second encoding unit (810b) may be determined to be divided into an odd number of encoding units. According to one embodiment, when the image decoding device (100) is divided into an odd number of encoding units, it may place a certain restriction on the encoding unit at a certain position among the divided encoding units, and since the details of such restriction or the certain position, etc., have been described in detail through various embodiments, a detailed explanation will be omitted.
[0172] FIG. 9 illustrates a process in which an image decoding device (100) divides a first encoding unit (900) to determine at least one encoding unit according to one embodiment.
[0173] According to one embodiment, the image decoding device (100) may divide the first encoding unit (900) based on the segmentation form mode information obtained through the bitstream acquisition unit (110). The first encoding unit (900) in a square shape may be divided into four square-shaped encoding units or into a plurality of non-square-shaped encoding units. For example, referring to FIG. 9, the first encoding unit (900) is square and the segmentation form mode information indicates that it is divided into non-square encoding units, so the image decoding device (100) may divide the first encoding unit (900) into a plurality of non-square encoding units. Specifically, when the splitting mode information indicates that the first encoding unit (900) is divided in a horizontal or vertical direction to determine an odd number of encoding units, the image decoding device (100) can divide the square-shaped first encoding unit (900) into an odd number of encoding units, such as a second encoding unit (910a, 910b, 910c) determined by dividing in a vertical direction or a second encoding unit (920a, 920b, 920c) determined by dividing in a horizontal direction.
[0174] According to one embodiment, the image decoding device (100) can determine whether the second encoding unit (910a, 910b, 910c, 920a, 920b, 920c) included in the first encoding unit (900) satisfies a condition that the second encoding unit (910a, 910b, 910c, 920a, 920b, 920c) can be processed in a predetermined order, and the condition relates to whether at least one of the width and height of the first encoding unit (900) is divided in half according to the boundary of the second encoding unit (910a, 910b, 910c, 920a, 920b, 920c). Referring to FIG. 9, the boundaries of the second encoding units (910a, 910b, 910c), which are determined by dividing the square-shaped first encoding unit (900) in the vertical direction, do not divide the width of the first encoding unit (900) in half, so the first encoding unit (900) may be determined not to satisfy the condition of being processed in a predetermined order. Additionally, the boundaries of the second encoding units (920a, 920b, 920c), which are determined by dividing the square-shaped first encoding unit (900) in the horizontal direction, do not divide the height of the first encoding unit (900) in half, so the first encoding unit (900) may be determined not to satisfy the condition of being processed in a predetermined order. The image decoding device (100) determines that if these conditions are not satisfied, there is a disconnection in the scan order, and based on the result of the determination, the first encoding unit (900) may be divided into an odd number of encoding units. According to one embodiment, when the image decoding device (100) is divided into an odd number of encoding units, it may place a certain restriction on the encoding unit at a certain position among the divided encoding units. Since the details of such restriction or the certain position have been described in detail through various embodiments, a detailed explanation will be omitted.
[0175] According to one embodiment, the image decoding device (100) can divide the first encoding unit to determine various forms of encoding units.
[0176] Referring to FIG. 9, the image decoding device (100) can divide a square-shaped first encoding unit (900) and a non-square-shaped first encoding unit (930 or 950) into various types of encoding units.
[0177] FIG. 10 illustrates that, according to one embodiment, when a video decoding device (100) divides a first encoding unit (1000) and a second encoding unit of a non-square shape determined by the division satisfies a predetermined condition, the shape in which the second encoding unit can be divided is limited.
[0178] According to one embodiment, the image decoding device (100) may decide to divide a square-shaped first encoding unit (1000) into non-square-shaped second encoding units (1010a, 1010b, 1020a, 1020b) based on division shape mode information obtained through a bitstream acquisition unit (110). The second encoding units (1010a, 1010b, 1020a, 1020b) may be divided independently. Accordingly, the image decoding device (100) may decide to divide into a plurality of encoding units or not divide based on division shape mode information related to each of the second encoding units (1010a, 1010b, 1020a, 1020b). According to one embodiment, the image decoding device (100) may determine a third encoding unit (1012a, 1012b) by dividing the left second encoding unit (1010a), which is a non-square shape determined by dividing the first encoding unit (1000) in the vertical direction, in the horizontal direction. However, when the image decoding device (100) divides the left second encoding unit (1010a) in the horizontal direction, the right second encoding unit (1010b) may be restricted so that it cannot be divided in the same horizontal direction as the left second encoding unit (1010a). If the right second encoding unit (1010b) is divided in the same direction to determine the third encoding unit (1014a, 1014b), the left second encoding unit (1010a) and the right second encoding unit (1010b) may be divided independently in the horizontal direction to determine the third encoding unit (1012a, 1012b, 1014a, 1014b). However, this is the same result as the image decoding device (100) dividing the first encoding unit (1000) into four square-shaped second encoding units (1030a, 1030b, 1030c, 1030d) based on the division shape mode information, and this may be inefficient in terms of image decoding.
[0179] According to one embodiment, the image decoding device (100) may determine a third encoding unit (1022a, 1022b, 1024a, 1024b) by dividing a first encoding unit (1000) in a horizontal direction and a second encoding unit (1020a or 1020b) in a non-square shape in a vertical direction. However, if the image decoding device (100) divides one of the second encoding units (e.g., the upper second encoding unit (1020a)) in a vertical direction, it may restrict the other second encoding unit (e.g., the lower encoding unit (1020b)) from being divided in the same vertical direction as the upper second encoding unit (1020a) in accordance with the above-described reason.
[0180] FIG. 11 illustrates the process of a video decoder (100) dividing square-shaped encoding units when, according to one embodiment, the divided shape mode information cannot be divided into four square-shaped encoding units.
[0181] According to one embodiment, the image decoding device (100) can determine the second encoding unit (1110a, 1110b, 1120a, 1120b, etc.) by dividing the first encoding unit (1100) based on the division shape mode information. The division shape mode information may include information on various shapes in which the encoding unit can be divided, but the information on various shapes may not include information for dividing into four square-shaped encoding units. According to this division shape mode information, the image decoding device (100) cannot divide the square-shaped first encoding unit (1100) into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d). Based on the segmented form mode information, the image decoding device (100) can determine a non-square second encoding unit (1110a, 1110b, 1120a, 1120b, etc.).
[0182] According to one embodiment, the image decoding device (100) can independently divide each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) in a non-square shape. Each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) can be divided in a predetermined order through a recursive method, and this may be a division method corresponding to the method in which the first encoding unit (1100) is divided based on division shape mode information.
[0183] For example, the image decoding device (100) can determine a square-shaped third encoding unit (1112a, 1112b) by dividing the left second encoding unit (1110a) in a horizontal direction, and can determine a square-shaped third encoding unit (1114a, 1114b) by dividing the right second encoding unit (1110b) in a horizontal direction. Furthermore, the image decoding device (100) can determine a square-shaped third encoding unit (1116a, 1116b, 1116c, 1116d) by dividing both the left second encoding unit (1110a) and the right second encoding unit (1110b) in a horizontal direction. In this case, the encoding unit can be determined in the same form as the first encoding unit (1100) being divided into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d).
[0184] As another example, the video decoding device (100) may determine a square-shaped third encoding unit (1122a, 1122b) by dividing the upper second encoding unit (1120a) in a vertical direction, and determine a square-shaped third encoding unit (1124a, 1124b) by dividing the lower second encoding unit (1120b) in a vertical direction. Furthermore, the video decoding device (100) may determine a square-shaped third encoding unit (1126a, 1126b, 1126a, 1126b) by dividing both the upper second encoding unit (1120a) and the lower second encoding unit (1120b) in a vertical direction. In this case, the encoding unit can be determined in the same form as the first encoding unit (1100) being divided into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d).
[0185] FIG. 12 illustrates that, according to one embodiment, the processing order between a plurality of encoding units may vary depending on the division process of the encoding unit.
[0186] According to one embodiment, the image decoding device (100) may divide a first encoding unit (1200) based on division shape mode information. When the block shape is square and the division shape mode information indicates that the first encoding unit (1200) is divided in at least one of the horizontal direction and the vertical direction, the image decoding device (100) may divide the first encoding unit (1200) to determine a second encoding unit (e.g., 1210a, 1210b, 1220a, 1220b, etc.). Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) in a non-square shape determined by dividing the first encoding unit (1200) only in the horizontal direction or the vertical direction may be divided independently based on the division shape mode information for each. For example, the video decoding device (100) can determine the third encoding unit (1216a, 1216b, 1216c, 1216d) by dividing the second encoding unit (1210a, 1210b) generated by dividing the first encoding unit (1200) in the vertical direction, and can determine the third encoding unit (1226a, 1226b, 1226c, 1226d) by dividing the second encoding unit (1220a, 1220b) generated by dividing the first encoding unit (1200) in the horizontal direction, respectively, in the vertical direction. Since the process of dividing these second encoding units (1210a, 1210b, 1220a, 1220b) has been described in detail in relation to FIG. 11, a detailed explanation will be omitted.
[0187] According to one embodiment, the image decoding device (100) can process encoding units in a predetermined order. Since the characteristics of processing encoding units in a predetermined order have been described in detail in relation to FIG. 7, a detailed explanation will be omitted. Referring to FIG. 12, the image decoding device (100) can divide a square-shaped first encoding unit (1200) to determine four square-shaped third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d). According to one embodiment, the image decoding device (100) can determine the processing order of the third encoding unit (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) according to the form in which the first encoding unit (1200) is divided.
[0188] According to one embodiment, the image decoding device (100) can determine the third encoding unit (1216a, 1216b, 1216c, 1216d) by dividing the second encoding unit (1210a, 1210b) generated by dividing in the vertical direction into the horizontal direction, and the image decoding device (100) can process the third encoding unit (1216a, 1216b, 1216c, 1216d) according to the order (1217) of first processing the third encoding unit (1216a, 1216c) included in the left second encoding unit (1210a) in the vertical direction, and then processing the third encoding unit (1216b, 1216d) included in the right second encoding unit (1210b) in the vertical direction.
[0189] According to one embodiment, the image decoding device (100) can determine the third encoding unit (1226a, 1226b, 1226c, 1226d) by dividing the second encoding unit (1220a, 1220b) generated by dividing in the horizontal direction into the vertical direction, and the image decoding device (100) can process the third encoding unit (1226a, 1226b, 1226c, 1226d) according to the order (1227) of first processing the third encoding unit (1226a, 1226b) included in the upper second encoding unit (1220a) in the horizontal direction, and then processing the third encoding unit (1226c, 1226d) included in the lower second encoding unit (1220b) in the horizontal direction.
[0190] Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) are each divided to determine the square-shaped third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d). The second encoding unit (1210a, 1210b) determined by dividing in the vertical direction and the second encoding unit (1220a, 1220b) determined by dividing in the horizontal direction are divided into different forms, but according to the third encoding unit (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) determined thereafter, the result is that the first encoding unit (1200) is divided into encoding units of the same form. Accordingly, the image decoding device (100) recursively divides the encoding unit through different processes based on the division form mode information, so that even if the encoding units of the same form are determined as a result, the multiple encoding units determined in the same form can be processed in different orders.
[0191] FIG. 13 illustrates a process in which, according to one embodiment, a encoding unit is recursively divided to determine a plurality of encoding units, and the depth of the encoding unit is determined as the shape and size of the encoding unit change.
[0192] According to one embodiment, the image decoding device (100) may determine the depth of the encoding unit according to a predetermined standard. For example, the predetermined standard may be the length of the long side of the encoding unit. The image decoding device (100) may determine that if the length of the long side of the current encoding unit is divided by 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 compared to the depth of the encoding unit before division. In the following, the encoding unit with increased depth is expressed as a lower depth encoding unit.
[0193] Referring to FIG. 13, according to one embodiment, based on block shape information indicating that it is a square shape (for example, the block shape information may indicate '0: SQUARE'), an image decoding device (100) can determine a second encoding unit (1302), a third encoding unit (1304), etc. of a lower depth by dividing a first encoding unit (1300) that is square in shape. If the size of the first encoding unit (1300) that is square in shape is 2Nx2N, the second encoding unit (1302), which is determined by dividing the width and height of the first encoding unit (1300) by half, may have a size of NxN. Furthermore, the third encoding unit (1304), which is determined by dividing the width and height of the second encoding unit (1302) by half, may have a size of N / 2xN / 2. In this case, the width and height of the third encoding unit (1304) correspond to 1 / 4 times the width and height of the first encoding unit (1300). When the depth of the first encoding unit (1300) is D, the depth of the second encoding unit (1302), which is 1 / 2 times the width and height of the first encoding unit (1300), may be D+1, and the depth of the third encoding unit (1304), which is 1 / 4 times the width and height of the first encoding unit (1300), may be D+2.
[0194] According to one embodiment, based on block shape information representing a non-square shape (for example, the block shape information may represent '1: NS_VER' indicating that the height is longer than the width, or '2: NS_HOR' indicating that the width is longer than the height), the image decoding device (100) may divide a first encoding unit (1310 or 1320) that is a non-square shape to determine a second encoding unit (1312 or 1322), a third encoding unit (1314 or 1324), etc. of a lower depth.
[0195] The image decoding device (100) can determine a second encoding unit (e.g., 1302, 1312, 1322, etc.) by dividing at least one of the width and height of a first encoding unit (1310) of size Nx2N. That is, the image decoding device (100) can determine a second encoding unit (1302) of size NxN or a second encoding unit (1322) of size NxN / 2 by dividing the first encoding unit (1310) in a horizontal direction, and can also determine a second encoding unit (1312) of size N / 2xN by dividing it in a horizontal direction and a vertical direction.
[0196] According to one embodiment, the image decoding device (100) may determine a second encoding unit (e.g., 1302, 1312, 1322, etc.) by dividing at least one of the width and height of a first encoding unit (1320) of size 2NxN. That is, the image decoding device (100) may determine a second encoding unit (1302) of size NxN or a second encoding unit (1312) of size N / 2xN by dividing the first encoding unit (1320) in the vertical direction, and may determine a second encoding unit (1322) of size NxN / 2 by dividing it in the horizontal and vertical directions.
[0197] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of a second encoding unit (1302) of size NxN. That is, the image decoding device (100) may determine a third encoding unit (1304) of size N / 2xN / 2 by dividing the second encoding unit (1302) in a vertical direction and a horizontal direction, or determine a third encoding unit (1314) of size N / 4xN / 2, or determine a third encoding unit (1324) of size N / 2xN / 4.
[0198] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of a second encoding unit (1312) of size N / 2xN. That is, the image decoding device (100) may determine a third encoding unit (1304) of size N / 2xN / 2 or a third encoding unit (1324) of size N / 2xN / 4 by dividing the second encoding unit (1312) in a horizontal direction, or determine a third encoding unit (1314) of size N / 4xN / 2 by dividing it in a vertical direction and a horizontal direction.
[0199] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of a second encoding unit (1322) of size NxN / 2. That is, the image decoding device (100) may determine a third encoding unit (1304) of size N / 2xN / 2 or a third encoding unit (1314) of size N / 4xN / 2 by dividing the second encoding unit (1322) in the vertical direction, or determine a third encoding unit (1324) of size N / 2xN / 4 by dividing it in the vertical and horizontal directions.
[0200] According to one embodiment, the image decoding device (100) may divide square-shaped encoding units (e.g., 1300, 1302, 1304) in a horizontal or vertical direction. For example, a first encoding unit (1300) of size 2Nx2N may be divided in a vertical direction to determine a first encoding unit (1310) of size Nx2N, or divided in a horizontal direction to determine a first encoding unit (1320) of size 2NxN. According to one embodiment, when the depth is determined based on the length of the longest side of the encoding unit, the depth of the encoding unit determined by dividing the first encoding unit (1300) of size 2Nx2N in a horizontal or vertical direction may be the same as the depth of the first encoding unit (1300).
[0201] According to one embodiment, the width and height of the third encoding unit (1314 or 1324) may correspond to 1 / 4 times the width and height of the first encoding unit (1310 or 1320). If the depth of the first encoding unit (1310 or 1320) is D, the depth of the second encoding unit (1312 or 1322), which is 1 / 2 times the width and height of the first encoding unit (1310 or 1320), may be D+1, and the depth of the third encoding unit (1314 or 1324), which is 1 / 4 times the width and height of the first encoding unit (1310 or 1320), may be D+2.
[0202] FIG. 14 illustrates a depth and part index (hereinafter PID) for distinguishing between coding units that can be determined according to the shape and size of the coding units according to one embodiment.
[0203] According to one embodiment, the image decoding device (100) can determine various shapes of second encoding units by dividing a square-shaped first encoding unit (1400). Referring to FIG. 14, the image decoding device (100) can determine second encoding units (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) by dividing the first encoding unit (1400) in at least one of a vertical direction and a horizontal direction according to the division shape mode information. That is, the image decoding device (100) can determine the second encoding unit (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) based on the segmented form mode information for the first encoding unit (1400).
[0204] According to one embodiment, the depth of the second encoding unit (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d), which is determined according to the segmented shape mode information for the first encoding unit (1400) in a square shape, can be determined based on the length of the longer side. For example, since the length of one side of the first encoding unit (1400) in a square shape and the length of the longer side of the second encoding unit (1402a, 1402b, 1404a, 1404b) in a non-square shape are the same, the depth of the first encoding unit (1400) and the second encoding unit (1402a, 1402b, 1404a, 1404b) in a non-square shape can be considered to be the same as D. In contrast, when the video decoding device (100) divides the first encoding unit (1400) into four square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) based on the division shape mode information, since the length of one side of the square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) is half the length of one side of the first encoding unit (1400), the depth of the second encoding units (1406a, 1406b, 1406c, 1406d) may be a depth of D+1, which is one depth lower than the depth D of the first encoding unit (1400).
[0205] According to one embodiment, the image decoding device (100) may divide a first encoding unit (1410), in which the height is longer than the width, into a plurality of second encoding units (1412a, 1412b, 1414a, 1414b, 1414c) by dividing it in a horizontal direction according to the division shape mode information. According to one embodiment, the image decoding device (100) may divide a first encoding unit (1420), in which the width is longer than the height, into a plurality of second encoding units (1422a, 1422b, 1424a, 1424b, 1424c) by dividing it in a vertical direction according to the division shape mode information.
[0206] According to one embodiment, a second encoding unit (1412a, 1412b, 1414a, 1414b, 1414c, 1422a, 1422b, 1424a, 1424b, 1424c) determined according to the segmented shape mode information for a first encoding unit (1410 or 1420) of a non-square shape may have its depth determined based on the length of the longer side. For example, since the length of one side of the square-shaped second encoding unit (1412a, 1412b) is half the length of one side of the non-square-shaped first encoding unit (1410) in which the height is longer than the width, the depth of the square-shaped second encoding unit (1412a, 1412b) is D+1, which is one depth lower than the depth D of the non-square-shaped first encoding unit (1410).
[0207] Furthermore, the image decoding device (100) may divide a non-square shape first encoding unit (1410) into an odd number of second encoding units (1414a, 1414b, 1414c) based on the division shape mode information. The odd number of second encoding units (1414a, 1414b, 1414c) may include non-square shape second encoding units (1414a, 1414c) and square shape second encoding units (1414b). In this case, since the length of the longer side of the non-square second encoding unit (1414a, 1414c) and the length of one side of the square second encoding unit (1414b) are half the length of one side of the first encoding unit (1410), the depth of the second encoding unit (1414a, 1414b, 1414c) may be a depth of D+1, which is one depth lower than the depth D of the first encoding unit (1410). The image decoding device (100) may determine the depth of the encoding units associated with the non-square first encoding unit (1420), in a manner corresponding to the above method of determining the depth of the encoding units associated with the first encoding unit (1410).
[0208] According to one embodiment, when determining an index (PID) for distinguishing divided encoding units, the video decoding device (100) may determine the index based on the size ratio between the encoding units when the odd number of divided encoding units are not of the same size. Referring to FIG. 14, the encoding unit (1414b) located in the middle among the odd number of divided encoding units (1414a, 1414b, 1414c) may have the same width as the other encoding units (1414a, 1414c) but may have twice the height of the other encoding units (1414a, 1414c). That is, in this case, the encoding unit (1414b) located in the middle may include two of the other encoding units (1414a, 1414c). Accordingly, if the index (PID) of the encoding unit (1414b) located in the middle according to the scan order is 1, the encoding unit (1414c) located in the next order may have an index of 3, which is an increase of 2. That is, there may be a discontinuity in the index values. According to one embodiment, the image decoding device (100) may determine whether the encoding units divided into an odd number are not of the same size based on whether there is a discontinuity in the index for distinguishing between these divided encoding units.
[0209] According to one embodiment, the image decoding device (100) may determine whether a plurality of encoding units determined by dividing from the current encoding unit are divided into a specific division form based on the value of an index for distinguishing the plurality of encoding units. Referring to FIG. 14, the image decoding device (100) may divide a first encoding unit (1410) in the shape of a rectangle whose height is greater than its width to determine an even number of encoding units (1412a, 1412b) or an odd number of encoding units (1414a, 1414b, 1414c). The image decoding device (100) may use an index (PID) representing each encoding unit to distinguish each of the plurality of encoding units. According to one embodiment, the PID may be obtained from a sample at a predetermined position of each encoding unit (e.g., the upper left sample).
[0210] According to one embodiment, the image decoding device (100) can determine a coding unit at a predetermined position among the coding units determined by division using an index for distinguishing the coding units. According to one embodiment, if the division shape mode information for a first coding unit (1410) in the form of a rectangle whose height is longer than its width indicates that it is divided into three coding units, the image decoding device (100) can divide the first coding unit (1410) into three coding units (1414a, 1414b, 1414c). The image decoding device (100) can assign an index to each of the three coding units (1414a, 1414b, 1414c). The image decoding device (100) can compare the indices for each coding unit to determine the middle coding unit among the odd number of divided coding units. The image decoding device (100) may determine a encoding unit (1414b) having an index corresponding to the middle value among the indices based on the indices of the encoding units, as the encoding unit at the middle position among the encoding units determined by dividing the first encoding unit (1410). According to one embodiment, when determining an index for distinguishing the divided encoding units, the image decoding device (100) may determine the index based on the size ratio between the encoding units if the encoding units are not of the same size. Referring to FIG. 14, the encoding unit (1414b) generated by dividing the first encoding unit (1410) may have the same width as the other encoding units (1414a, 1414c) but may have a height twice that of the other encoding units (1414a, 1414c). In this case, if the index (PID) of the encoding unit (1414b) located in the middle is 1, the encoding unit (1414c) located in the next order may have an index of 3, which is increased by 2.In cases where the index increases uniformly but the rate of increase changes, such as in this case, the image decoding device (100) may determine that the current encoding unit is divided into a plurality of encoding units, including encoding units having different sizes from other encoding units. In one embodiment, if the division type mode information indicates that the current encoding unit is divided into an odd number of encoding units, the image decoding device (100) may divide the current encoding unit in such a way that the encoding unit at a predetermined position among the odd number of encoding units (e.g., the middle encoding unit) has a different size from other encoding units. In this case, the image decoding device (100) may determine the middle encoding unit having a different size by using an index (PID) for the encoding unit. However, the aforementioned index, the size or position of the encoding unit at a predetermined position to be determined, is specific for the purpose of explaining one embodiment and should not be interpreted as being limited thereto, and should be interpreted as allowing various indices, positions, and sizes of encoding units to be used.
[0211] According to one embodiment, the image decoding device (100) may use a predetermined data unit in which recursive division of the encoding unit begins.
[0212] FIG. 15 illustrates that a plurality of encoding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment.
[0213] According to one embodiment, a predetermined data unit may be defined as a data unit in which the encoding unit begins to recursively divide using the division form mode information. That is, it may correspond to the highest depth encoding unit used in the process of determining multiple encoding units that divide the current picture. For convenience of explanation, such a predetermined data unit will be referred to as a reference data unit below.
[0214] According to one embodiment, the reference data unit may have a predetermined size and shape. According to one embodiment, the reference data unit may include MxN samples. Here, M and N may be the same and may be integers expressed as powers of 2. That is, the reference data unit may have a square or non-square shape and may subsequently be divided into an integer number of encoding units.
[0215] According to one embodiment, the image decoding device (100) can divide the current picture into a plurality of reference data units. According to one embodiment, the image decoding device (100) can divide the current picture into a plurality of reference data units using division form mode information for each reference data unit. This division process of reference data units may correspond to a division process using a quad-tree structure.
[0216] According to one embodiment, the image decoding device (100) can predetermine the minimum size that a reference data unit included in the current picture may have. Accordingly, the image decoding device (100) can determine reference data units of various sizes having a size greater than or equal to the minimum size, and can determine at least one encoding unit using segmentation form mode information based on the determined reference data unit.
[0217] Referring to FIG. 15, the image decoding device (100) may use a square-shaped reference encoding unit (1500) or a non-square-shaped reference encoding unit (1502). According to one embodiment, the shape and size of the reference encoding unit may be determined according to various data units (e.g., sequence, picture, slice, slice segment, tile, tile group, maximum encoding unit, etc.) that may include at least one reference encoding unit.
[0218] According to one embodiment, the bitstream acquisition unit (110) of the image decoding device (100) can acquire at least one of information regarding the shape of the reference encoding unit and information regarding the size of the reference encoding unit from the bitstream for each of the various data units. The process of determining at least one encoding unit included in the square-shaped reference encoding unit (1500) has been described in detail through the process of dividing the current encoding unit (300) of FIG. 3, and the process of determining at least one encoding unit included in the non-square-shaped reference encoding unit (1502) has been described in detail through the process of dividing the current encoding unit (400 or 450) of FIG. 4, so a detailed explanation is omitted.
[0219] According to one embodiment, the image decoding device (100) may use an index to identify the size and shape of a reference encoding unit in order to determine the size and shape of a reference encoding unit according to a portion of data units that are predetermined based on a predetermined condition. That is, the bitstream acquisition unit (110) may acquire only an index for identifying the size and shape of a reference encoding unit for each slice, slice segment, tile, tile group, maximum encoding unit, etc., among the various data units (e.g., sequence, picture, slice, slice segment, tile, tile group, maximum encoding unit, etc.) from the bitstream, as a data unit that satisfies a predetermined condition (e.g., a data unit having a size smaller than or equal to a slice). By using the index, the image decoding device (100) can determine the size and shape of a reference data unit for each data unit that satisfies the predetermined condition. When information regarding the form of the reference encoding unit and information regarding the size of the reference encoding unit are obtained from the bitstream for each data unit of a relatively small size and used, the utilization efficiency of the bitstream may be poor; therefore, instead of directly obtaining information regarding the form of the reference encoding unit and information regarding the size of the reference encoding unit, only the index may be obtained and used. In this case, at least one of the size and form of the reference encoding unit corresponding to the index representing the size and form of the reference encoding unit may be predetermined. That is, the image decoding device (100) can determine at least one of the size and form of the reference encoding unit included in the data unit that serves as the basis for obtaining the index by selecting at least one of the predetermined size and form of the reference encoding unit according to the index.
[0220] According to one embodiment, the image decoding device (100) may utilize at least one reference encoding unit included in one maximum encoding unit. That is, the maximum encoding unit that divides the image may include at least one reference encoding unit, and the encoding unit may be determined through a recursive division process of each reference encoding unit. According to one embodiment, at least one of the width and height of the maximum encoding unit may correspond to an integer multiple of at least one of the width and height of the reference encoding unit. According to one embodiment, the size of the reference encoding unit may be the size obtained by dividing the maximum encoding unit n times according to a quad tree structure. That is, the image decoding device (100) may determine the reference encoding unit by dividing the maximum encoding unit n times according to a quad tree structure, and according to various embodiments, the reference encoding unit may be divided based on at least one of block form information and division form mode information.
[0221] According to one embodiment, the image decoding device (100) may obtain and use block form information indicating the form of the current encoding unit or division form mode information indicating a method of dividing the current encoding unit from a bitstream. The division form mode information may be included in bitstreams associated with various data units. For example, the image decoding device (100) may use division form mode information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, and a tile group header. Furthermore, the image decoding device (100) may obtain and use syntax elements corresponding to the block form information or division form mode information from the bitstream for each maximum encoding unit and reference encoding unit.
[0222] A method for determining a division rule according to one embodiment of the present disclosure will be described in detail below.
[0223] The image decoding device (100) can determine the segmentation rule of the image. The segmentation rule may be predetermined between the image decoding device (100) and the image encoding device (200). The image decoding device (100) can determine the segmentation rule of the image based on information obtained from a bitstream. The image decoding device (100) can determine the segmentation rule based on information obtained from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, and a tile group header. The image decoding device (100) can determine the segmentation rule differently depending on the frame, slice, tile, temporal layer, maximum encoding unit, or encoding unit.
[0224] The image decoding device (100) can determine a partitioning rule based on the block shape of the encoding unit. The block shape may include the size, shape, ratio of width and height, and orientation of the encoding unit. The image encoding device (200) and the image decoding device (100) may predetermine to determine a partitioning rule based on the block shape of the encoding unit. However, they are not limited thereto. The image decoding device (100) can determine a partitioning rule based on information obtained from a bitstream received from the image encoding device (200).
[0225] The shape of the encoding unit may include square and non-square. If the width and height of the encoding unit are the same, the image decoder (100) may determine the shape of the encoding unit as square. Additionally, if the width and height of the encoding unit are not the same, the image decoder (100) may determine the shape of the encoding unit as non-square.
[0226] The size of the encoding unit may include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ..., 256x256. The size of the encoding unit may be classified according to the length of the long side, the length of the short side, or the width of the encoding unit. The image decoding device (100) may apply the same partitioning rule to encoding units classified into the same group. For example, the image decoding device (100) may classify encoding units having the same long side length into the same size. Additionally, the image decoding device (100) may apply the same partitioning rule to encoding units having the same long side length.
[0227] The ratio of width to height of a encoding 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. Additionally, the direction of the encoding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate a case where the width of the encoding unit is longer than the height. The vertical direction may indicate a case where the width of the encoding unit is shorter than the height.
[0228] The image decoder (100) can adaptively determine a splitting rule based on the size of the encoding unit. The image decoder (100) can determine different acceptable splitting mode types based on the size of the encoding unit. For example, the image decoder (100) can determine whether splitting is allowed based on the size of the encoding unit. The image decoder (100) can determine the splitting direction according to the size of the encoding unit. The image decoder (100) can determine an acceptable splitting type according to the size of the encoding unit.
[0229] Determining the division rule based on the size of the encoding unit may be a division rule predetermined between the image encoding device (200) and the image decoding device (100). Additionally, the image decoding device (100) may determine the division rule based on information obtained from the bitstream.
[0230] The image decoder (100) can adaptively determine a partitioning rule based on the position of the encoding unit. The image decoder (100) can adaptively determine a partitioning rule based on the position occupied by the encoding unit in the image.
[0231] Additionally, the video decoding device (100) can determine a splitting rule so that encoding units generated by different splitting paths do not have the same block shape. However, this is not limited thereto, and encoding units generated by different splitting paths may have the same block shape. Encoding units generated by different splitting paths may have different decoding processing orders. Since the decoding processing order has been explained together with FIG. 12, a detailed explanation is omitted.
[0232] FIG. 16 illustrates the encoding units that can be determined for each picture when the combination of forms in which the encoding units can be divided according to one embodiment is different for each picture.
[0233] Referring to FIG. 16, the image decoding device (100) may determine different combinations of division forms in which the encoding unit can be divided for each picture. For example, the image decoding device (100) may decode an image using a picture (1600) that can be divided into four encoding units, a picture (1610) that can be divided into two or four encoding units, and a picture (1620) that can be divided into two, three, or four encoding units among at least one picture included in the image. To divide the picture (1600) into multiple encoding units, the image decoding device (100) may use only division form information indicating that it is divided into four square encoding units. To divide the picture (1610), the image decoding device (100) may use only division form information indicating that it is divided into two or four encoding units. The image decoding device (100) may use only division form information indicating that the picture (1620) is divided into two, three, or four encoding units in order to divide the picture. Since the combination of division forms described above is merely an example for explaining the operation of the image decoding device (100), the combination of division forms described above should not be interpreted as being limited to the above example, but should be interpreted as allowing various combinations of division forms to be used for each predetermined data unit.
[0234] According to one embodiment, a bitstream acquisition unit (110) of an image decoding device (100) may acquire a bitstream including an index representing a combination of division form information for each predetermined data unit (e.g., sequence, picture, slice, slice segment, tile, or tile group, etc.). For example, the bitstream acquisition unit (110) may acquire an index representing a combination of division form information from a sequence parameter set, a picture parameter set, a slice header, a tile header, or a tile group header. The image decoding device (100) of the image decoding device (100) may determine a combination of division forms in which the encoding unit can be divided for each predetermined data unit using the acquired index, and accordingly, different combinations of division forms may be used for each predetermined data unit.
[0235] FIG. 17 illustrates various forms of encoding units that can be determined based on partitioned form mode information that can be expressed as binary code according to one embodiment.
[0236] According to one embodiment, the image decoding device (100) can divide the encoding unit into various forms using block form information and division form mode information obtained through the bitstream acquisition unit (110). The forms of the encoding unit that can be divided may correspond to various forms including the forms described through the embodiments above.
[0237] Referring to FIG. 17, the image decoding device (100) can divide a square-shaped encoding unit into at least one of a horizontal direction and a vertical direction based on the divided shape mode information, and can divide a non-square-shaped encoding unit into a horizontal direction or a vertical direction.
[0238] According to one embodiment, if the image decoding device (100) can divide a square-shaped encoding unit into four square encoding units by dividing it in the horizontal and vertical directions, there may be four types of division forms that can be represented by the division form mode information for the square encoding unit. According to one embodiment, the division form mode information may be expressed as a 2-digit binary code, and a binary code may be assigned to each division form. For example, if the encoding unit is not divided, the division form mode information may be expressed as (00)b; if the encoding unit is divided in the horizontal and vertical directions, the division form mode information may be expressed as (01)b; if the encoding unit is divided in the horizontal direction, the division form mode information may be expressed as (10)b; and if the encoding unit is divided in the vertical direction, the division form mode information may be expressed as (11)b.
[0239] According to one embodiment, when the image decoding device (100) divides a non-square-shaped encoding unit in a horizontal or vertical direction, the type of division form that can be represented by the division form mode information may be determined by how many encoding units are divided. Referring to FIG. 17, according to one embodiment, the image decoding device (100) may divide a non-square-shaped encoding unit into up to three. The image decoding device (100) may divide the encoding unit into two encoding units, in which case the division form mode information may be expressed as (10)b. The image decoding device (100) may divide the encoding unit into three encoding units, in which case the division form mode information may be expressed as (11)b. The image decoding device (100) may decide not to divide the encoding unit, in which case the division form mode information may be expressed as (0)b. That is, the video decoding device (100) can use variable length coding (VLC) rather than fixed length coding (FLC) to use binary code representing segmented form mode information.
[0240] Referring to FIG. 17 according to one embodiment, the binary code of the division type mode information indicating that the encoding unit is not divided can be represented as (0)b. If the binary code of the division type mode information indicating that the encoding unit is not divided is set to (00)b, then all 2 bits of the binary code of the division type mode information must be used even though there is no division type mode information set to (01)b. However, as illustrated in FIG. 17, if three division types for a non-square encoding unit are used, the image decoding device (100) can determine that the encoding unit is not divided even if a 1-bit binary code (0)b is used as the division type mode information, thus allowing for efficient use of the bitstream. However, the division type of the non-square encoding unit indicated by the division type mode information should not be interpreted as being limited only to the three types illustrated in FIG. 17, but should be interpreted as various types including the embodiments described above.
[0241] FIG. 18 illustrates another form of encoding unit that can be determined based on partitioned form mode information that can be represented as binary code according to one embodiment.
[0242] Referring to FIG. 18, the image decoding device (100) can divide a square-shaped encoding unit in a horizontal or vertical direction based on the division shape mode information, and can divide a non-square-shaped encoding unit in a horizontal or vertical direction. That is, the division shape mode information can indicate that a square-shaped encoding unit is divided in one direction. In this case, the binary code of the division shape mode information indicating that the square-shaped encoding unit is not divided can be represented as (0)b. If the binary code of the division shape mode information indicating that the encoding unit is not divided is set to (00)b, then all 2 bits of the binary code of the division shape mode information must be used even though there is no division shape mode information set to (01)b. However, as illustrated in FIG. 18, if three division forms for a square-shaped encoding unit are used, the image decoding device (100) can determine that the encoding unit is not divided even if a 1-bit binary code (0)b is used as division form mode information, thus allowing the bitstream to be used efficiently. However, the division form of the square-shaped encoding unit indicated by the division form mode information should not be interpreted as being limited only to the three forms illustrated in FIG. 18, but should be interpreted as various forms including the embodiments described above.
[0243] According to one embodiment, block form information or partition form mode information can be represented using binary code, and such information can be immediately generated as a bitstream. Additionally, block form information or partition form mode information that can be represented by binary code may not be immediately generated as a bitstream but may be used as binary code input in CABAC (context adaptive binary arithmetic coding).
[0244] According to one embodiment, the image decoding device (100) describes a process of obtaining syntax for block form information or partition form mode information through CABAC. A bitstream containing a binary code for the syntax can be obtained through a bitstream acquisition unit (110). The image decoding device (100) can detect a syntax element representing block form information or partition form mode information by debinding a bin string included in the obtained bitstream. According to one embodiment, the image decoding device (100) obtains a set of binary bin strings corresponding to the syntax element to be decoded, and can decode each bin using probability information, and the image decoding device (100) can repeat this process until the bin string composed of these decoded bins becomes equal to one of the previously obtained bin strings. The image decoding device (100) can determine the syntax element by performing debinding of the bin string.
[0245] According to one embodiment, the image decoding device (100) can determine the syntax for a bin string by performing a decoding process of adaptive binary arithmetic coding, and the image decoding device (100) can update a probability model for the bins obtained through a bitstream acquisition unit (110). Referring to FIG. 17, the bitstream acquisition unit (110) of the image decoding device (100) can obtain a bitstream representing a binary code representing partitioned mode information according to one embodiment. Using the obtained binary code having a size of 1 bit or 2 bits, the image decoding device (100) can determine the syntax for the partitioned mode information. To determine the syntax for the partitioned mode information, the image decoding device (100) can update the probability for each bit of the 2-bit binary code. That is, the image decoding device (100) can update the probability of having a value of 0 or 1 when decoding the next bin, depending on whether the value of the first bin of the 2-bit binary code is 0 or 1.
[0246] According to one embodiment, the image decoding device (100) can update the probability for the bins used in the process of decoding the bins of the empty string for the syntax during the process of determining the syntax, and the image decoding device (100) can determine that the probability is not updated for certain bits of the empty string and has the same probability.
[0247] Referring to FIG. 17, in the process of determining syntax using an empty string representing segmentation mode information for a non-square type encoding unit, the image decoder (100) can determine syntax for the segmentation mode information using one bin having a value of 0 when the non-square type encoding unit is not segmented. That is, when block type information indicates that the current encoding unit is a non-square type, the first bin of the empty string for the segmentation mode information may be 0 when the non-square type encoding unit is not segmented, and 1 when it is segmented into two or three encoding units. Accordingly, the probability that the first bin of the empty string for the segmentation mode information for a non-square type encoding unit is 0 may be 1 / 3, and the probability that it is 1 may be 2 / 3. As described above, since the image decoding device (100) can represent only a 1-bit empty string having a value of 0 as the segmentation mode information indicating that a non-square type encoding unit is not segmented, the image decoding device (100) can determine the syntax for the segmentation mode information by determining whether the second bin is 0 or 1 only when the first bin of the segmentation mode information is 1. According to one embodiment, the image decoding device (100) can decode the bin by considering that when the first bin of the segmentation mode information is 1, the probability that the second bin is 0 or 1 is equal to the probability.
[0248] According to one embodiment, the image decoding device (100) may use various probabilities for each bin in the process of determining the bins of the bin string for the segmented form mode information. According to one embodiment, the image decoding device (100) may determine the probability of the bins for the segmented form mode information differently depending on the direction of the non-square block. According to one embodiment, the image decoding device (100) may determine the probability of the bins for the segmented form mode information differently depending on the width or the length of the long side of the current encoding unit. According to one embodiment, the image decoding device (100) may determine the probability of the bins for the segmented form mode information differently depending on at least one of the shape of the current encoding unit and the length of the long side.
[0249] According to one embodiment, the image decoding device (100) may determine that the probability of bins for segmented form mode information is the same for encoding units of a predetermined size or larger. For example, based on the length of the long side of the encoding unit, the probability of bins for segmented form mode information is determined to be the same for encoding units of a size of 64 samples or larger.
[0250] According to one embodiment, the image decoding device (100) may determine the initial probability for the bins constituting the empty string of the segmented form mode information based on the slice type (e.g., I slice, P slice, or B slice).
[0251] Figure 19 is a block diagram of an image encoding and decoding system that performs loop filtering.
[0252] The encoding unit (1910) of the video encoding and decoding system (1900) transmits an encoded bitstream of the video, and the decoding unit (1950) receives the bitstream and decodes it to output a restored video. Here, the encoding unit (1910) may have a configuration similar to the video encoding device (200) described later, and the decoding unit (1950) may have a configuration similar to the video decoding device (100).
[0253] In the encoding unit (1910), the prediction encoding unit (1915) outputs prediction data through inter-prediction and intra-prediction, and the transformation and quantization unit (1920) outputs quantized transformation coefficients of residual data between the prediction data and the current input image. The entropy encoding unit (1925) encodes and transforms the quantized transformation coefficients and outputs them as a bitstream. The quantized transformation coefficients are restored to spatial domain data through the inverse quantization and inverse transformation unit (1930), and the restored spatial domain data is output as a restored image through the deblocking filtering unit (1935) and the loop filtering unit (1940). The restored image can be used as a reference image for the next input image after passing through the prediction encoding unit (1915).
[0254] The encoded image data among the bitstreams received by the decoding unit (1950) is restored into spatial domain residual data through the entropy decoding unit (1955) and the inverse quantization and inverse transform unit (1960). The predicted data and residual data output from the prediction decoding unit (1975) are combined to form spatial domain image data, and the deblocking filtering unit (1965) and the loop filtering unit (1970) can perform filtering on the spatial domain image data to output a restored image for the current original image. The restored image can be used as a reference image for the next original image by the prediction decoding unit (1975).
[0255] The loop filtering unit (1940) of the encoding unit (1910) performs loop filtering using filter information input according to user input or system settings. The filter information used by the loop filtering unit (1940) is output to the entropy encoding unit (1925) and transmitted to the decoding unit (1950) along with the encoded image data. The loop filtering unit (1970) of the decoding unit (1950) can perform loop filtering based on the filter information input from the decoding unit (1950).
[0256] The various embodiments described above explain the operation related to the image decoding method performed by the image decoding device (100). Below, the operation of the image encoding device (200) that performs an image encoding method corresponding to the reverse process of the image decoding method will be explained through various embodiments.
[0257] FIG. 2 illustrates a block diagram of an image encoding device (200) capable of encoding an image based on at least one of block shape information and segmented shape mode information according to one embodiment.
[0258] The video encoding device (200) may include an encoding unit (220) and a bitstream generation unit (210). The encoding unit (220) may receive an input video and encode the input video. The encoding unit (220) may encode the input video to obtain at least one syntax element. The syntax element may include at least one of a skip flag, a prediction mode, a motion vector difference, a motion vector prediction method (or index), a transform quantized coefficient, a coded block pattern, a coded block flag, an intra prediction mode, a direct flag, a merge flag, a delta QP, a reference index, a prediction direction, and a transform index. The encoding unit (220) may determine a context model based on block shape information including at least one of the shape, direction, width, and height ratio or size of the encoding unit.
[0259] The bitstream generation unit (210) can generate a bitstream based on the encoded input image. For example, the bitstream generation unit (210) can generate a bitstream by entropy encoding syntax elements based on a context model. Additionally, the image encoding device (200) can transmit the bitstream to the image decoding device (100).
[0260] According to one embodiment, the encoding unit (220) of the image encoding device (200) can determine the shape of the encoding unit. For example, the encoding unit may be square or non-square in shape, and information indicating such shape may be included in block shape information.
[0261] According to one embodiment, the encoding unit (220) can determine how the encoding unit will be divided. 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 including division form mode information that includes information about the form of such encoding unit.
[0262] According to one embodiment, the encoding unit (220) may determine whether the encoding unit is divided or not. If the encoding unit (220) determines that only one encoding unit is included in the encoding unit or that the encoding unit is not divided, the bitstream generation unit (210) may generate a bitstream including division type mode information indicating that the encoding unit is not divided. Additionally, the encoding unit (220) may divide the encoding unit into a plurality of encoding units, and the bitstream generation unit (210) may generate a bitstream including division type mode information indicating that the encoding unit is divided into a plurality of encoding units.
[0263] According to one embodiment, information indicating how many encoding units to divide or in which direction to divide may be included in the division type mode information. For example, the division type mode information may indicate dividing in at least one of the vertical direction and the horizontal direction, or not dividing.
[0264] The video encoding device (200) determines information regarding the segmentation mode based on the segmentation mode of the encoding unit. The video encoding device (200) determines a context model based on at least one of the ratio or size of the shape, direction, width, and height of the encoding unit. Then, the video encoding device (200) generates information regarding the segmentation mode for segmenting the encoding unit based on the context model as a bitstream.
[0265] The video encoding device (200) may obtain an array for matching at least one of the ratio or size of the shape, direction, width, and height of an encoding unit with an index for the context model in order to determine the context model. The video encoding device (200) may obtain an index for the context model based on at least one of the ratio or size of the shape, direction, width, and height of an encoding unit in the array. The video encoding device (200) may determine the context model based on the index for the context model.
[0266] The video encoding device (200) may determine a context model based further on block shape information including at least one of the ratio or size of the shape, direction, width, and height of a surrounding encoding unit adjacent to the encoding unit, in order to determine the context model. Additionally, the surrounding encoding unit may include at least one of the encoding units located on the lower left, left, upper left, upper, upper right, right, or lower right side of the encoding unit.
[0267] Additionally, the video encoding device (200) can compare the width of an upper peripheral encoding unit with the width of an encoding unit in order to determine a context model. Additionally, the video encoding device (200) can compare the height of left and right peripheral encoding units with the height of an encoding unit. Additionally, the video encoding device (200) can determine a context model based on the comparison results.
[0268] The operation of the video encoding device (200) includes content similar to the operation of the video decoding device (100) described in FIGS. 3 to 19, so a detailed description is omitted.
[0269] FIG. 20 is a block diagram illustrating the configuration of an image decoding device (2000) according to one embodiment.
[0270] Referring to FIG. 20, the image decoding device (2000) may include an acquisition unit (2010) and a prediction decoding unit (2030).
[0271] According to one embodiment, the acquisition unit (2010) and the prediction decoding unit (2030) may be implemented with at least one processor. In one embodiment, the acquisition unit (2010) and the prediction decoding unit (2030) may operate according to at least one instruction stored in at least one memory.
[0272] The image decoding device (2000) may include at least one memory that stores input / output data of the acquisition unit (2010) and the prediction decoding unit (2030). Additionally, the image decoding device (2000) may include a memory control unit that controls the data input / output of at least one memory.
[0273] In one embodiment, the acquisition unit (2010) may correspond to the entropy decoding unit (1955) shown in FIG. 19, and the prediction decoding unit (2030) may correspond to the prediction decoding unit (1975) shown in FIG. 19.
[0274] The acquisition unit (2010) can acquire a bitstream generated as a result of encoding a picture. The bitstream may include the encoding result for the current block. The current block may be a maximum encoding unit, encoding unit, conversion unit, or prediction unit divided from the current picture to be decoded.
[0275] In one embodiment, the acquisition unit (2010) can receive a bitstream from a video encoding device through a network.
[0276] In one embodiment, the acquisition unit (2010) can acquire a bitstream from a data storage medium including a magnetic medium such as a hard disk, a floppy disk and a magnetic tape, an optical recording medium such as a CD-ROM and a DVD, a magneto-optical medium such as a floptical disk, etc.
[0277] The acquisition unit (2010) can acquire syntax elements for decoding a picture from a bitstream. Values corresponding to the syntax elements can be included in the bitstream according to the hierarchical structure of the picture.
[0278] The acquisition unit (2010) can acquire syntax elements by entropy decoding the bins included in the bitstream.
[0279] In one embodiment, the bitstream may include information about the prediction mode of the current block within the current picture. The prediction mode of the current block may be any one of a plurality of prediction modes, including an intra mode and an inter mode. As an example, the inter mode may include a template matching mode.
[0280] In the present disclosure, a template matching mode represents a method for determining motion information based on template matching. The template matching mode may be referred to as a template matching prediction, a template matching prediction mode, an inter-template matching prediction, an inter-template matching mode, an inter-template matching prediction mode, etc.
[0281] Alternatively, in one embodiment, the prediction mode of the current block may be any one of a plurality of prediction modes including at least one of an intra mode, an inter mode, or a template matching mode.
[0282] The prediction decoding unit (2030) can generate a prediction block of the current block by performing intra prediction or inter prediction on the current block according to the prediction mode of the current block, and can restore the current block using the prediction block.
[0283] In one embodiment, the acquisition unit (2010) can acquire information about the inter mode of the current block from the bitstream when the prediction mode of the current block is an inter mode. As an example, the information about the inter mode may include information about the template matching mode. As an example, the information about the template matching mode may include information indicating whether the template matching mode is applied.
[0284] In one embodiment, information regarding the intermode may be included in the sequence parameter set, picture parameter set, slice header, or slice data of the bitstream. As an example, the slice data may include information signaled at the level of a coding tree, coding unit, transform tree, or transform unit.
[0285] The predictive decoding unit (2030) can generate a predicted block of the current block through inter-prediction of the current block. Specifically, the predictive decoding unit (2030) can determine the motion vector of the current block and can identify a reference block within a reference picture using the motion vector of the current block. The predictive decoding unit (2030) can determine the reference block as the predicted block of the current block.
[0286] In one embodiment, when a prediction block of the current block is generated, the prediction decoding unit (2030) can obtain a restoration block of the current block using the prediction block.
[0287] In one embodiment, the prediction decoding unit (2030) can determine the prediction block as the recovery block.
[0288] In one embodiment, the prediction decoding unit (2030) can generate a restoration block of the current block by combining the residual data obtained from the bitstream by the acquisition unit (2010) with the prediction block.
[0289] In one embodiment, when a merge mode is applied, the predictive decoder (2030) can construct a merge candidate list using the motion vector of a surrounding block and determine the motion vector of the current block from the merge candidate list.
[0290] In one embodiment, when the AMVP (advanced motion vector prediction) mode is applied, the prediction decoder (2030) can construct a motion vector predictor (MVP) candidate list using the motion vectors of surrounding blocks and determine the MVP of the current block from the MVP candidate list. The prediction decoder (2030) can determine the motion vector of the current block by adding the motion vector difference (MVD) obtained by the acquisition unit (2010) to the MVP of the current block.
[0291] Hereinafter, the process of determining motion vectors in AMVP mode is explained with reference to FIGS. 21 to 24.
[0292] FIG. 21 is a diagram illustrating a method for determining a motion vector according to one embodiment.
[0293] Referring to FIG. 21, the image decoding device (2000) can induce the MVP (2140) of the current block (2100) by using the motion vector of the surrounding blocks of the current block (2100).
[0294] In one embodiment, the MVP (2140) of the current block (2100) may be obtained from an MVP candidate list (hereinafter abbreviated as candidate list). The candidate list may be constructed using motion vectors of spatially or temporally adjacent neighboring blocks. As an example, spatially adjacent neighboring blocks may include spatially adjacent neighboring blocks and / or spatially non-adjacent neighboring blocks. Temporally adjacent neighboring blocks may include temporally adjacent neighboring blocks and / or temporally non-adjacent neighboring blocks. Additionally, as an example, the candidate list may include a History-based MVP (HMVP).
[0295] The video decoder (2000) can obtain information regarding the MVD (2150) from the bitstream and derive the MVD (2150) of the current block (2100) based on the obtained information. The video decoder (2000) can determine the motion vector (MV) (2160) of the current block (2100) by adding the MVD (2150) to the MVP (2140). The reference block (2110) of the current block (2100) can be determined within the reference picture (2130) by the motion vector (2160) of the current block (2100).
[0296] In one embodiment, the number of MVP candidates (hereinafter abbreviated as candidates) included in the candidate list (i.e., the size of the candidate list) may be determined in advance. For example, in AMVP mode, the maximum number of candidates included in the candidate list may be a value fixed in advance. The value fixed in advance may be 2, 3, 4, 5, or a larger integer.
[0297] In one embodiment, the image decoding device (2000) can add motion vectors of surrounding blocks determined in a predetermined order as MVP to the candidate list.
[0298] 1. Motion vectors of spatially adjacent surrounding blocks (hereinafter, spatially adjacent surrounding blocks)
[0299] 2. Temporal motion vector of surrounding blocks
[0300] 3. Motion vectors of spatially non-adjacent neighboring blocks (hereinafter, spatially non-adjacent surrounding blocks)
[0301] 4. HMVP
[0302] 5. Zero motion vector
[0303] In one embodiment, the number of motion vectors of surrounding blocks added according to a predefined order may be predefined. For example, up to two motion vectors of spatially adjacent surrounding blocks may be added to the candidate list. Up to two motion vectors of temporal surrounding blocks may be added to the candidate list.
[0304] FIG. 22 is a diagram illustrating the process of inserting a motion vector of a spatially surrounding block into a motion vector predictor candidate list according to one embodiment.
[0305] Referring to FIG. 22, the image decoding device (2000) can search for motion vectors of spatially adjacent surrounding blocks in a predefined order and add them to a candidate list. The spatially adjacent surrounding blocks of the current block (2200) may include a left block (L), a lower-left block (BL), an upper block (A), an upper-right block (AR), and an upper-left block (AL).
[0306] In one embodiment, the image decoding device (2000) may add motion vectors of up to two spatially adjacent neighbor blocks to a candidate list. Spatially adjacent neighbor blocks may be classified into a left group (2210) or an upper group (2220). Spatially adjacent neighbor blocks may be searched individually within the classified groups and inserted as candidates into the candidate list.
[0307] For example, as illustrated in FIG. 22, the left block and the lower-left block may be classified into a left group (2210), and the upper block, the upper-right block and the upper-left block may be classified into an upper group (2220). However, the content of the present disclosure is not limited thereto. For example, the upper-left block may be classified to be included in the left group (2210).
[0308] The video decoding device (2000) can add up to 1 candidate within the left group (2210) to the candidate list and up to 1 candidate within the upper group (2220) to the candidate list.
[0309] In one embodiment, when adding up to one candidate from the left group (2210), the image decoding device (2000) can search for candidates in the order of [lower-left block, left block]. In other words, the image decoding device (2000) can search for candidates in the order of [lower-left block, left block] to check whether the corresponding block is available (e.g., whether it has motion information) and add the motion vector of the available candidate to the candidate list.
[0310] Additionally, when adding up to one candidate from the upper group (2220), the image decoding device (2000) can search for candidates in the order of [upper right block, upper block, upper left block]. The image decoding device (2000) can search for candidates in the order of [upper right block, upper block, upper left block] to check if the corresponding block is available, and can add the motion vector of the available candidate to the candidate list.
[0311] FIG. 23 is a diagram illustrating the process of inserting a motion vector of a temporal surrounding block into a motion vector predictor candidate list according to one embodiment.
[0312] Referring to FIG. 23, the image decoding device (2000) can search for motion vectors of temporal neighbor blocks adjacent to the current block (2300) in a predefined order and add them to a candidate list. Temporal neighbor blocks of the current block (2300) may include a central block (C) containing pixels at the central position (e.g., lower right central position) of the current block (2300) within the collocated picture, and a lower right block (BR) containing pixels adjacent to the lower right corner of the current block (2300).
[0313] In one embodiment, the number of motion vectors of temporal surrounding blocks added according to a predefined order may be predefined. As an example, the image decoder (2000) may add up to two motion vectors of temporal surrounding blocks to the candidate list. At most one temporal surrounding block may be added to the candidate list for each collocated picture. The number of collocated pictures may be predefined. The predefined number may be an integer of 1, 2, or more.
[0314] In one embodiment, when adding candidates within a collocated picture, the image decoding device (2000) may search for candidates in the order of [lower right block, center block]. Alternatively, the image decoding device (2000) may search for candidates in the order of [center block, lower right block].
[0315] In one embodiment, the maximum number of candidates included in the candidate list may be predefined. The motion vectors of the surrounding blocks described above may be added within the range of the maximum number of candidates in the candidate list. As an example, if template matching is not applied, the maximum number of candidates in the candidate list may be 2.
[0316] The image decoding device (2000) can obtain information from the bitstream indicating the motion vector predictor of the current block within the candidate list. If the number of candidates included in the candidate list is 2, the image decoding device (2000) can obtain flag information (e.g., mvp_flag) from the bitstream. The image decoding device (2000) can use the flag information to determine whether to use the first candidate within the candidate list as the motion vector predictor of the current block or to use the second candidate as the motion vector predictor of the current block.
[0317] Meanwhile, according to one embodiment of the present disclosure, the image decoding device (2000) may apply template matching when encoding / decoding motion information. By template matching, the motion vectors of all or some of the candidates included in the candidate list may be corrected. A template matching-based correction method is described later in FIG. 30. In addition, the order (or assigned index) of the candidates in the candidate list may be rearranged by template matching. Alternatively, a candidate used for predicting the current block may be determined among the candidates in the candidate list by template matching.
[0318] In one embodiment, when a candidate list is corrected and / or sorted based on template matching, candidate selection information for the corrected and / or sorted candidate list may be signaled. Alternatively, when a candidate list is corrected and / or sorted based on template matching, the signaling of candidate selection information may be omitted. That is, the candidate with the smallest template matching cost within the candidate list may be determined as the motion vector predictor of the current block without explicit signaling. Alternatively, when a candidate list is corrected and / or sorted based on template matching, selection information for a limited number of candidates may be signaled. For example, information specifying a candidate among the two candidates with the smallest template matching cost out of five candidates may be signaled.
[0319] In an embodiment of the present disclosure, the template matching cost may represent the difference between templates. The template matching cost may be calculated through the difference between the template of the current block and the template of the reference block (or candidate block) specified by the corresponding motion vector. As an example, the template matching cost may be calculated based on SAD (sum of absolute difference), SSE (sum of squared error), MR-SAD (mean removed SAD), or MAD (mean of absolute difference).
[0320] In one embodiment, when template matching is applied, the image decoder (2000) can add motion vectors of surrounding blocks to a candidate list as MVP in a predefined order as follows.
[0321] 1. Motion vectors of spatially adjacent surrounding blocks (hereinafter, spatially adjacent surrounding blocks)
[0322] 2. Temporal motion vector of surrounding blocks
[0323] 3. Motion vectors of spatially non-adjacent neighboring blocks (spatially non-adjacent surrounding blocks)
[0324] 4. HMVP
[0325] In one embodiment, when template matching is applied, the maximum number of candidate lists may be predefined. For example, when template matching is applied, the maximum number of candidate lists may be defined as 5. The image decoding device (2000) may add motion vectors of surrounding blocks to the candidate list according to a predefined order within the range of the defined maximum number of candidate lists. The image decoding device (2000) may add motion vectors of up to 2 spatially adjacent surrounding blocks to the candidate list, and the embodiment described above in FIG. 22 may be applied.
[0326] The image decoding device (2000) can add motion vectors of up to two temporal surrounding blocks to the candidate list. As an example, up to one temporal surrounding block can be added to the candidate list for each collocated picture. The number of collocated pictures can be predefined. The predefined number can be an integer of 1, 2, or more.
[0327] In one embodiment, the image decoding device (2000) may add a motion vector having the smallest template matching cost among motion vectors of temporal surrounding blocks of a predefined location within a collocated picture to a candidate list as a temporal candidate. As an example, the temporal surrounding blocks of a predefined location may include the lower right block and the center block of the location described above in FIG. 23.
[0328] Subsequently, the image decoding device (2000) may add spatially non-adjacent surrounding blocks and HMVPs to the candidate list. If the number of candidates included in the candidate list is less than the maximum number, the image decoding device (2000) may add spatially non-adjacent surrounding blocks to the candidate list according to a predefined order. If the number of candidates included in the candidate list is less than the maximum number, the image decoding device (2000) may add HMVPs to the candidate list according to a predefined order. The number of motion vectors of spatially non-adjacent surrounding blocks or HMVPs added to the candidate list may be predefined. In one embodiment, since temporal candidates can be selected at the decoder side based on template matching, the image decoding device (2000) may consider a relatively large number of candidates for prediction. As an example, temporal surrounding blocks may include temporally adjacent blocks (the lower right block and the center block described in FIG. 23) and additionally neighboring blocks that are not temporally adjacent (temporally non-adjacent surrounding blocks). This is explained with reference to the following drawings.
[0329] FIG. 24 is a drawing illustrating a temporal peripheral block according to one embodiment.
[0330] Referring to FIG. 24, the image decoding device (2000) may consider temporally adjacent surrounding blocks as well as temporally non-adjacent surrounding blocks as temporal candidates. The image decoding device (2000) may add motion vectors of surrounding blocks to the candidate list as MVPs according to a predefined order, as described in FIG. 23 above. The embodiment described in FIG. 23 above may be applied in the same way, and here, redundant descriptions are omitted.
[0331] In one embodiment, the image decoding device (2000) may add a motion vector having the smallest template matching cost among motion vectors of temporal surrounding blocks of a predefined location within a collocated picture to a candidate list as a temporal candidate. At this time, as illustrated in FIG. 24, the temporal surrounding blocks of a predefined location may include temporal adjacent surrounding blocks and temporal non-adjacent surrounding blocks.
[0332] First, the temporally adjacent surrounding block may represent the central position block (C1-1) of the collocated block (2400) within the collocated picture and / or the lower right position block (C0-1) of the collocated block (2400). The collocated block (2400) may be referred to as the corresponding block of the current block within the collocated picture. In FIG. 24, the temporally adjacent surrounding block is denoted by 1. The temporally adjacent surrounding block may be the collocated block (2400) of the current block.
[0333] In one embodiment, the collocated block (2400) may include a central block containing a pixel at the central position of the current block (e.g., lower right central position) within the collocated picture, and a lower right block containing a pixel adjacent to the lower right corner of the current block.
[0334] In FIG. 24, temporal non-adjacent surrounding blocks may be denoted as 2 to 10. That is, the positions 2 to 10 may be determined based on the collocated block (2400) of the current block as illustrated in FIG. 24. For example, a temporal non-adjacent surrounding block denoted as 2 may include a block (C1-2) containing a pixel adjacent to the lower side of the lower right pixel of the collocated block (2400) within the collocated picture, and / or a block (C0-2) containing a pixel adjacent to the right. Additionally, temporal non-adjacent surrounding blocks located in the diagonal lower right direction of the collocated block (2400) denoted as 3, 5, 7, and 9 may be defined, and temporal non-adjacent surrounding blocks located in the lower or right direction of the collocated block (2400) denoted as 4, 6, 8, and 10 may be defined.
[0335] In one embodiment, the image decoding device (2000) can determine the motion vector of a temporal neighbor block to be added to a candidate list among the motion vectors of a temporally adjacent neighbor block and a temporally non-adjacent neighbor block based on template matching. The image decoding device (2000) can add up to two motion vectors of temporal neighbor blocks to the candidate list. As an example, up to one temporal neighbor block may be added to the candidate list for each collocated picture. The number of collocated pictures may be predefined. The predefined number may be an integer of 1, 2, or more.
[0336] In one embodiment, the image decoder (2000) can calculate the template matching cost for the motion vectors of the temporal surrounding blocks at positions 1 to 10 shown in FIG. 24 for the temporal surrounding blocks of the current block. The image decoder (2000) can add the motion vectors of the temporal surrounding blocks that minimize the template matching cost to a candidate list. In one embodiment, a template matching-based selection may be performed for all or part of the available blocks among the temporal surrounding blocks shown in FIG. 24. As an example, some surrounding blocks may be omitted from the temporal surrounding blocks shown in FIG. 24, or surrounding blocks at other positions may be added. Alternatively, as an example, the image decoder (2000) can add the motion vectors of the blocks that minimize the template matching cost in the C0 blocks and / or the motion vectors of the blocks that minimize the template matching cost in the C1 blocks to a candidate list.
[0337] In embodiments of the present disclosure, the template matching cost may represent the difference between templates. The template matching cost may be calculated through the difference between the template of the current block and the template of the reference block (or candidate block) specified by the corresponding motion vector. As an example, the template matching cost may be calculated based on SAD, SSE, MR-SAD, or MAD.
[0338] In one embodiment, when the candidate list is corrected and / or sorted based on template matching, the candidate selection information may be omitted. That is, the candidate with the smallest template matching cost within the candidate list may be determined as the motion vector predictor of the current block without explicit signaling. The image decoder (2000) may determine the candidate having the lowest index value within the candidate list to be reordered as the motion vector predictor of the current block.
[0339] Alternatively, when the candidate list is corrected and / or sorted based on template matching, selection information for only a limited number of candidates may be signaled. For example, among five candidates, the two candidates with the smallest template matching cost may be determined to be available for prediction, and candidate selection information to specify a candidate among the two candidates may be signaled. A template matching-based correction method is described later in FIG. 30.
[0340] Meanwhile, according to the above-described embodiment, it can be seen that zero motion vectors are not used in constructing the candidate list when template matching is applied. In other words, zero motion vectors are not considered in the existing template matching-based candidate list construction process. However, it has been confirmed through various experiments that zero motion vectors are statistically selected relatively frequently as optimal motion vector predictors. The fact that zero motion vectors exhibit a statistically high selection rate suggests that a structure or strategy capable of more actively utilizing zero motion vectors is required.
[0341] Nevertheless, as in the existing template matching-based candidate list construction process, excluding zero motion vectors with a sufficiently high selection probability from the candidate list construction process can result in a loss in terms of encoding efficiency.
[0342] Accordingly, one embodiment of the present disclosure proposes a method for considering zero motion vectors during the process of constructing a template matching-based candidate list. According to one embodiment of the present disclosure, by considering zero motion vectors during the process of correcting and aligning (realigning) motion vector predictor candidates using template matching, encoding efficiency can be improved and prediction accuracy can be increased.
[0343] A motion vector predictor candidate list according to one embodiment of the present disclosure may include zero motion vectors reordered based on template matching costs. In the present disclosure, a zero motion vector represents a vector in which both the horizontal and vertical components of the motion vector are zero, and the zero motion vector may be referred to as a zero vector, a zero motion vector candidate, a zero candidate, a zero vector candidate, etc.
[0344] FIG. 25 is a diagram illustrating a method for constructing a candidate list using a zero motion vector according to one embodiment.
[0345] Referring to FIG. 25, the candidate list (2510) shown in the first figure represents a candidate list (2510) generated according to a method of constructing a conventional candidate list that does not use zero motion vectors. The candidate list (2510) may include MV0, MV1, and MV2 as candidates. The image decoder (2000) may perform correction based on template matching for MV0, MV1, and MV2. A specific method for correction based on template matching is described later in FIG. 30.
[0346] The video decoder (2000) can rearrange the corrected MV0, corrected MV1, and corrected MV2 based on template matching. At this time, zero motion vectors are not included, and zero motion vectors are not included in the finally generated candidate list (2510).
[0347] On the other hand, the second illustrated candidate list (2520) is a candidate list according to one embodiment of the present disclosure, wherein the candidate list (2520) may include zero motion vectors rearranged based on template matching.
[0348] Specifically, the candidate list (2520) may include MV0, MV1, MV2, and zero motion vectors as candidates. The image decoding device (2000) may perform correction based on template matching for MV0, MV1, and MV2, and may reorder the corrected MV0 (hereinafter MV0'), corrected MV1 (hereinafter MV1'), corrected MV2 (hereinafter MV2'), and zero motion vectors based on template matching. The image decoding device (2000) may calculate the template matching cost of MV0', MV1', MV2', and zero motion vectors, and may construct a reordered candidate list (2520) according to the calculated cost value.
[0349] According to one embodiment of the present disclosure, an image decoding device (2000) may construct an initial candidate list using motion information of surrounding blocks. The image decoding device (2000) may correct all or some of the candidates included in the initial candidate list. Subsequently, the image decoding device (2000) may construct a final candidate list (2520) by rearranging the candidates.
[0350] In one embodiment, the zero motion vector may be inserted during the initial candidate list construction process, or may be inserted into the candidate list after the initial candidate list construction and before reordering. This will be explained in detail below with reference to FIGS. 26 to 28.
[0351] FIG. 26 is a diagram illustrating a method of constructing a candidate list using a zero motion vector according to one embodiment.
[0352] According to one embodiment of the present disclosure, a zero motion vector can be inserted into the initial candidate list construction process.
[0353] Referring to FIG. 26, the image decoding device (2000) can construct an initial candidate list (2610) using motion information of surrounding blocks. In one embodiment, zero motion vectors can be added to the initial candidate list (2610) according to a predefined order.
[0354] The image decoding device (2000) can perform correction based on template matching for the remaining candidates excluding the zero motion vector. The method of performing correction based on template matching is described in detail later in FIG. 30.
[0355] In one embodiment, the image decoding device (2000) may perform correction on all or some of the remaining candidates, excluding the zero motion vector. As correction is performed on all or some of the candidates in the initial candidate list (2610), an intermediate candidate list (2620) may be generated. The intermediate candidate list (2620) may include the corrected motion vectors.
[0356] In the present disclosure, for convenience of explanation, the initial candidate list (2610) and the intermediate candidate list (2620) are described as separate lists, but are not limited thereto. As an example, since each candidate has the same index within the list, the intermediate candidate list (2620) may be the same list as the initial candidate list (2610). The intermediate candidate list (2620) prior to reordering may be referred to as the initial candidate list (2610).
[0357] The image decoding device (2000) can rearrange the candidates included in the intermediate candidate list (2620), including the zero motion vector, based on template matching. The image decoding device (2000) can calculate the template matching cost for each candidate included in the intermediate candidate list (2620). For example, the cost values for MV0', MV1', MV2' and the zero motion vector can be calculated as 30, 60, 40, and 20, respectively, as shown in FIG. 26.
[0358] The image decoding device (2000) can reorder the candidates by newly assigning low indices in order of decreasing template matching cost value. The image decoding device (2000) can construct a final candidate list (2630) by reordering the candidates according to the cost value.
[0359] Meanwhile, in one embodiment, zero motion vectors may be added to an initial candidate list (2610) in a predefined order during the process of constructing spatial candidates.
[0360] Referring again to FIG. 22 above, in one embodiment, the image decoding device (2000) can add the motion vector of a spatially adjacent surrounding block to the initial candidate list (2610) and then add the zero motion vector to the initial candidate list (2610).
[0361] Alternatively, in one embodiment, when adding up to one candidate from the left group (2210), the image decoding device (2000) may search for candidates in the order of [lower-left block, left block, zero motion vector]. In other words, the image decoding device (2000) may search for candidates in the order of [lower-left block, left block] to check whether the corresponding block is available (e.g., whether it has motion information), and if there are no available candidates, the zero motion vector may be added to the initial candidate list (2610).
[0362] Alternatively, in one embodiment, when adding up to one candidate from the upper group (2220), the image decoding device (2000) may search for candidates in the order of [upper right block, upper block, upper left block, zero motion vector].
[0363] Additionally, zero motion vectors can be added to the initial candidate list (2610) in a predefined order during the process of constructing temporal candidates. This will be explained with reference to the following Fig. 27.
[0364] FIG. 27 is a diagram illustrating a method for adding a zero motion vector to a candidate list as a temporal candidate according to one embodiment.
[0365] As previously described in FIGS. 23 and 24, the image decoding device (2000) may add motion vectors of up to two temporal surrounding blocks to the candidate list, and motion vectors of temporal surrounding blocks may be added to the candidate list at a rate of up to one per collocated picture. As an example, N candidates may be added to the candidate list as temporal candidates for each collocated picture. Here, N may be 1, 2, 3, or a greater integer.
[0366] Referring to FIG. 27, the image decoding device (2000) may add a motion vector having the smallest template matching cost among motion vectors of temporal surrounding blocks at a predefined location within a collocated picture to a candidate list as a temporal candidate. The temporal surrounding blocks may be blocks at locations described in FIG. 23 and FIG. 24 within the collocated picture. Here, redundant descriptions related thereto are omitted.
[0367] The image decoding device (2000) can construct an initial temporal candidate list (2710, 2720) using the motion vectors of temporal surrounding blocks. At this time, the image decoding device (2000) can add zero motion vectors to the initial temporal candidate list (2710, 2720).
[0368] In one embodiment, the motion vectors considered in the initial temporal candidate list (2710, 2720) may include the motion vectors of temporally adjacent neighboring blocks, the motion vectors of temporally non-adjacent neighboring blocks, and zero motion vectors.
[0369] The image decoding device (2000) can calculate a template matching cost for each candidate included in the initial temporal candidate list (2710, 2720). For example, the template matching cost values for T0, T1, T2, and zero motion vectors can be calculated as 30, 60, 40, and 20, respectively, as shown in FIG. 27.
[0370] The video decoding device (2000) can add the temporal candidate with the smallest cost value (or a predefined number of temporal candidates) within the initial temporal candidate list (2710, 2720) to the candidate list (2730).
[0371] In one embodiment, the image decoding device (2000) can construct a candidate list using motion vectors of surrounding blocks. At this time, zero motion vectors can be added to the candidate list according to a predefined order.
[0372] For example, a zero motion vector can be added to the candidate list between spatial adjacency candidates and temporal candidates. That is, a zero motion vector can be added to the candidate list in the order of [spatial adjacency candidate, zero motion vector, temporal candidate, history-based candidate].
[0373] For example, a zero motion vector can be added to the candidate list between the temporal adjacency candidate and the history-based candidate. That is, the zero motion vector can be added to the candidate list in the order of [spatial adjacency candidate, temporal candidate, zero motion vector, history-based candidate].
[0374] For example, a zero motion vector can be added to the candidate list between spatially non-adjacent candidates and history-based candidates. That is, a zero motion vector can be added to the candidate list in the order of [spatially adjacent candidate, temporal candidate, spatially non-adjacent candidate, zero motion vector, history-based candidate].
[0375] For example, it can be added to the candidate list last, after the history-based candidate has been added. Zero motion vectors can be added to the candidate list in the order of [spatial adjacent candidate, temporal candidate, history-based candidate, zero motion vector], or in the order of [spatial adjacent candidate, temporal candidate, spatial non-adjacent candidate, history-based candidate, zero motion vector].
[0376] In one embodiment, when adding a zero motion vector to a candidate list, the image decoding device (2000) can check whether duplicate motion information exists in the candidate list. If duplicate motion information exists, the image decoding device (2000) may not add the zero motion vector.
[0377] The zero motion vector rearrangement method according to the embodiment described in FIGS. 25 to 27 may always be applied or may be applied optionally. In the former case, the image decoding device (2000) may rearrange the candidates by always including the zero motion vector during the candidate list construction process. In the latter case, when rearranging the candidate list, the inclusion of the zero motion vector may be determined explicitly or implicitly.
[0378] In one embodiment, the image encoding device may signal a flag to the image decoder (2000) indicating whether to reorder including a zero motion vector. For example, the flag indicating whether to reorder including a zero motion vector may be signaled at the sequence, picture, slice, tile, CTU (Coding Tree Unit), and CU (Coding Unit) levels. As an example, information regarding whether to reorder including a zero motion vector may be signaled at the slice level (e.g., slice header syntax) as shown in Table 1 below.
[0379]
[0380] In Table 1, sh_zero_mv_reordering_enabled_flag is a flag indicating whether the reordering mode including zero motion vectors is enabled. If the reordering mode including zero motion vectors is enabled, sh_zero_mv_reordering_explicit_flag may be signaled. sh_zero_mv_reordering_explicit_flag is a flag indicating whether to explicitly signal whether reordering including zero motion vectors is performed for the current slice. In one embodiment, the reordering mode including zero motion vectors may be available when the current slice is slice B.
[0381] In one embodiment, a flag indicating whether to realign including a zero motion vector may be signaled at the CU level (e.g., coding unit syntax) as shown in Table 2 below.
[0382]
[0383] In Table 2, zero_mv_reordering_flag is a flag indicating whether to reorder with zero motion vectors for the current CU. If the reordering mode with zero motion vectors is enabled via sh_zero_mv_reordering_explicit_flag, zero_mv_reordering_flag can be parsed.
[0384] In one embodiment, the image decoder (2000) may determine whether to rearrange the candidate list, including a zero motion vector, implicitly according to a predetermined criterion. The image decoder (2000) may determine whether to rearrange the candidate list, including a zero motion vector, based on predefined encoding information. As an example, the predetermined criterion or predefined encoding information may be defined based on a template matching cost, information of the current block (e.g., size, shape), and whether surrounding blocks are aligned.
[0385] For example, the image decoder (2000) may determine whether to rearrange the candidate list including zero motion vectors by comparing the smallest cost value among the cost values of candidates in the candidate list with a predetermined threshold value. The image decoder (2000) may determine whether to rearrange the candidate list including zero motion vectors depending on whether the width and / or height of the current block is greater than or less than a predefined value. The image decoder (2000) may determine whether to rearrange the candidate list including zero motion vectors depending on whether the surrounding blocks of a predefined location are aligned.
[0386] FIG. 28 is a diagram illustrating a method of constructing a candidate list using a zero motion vector according to one embodiment.
[0387] According to one embodiment of the present disclosure, a zero motion vector can be inserted into the candidate list after the initial candidate list is constructed and before reordering.
[0388] Referring to FIG. 28, the image decoding device (2000) can construct an initial candidate list (2810, 2820) using motion information of surrounding blocks. The image decoding device (2000) can perform correction based on template matching on all or some of the candidates included in the initial candidate list (2810, 2820). A method for performing correction based on template matching is described in detail later in FIG. 30.
[0389] In one embodiment, the image decoding device (2000) may perform correction on all or some of the candidates included in the initial candidate list (2810, 2820). FIG. 28 illustrates the case where correction is performed on all candidates. An initial candidate list (2820) in which correction is performed on the candidates may be configured.
[0390] The image decoding device (2000) can construct an intermediate candidate list (2830) by adding a zero motion vector to an initial candidate list (2820) in which corrections have been performed on the candidates.
[0391] In the present disclosure, for convenience of explanation, the initial candidate list (2820) and the intermediate candidate list (2830) are described as separate lists, but since each candidate has the same index within the list except for the zero motion vector, the intermediate candidate list (2830) may be identical to the initial candidate list (2820) that has been corrected. That is, the intermediate candidate list (2830) prior to reordering may be referred to as the initial candidate list (2820) that has been corrected.
[0392] The image decoding device (2000) can calculate a template matching cost for each candidate included in the intermediate candidate list (2830). For example, the cost values of MV0', MV1', MV2' and zero motion vector can be calculated as 30, 60, 40, and 20, respectively, as shown in FIG. 28.
[0393] The image decoding device (2000) can reorder the candidates by newly assigning low indices in order of decreasing cost value. The image decoding device (2000) can construct a final candidate list (2840) by reordering the candidates according to the cost value.
[0394] The zero motion vector rearrangement method according to the embodiment described in FIG. 28 may always be applied or may be applied optionally. In the former case, the image decoding device (2000) may rearrange the candidates by always including the zero motion vector during the candidate list construction process. In the latter case, when rearranging the candidate list, the inclusion of the zero motion vector may be determined explicitly or implicitly.
[0395] In one embodiment, the image encoding device may signal a flag to the image decoder (2000) indicating whether to reorder including a zero motion vector. For example, the flag indicating whether to reorder including a zero motion vector may be signaled at the sequence, picture, slice, tile, CTU, and CU levels. As an example, the embodiments described above in Tables 1 and 2 may be applied. Here, redundant descriptions are omitted.
[0396] In one embodiment, the image decoder (2000) may determine whether to rearrange the candidate list, including a zero motion vector, implicitly according to a predetermined criterion. The image decoder (2000) may determine whether to rearrange the candidate list, including a zero motion vector, based on predefined encoding information. As an example, the predetermined criterion or predefined encoding information may be defined based on a template matching cost, information of the current block (e.g., size, shape), and whether surrounding blocks are aligned.
[0397] For example, the image decoder (2000) may determine whether to rearrange the candidate list including zero motion vectors by comparing the smallest cost value among the cost values of candidates in the candidate list with a predetermined threshold value. The image decoder (2000) may determine whether to rearrange the candidate list including zero motion vectors depending on whether the width and / or height of the current block is greater than or less than a predefined value. The image decoder (2000) may determine whether to rearrange the candidate list including zero motion vectors depending on whether the surrounding blocks of a predefined location are aligned.
[0398] FIG. 29 is a diagram illustrating a method for constructing a candidate list using a zero motion vector according to one embodiment.
[0399] Referring to FIG. 29, the candidate list (2910) shown in the first figure represents a candidate list (2910) generated according to a method of constructing a conventional candidate list that does not use zero motion vectors. The candidate list (2910) may include MV0, MV1, and MV2 as candidates. The image decoding device (2000) may perform correction based on template matching for MV0, MV1, and MV2, and may rearrange the corrected MV0 (hereinafter MV0'), corrected MV1 (hereinafter MV1'), and corrected MV2 (hereinafter MV2') based on template matching. At this time, zero motion vectors are not included, and the finally generated candidate list (2910) does not include zero motion vectors. The method of performing correction based on template matching is described in detail later in FIG. 30.
[0400] On the other hand, the second candidate list (2920) is a candidate list according to one embodiment of the present disclosure, and the candidate list (2920) may include zero motion vectors corrected and reordered based on template matching.
[0401] Specifically, the candidate list (2920) may include MV0, MV1, MV2, and a zero motion vector (ZR) as candidates. The image decoder (2000) may perform correction based on template matching for MV0, MV1, MV2, and the zero motion vector, and may rearrange MV0', MV1', MV2' and the corrected zero motion vector (hereinafter ZR') based on template matching. The image decoder (2000) may calculate the template matching cost of MV0', MV1', MV2', and ZR', and construct a rearranged candidate list (2920) according to the calculated cost value.
[0402] FIG. 30 is a diagram illustrating a method of constructing a candidate list using a zero motion vector according to one embodiment.
[0403] According to one embodiment of the present disclosure, a zero motion vector can be inserted into the initial candidate list construction process.
[0404] Referring to FIG. 30, the image decoding device (2000) can construct an initial candidate list (3010) using motion information of surrounding blocks. In one embodiment, zero motion vectors may be added to the initial candidate list (3010) according to a predefined order. The embodiments described in FIG. 26 and FIG. 27 above may be applied in the same way. Here, redundant descriptions are omitted.
[0405] The image decoder (2000) may perform refinement based on template matching for all or some candidates including zero motion vectors. Alternatively, the image decoder (2000) may perform refinement based on template matching for a predetermined number of candidates (or a predetermined number of candidates) within an initial candidate list (3010) including zero motion vectors. As an example, FIG. 30 illustrates a case where refinement is performed for all candidates.
[0406] In one embodiment, the image decoding device (2000) may perform correction on all or some candidates in an initial candidate list (3010) including zero motion vectors. As correction is performed on all or some candidates in the initial candidate list (3010), an intermediate candidate list (3020) may be generated. The intermediate candidate list (3020) may include corrected motion vectors.
[0407] In the present disclosure, for convenience of explanation, the initial candidate list (3010) and the intermediate candidate list (3020) are described as separate lists; however, since each candidate has the same index within the list, the intermediate candidate list (3020) may be identical to the initial candidate list (3010). That is, the intermediate candidate list (3020) prior to reordering may be referred to as the initial candidate list (3010).
[0408] Below, a template matching-based correction process for a candidate (or motion vector) is described.
[0409] In one embodiment, the image decoder (2000) can determine an initial reference block specified by a correction target candidate (i.e., an initial motion vector). The image decoder (2000) can find a reference block (or motion vector) that minimizes the template matching cost within a predefined search area (i.e., a range of correction). As an example, the search area may be defined as a range of a predetermined number of pixels. For example, the search area may be defined as a pixel range of [-2, +2], [-4, +4], [-8, +8], [-16, +16]. Alternatively, the search area may be defined as a preset number of samples in the up, down, left, and right directions. In this case, the samples may be integer samples or fractional samples. The preset number may be 1, 2, 3, 4, or an integer greater than or equal to these.
[0410] In one embodiment, the image decoding device (2000) may search all pixels within a predefined search area, or it may search some pixels considering computational complexity, etc. Here, search may refer to the difference between the template of a reference block specified by the searched pixel and the template of the current block, i.e., the calculation of the template matching cost. For example, the image decoding device (2000) may perform a predetermined point diamond search within the search area.
[0411] In one embodiment, the image decoding device (2000) may first search with a relatively low precision (e.g., integer pixels, 4 pels) and then search adjacent samples with a high precision (e.g., fractional pixels, 1 / 4, 1 / 8, 1 / 16, 1 / 32 pels) from the sample with the lowest cost. As an example, the image decoding device (2000) may obtain a corrected motion vector by performing a diamond search with a first precision (or resolution) within a search area to find an intermediate sample, and by searching a predetermined number of samples in the up, down, left, and right directions of the intermediate sample to find a final sample.
[0412] In one embodiment, the image decoding device (2000) can calculate a template matching cost while searching up, down, left, and right directions starting from a sample specified by an initial motion vector. The image decoding device (2000) can search for a sample having the lowest cost value within a correction range and correct the initial motion vector according to the search result.
[0413] In one embodiment, the resolution for performing correction may be predefined. For example, the resolution for performing correction may be defined as 1 / 4, 1 / 8, 1 / 16, 1 / 32 pel, etc.
[0414] Additionally, in one embodiment, the image decoding device (2000) may perform correction on all candidates included in the initial candidate list (3010), or may perform correction on some of the candidates included in the initial candidate list (3010). As an example, the candidate to be corrected (hereinafter, the correction target) may be selected using various methods.
[0415] In one embodiment, as an example, the number of candidates for which correction is performed based on template matching may be predetermined. Alternatively, the number of candidates for which correction is performed based on template matching may be determined based on predetermined encoding information. Alternatively, correction based on template matching may be performed only on candidates specified based on template matching (e.g., the candidate with the lowest template matching cost, a predetermined number of candidates with the lowest template matching cost).
[0416] In one embodiment, the candidates for which correction is performed may be determined as a predetermined number of candidates with low template matching costs. That is, the image decoding device (2000) may calculate the template matching cost of each candidate included in the initial candidate list (3010), and select a predetermined number of candidates with low template matching costs to perform correction.
[0417] In one embodiment, the candidate for which correction is performed may be determined to be a candidate having a cost lower than the template matching cost of a specific candidate. That is, the image decoding device (2000) may calculate the template matching cost of each candidate included in the initial candidate list (3010), and select a candidate having a cost lower than the template matching cost of a specific candidate to perform correction.
[0418] In one embodiment, the candidates for which correction is performed may be determined as the remaining candidates excluding a predetermined number of candidates with high template matching costs. That is, the image decoding device (2000) may calculate the template matching cost of each candidate included in the initial candidate list (3010), remove a predetermined number of candidates with high template matching costs from the initial candidate list (3010), and perform correction on the remaining candidates.
[0419] In one embodiment, the candidate for which correction is performed may be determined as an even-numbered candidate or an odd-numbered candidate within the initial candidate list (3010).
[0420] In one embodiment, the image decoding device (2000) may, when determining the correction target, remove from the initial candidate list (3010) a candidate having a cost value that is N times greater than the smallest cost value of the initial candidate list (3010). The image decoding device (2000) may correct the candidates remaining after removal. As an example, N may be defined as 5. As an example, N may be defined as an integer greater than 2.
[0421] In one embodiment, the image decoding device (2000) may remove candidates having a cost value greater than the cost value of the zero motion vector from the initial candidate list (3010) when determining the correction target. The image decoding device (2000) may correct the candidates remaining after removal.
[0422] The image decoding device (2000) can calculate a template matching cost for each candidate included in the intermediate candidate list (3020). For example, the cost values of MV0', MV1', MV2' and the corrected zero motion vector can be calculated as 30, 60, 40, and 10, respectively, as shown in FIG. 30.
[0423] The image decoding device (2000) can reorder the candidates by newly assigning indices starting from the lowest index in order of decreasing cost value. The image decoding device (2000) can construct a final candidate list (3030) by reordering the candidates according to the cost value.
[0424] Additionally, in one embodiment, the image decoding device (2000) may rearrange all candidates included in the initial candidate list (3010), or rearrange some of the candidates included in the initial candidate list (3010). As an example, the candidates to be rearranged may be selected using various methods.
[0425] In one embodiment, the candidates for reordering may be determined as a predetermined number of candidates with low template matching costs. That is, the image decoding device (2000) may calculate the template matching cost of each candidate and select a predetermined number of candidates with low template matching costs to perform reordering.
[0426] In one embodiment, the candidate for which reordering is performed may be determined to be a candidate having a cost lower than the template matching cost of a specific candidate. That is, the image decoding device (2000) may calculate the template matching cost of each candidate and select a candidate having a cost lower than the template matching cost of a specific candidate to perform reordering.
[0427] In one embodiment, the candidates for which reordering is performed may be determined as the remaining candidates excluding a predetermined number of candidates with high template matching costs. That is, the image decoding device (2000) may calculate the template matching cost of each candidate, remove a predetermined number of candidates with high template matching costs from the initial candidate list (3010), and then perform reordering on the remaining candidates.
[0428] Meanwhile, in one embodiment, zero motion vectors may be added to an initial candidate list (3010) in a predetermined order during the process of constructing spatial candidates.
[0429] Referring again to FIG. 22 above, in one embodiment, the image decoding device (2000) can add the motion vector of a spatially adjacent surrounding block to the initial candidate list (3010) and then add the zero motion vector to the initial candidate list (3010).
[0430] Alternatively, in one embodiment, when adding up to one candidate from the left group (2210), the image decoding device (2000) may search for candidates in the order of [lower-left block, left block, zero motion vector]. In other words, the image decoding device (2000) may search for candidates in the order of [lower-left block, left block] to check whether the corresponding block is available (e.g., whether it has motion information), and if there are no available candidates, the zero motion vector may be added to the initial candidate list (3010).
[0431] Alternatively, in one embodiment, when adding up to one candidate from the upper group (2220), the image decoding device (2000) may search for candidates in the order of [upper right block, upper block, upper left block, zero motion vector].
[0432] Additionally, zero motion vectors may be added to the initial candidate list (3010) in a predetermined order during the process of constructing temporal candidates. At this time, the embodiment described in FIG. 27 above may be applied. Here, redundant descriptions are omitted.
[0433] In one embodiment, the image decoding device (2000) can construct a candidate list using motion vectors of surrounding blocks. At this time, zero motion vectors can be added to the candidate list according to a predefined order.
[0434] For example, a zero motion vector can be added to the candidate list between spatial adjacency candidates and temporal candidates. That is, a zero motion vector can be added to the candidate list in the order of [spatial adjacency candidate, zero motion vector, temporal candidate, history-based candidate].
[0435] For example, a zero motion vector can be added to the candidate list between the temporal adjacency candidate and the history-based candidate. That is, the zero motion vector can be added to the candidate list in the order of [spatial adjacency candidate, temporal candidate, zero motion vector, history-based candidate].
[0436] For example, a zero motion vector can be added to the candidate list between spatially non-adjacent candidates and history-based candidates. That is, a zero motion vector can be added to the candidate list in the order of [spatially adjacent candidate, temporal candidate, spatially non-adjacent candidate, zero motion vector, history-based candidate].
[0437] For example, it can be added to the candidate list last, after the history-based candidate has been added. Zero motion vectors can be added to the candidate list in the order of [spatial adjacent candidate, temporal candidate, history-based candidate, zero motion vector], or in the order of [spatial adjacent candidate, temporal candidate, spatial non-adjacent candidate, history-based candidate, zero motion vector].
[0438] In one embodiment, when adding a zero motion vector to a candidate list, the image decoding device (2000) can check whether duplicate motion information exists in the candidate list.
[0439] The zero motion vector rearrangement method according to the embodiment described above in FIGS. 29 and 30 may be applied always or optionally. In the former case, the image decoding device (2000) may rearrange the candidates by always including the zero motion vector during the candidate list construction process. In the latter case, when rearranging the candidate list, the inclusion of the zero motion vector may be determined explicitly or implicitly. In this case, the embodiment described above in FIG. 27, Table 1, and Table 2 may be applied in the same way. Here, redundant descriptions are omitted.
[0440] Additionally, the zero motion vector correction method according to the embodiment described above in FIGS. 29 and 30 may always be applied or may be applied optionally. In the former case, the image decoding device (2000) may always correct the zero motion vector during the candidate list configuration process. In the latter case, when rearranging the candidate list, it may decide whether to correct the zero motion vector explicitly or implicitly.
[0441] In one embodiment, the image encoding device may signal a flag to the image decoder (2000) indicating whether to explicitly correct the zero motion vector. For example, the flag indicating whether to correct the zero motion vector may be signaled at the sequence, picture, slice, tile, CTU, and CU levels. As an example, the flag indicating whether to explicitly signal whether to correct the zero motion vector may be signaled at the slice level (e.g., slice header syntax) as shown in Table 3 below.
[0442]
[0443] In Table 3, sh_zero_mv_refine_enabled_flag is a flag indicating whether the zero motion vector correction mode is enabled. If the zero motion vector correction mode is enabled, sh_zero_mv_refine_explicit_flag may be signaled. sh_zero_mv_refine_explicit_flag is a flag indicating whether to explicitly signal whether the zero motion vector is corrected for the current slice. In one embodiment, the zero motion vector correction mode may be available when the current slice is slice B.
[0444] In one embodiment, a flag indicating whether to correct the zero motion vector may be signaled at the CU level (e.g., coding unit syntax) as shown in Table 4 below.
[0445]
[0446] In Table 4, zero_mv_refine_flag is a flag indicating whether zero motion vector correction is performed for the current CU. zero_mv_reordering_flag is a flag indicating whether reordering including zero motion vectors is performed for the current CU. If reordering including zero motion vectors is performed for the current CU and the zero motion vector correction mode is enabled via sh_zero_mv_refine_explicit_flag, zero_mv_refine_flag can be parsed.
[0447] FIG. 31 is a diagram illustrating a method for constructing a candidate list using a zero motion vector according to one embodiment.
[0448] Referring to FIG. 31, the candidate list (3110) shown in the first figure represents a candidate list (3110) generated according to a method of constructing a conventional candidate list that does not use zero motion vectors. The candidate list (3110) may include MV0, MV1, and MV2 as candidates. The image decoding device (2000) may perform correction based on template matching for MV0, MV1, and MV2, and may rearrange the corrected MV0 (hereinafter MV0'), corrected MV1 (hereinafter MV1'), and corrected MV2 (hereinafter MV2') based on template matching. At this time, zero motion vectors are not included, and the finally generated candidate list (3110) does not include zero motion vectors. The method of correcting motion vectors based on template matching is as described above in FIG. 30.
[0449] On the other hand, the second candidate list (3120) is a candidate list according to one embodiment of the present disclosure, wherein the candidate list (3120) may include zero motion vectors that are corrected and / or reordered based on template matching. Some zero motion vectors may be corrected and reordered, and some zero motion vectors may be reordered without correction.
[0450] Specifically, the candidate list (3120) may include MV0, MV1, MV2, and a plurality of zero motion vectors (ZR) as candidates. The image decoding device (2000) may perform correction based on template matching for some zero motion vectors of MV0, MV1, and MV2, and may rearrange MV0', MV1', MV2', zero motion vectors (ZR), and the corrected zero motion vectors (hereinafter ZR') based on template matching. The image decoding device (2000) may calculate the template matching cost of MV0', MV1', MV2', ZR, and ZR', and construct a rearranged candidate list (3120) according to the calculated cost value.
[0451] In one embodiment, the embodiment described in FIG. 31 may be an embodiment in which the embodiments described in FIG. 25 to 28 and the embodiments described in FIG. 29 and 30 are combined. Duplicate descriptions in this regard are omitted.
[0452] FIG. 32 is a diagram illustrating a method of constructing a candidate list using a zero motion vector according to one embodiment.
[0453] According to one embodiment of the present disclosure, a zero motion vector can be inserted into the initial candidate list construction process.
[0454] Referring to FIG. 32, the image decoding device (2000) can construct an initial candidate list (3210) using motion information of surrounding blocks. In one embodiment, zero motion vectors may be added to the initial candidate list (3210) according to a predefined order. The embodiments described in FIG. 26 and FIG. 27 above may be applied in the same way. Here, redundant descriptions related thereto are omitted.
[0455] The image decoding device (2000) can perform correction based on template matching for all candidates including zero motion vectors. Alternatively, the image decoding device (2000) can perform correction based on template matching for all or some candidates within the initial candidate list (3210) including zero motion vectors. The embodiments described in FIGS. 29 and FIGS. 30 above may be applied in the same way. Here, redundant descriptions related thereto are omitted. The specific motion vector correction method based on template matching is as described in FIGS. 30 above.
[0456] In one embodiment, the image decoding device (2000) may perform correction on all or some candidates in an initial candidate list (3210) including zero motion vectors. As correction is performed on all or some candidates in the initial candidate list (3210), an intermediate candidate list (3220) may be generated. The intermediate candidate list (3220) may include corrected motion vectors.
[0457] In the present disclosure, for convenience of explanation, the initial candidate list (3210) and the intermediate candidate list (3220) are described as separate lists; however, since each candidate has the same index within the list, the intermediate candidate list (3220) may be identical to the initial candidate list (3210). That is, the intermediate candidate list (3220) prior to reordering may be referred to as the initial candidate list (3210).
[0458] The image decoding device (2000) can construct an intermediate candidate list (3230) by adding a zero motion vector to an intermediate candidate list (3220) in which correction for the candidate has been performed.
[0459] The image decoding device (2000) can calculate a template matching cost for each candidate included in the intermediate candidate list (3230). For example, the cost values for MV0', MV1', MV2', ZR', and ZR can be calculated as 30, 60, 40, 10, and 20, respectively, as shown in FIG. 32.
[0460] The image decoding device (2000) can reorder the candidates by newly assigning low indices in order of decreasing cost value. The image decoding device (2000) can construct a final candidate list (3240) by reordering the candidates according to the cost value.
[0461] In one embodiment, the image decoder (2000) may add a zero motion vector to a candidate list and perform template matching-based correction on the candidate list to which the zero motion vector has been added. The image decoder (2000) may add the zero motion vector again to the candidate list to which the template matching-based correction has been performed. The image decoder (2000) may rearrange the candidate list containing the zero motion vector to which the template matching-based correction has been performed and the zero motion vector to which the template matching-based correction has not been performed based on template matching.
[0462] In one embodiment, the image decoding device (2000) may not add a zero motion vector if the candidate list already contains a zero motion vector when adding a zero motion vector. Alternatively, the image decoding device (2000) may add a zero motion vector regardless of whether the candidate list already contains a zero motion vector when adding a zero motion vector.
[0463] In one embodiment, the number of zero motion vectors added to the candidate list may be predetermined. For example, the number of zero motion vectors added may be a predetermined fixed value, such as 1 or 2. Alternatively, the number of zero motion vectors added may be defined as a certain ratio of the number of remaining candidate positions in the candidate list. Alternatively, the number of zero motion vectors added may be defined as a certain ratio of the size of the candidate list.
[0464] In one embodiment, the number of zero motion vectors corrected based on template matching within a candidate list may be predetermined. For example, the number of zero motion vectors corrected may be a predetermined fixed value such as 1 or 2. Alternatively, the number of zero motion vectors corrected may be defined as a certain ratio of the number of zero motion vectors added.
[0465] The zero motion vector rearrangement method according to the embodiment described in FIG. 32 may always be applied or may be applied optionally. In the former case, the image decoding device (2000) may rearrange the candidates by always including the zero motion vector during the candidate list construction process. In the latter case, when rearranging the candidate list, the inclusion of the zero motion vector may be determined explicitly or implicitly. In this case, the embodiment described above in FIG. 27, Table 1, and Table 2 may be applied in the same way. Here, redundant descriptions are omitted.
[0466] Additionally, the zero motion vector correction method according to the embodiment described in FIG. 32 may be applied always or optionally. In the former case, the image decoding device (2000) may always correct the zero motion vector during the candidate list configuration process. In the latter case, when rearranging the candidate list, the decision to correct the zero motion vector may be made explicitly or implicitly. In this case, the embodiment described above in FIG. 30, Table 3, and Table 4 may be applied in the same way. Here, redundant descriptions are omitted.
[0467] FIG. 33 is a flowchart illustrating an image decoding method according to one embodiment.
[0468] According to one embodiment of the present disclosure, an image decoding device (2000) may construct a motion vector predictor candidate list using motion vectors of surrounding blocks and perform correction and reordering on the motion vector predictor candidate list based on template matching. The final motion vector predictor candidate list, after correction and reordering according to one embodiment of the present disclosure, may include zero motion vectors reordered based on the template matching cost. In this case, the embodiments described above in FIGS. 25 to 32 may be applied. Here, redundant descriptions are omitted.
[0469] Referring to FIG. 33, the image decoder (2000) can construct a list of candidate initial motion vector predictors for the current block (S3310).
[0470] The image decoding device (2000) can perform correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in the initial motion vector predictor candidate list (S3320). A specific motion vector correction method based on template matching is as described above in FIG. 30.
[0471] The image decoding device (2000) can construct a final motion vector predictor candidate list by rearranging a plurality of motion vector predictor candidates based on a template matching cost (S3330). In one embodiment, the final motion vector predictor candidate list may include zero motion vectors rearranged based on a template matching cost. In this case, the embodiments described above in FIGS. 25 to 32 may be applied. Here, redundant descriptions related thereto are omitted.
[0472] The image decoder (2000) can determine the motion vector predictor of the current block based on the final motion vector predictor candidate list (S3340). In one embodiment, the image decoder (2000) can determine the first candidate within the candidate list rearranged based on template matching as the motion vector predictor of the current block.
[0473] Alternatively, in one embodiment, the image decoding device (2000) may obtain from the bitstream a syntax element (e.g., flag, index) that specifies the motion vector predictor of the current block within a candidate list rearranged based on template matching. The image decoding device (2000) may determine the motion vector predictor of the current block using the syntax element.
[0474] The video decoder (2000) can determine the motion vector of the current block by summing the motion vector predictor of the current block and the motion vector difference of the current block (S3350).
[0475] The image decoder (2000) can generate a prediction block of the current block using the motion vector of the current block (S3360). The image decoder (2000) can generate a restored block of the current block by adding the residual block of the current block to the prediction block of the current block. In one embodiment, the image decoder (2000) can generate a restored current block by combining residual data obtained from a bitstream with the prediction block.
[0476] FIG. 34 is a block diagram illustrating the configuration of an image encoding device according to one embodiment.
[0477] Referring to FIG. 34, the image encoding device (3400) may include a prediction encoding unit (3410) and a generation unit (3420).
[0478] According to one embodiment, the prediction encoding unit (3410) and the generation unit (3420) may be implemented with at least one processor. In one embodiment, the prediction encoding unit (3410) and the generation unit (3420) may operate according to at least one instruction stored in at least one memory.
[0479] The video encoding device (3400) may include at least one memory that stores input / output data of the prediction encoding unit (3410) and the generation unit (3420). Additionally, the video encoding device (3400) may include a memory control unit that controls the data input / output of the memory.
[0480] In one embodiment, the prediction encoding unit (3410) may correspond to the prediction encoding unit (1915) shown in FIG. 19, and the generation unit (3420) may correspond to the entropy encoding unit (1925) shown in FIG. 19.
[0481] The prediction encoding unit (3410) can determine the prediction mode of the current block. The current block may be a maximum encoding unit, encoding unit, conversion unit, or prediction unit divided from the current picture to be encoded.
[0482] The prediction mode of the current block may be any one of a plurality of prediction modes, including intra mode and inter mode. As an example, the inter mode may include a template matching mode.
[0483] In the present disclosure, a template matching mode represents a method for determining motion information based on template matching. The template matching mode may be referred to as a template matching prediction, a template matching prediction mode, an inter-template matching prediction, an inter-template matching mode, an inter-template matching prediction mode, etc.
[0484] Alternatively, in one embodiment, the prediction mode of the current block may be any one of a plurality of prediction modes including at least one of an intra mode, an inter mode, or a template matching mode.
[0485] The prediction encoding unit (3410) can generate a prediction block of the current block by performing intra prediction or inter prediction on the current block according to the prediction mode of the current block, and can encode the current block using the prediction block.
[0486] In one embodiment, encoding of the current block may mean a process of generating information that enables the image decoding device (2000) to restore the current block. The information generated through encoding may be included in a bitstream.
[0487] In one embodiment, the prediction encoding unit (3410) can encode the current block using the prediction block. A bitstream can be generated as a result of encoding the current block. In one embodiment, the image encoding device (3410) can obtain residual data corresponding to the difference between the prediction block and the original block, and information regarding the residual data can be included in the bitstream.
[0488] In one embodiment, since the operation of the predictive encoding unit (3410) of the image encoding device (3400) may be substantially the same as the operation of the predictive decoding unit (2030) of the image decoding device (2000), the description of the operation of the aforementioned predictive decoding unit (2030) may be applied equally to the predictive encoding unit (3410).
[0489] The generating unit (3420) can generate a bitstream containing the encoding result of the picture. The bitstream may contain the encoding result for the current block.
[0490] In one embodiment, the generating unit (3420) can transmit the bitstream to the video decoding device (2000) through a network.
[0491] In one embodiment, the generating unit (3420) can store a bitstream in a data storage medium including a magnetic medium such as a hard disk, a floppy disk and a magnetic tape, an optical recording medium such as a CD-ROM and a DVD, a magneto-optical medium such as a floptical disk, etc.
[0492] The generating unit (3420) can generate a bitstream containing syntax elements generated through the encoding of the picture. Values corresponding to the syntax elements can be included in the bitstream according to the hierarchical structure of the picture.
[0493] The generation unit (3420) can obtain bins included in the bitstream by entropy encoding the syntax elements.
[0494] In one embodiment, the bitstream may include information about the prediction mode of the current block in the current picture.
[0495] In one embodiment, information regarding the prediction mode may be included in the sequence parameter set, picture parameter set, slice header, or slice data of the bitstream. As an example, the slice data may include information signaled at the level of a coding tree, coding unit, transform tree, or transform unit.
[0496] FIG. 35 is a flowchart illustrating an image encoding method according to one embodiment.
[0497] According to one embodiment of the present disclosure, the image encoding device (3400) may construct a motion vector predictor candidate list using motion vectors of surrounding blocks in substantially the same manner as the image decoding device (2000), and may perform correction and reordering on the motion vector predictor candidate list based on template matching. The final motion vector predictor candidate list, after correction and reordering according to one embodiment of the present disclosure, may include zero motion vectors reordered based on the template matching cost. In this case, the embodiments described above in FIGS. 25 to 32 may be applied in the same way. Here, redundant descriptions are omitted.
[0498] Referring to FIG. 35, the image encoding device (3400) can construct a list of candidate initial motion vector predictors for the current block (S3510).
[0499] The video encoding device (3400) can perform correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in the initial motion vector predictor candidate list (S3520). A specific motion vector correction method based on template matching is as described above in FIG. 30.
[0500] The video encoding device (3400) can construct a final motion vector predictor candidate list by rearranging a plurality of motion vector predictor candidates based on a template matching cost (S3530). In one embodiment, the final motion vector predictor candidate list may include zero motion vectors rearranged based on a template matching cost. In this case, the embodiments described above in FIGS. 25 to 32 may be applied in the same way. Here, redundant descriptions related thereto are omitted.
[0501] The video encoding device (3400) can determine the motion vector predictor of the current block based on the final motion vector predictor candidate list (S3540). In one embodiment, the video encoding device (3400) can determine the first candidate within the candidate list rearranged based on template matching as the motion vector predictor of the current block.
[0502] Alternatively, in one embodiment, the image encoding device (3400) may encode syntax elements (e.g., flag, index) that specify the motion vector predictor of the current block within a candidate list rearranged based on template matching.
[0503] The video encoding device (3400) can determine the motion vector difference of the current block using the motion vector of the current block and the motion vector predictor of the current block (S3550). The video encoding device (3400) can signal the motion vector difference information of the current block to the video decoder (2000) via a bitstream. The video encoding device (3400) can determine the motion vector of the current block and / or the motion vector predictor of the current block based on rate-distortion and signal the motion vector difference based thereon.
[0504] The image encoding device (3400) can generate a prediction block of the current block using the motion vector of the current block (S3560). The image decoding device (2000) can generate a residual block of the current block by adding the prediction block of the current block to the current block of the original image. The image encoding device (3400) can signal the residual block information to the image decoding device (2000) via a bitstream.
[0505] An image encoding method and apparatus (3400) and an image decoding method and apparatus (2000) according to one embodiment have the objective of improving the performance of predictive encoding and predictive decoding for a current block.
[0506] An image encoding method and apparatus (3400) and an image decoding method and apparatus (2000) according to one embodiment have the objective of increasing the accuracy of prediction by considering zero motion vectors during the process of correcting and aligning (realigning) motion vector predictor candidates using template matching.
[0507] The technical problems to be solved by the present disclosure are not limited to those mentioned above, and other unmentioned technical problems will be clearly understood by those skilled in the art to which the present disclosure belongs from the description below.
[0508] A decoding method for an image according to one embodiment may include the step of constructing a list of candidate initial motion vector predictors for the current block using motion vectors of surrounding blocks.
[0509] A decoding method for an image according to one embodiment may include the step of performing correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in an initial motion vector predictor candidate list.
[0510] A decoding method for an image according to one embodiment may include the step of constructing a final list of motion vector predictor candidates by rearranging a plurality of motion vector predictor candidates based on a template matching cost.
[0511] A decoding method for an image according to one embodiment may include the step of determining a motion vector predictor of the current block based on a final motion vector predictor candidate list.
[0512] A decoding method for an image according to one embodiment may include the step of determining the motion vector of the current block by summing the motion vector predictor of the current block and the motion vector difference of the current block.
[0513] A method for decoding an image according to one embodiment may include the step of generating a prediction block of the current block using the motion vector of the current block.
[0514] According to one embodiment, the final motion vector predictor candidate list may include zero motion vectors reordered based on template matching costs.
[0515] A method for decoding an image according to one embodiment may include the step of adding a zero motion vector to an initial motion vector predictor candidate list according to a predefined order.
[0516] A decoding method for an image according to one embodiment may include the step of adding a zero motion vector to an initial motion vector predictor candidate list when the lower-left block and the left block of the current block are not available.
[0517] A method for decoding an image according to one embodiment may include the step of adding a zero motion vector to an initial motion vector predictor candidate list when the upper-right block, upper block, and upper-left block of the current block are not available.
[0518] A decoding method for an image according to one embodiment may include the step of calculating the template matching cost of the motion vector of a temporal neighbor block of at least one current block and the zero motion vector.
[0519] A method for decoding an image according to one embodiment may include the step of adding a motion vector having the smallest template matching cost among the calculated template matching costs to an initial motion vector predictor candidate list.
[0520] According to one embodiment, the predefined order may be defined as one of a first order defined in the order of (spatial adjacent candidate, zero motion vector, temporal candidate, history-based candidate), a second order defined in the order of (spatial adjacent candidate, temporal candidate, zero motion vector, history-based candidate), a third order defined in the order of (spatial adjacent candidate, temporal candidate, spatial non-adjacent candidate, zero motion vector, history-based candidate), a fourth order defined in the order of (spatial adjacent candidate, temporal candidate, history-based candidate, zero motion vector), or a fifth order defined in the order of (spatial adjacent candidate, temporal candidate, spatial non-adjacent candidate, history-based candidate, zero motion vector).
[0521] A decoding method for an image according to one embodiment may include the step of adding a zero motion vector to an initial motion vector predictor candidate list in which correction is performed on at least one motion vector predictor candidate.
[0522] A decoding method for an image according to one embodiment may include the step of obtaining information from a bitstream indicating whether to reorder a zero motion vector.
[0523] An image decoding device according to one embodiment may include at least one memory storing at least one instruction; and at least one processor operating according to at least one instruction.
[0524] In one embodiment, at least one processor can construct a list of candidate initial motion vector predictors for the current block using motion vectors of surrounding blocks.
[0525] In one embodiment, at least one processor can perform correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in an initial motion vector predictor candidate list.
[0526] In one embodiment, at least one processor can construct a final list of motion vector predictor candidates by rearranging a plurality of motion vector predictor candidates based on template matching costs.
[0527] In one embodiment, at least one processor can determine the motion vector predictor of the current block based on the final motion vector predictor candidate list.
[0528] In one embodiment, at least one processor can determine the motion vector of the current block by summing the motion vector predictor of the current block and the motion vector difference of the current block.
[0529] In one embodiment, at least one processor can generate a prediction block of the current block using the motion vector of the current block.
[0530] According to one embodiment, the final motion vector predictor candidate list may include zero motion vectors reordered based on template matching costs.
[0531] In one embodiment, at least one processor may add zero motion vectors to an initial motion vector predictor candidate list in a predefined order.
[0532] In one embodiment, at least one processor may add a zero motion vector to the initial motion vector predictor candidate list when the lower-left block and the left block of the current block are not available.
[0533] In one embodiment, at least one processor may add a zero motion vector to the initial motion vector predictor candidate list when the upper right block, upper block, and upper left block of the current block are not available.
[0534] In one embodiment, at least one processor can calculate the template matching cost of the motion vector of the temporal surrounding block of at least one current block and the zero motion vector.
[0535] In one embodiment, at least one processor may add a motion vector having the smallest template matching cost among the calculated template matching costs to the initial motion vector predictor candidate list.
[0536] According to one embodiment, the predefined order may be defined as one of a first order defined in the order of (spatial adjacent candidate, zero motion vector, temporal candidate, history-based candidate), a second order defined in the order of (spatial adjacent candidate, temporal candidate, zero motion vector, history-based candidate), a third order defined in the order of (spatial adjacent candidate, temporal candidate, spatial non-adjacent candidate, zero motion vector, history-based candidate), a fourth order defined in the order of (spatial adjacent candidate, temporal candidate, history-based candidate, zero motion vector), or a fifth order defined in the order of (spatial adjacent candidate, temporal candidate, spatial non-adjacent candidate, history-based candidate, zero motion vector).
[0537] In one embodiment, at least one processor may add a zero motion vector to an initial motion vector predictor candidate list in which correction has been performed for at least one motion vector predictor candidate.
[0538] In one embodiment, at least one processor can obtain information from a bitstream indicating whether to reorder the zero motion vector.
[0539] An image encoding method according to one embodiment may include the step of constructing a list of initial motion vector predictor candidates for the current block using motion vectors of surrounding blocks.
[0540] An image encoding method according to one embodiment may include the step of performing correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in an initial motion vector predictor candidate list.
[0541] An image encoding method according to one embodiment may include the step of constructing a final motion vector predictor candidate list by rearranging a plurality of motion vector predictor candidates based on a template matching cost.
[0542] An image encoding method according to one embodiment may include the step of determining a motion vector predictor of the current block based on a final motion vector predictor candidate list.
[0543] An image encoding method according to one embodiment may include the step of determining the difference in motion vectors of a current block using a motion vector of a current block and a motion vector predictor of a current block.
[0544] An image encoding method according to one embodiment may include the step of generating a prediction block of the current block using the motion vector of the current block.
[0545] According to one embodiment, the final motion vector predictor candidate list may include zero motion vectors reordered based on template matching costs.
[0546] An image encoding device according to one embodiment may include at least one memory for storing at least one instruction; and at least one processor for operating according to at least one instruction.
[0547] In one embodiment, at least one processor can construct a list of candidate initial motion vector predictors for the current block using motion vectors of surrounding blocks.
[0548] In one embodiment, at least one processor can perform correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in an initial motion vector predictor candidate list.
[0549] In one embodiment, at least one processor can construct a final list of motion vector predictor candidates by rearranging a plurality of motion vector predictor candidates based on template matching costs.
[0550] In one embodiment, at least one processor can determine the motion vector predictor of the current block based on the final motion vector predictor candidate list.
[0551] In one embodiment, at least one processor can determine the difference in the motion vector of the current block using the motion vector of the current block and the motion vector predictor of the current block.
[0552] In one embodiment, at least one processor can generate a prediction block of the current block using the motion vector of the current block.
[0553] According to one embodiment, the final motion vector predictor candidate list may include zero motion vectors reordered based on template matching costs.
[0554] In a computer-readable recording medium that records a bitstream according to one embodiment, the bitstream may include the encoding result of the current block.
[0555] In one embodiment, the encoding result of the current block can be generated by constructing a list of candidate initial motion vector predictors for the current block using the motion vectors of surrounding blocks.
[0556] In one embodiment, the encoding result of the current block can be generated by performing correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in an initial motion vector predictor candidate list.
[0557] In one embodiment, the encoding result of the current block can be generated by constructing a final motion vector predictor candidate list by rearranging a plurality of motion vector predictor candidates based on template matching costs.
[0558] In one embodiment, the encoding result of the current block can be generated by determining the motion vector predictor of the current block based on the final motion vector predictor candidate list.
[0559] In one embodiment, the encoding result of the current block can be generated by determining the difference in the motion vector of the current block using the motion vector of the current block and the motion vector predictor of the current block.
[0560] In one embodiment, the encoding result of the current block can be generated by generating a prediction block of the current block using the motion vector of the current block.
[0561] According to one embodiment, the final motion vector predictor candidate list may include zero motion vectors reordered based on template matching costs.
[0562] An image encoding method and apparatus (3500) and an image decoding method and apparatus (2000) according to one embodiment can improve the performance of predictive encoding and predictive decoding for a current block.
[0563] An image encoding method and apparatus (3500) and an image decoding method and apparatus (2000) according to one embodiment can increase the accuracy of the prediction by considering zero motion vectors during the process of correcting and aligning (realigning) motion vector predictor candidates using template matching.
[0564] The effects obtainable from the present disclosure are not limited to those mentioned above, and other unmentioned effects will be clearly understood by those skilled in the art to which the present disclosure belongs from the description below.
[0565] A device-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory storage medium' simply means that it is a tangible device and does not contain a signal (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently and cases where it is stored temporarily. For example, a 'non-transitory storage medium' may include a buffer in which data is stored temporarily.
[0566] According to one embodiment, the method according to the various embodiments disclosed herein may be provided by being included in a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)), or distributed online (e.g., download or upload) through an application store or directly between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product (e.g., downloadable app) may be temporarily stored or temporarily created on a device-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or a relay server.
Claims
In a method for decoding an image, Step of constructing a list of candidate initial motion vector predictors for the current block using the motion vectors of surrounding blocks (S3410); A step (S3420) of performing correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in the above initial motion vector predictor candidate list; A step (S3430) of constructing a final list of motion vector predictor candidates by rearranging the plurality of motion vector predictor candidates based on template matching costs; Step (S3440) of determining the motion vector predictor of the current block based on the above final motion vector predictor candidate list; A step of determining the motion vector of the current block by summing the motion vector predictor of the current block and the motion vector difference of the current block (S3450); and The method includes the step (S3460) of generating a prediction block of the current block using the motion vector of the current block, wherein A method for decoding an image, wherein the above-mentioned final motion vector predictor candidate list includes zero motion vectors rearranged based on template matching costs. In paragraph 1, The step (S3410) of constructing the above initial motion vector predictor candidate list is, A method for decoding an image, comprising the step of adding a zero motion vector to the initial motion vector predictor candidate list according to a predefined order. In paragraph 2, The step (S3410) of constructing the above initial motion vector predictor candidate list is, A method for decoding an image, comprising the step of adding the zero motion vector to the initial motion vector predictor candidate list when the lower-left block and the left block of the current block are not available. In paragraph 2, The step (S3410) of constructing the above initial motion vector predictor candidate list is, A method for decoding an image, comprising the step of adding the zero motion vector to the initial motion vector predictor candidate list when the upper right block, upper block, and upper left block of the current block are not available. In paragraph 2, The step (S3410) of constructing the above initial motion vector predictor candidate list is, A step of calculating the template matching cost of at least one motion vector of a temporal surrounding block of the current block and the zero motion vector; and A method for decoding an image, comprising the step of adding the motion vector having the smallest template matching cost among the calculated template matching costs to the initial motion vector predictor candidate list. In paragraph 2, A method for decoding an image, wherein the above-mentioned predefined order is defined as one of a first order defined in the order of (spatial adjacent candidate, zero motion vector, temporal candidate, history-based candidate), a second order defined in the order of (spatial adjacent candidate, temporal candidate, zero motion vector, history-based candidate), a third order defined in the order of (spatial adjacent candidate, temporal candidate, spatial non-adjacent candidate, zero motion vector, history-based candidate), a fourth order defined in the order of (spatial adjacent candidate, temporal candidate, history-based candidate, zero motion vector), or a fifth order defined in the order of (spatial adjacent candidate, temporal candidate, spatial non-adjacent candidate, history-based candidate, zero motion vector). In paragraph 1, The step (S3430) of constructing the above final motion vector predictor candidate list is, A method for decoding an image, comprising the step of adding a zero motion vector to an initial motion vector predictor candidate list in which correction is performed on at least one motion vector predictor candidate. In paragraph 1, A method for decoding an image, comprising the step of obtaining information from a bitstream indicating whether to reorder the above-mentioned zero motion vector. In the image decoding device (3500), At least one memory storing at least one instruction; and It includes at least one processor that operates according to the above at least one instruction, and The above-mentioned at least one processor is, Construct a list of candidate predictors for the initial motion vector of the current block using the motion vectors of surrounding blocks, and Correction is performed on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in the above initial motion vector predictor candidate list, and By rearranging the plurality of motion vector predictor candidates based on template matching costs, a final motion vector predictor candidate list is constructed, and Determine the motion vector predictor of the current block based on the above final motion vector predictor candidate list, and The motion vector of the current block is determined by summing the motion vector predictor of the current block and the motion vector difference of the current block, and Generate a prediction block of the current block using the motion vector of the current block, An image decoding device in which the above final motion vector predictor candidate list includes zero motion vectors rearranged based on template matching costs. In the image encoding method, Step of constructing a list of candidate initial motion vector predictors for the current block using the motion vectors of surrounding blocks (S3610); A step (S3620) of performing correction on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in the above initial motion vector predictor candidate list; A step (S3630) of constructing a final list of motion vector predictor candidates by rearranging the plurality of motion vector predictor candidates based on template matching costs; Step (S3640) of determining the motion vector predictor of the current block based on the above final motion vector predictor candidate list; A step of determining the difference in the motion vector of the current block using the motion vector of the current block and the motion vector predictor of the current block (S3650); and The method includes the step (S3660) of generating a prediction block of the current block using the motion vector of the current block, wherein A method for encoding images, wherein the above-mentioned final motion vector predictor candidate list includes zero motion vectors reordered based on template matching costs. In a computer-readable recording medium that records a bitstream, The above bitstream includes the encoding result of the current block, and The encoding result of the current block above is, Construct a list of candidate predictors for the initial motion vector of the current block using the motion vectors of surrounding blocks, and Correction is performed on at least one motion vector predictor candidate among a plurality of motion vector predictor candidates included in the above initial motion vector predictor candidate list, and By rearranging the plurality of motion vector predictor candidates based on template matching costs, a final motion vector predictor candidate list is constructed, and Determine the motion vector predictor of the current block based on the above final motion vector predictor candidate list, and Determining the difference in the motion vector of the current block using the motion vector of the current block and the motion vector predictor of the current block, and It is generated by generating a prediction block of the current block using the motion vector of the current block, and The above final motion vector predictor candidate list includes zero motion vectors reordered based on template matching costs, on a recording medium
Citation Information
Patent Citations
Hologram calculation for compact head-up display
KR1020240055642A
Entrance order device for flood prevention
KR1020250071407A
Apparatus for Reviewing and Inspecting Panel for Rapid Inspection
KR102274053B1
Transfer and Storage Case for Preventing Fire Diffusion of Lithium Batteries
KR102802300B1
KR20210082533A