Device and method for decoding image by using deblocking filtering considering sub-block transformation, and device and method for encoding image

By employing sub-block transformation and deblocking filtering, the method addresses artifacts in image encoding and decoding, improving image quality and efficiency in video processing.

WO2026141951A1PCT designated stage Publication Date: 2026-07-02SAMSUNG ELECTRONICS CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
SAMSUNG ELECTRONICS CO LTD
Filing Date
2025-11-07
Publication Date
2026-07-02

AI Technical Summary

Technical Problem

Existing image encoding and decoding technologies face challenges in effectively addressing artifacts caused by block-based compression, particularly in video encoding and decoding, where inter-prediction and intra-prediction methods do not adequately handle spatial and temporal redundancies, leading to suboptimal image quality.

Method used

The proposed method employs sub-block transformation and deblocking filtering techniques to enhance image encoding and decoding by dividing blocks into sub-blocks, performing inverse transformation, generating restoration blocks, and applying deblocking filters on block boundaries to reduce artifacts.

Benefits of technology

This approach improves image quality by effectively reducing artifacts and enhancing the efficiency of image encoding and decoding processes, particularly in video applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2025018240_02072026_PF_FP_ABST
    Figure KR2025018240_02072026_PF_FP_ABST
Patent Text Reader

Abstract

An image decoding method according to one embodiment may comprise the steps of: generating a prediction block through prediction on the current block; identifying a first sub-block in the current block; performing inverse transformation on a transformation coefficient of the first sub-block so as to acquire residual samples of the first sub-block, sample values of residual sample of parts other than the first sub-block in the current block being determined to be 0; generating a reconstructed block by using the prediction block and the residual sample of the first sub-block; and performing deblocking filtering on a boundary of the first sub-block in the reconstructed block so as to generate a filtered block.
Need to check novelty before this filing date? Find Prior Art

Description

Device and method for decoding an image using deblocking filtering considering sub-block transformation, device and method for encoding an image

[0001] The present disclosure relates to image encoding and decoding technology, and more specifically, to an apparatus and method for encoding and decoding an image using deblocking filtering that considers sub-block transformation.

[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 can be a technique for compressing 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 generated as a result from the current block.

[0004] Intra prediction can be a technique for compressing an image by eliminating spatial redundancy within the image. In intra prediction, a prediction block can be generated based on the surrounding pixels of the current block by considering the intra prediction mode. Additionally, a residual block can be generated by subtracting the prediction block from the current block. The intra prediction mode used to generate the prediction block can be signaled to the decoder side through a predetermined method.

[0005] Residual blocks generated through inter-prediction or intra-prediction can be passed to a decoder after undergoing transformation and quantization.

[0006] The encoder and decoder can reconstruct the current block by combining the prediction block and the residual block of the current block. The encoder and decoder can remove artifacts within the reconstructed block by applying a deblocking filter and / or an adaptive loop filter to the reconstructed current block.

[0007] A method for decoding an image according to one embodiment may include the step of generating a prediction block through a prediction for the current block.

[0008] A method for decoding an image according to one embodiment may include the step of identifying a first sub-block within the current block.

[0009] A decoding method for an image according to one embodiment includes the step of obtaining residual samples of the first sub-block by performing an inverse transformation on the transformation coefficients of the first sub-block, wherein the sample value of the residual samples of the portion of the current block other than the first sub-block may be determined to be 0.

[0010] A decoding method for an image according to one embodiment may include the step of generating a restoration block using residual samples of the prediction block and the first sub-block.

[0011] A method for decoding an image according to one embodiment may include the step of generating a filtered block by performing deblocking filtering on the boundary of a first sub-block within the restoration block.

[0012] An image encoding method according to one embodiment may include the step of generating a prediction block through prediction of the current block.

[0013] An image encoding method according to one embodiment may include the step of obtaining residual samples using the current block and the prediction block.

[0014] A method for encoding an image according to one embodiment may include the step of determining a first sub-block within the current block.

[0015] An image encoding method according to one embodiment may include the step of obtaining a transformation coefficient by performing a transformation on the residual sample of the first sub-block.

[0016] A method for encoding an image according to one embodiment may include the step of generating a bitstream containing information about the transformation coefficients.

[0017] An image encoding method according to one embodiment includes the step of obtaining residual samples of the first sub-block by performing an inverse transformation on the transformation coefficients of the first sub-block, wherein the sample value of the residual samples of the portion of the current block other than the first sub-block may be determined to be 0.

[0018] An image encoding method according to one embodiment may include the step of generating a restoration block using residual samples of the prediction block and the first sub-block.

[0019] An image encoding method according to one embodiment may include the step of generating a filtered block by performing deblocking filtering on the boundary of a first sub-block within the restoration block.

[0020] An image decoding device according to one embodiment may include a prediction unit that generates a prediction block through a prediction of the current block.

[0021] An image decoding device according to one embodiment may include an inverse transformation unit that identifies a first sub-block within the current block and performs an inverse transformation on the transformation coefficients of the first sub-block to obtain residual samples of the first sub-block.

[0022] An image decoding device according to one embodiment may include a restoration unit that generates a restoration block using residual samples of the prediction block and the first sub-block.

[0023] An image decoding device according to one embodiment may include a filter unit that generates a filtered block by performing deblocking filtering on the boundary of the first sub-block within the restoration block.

[0024] In one embodiment, the sample value of the residual sample of the portion of the current block other than the first sub-block may be determined to be 0.

[0025] An image encoding device according to one embodiment may include a prediction unit that generates a prediction block through a prediction of the current block.

[0026] An image encoding device according to one embodiment may include a conversion unit that obtains residual samples using the current block and the prediction block, determines a first sub-block within the current block, and obtains conversion coefficients by performing a conversion on the residual samples of the first sub-block.

[0027] An image encoding device according to one embodiment may include a generating unit that generates a bitstream including information about the conversion coefficients.

[0028] An image encoding device according to one embodiment may include an inverse transform unit that performs an inverse transform on the transform coefficients of the first sub-block to obtain residual samples of the first sub-block.

[0029] An image encoding device according to one embodiment may include a restoration unit that generates a restoration block using residual sample values ​​of the prediction block and the first sub-block.

[0030] An image encoding device according to one embodiment may include a filter unit that generates a filtered block by performing deblocking filtering on the boundary of a first sub-block within the restoration block.

[0031] In one embodiment, the sample value of the residual sample of the portion of the current block other than the first sub-block may be determined to be 0.

[0032] FIG. 1 is a block diagram of an image decoding device according to one embodiment.

[0033] FIG. 2 is a block diagram of an image encoding device according to one embodiment.

[0034] FIG. 3 illustrates a process of determining at least one encoding unit by dividing the current encoding unit according to one embodiment.

[0035] 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.

[0036] 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.

[0037] FIG. 6 illustrates a method for determining a predetermined encoding unit among an odd number of encoding units according to one embodiment.

[0038] 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.

[0039] 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.

[0040] FIG. 9 illustrates a process of determining at least one encoding unit by dividing a first encoding unit according to one embodiment.

[0041] 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.

[0042] 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.

[0043] 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.

[0044] 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.

[0045] 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.

[0046] 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.

[0047] 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.

[0048] 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.

[0049] 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.

[0050] FIG. 19 is a block diagram of an image encoding and decoding system according to one embodiment.

[0051] FIG. 20 is a block diagram illustrating the configuration of an image decoding device according to one embodiment.

[0052] FIG. 21 is a drawing illustrating conversion units divided in the current block according to one embodiment.

[0053] FIG. 22 is a diagram illustrating a method for performing deblocking filtering on the boundary between conversion units according to one embodiment.

[0054] FIG. 23 is a diagram illustrating the form of division from the current block to the sub-block when a sub-block conversion mode is applied to the current block according to one embodiment.

[0055] FIG. 24 is a diagram illustrating the form of division from the current block to the sub-block when a sub-block conversion mode is applied to the current block according to one embodiment.

[0056] FIG. 25 is a diagram illustrating the form of division from the current block to the sub-block when a sub-block conversion mode is applied to the current block according to one embodiment.

[0057] FIG. 26 is a diagram showing the boundaries of sub-blocks divided from the current block according to one embodiment that are subject to deblocking filtering.

[0058] FIG. 27 is a diagram showing the boundaries of sub-blocks divided from the current block according to one embodiment that are subject to deblocking filtering.

[0059] FIG. 28 is a diagram showing the boundaries of sub-blocks divided from the current block according to one embodiment that are subject to deblocking filtering.

[0060] FIG. 29 is a diagram illustrating an adaptive sub-block conversion mode according to one embodiment.

[0061] FIG. 30 is a diagram illustrating a method for determining the location of a first sub-block within a current block in an adaptive sub-block conversion mode according to one embodiment.

[0062] FIG. 31 is a drawing illustrating adjacent candidate blocks used to determine the location of a first sub-block according to one embodiment.

[0063] FIG. 32 is a diagram showing that deblocking filtering is applied to the boundary of a first sub-block within a current block in an adaptive sub-block conversion mode according to one embodiment.

[0064] FIG. 33 is a diagram showing boundaries to which deblocking filtering is applied among boundaries related to the maximum encoding unit according to one embodiment.

[0065] FIG. 34 is a flowchart of an image decoding method according to one embodiment.

[0066] FIG. 35 is a diagram illustrating the configuration of an image encoding device according to one embodiment.

[0067] FIG. 36 is a flowchart of an image encoding method according to one embodiment.

[0068] A method for decoding an image according to one embodiment may include the step of generating a prediction block through a prediction for the current block.

[0069] A method for decoding an image according to one embodiment may include the step of identifying a first sub-block within the current block.

[0070] A decoding method for an image according to one embodiment includes the step of obtaining residual samples of the first sub-block by performing an inverse transformation on the transformation coefficients of the first sub-block, wherein the sample value of the residual samples of the portion of the current block other than the first sub-block may be determined to be 0.

[0071] A decoding method for an image according to one embodiment may include the step of generating a restoration block using residual samples of the prediction block and the first sub-block.

[0072] A method for decoding an image according to one embodiment may include the step of generating a filtered block by performing deblocking filtering on the boundary of a first sub-block within the restoration block.

[0073] 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.

[0074] 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.

[0075] 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.

[0076] 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.

[0077] 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 performed by other components.

[0078] 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.

[0079] 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.

[0080] 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.

[0081] FIG. 1 illustrates a block diagram of an image decoding device (100) according to one embodiment.

[0082] 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.

[0083] 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.

[0084] To explain in detail the operation of the video decoding device (100), the bitstream acquisition unit (110) can receive a bitstream.

[0085] 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.

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

[0087] 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.

[0088] 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.

[0089] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), the maximum encoding unit (CTU) is a unit comprising a maximum encoding block for luminance samples and two corresponding maximum encoding blocks for chroma samples, and 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 comprising a maximum encoding block for monochrome samples and syntax structures used to encode the monochrome samples. When a picture is encoded in color planes separated by color components, the maximum encoding unit is a unit comprising the picture and syntax structures used to encode the samples of the picture.

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

[0091] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) is a unit comprising 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 comprising 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 comprising the picture and syntax structures used to encode the samples of the picture.

[0092] 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.

[0093] 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.

[0094] 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.

[0095] 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.

[0096] 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.

[0097] 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.

[0098] For example, information indicating whether quad splitting is performed can indicate whether the current encoding unit will be quad split or not.

[0099] 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.

[0100] 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.

[0101] 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.

[0102] 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).

[0103] 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.

[0104] 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.

[0105] 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.

[0106] The shape and size of the transformation block and the prediction block may not be related to each other.

[0107] 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.

[0108] 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 the maximum encoding unit, the encoding unit, the prediction block, and the 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.

[0109] 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.

[0110] 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.

[0111] 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.

[0112] 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.

[0113] 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.

[0114] 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.

[0115] 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., according to 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) according to 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.

[0116] 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.

[0117] 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.

[0118] 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.

[0119] 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.

[0120] 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).

[0121] 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).

[0122] 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.

[0123] 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.

[0124] 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.

[0125] 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.

[0126] 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.

[0127] 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 split-form mode information, and the image decoding device (100) can obtain a plurality of second encoding units (e.g., 510) of various forms by dividing the first encoding unit (500) based on the obtained split-form mode information, and the second encoding unit (510) can be divided according to the method in which the first encoding unit (500) was divided based on the split-form mode information. According to one embodiment, when the first encoding unit (500) is divided into the second encoding unit (510) based on the split-form mode information for the first encoding unit (500), the second encoding unit (510) can also be divided into third encoding units (e.g., 520a, 520b, 520c, 520d, etc.) based on the split-form 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.

[0128] 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 (520b) 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.

[0129] 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.

[0130] 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).

[0131] 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.

[0132] 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.

[0133] 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.

[0134] 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.

[0135] 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.

[0136] 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).

[0137] 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.

[0138] 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.

[0139] 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).

[0140] 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.

[0141] 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).

[0142] 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.

[0143] 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.

[0144] 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.

[0145] 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.

[0146] 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.

[0147] 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.

[0148] 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 limit.

[0149] 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.

[0150] 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.

[0151] 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).

[0152] 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.

[0153] 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.

[0154] 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.).

[0155] 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).

[0156] 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.

[0157] 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.

[0158] 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.

[0159] 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).

[0160] 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.

[0161] 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.

[0162] 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.

[0163] 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.

[0164] 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.

[0165] According to one embodiment, the image decoding device (100) can divide the first encoding unit to determine various forms of encoding units.

[0166] 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.

[0167] 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.

[0168] 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.

[0169] 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.

[0170] 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.

[0171] 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.).

[0172] 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.

[0173] 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).

[0174] 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).

[0175] 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.

[0176] 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.

[0177] 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.

[0178] 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.

[0179] 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.

[0180] 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.

[0181] 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.

[0182] 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.

[0183] 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.

[0184] 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.

[0185] 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.

[0186] 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.

[0187] 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.

[0188] 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.

[0189] 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.

[0190] 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).

[0191] 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.

[0192] 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.

[0193] 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).

[0194] 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).

[0195] 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.

[0196] 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).

[0197] Furthermore, the image decoding device (100) may divide a first encoding unit (1410) in a non-square shape 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 a second encoding unit (1414a, 1414c) in a non-square shape and a second encoding unit (1414b) in a square shape. 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).

[0198] 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.

[0199] 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).

[0200] 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.

[0201] According to one embodiment, the image decoding device (100) may use a predetermined data unit in which recursive division of the encoding unit begins.

[0202] 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.

[0203] 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.

[0204] 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.

[0205] 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.

[0206] 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.

[0207] 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.

[0208] 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.

[0209] 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.

[0210] 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.

[0211] 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.

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

[0213] 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.

[0214] 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).

[0215] The shape of the encoding unit may include square and non-square. When 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, when 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.

[0216] 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.

[0217] 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.

[0218] 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.

[0219] 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.

[0220] 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.

[0221] 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.

[0222] 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.

[0223] 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.

[0224] 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.

[0225] 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.

[0226] 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.

[0227] 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.

[0228] 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.

[0229] 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.

[0230] 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.

[0231] 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.

[0232] 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.

[0233] 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).

[0234] 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.

[0235] 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.

[0236] 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.

[0237] 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.

[0238] 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.

[0239] 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.

[0240] 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).

[0241] FIG. 19 is a block diagram of an image encoding and decoding system according to one embodiment.

[0242] 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).

[0243] 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).

[0244] 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).

[0245] 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).

[0246] 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.

[0247] 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.

[0248] 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.

[0249] 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).

[0250] 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.

[0251] 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.

[0252] 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.

[0253] 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.

[0254] 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.

[0255] 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.

[0256] 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.

[0257] 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.

[0258] 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.

[0259] FIG. 20 is a block diagram illustrating the configuration of an image decoding device (2000) according to one embodiment.

[0260] Referring to FIG. 20, the image decoding device (2000) may include a prediction unit (2010), an inverse transformation unit (2030), a restoration unit (2050), and a filter unit (2070).

[0261] The prediction unit (2010), the inverse transformation unit (2030), the restoration unit (2050), and the filter unit (2070) may be implemented with at least one processor. At least one processor may include processing circuitry.

[0262] The prediction unit (2010), inverse transformation unit (2030), restoration unit (2050), and filter unit (2070) can operate according to at least one instruction stored in at least one memory.

[0263] In one embodiment, the image decoding device (2000) may be an electronic device comprising at least one processor and at least one memory. The at least one processor of the electronic device may perform image decoding according to instructions stored in at least one memory.

[0264] In one embodiment, the prediction unit (2010) and the inverse transformation unit (2030) may correspond to the prediction decoding unit (1975) and the inverse quantization and inverse transformation unit (1960) shown in FIG. 19, respectively. In one embodiment, the restoration unit (2050) may correspond to an adder that combines the output of the prediction decoding unit (1975) shown in FIG. 19 and the output of the inverse quantization and inverse transformation unit (1960), and the filter unit (2070) may correspond to the deblocking filtering unit (1965) shown in FIG. 19.

[0265] In one embodiment, the image decoding device (2000) may further include an acquisition unit that acquires a bitstream generated as a result of encoding a picture. The acquisition unit may correspond to the entropy decoding unit (1955) shown in FIG. 19.

[0266] The bitstream may contain the encoding result for the current block contained in the current picture.

[0267] In the present disclosure, the current block may be a maximum encoding unit, encoding unit, or conversion unit divided from the current picture to be decoded. In one embodiment, one or more sub-blocks may be determined within the current block. The sub-blocks determined within the current block may correspond to conversion units.

[0268] A maximum encoding unit, encoding unit, or conversion unit containing one or more sub-blocks may be referred to as a parent block.

[0269] In one embodiment, the bitstream may be transmitted via a network from a video encoding device to a video decoding device (2000). In one embodiment, the bitstream may be obtained from a data storage medium including a magnetic medium (e.g., a hard disk, a floppy disk, or a magnetic tape), an optical recording medium (e.g., a CD-ROM or a DVD), and a magneto-optical medium (e.g., a floptical disk).

[0270] The acquisition unit can acquire syntax elements for decoding a picture from the bitstream. Values ​​corresponding to the syntax elements can be included in the bitstream according to the syntax structure.

[0271] The acquisition unit can acquire syntax elements by entropy decoding the bins constituting the bitstream.

[0272] The prediction unit (2010) can predict the current block according to the prediction mode and generate a prediction block corresponding to the current block. The prediction block may include prediction samples corresponding to samples within the current block.

[0273] In one embodiment, the prediction mode of the current block may be selected from several modes including an intra prediction mode, an inter prediction mode, a CIIP (combined intra / inter prediction) mode, an IBC (Intra Block Copy) mode, a GPM (Geometric Partitioning Mode) intra mode, etc.

[0274] In one embodiment, the prediction unit (2010) can determine the prediction mode of the current block from information indicating the prediction mode of the current block obtained from the bitstream, and generate a prediction block of the current block according to the determined prediction mode.

[0275] In one embodiment, information for generating a prediction block of the current block, for example, information indicating the prediction mode of the current block, information indicating movement information of the current block and / or information indicating the intra mode of the current block, etc., may be included in the bitstream.

[0276] In one embodiment, the prediction unit (2010) may directly determine the prediction mode of the current block according to a predetermined standard and generate a prediction block of the current block according to the determined prediction mode.

[0277] The inverse transformation unit (2030) can inversely transform the transformation coefficients of the current block obtained from the bitstream to obtain residual samples for the current block.

[0278] In one embodiment, inverse quantization may be applied to the transform coefficients before the inverse transform. Residual samples of the current block can be obtained by applying inverse quantization and inverse transform to the quantized transform coefficients of the current block.

[0279] In one embodiment, the inverse conversion unit (2030) determines at least one conversion unit within the current block and can perform an inverse conversion for each of the at least one conversion unit.

[0280] As described below, if non-zero transformation coefficients exist only in the first sub-block determined within the current block, the inverse transformation unit (2030) can inversely transform the transformation coefficients of the first sub-block to obtain residual samples of the first sub-block.

[0281] A mode that applies transformation / inverse transformation only to the first sub-block included in the current block may be referred to as a Sub-Block Transform mode. When the Sub-Block Transform mode is applied to the current block, transformation / inverse transformation may not be applied to parts of the current block other than the first sub-block.

[0282] When the sub-block transformation mode is applied to the current block, the transformation coefficients of the parts of the current block other than the first sub-block can be determined or inferred to be 0, and accordingly, the residual sample values ​​of the parts of the current block other than the first sub-block can also all be determined to be 0.

[0283] The restoration unit (2050) can generate a reconstructed block by combining the prediction block generated by the prediction unit (2010) and the residual samples generated by the inverse transformation unit (2030).

[0284] In one embodiment, the restoration unit (2050) can generate a restoration block containing reconstructed samples by combining the prediction samples and residual samples included in the prediction block.

[0285] The filter unit (2070) can filter the restoration block to generate a filtered block. In one embodiment, deblocking filtering may be applied to the restoration block.

[0286] The filter unit (2070) can reduce block artifacts of the restored block by performing deblocking filtering on boundaries related to the restored block.

[0287] The filtered block can be output for playback. In one embodiment, the filtered block can be used as a reference block for the next block to predict the next block.

[0288] Below, deblocking filtering is briefly explained.

[0289] FIG. 21 is a drawing illustrating conversion units divided in the current block according to one embodiment.

[0290] In one embodiment, when transformation units are determined within the current block (2100), the filter unit (2070) may perform deblocking filtering on the boundaries of the transformation units. Deblocking filtering on the boundaries of the transformation units may be performed after the current block (2100) is restored.

[0291] In one embodiment, performing deblocking filtering on the boundaries of the transformation units may mean filtering samples adjacent to the boundaries of the transformation units with a filter of a predetermined length.

[0292] Unless explicitly stated otherwise below, the boundaries of a block may refer to the left boundary and the top boundary among the left boundary, the right boundary, the top boundary, and the bottom boundary of the block. The left boundary of the block may be referred to as the vertical boundary of the block, and the top boundary of the block may be referred to as the horizontal boundary of the block.

[0293] In one embodiment, deblocking filtering may be performed first on the vertical boundaries within the current block (2100), and then on the horizontal boundaries within the current block (2100).

[0294] Referring to FIG. 21, when four transformation units, namely TU0, TU1, TU2, and TU3, are determined from the current block (2100), the filter unit (2070) can identify the boundaries of TU0, TU1, TU2, and TU3 and determine the boundary strength and / or filter length for the identified boundaries.

[0295] In one embodiment, the boundary strength and / or filter length may be determined based on at least one of the type of block adjacent to the boundary or the size of the transformation units adjacent to the boundary. For example, if one boundary corresponds to the boundary of the transformation units, the boundary strength may be determined to be 3, and the filter length may be adaptively determined based on the size of the transformation units adjacent to one boundary.

[0296] The filter section (2070) can determine the boundary strength and / or filter length for each of the vertical boundary (2112) of TU0, the vertical boundary (2132) of TU1, the vertical boundary (2152) of TU2, the vertical boundary (2172) of TU3, the horizontal boundary (2114) of TU0, the horizontal boundary (2134) of TU1, the horizontal boundary (2154) of TU2, and the horizontal boundary (2174) of TU3.

[0297] In one embodiment, when the boundary strength and / or filter length for the boundaries of the transformation units within the current block (2100) is determined, the filter unit (2070) may update the boundary strength and / or filter length for each block of a predetermined size adjacent to each of the boundaries of the transformation units within the current block (2100). This will be explained with reference to FIG. 22.

[0298] FIG. 22 is a diagram illustrating a method for performing deblocking filtering on the boundary between conversion units according to one embodiment.

[0299] Referring to the left side of FIG. 22, the boundary strength and / or filter length can be determined for the P blocks in TU0 and the Q blocks in TU1 adjacent to the vertical boundary (or left boundary) (2132) of TU1. Referring to the right side of FIG. 22, the boundary strength and / or filter length can be determined for the P blocks in TU0 and the Q blocks in TU2 adjacent to the horizontal boundary (or upper boundary) (2154) of TU2.

[0300] In one embodiment, the size of the P block and the Q block may be 4 x 4, but the size of the P block and the Q block is not limited thereto.

[0301] In one embodiment, for a pair of any one P block and any one Q block, the filter unit (2070) may determine a boundary strength and / or a filter length based on at least one of a prediction mode applied to each of the P block and the Q block, a sample value included in the P block and the Q block, or a cbf (coded block flag) of a transformation unit including the P block and the Q block. For example, the filter unit (2070) may determine a boundary strength of 2 if the prediction mode applied to the P block or the prediction mode applied to the Q block is a CIIP mode.

[0302] cbf is a flag indicating whether the conversion unit contains non-zero conversion factors. For example, if cbf is 0, it indicates that all conversion factors of the conversion unit are 0, and if cbf is 1, it indicates that the conversion unit contains non-zero conversion factors.

[0303] When the boundary strength and / or filter length are determined for the P blocks and Q blocks adjacent to the vertical boundary (2132) of TU1, the filter unit (2070) can filter samples adjacent to the vertical boundary (2132) of TU1 based on the determined boundary strength and / or filter length. Additionally, when the boundary strength and / or filter length are determined for the P blocks and Q blocks adjacent to the horizontal boundary (2154) of TU2, the filter unit (2070) can filter samples adjacent to the horizontal boundary (2154) of TU2 based on the determined boundary strength and / or filter length.

[0304] In one embodiment, if the boundary strength is determined to be 0 for any pair of P blocks and Q blocks, deblocking filtering for the pair of P blocks and Q blocks may be skipped. For example, if the cbf of the transformation units including P blocks and Q blocks are all 0, the boundary strength may be determined to be 0.

[0305] The process of determining boundary strength and / or filter length by considering various conditions to filter samples adjacent to the boundary is defined in the HEVC (High Efficiency Video Coding) standard and VVC (Versatile Video Coding) standard, etc., so a detailed description is omitted in this specification.

[0306] On the other hand, if the transformation units adjacent to a specific boundary all contain transformation coefficients of zero, it may not be necessary to apply deblocking filtering to that boundary. This is because if the transformation coefficients of the transformation units are all zero, block artifacts may not occur between the transformation units. However, in HEVC standards and / or VVC standards, deblocking filtering may be performed on the boundary depending on the prediction mode applied to the transformation units, even if the cbf of the transformation units adjacent to a specific boundary is all zero.

[0307] In the aforementioned sub-block conversion mode, since the conversion coefficients (or residual sample values) of parts other than the first sub-block in the current block are all determined to be 0, unnecessary deblocking filtering may occur under the sub-block conversion mode, which can be a factor that increases the complexity of operations during the encoding / decoding process.

[0308] The sub-block conversion mode will be described below with reference to FIGS. 23 to 25.

[0309] In the description of FIGS. 23 to 25 below, ‘first’, ‘second’, etc. attached to ‘current block’ are used to distinguish current blocks including first sub-blocks at different locations or different shapes.

[0310] FIG. 23 is a diagram illustrating the form of division from the current block to the sub-block when a sub-block conversion mode is applied to the current block according to one embodiment.

[0311] In one embodiment, information indicating whether a sub-block conversion mode is applied to the current block may be obtained from a bitstream. The information indicating whether a sub-block conversion mode is applied to the current block may include a flag.

[0312] When a sub-block conversion mode is applied to the current block, the acquisition unit can obtain information indicating the size and shape of the sub-block from the bitstream.

[0313] In one embodiment, the acquisition unit may acquire at least one of first information indicating the size of a sub-block, second information indicating the direction (or shape) of a sub-block, or third information indicating the location of a first sub-block from a bitstream.

[0314] The inverse conversion unit (2030) can determine the first sub-block within the current block using at least one of the first information, the second information, or the third information.

[0315] In the present disclosure, a first sub-block may refer to a conversion unit including a conversion factor (or a non-zero conversion factor), and a second sub-block may refer to a conversion unit in which all conversion factors are zero. A conversion / inverse conversion may be applied to the first sub-block, and a conversion / inverse conversion may not be applied to the second sub-block. In one embodiment, the first sub-block may be defined as a conversion unit to which a conversion / inverse conversion is applied, and the second sub-block may be defined as a conversion unit to which a conversion / inverse conversion is not applied.

[0316] In one embodiment, the first information may include cu_sbt_quad_flag, the second information may include cu_sbt_horizontal, and the third information may include cu_sbt_pos_flag.

[0317] In FIG. 23, cu_sbt_quad_flag indicates whether the size of the sub-block is 1 / 4 or 1 / 2 of the current block, and cu_sbt_horizontal indicates whether the orientation of the sub-block is horizontal or vertical. Additionally, cu_sbt_pos_flag may indicate which of the sub-blocks within the current block is the first sub-block.

[0318] In one example, if cu_sbt_quad_flag of the first current block (2310) is 0, cu_sbt_horizontal is 1, and cu_sbt_pos_flag is 0, the inverse transformation unit (2030) may divide the first current block (2310) into two horizontal directions to determine TU0 and TU1 in the horizontal direction, determine TU0 among TU0 and TU1 as the first sub-block, and determine TU1 as the second sub-block. The height of TU0 and TU1 determined in the first current block (2310) is half the height of the first current block (2310), and the width of TU0 and TU1 may be the same as the width of the first current block (2310).

[0319] In one example, if cu_sbt_quad_flag of the second current block (2330) is 0, cu_sbt_horizontal is 1, and cu_sbt_pos_flag is 1, the inverse transformation unit (2030) may divide the second current block (2330) into two horizontal directions to determine TU0 and TU1 in the horizontal direction, determine TU1 among TU0 and TU1 as the first sub-block, and determine TU0 as the second sub-block. The height of TU0 and TU1 determined in the second current block (2330) is 1 / 2 of the height of the second current block (2330), and the width of TU0 and TU1 may be the same as the width of the second current block (2330).

[0320] In one example, if cu_sbt_quad_flag of the third current block (2350) is 0, cu_sbt_horizontal is 0, and cu_sbt_pos_flag is 0, the inverse transformation unit (2030) may divide the third current block (2350) into two in the vertical direction to determine TU0 and TU1 in the vertical direction, determine TU0 as the first sub-block among TU0 and TU1, and determine TU1 as the second sub-block. The height of TU0 and TU1 determined in the third current block (2350) is the same as the height of the third current block (2350), and the width of TU0 and TU1 may be half the width of the third current block (2350).

[0321] In one example, if cu_sbt_quad_flag of the fourth current block (2370) is 0, cu_sbt_horizontal is 0, and cu_sbt_pos_flag is 1, the inverse transformation unit (2030) can divide the fourth current block (2370) into two in the vertical direction to determine TU0 and TU1 in the vertical direction, determine TU1 among TU0 and TU1 as the first sub-block, and determine TU0 as the second sub-block. The height of TU0 and TU1 determined in the fourth current block (2370) is the same as the height of the fourth current block (2370), and the width of TU0 and TU1 may be half the width of the fourth current block (2370).

[0322] In one example, if cu_sbt_quad_flag of the 5th current block (2320) is 1, cu_sbt_horizontal is 1, and cu_sbt_pos_flag is 0, the inverse transformation unit (2030) can divide the 5th current block (2320) into four horizontal directions to determine TU0, TU1, TU2, and TU3 in the horizontal direction. Then, the inverse transformation unit (2030) can determine TU0 among TU0, TU1, TU2, and TU3 as the first sub-block, and determine TU1, TU2, and TU3 as the second sub-block. The height of TU0, TU1, TU2, and TU3 determined in the 5th current block (2320) is 1 / 4 of the height of the 5th current block (2320), and the width of TU0, TU1, TU2, and TU3 may be the same as the width of the 5th current block (2320).

[0323] In one example, if cu_sbt_quad_flag of the 6th current block (2340) is 1, cu_sbt_horizontal is 1, and cu_sbt_pos_flag is 1, the inverse transformation unit (2030) can divide the 6th current block (2340) into four horizontal directions to determine TU0, TU1, TU2, and TU3 in the horizontal direction. Then, the inverse transformation unit (2030) can determine TU3 among TU0, TU1, TU2, and TU3 as the first sub-block, and determine TU0, TU1, and TU2 as the second sub-block. The height of TU0, TU1, TU2, and TU3 determined in the 6th current block (2340) is 1 / 4 of the height of the 6th current block (2340), and the width of TU0, TU1, TU2, and TU3 may be the same as the width of the 6th current block (2340).

[0324] In one example, if cu_sbt_quad_flag of the 7th current block (2360) is 1, cu_sbt_horizontal is 0, and cu_sbt_pos_flag is 0, the inverse transformation unit (2030) can divide the 7th current block (2360) into four vertical directions to determine TU0, TU1, TU2, and TU3 in the vertical direction. Then, the inverse transformation unit (2030) can determine TU0 among TU0, TU1, TU2, and TU3 as the first sub-block, and determine TU1, TU2, and TU3 as the second sub-block. The heights of TU0, TU1, TU2, and TU3 determined in the 7th current block (2360) are the same as the height of the 7th current block (2360), and the widths of TU0, TU1, TU2, and TU3 may be 1 / 4 of the width of the 7th current block (2360).

[0325] In one example, if cu_sbt_quad_flag of the 8th current block (2380) is 1, cu_sbt_horizontal is 0, and cu_sbt_pos_flag is 1, the inverse transformation unit (2030) can divide the 8th current block (2380) into four vertical directions to determine TU0, TU1, TU2, and TU3 in the vertical direction. Then, the inverse transformation unit (2030) can determine TU3 among TU0, TU1, TU2, and TU3 as the first sub-block, and determine TU0, TU1, and TU2 as the second sub-block. The heights of TU0, TU1, TU2, and TU3 determined in the 8th current block (2380) are the same as the height of the 8th current block (2380), and the widths of TU0, TU1, TU2, and TU3 may be 1 / 4 of the width of the 8th current block (2380).

[0326] In one embodiment, since the first sub-block includes a transformation coefficient that is the target of the inverse transformation, the cbf of the first sub-block may be 1. Since all transformation coefficients of the second sub-block are determined to be 0, the cbf of the second sub-block may be 0.

[0327] The inverse transformation unit (2030) can perform inverse transformation only on the first sub-block within the current block, and the restoration unit (2050) can generate a restoration block by combining the prediction block of the current block and the residual sample of the first sub-block.

[0328] The process of determining a first sub-block and one or more second sub-blocks within the current block by considering cu_sbt_quad_flag, cu_sbt_horizontal and cu_sbt_pos_flag is one example, and the process of determining a first sub-block and one or more second sub-blocks can be varied. For example, the inverse transformation unit (2030) may determine a first sub-block in the current block based on one or more flags and / or one or more indices indicating the size, shape and location of the first sub-block.

[0329] FIG. 24 is a diagram illustrating the form of division from the current block to the sub-block when a sub-block conversion mode is applied to the current block according to one embodiment.

[0330] In one embodiment, when a sub-block conversion mode is applied to the current block, the inverse conversion unit (2030) can obtain four sub-blocks by dividing the width and height of the current block into 1 / 2 each, based on information indicating the size of the sub-block or information indicating the shape of the sub-block. Accordingly, as shown in FIG. 24, TU0, TU1, TU2, and TU3 having a size of 1 / 4 of the current block can be determined.

[0331] In one example, the inverse converter (2030) may determine TU0 in the first current block (2410) as the first sub-block and determine TU1, TU2, and TU3 as the second sub-block based on information indicating the location of the first sub-block obtained from the bitstream.

[0332] In one example, the inverse conversion unit (2030) may determine TU1 in the second current block (2430) as the first sub-block and determine TU0, TU2, and TU3 as the second sub-block based on information indicating the location of the first sub-block.

[0333] In one example, the inverse conversion unit (2030) may determine TU2 in the third current block (2450) as the first sub-block and determine TU0, TU1, and TU3 as the second sub-block based on information indicating the location of the first sub-block.

[0334] In one example, the inverse conversion unit (2030) may determine TU3 in the fourth current block (2470) as the first sub-block and determine TU0, TU1, and TU2 as the second sub-block based on information indicating the location of the first sub-block.

[0335] FIG. 25 is a diagram illustrating the form of division from the current block to the sub-block when a sub-block conversion mode is applied to the current block according to one embodiment.

[0336] In one embodiment, when a sub-block conversion mode is applied to the current block, the inverse conversion unit (2030) can obtain 16 sub-blocks by dividing the width and height of the current block into 1 / 4 each, based on information indicating the size of the sub-block or information indicating the shape of the sub-block. Accordingly, as shown in FIG. 25, TU0 to TU15 having a size of 1 / 16 of the current block can be determined.

[0337] In one example, the inverse conversion unit (2030) may determine TU0 in the first current block (2510) as the first sub-block and determine TU2 to TU15 as the second sub-block based on information indicating the location of the first sub-block obtained from the bit stream.

[0338] Alternatively, in one example, the inverse conversion unit (2030) may determine TU3 in the second current block (2530) as the first sub-block based on information indicating the location of the first sub-block, and determine TU0 to TU2 and TU4 to TU15 as the second sub-block.

[0339] Alternatively, in one example, the inverse conversion unit (2030) may determine TU12 in the third current block (2550) as the first sub-block based on information indicating the location of the first sub-block, and determine TU0 to TU11 and TU13 to TU15 as the second sub-block.

[0340] Alternatively, in one example, the inverse conversion unit (2030) may determine TU15 in the fourth current block (2570) as the first sub-block and determine TU0 to TU14 as the second sub-block based on information indicating the location of the first sub-block.

[0341] The size, shape, and position of the sub-blocks shown in FIGS. 23 to 25 are examples, and sub-blocks of various sizes and shapes can be determined within the current block according to information obtained from the bitstream.

[0342] As mentioned above, the first sub-block contains transformation coefficients that are subject to inverse transformation, whereas the second sub-block does not contain transformation coefficients that are subject to inverse transformation, so applying deblocking filtering to the boundary of the second sub-block may be an unnecessary process.

[0343] Accordingly, the filter unit (2070) can distinguish the boundaries of the sub-blocks within the current block into boundaries that are subject to deblocking filtering and boundaries that are not subject to deblocking filtering by considering the location of the first sub-block and the location of the second sub-block within the current block.

[0344] In one embodiment, the filter unit (2070) may determine that the boundary of the first sub-block included in the current block is subject to deblocking filtering, and that the boundary of the second sub-block included in the current block is not subject to deblocking filtering. However, if the second sub-block is adjacent to the current block or the first sub-block, the filter unit (2070) may determine that the boundary of the second sub-block is subject to deblocking filtering.

[0345] In one embodiment, if the current sub-block is a first sub-block or a second sub-block and the boundary of the current sub-block is determined to be a target for deblocking filtering, the filter unit (2070) can determine a boundary strength and / or filter length for the boundary of the current sub-block. Then, the filter unit (2070) can filter samples adjacent to the boundary of the current sub-block according to the boundary strength and / or filter length.

[0346] In one embodiment, if it is determined that the boundary of the current sub-block is not subject to deblocking filtering, the filter unit (2070) may skip deblocking filtering for the boundary of the current sub-block without determining the boundary strength and / or filter length for the boundary of the current sub-block.

[0347] The criteria for determining whether the current sub-block boundary is subject to deblocking filtering may be as follows.

[0348] 1) If the current sub-block is the first sub-block, the boundary of the current sub-block is determined to be the target of deblocking filtering.

[0349] 2) If the current sub-block is the second sub-block and the boundary of the current sub-block corresponds to the boundary of the current block, the boundary of the current sub-block is determined to be the target of deblocking filtering.

[0350] 3) If the current sub-block is the second sub-block and the first sub-block is adjacent to the boundary of the current sub-block, the boundary of the current sub-block is determined to be the target of deblocking filtering.

[0351] 4) If the current sub-block is a second sub-block and another second sub-block is adjacent to the boundary of the current sub-block, the boundary of the current sub-block is determined not to be subject to deblocking filtering.

[0352] Since the boundaries of a sub-block may include the left boundary and the top boundary, the above four criteria can be explained in more detail as follows.

[0353] 1) If the current sub-block is the first sub-block, the left boundary and the top boundary of the current sub-block are determined to be targets for deblocking filtering.

[0354] 2) The current sub-block is the second sub-block, and the boundary corresponding to the boundary of the current block among the left boundary and the top boundary of the current sub-block is determined to be the target of deblocking filtering.

[0355] 3) The current sub-block is the second sub-block, and the left boundary and upper boundary of the current sub-block adjacent to the first sub-block are determined to be targets for deblocking filtering.

[0356] 4) The current sub-block is the second sub-block, and among the left and upper boundaries of the current sub-block, the boundary adjacent to the second sub-block is determined not to be subject to deblocking filtering.

[0357] In one embodiment, the filter unit (2070) can determine whether each of the vertical boundaries of the sub-blocks within the current block is subject to deblocking filtering, and then determine whether each of the horizontal boundaries of the sub-blocks within the current block is subject to deblocking filtering.

[0358] In one embodiment, the filter unit (2070) may determine whether the boundary of the current sub-block is subject to deblocking filtering based on the value indicated by cbf. For example, the filter unit (2070) may determine that the boundary of the current sub-block is subject to deblocking filtering if the cbf of the current sub-block is 1. Additionally, for example, if the cbf of the current sub-block is 0 but the current sub-block is adjacent to a sub-block with a cbf of 1, the boundary of the current sub-block may be determined to be subject to deblocking filtering.

[0359] In one embodiment, the filter unit (2070) can determine whether the boundary of the current sub-block is subject to deblocking filtering by considering the index assigned to the current sub-block.

[0360] Specifically, when multiple sub-blocks are determined from the current block, the inverse transformation unit (2030) may assign an index to the multiple sub-blocks to distinguish the multiple sub-blocks. When the index of the first sub-block within the current block is identified according to information indicating the location of the first sub-block, the filter unit (2070) may determine whether the boundary of the current sub-block is subject to deblocking filtering by considering the index of the current sub-block.

[0361] For example, in FIG. 24, it is assumed that the first current block (2410) is divided into TU0, TU1, TU2, and TU3, and the indices of TU0, TU1, TU2, and TU3 are 0, 1, 2, and 3, respectively, and that TU0 corresponds to the first sub-block. The filter unit (2070) may determine that the left boundary and upper boundary of TU0 having an index of 0, the left boundary and upper boundary of TU1 having an index of 1, and the left boundary and upper boundary of TU2 having an index of 2 are subject to deblocking filtering. Additionally, the filter unit (2070) may determine that the left boundary and upper boundary of TU3 having an index of 3 are not subject to deblocking filtering.

[0362] In one embodiment, according to the criteria for determining whether a specific boundary is subject to deblocking filtering, the boundaries of TU0 and TU1 within the first current block (2310), the second current block (2330), the third current block (2350), and the fourth current block (2370) shown in FIG. 23 may all be subject to deblocking filtering. However, if more than two sub-blocks are determined within the current block, the boundaries of some sub-blocks may not be subject to deblocking filtering.

[0363] FIG. 26 is a diagram showing the boundaries of sub-blocks divided from the current block according to one embodiment that are subject to deblocking filtering.

[0364] FIG. 26 illustrates the 5th current block (2320), 6th current block (2340), 7th current block (2360), and 8th current block (2380) shown in FIG. 23. Since the 5th current block (2320), 6th current block (2340), 7th current block (2360), and 8th current block (2380) contain more than two sub-blocks, it may be necessary to determine on a sub-block basis whether a specific boundary is subject to deblocking filtering.

[0365] In one embodiment, since whether to perform deblocking filtering can be determined after the creation of the restoration blocks, the current blocks (2320, 2340, 2360, 2380) shown in FIG. 26 can be referred to as restoration blocks.

[0366] Since TU0 corresponds to the first sub-block in the fifth current block (2320), the upper boundary and left boundary of TU0 can be subject to deblocking filtering. Although TU1, TU2, and TU3 all correspond to the second sub-block, the left boundaries of TU1, TU2, and TU3 all correspond to the boundaries of the fifth current block (2320), so the left boundaries of TU1, TU2, and TU3 can be subject to deblocking filtering. Additionally, since TU0 is located above TU1, the upper boundary of TU1 can be subject to deblocking filtering, whereas since the second sub-block is located above TU2 and TU3, the upper boundaries of TU2 and TU3 can be determined not to be subject to deblocking filtering.

[0367] Since TU3 corresponds to the first sub-block in the sixth current block (2340), the upper boundary and left boundary of TU3 may be subject to deblocking filtering. Although TU0, TU1, and TU2 all correspond to the second sub-block, the left boundaries of TU0, TU1, and TU2 all correspond to the boundaries of the sixth current block (2340), so the left boundaries of TU0, TU1, and TU2 may be subject to deblocking filtering. Additionally, since the upper boundary of TU0 corresponds to the boundary of the sixth current block (2340), the upper boundary of TU0 may be subject to deblocking filtering, whereas since the second sub-block is located above TU1 and TU2, the upper boundaries of TU1 and TU2 may be determined not to be subject to deblocking filtering.

[0368] Next, since TU0 corresponds to the first sub-block in the seventh current block (2360), the upper boundary and the left boundary of TU0 can be subject to deblocking filtering. Although TU1, TU2, and TU3 all correspond to the second sub-block, since the upper boundaries of TU1, TU2, and TU3 all correspond to the boundaries of the seventh current block (2360), the upper boundaries of TU1, TU2, and TU3 can be subject to deblocking filtering. Additionally, since TU0 is located to the left of TU1, the left boundary of TU1 can be subject to deblocking filtering, whereas since the second sub-block is located to the left of TU2 and TU3, the left boundaries of TU2 and TU3 can be determined not to be subject to deblocking filtering.

[0369] Next, since TU3 corresponds to the first sub-block in the eighth current block (2380), the upper boundary and the left boundary of TU3 may be subject to deblocking filtering. Although TU0, TU1, and TU2 all correspond to the second sub-block, since the upper boundaries of TU0, TU1, and TU2 all correspond to the boundaries of the eighth current block (2380), the upper boundaries of TU0, TU1, and TU2 may be subject to deblocking filtering. Additionally, since the left boundary of TU0 corresponds to the boundary of the eighth current block (2380), the left boundary of TU0 may be subject to deblocking filtering, whereas since the second sub-block is located to the left of TU1 and TU2, the left boundary of TU1 and TU2 may be determined not to be subject to deblocking filtering.

[0370] FIG. 27 is a diagram showing the boundaries of sub-blocks divided from the current block according to one embodiment that are subject to deblocking filtering.

[0371] FIG. 27 illustrates the first current block (2410), the second current block (2430), the third current block (2450), and the fourth current block (2470) illustrated in FIG. 24. In one embodiment, since whether to perform deblocking filtering can be determined after the creation of the restoration block, the current blocks (2410, 2430, 2450, 2470) illustrated in FIG. 27 may be referred to as restoration blocks.

[0372] Since TU0 corresponds to the first sub-block in the first current block (2410), the upper boundary and the left boundary of TU0 can be subject to deblocking filtering. Since TU0 is located to the left of TU1 and the upper boundary of TU1 corresponds to the boundary of the first current block (2410), both the left boundary and the upper boundary of TU1 can be subject to deblocking filtering. Since the left boundary of TU2 corresponds to the boundary of the first current block (2410) and TU0 is located to the top of TU2, both the left boundary and the upper boundary of TU2 can be subject to deblocking filtering. Since the second sub-block is located to both the left and the top of TU3, both the left boundary and the upper boundary of TU3 can be determined not to be subject to deblocking.

[0373] Next, since TU1 corresponds to the first sub-block in the second current block (2430), the upper boundary and the left boundary of TU1 can be subject to deblocking filtering. Since both the left boundary and the upper boundary of TU0 correspond to the boundaries of the second current block (2430), both the left boundary and the upper boundary of TU0 can be subject to deblocking filtering. Since the left boundary of TU2 corresponds to the boundary of the second current block (2430) and the second sub-block is located above TU2, the left boundary of TU2 can be subject to deblocking filtering, and the upper boundary of TU2 can be determined not to be subject to deblocking filtering. Since the second sub-block is located to the left of TU3, the left boundary of TU3 can be determined not to be subject to deblocking, and since the first sub-block is located above TU3, the upper boundary of TU3 can be subject to deblocking.

[0374] Next, since TU2 corresponds to the first sub-block in the third current block (2450), the upper boundary and the left boundary of TU2 can be subject to deblocking filtering. Since both the left boundary and the upper boundary of TU0 correspond to the boundaries of the third current block (2450), both the left boundary and the upper boundary of TU0 can be subject to deblocking filtering. Since the upper boundary of TU1 corresponds to the boundary of the third current block (2450) and the second sub-block is located to the left of TU1, the upper boundary of TU1 can be subject to deblocking filtering, and the left boundary of TU1 can be determined not to be subject to deblocking filtering. Since the first sub-block is located to the left of TU3, the left boundary of TU3 can be subject to deblocking filtering, and since the second sub-block is located to the top of TU3, the upper boundary of TU3 can be determined not to be subject to deblocking filtering.

[0375] Next, since TU3 corresponds to the first sub-block in the fourth current block (2470), the upper boundary and the left boundary of TU3 can be subject to deblocking filtering. Since both the left boundary and the upper boundary of TU0 correspond to the boundaries of the fourth current block (2470), both the left boundary and the upper boundary of TU0 can be subject to deblocking filtering. Since the upper boundary of TU1 corresponds to the boundary of the fourth current block (2470) and the second sub-block is located to the left of TU1, the upper boundary of TU1 can be subject to deblocking filtering, and the left boundary of TU1 can be determined not to be subject to deblocking filtering. Since the second sub-block is located at the top of TU2, the upper boundary of TU2 can be determined not to be subject to deblocking filtering, and since the left boundary of TU2 corresponds to the boundary of the fourth current block (2470), the left boundary of TU2 can be subject to deblocking filtering.

[0376] FIG. 28 is a diagram showing the boundaries of sub-blocks divided from the current block according to one embodiment that are subject to deblocking filtering.

[0377] FIG. 28 illustrates the first current block (2510), the second current block (2530), the third current block (2550), and the fourth current block (2570) illustrated in FIG. 25. In one embodiment, since whether to perform deblocking filtering can be determined after the creation of the restoration block, the current blocks (2510, 2530, 2550, 2570) illustrated in FIG. 28 may be referred to as restoration blocks.

[0378] In the case of the first current block (2510), since TU0 corresponds to the first sub-block, the left boundary and the upper boundary of TU0 may be subject to deblocking filtering. Additionally, since the upper boundary of TU1, TU2, and TU3, and the left boundary of TU4, TU8, and TU12 correspond to the boundaries of the first current block (2510), the upper boundary of TU1, TU2, and TU3, and the left boundary of TU4, TU8, and TU12 may be subject to deblocking filtering. Since the first sub-block is located to the left of TU1 and to the top of TU4, the left boundary of TU1 and the upper boundary of TU4 may be subject to deblocking filtering. Boundaries other than those mentioned above may be determined not to be subject to deblocking filtering.

[0379] In the case of the second current block (2530), since TU3 corresponds to the first sub-block, the left boundary and the upper boundary of TU3 may be subject to deblocking filtering. Additionally, since the upper boundary of TU0, TU1, and TU2, and the left boundary of TU0, TU4, TU8, and TU12 correspond to the boundaries of the second current block (2530), the upper boundary of TU0, TU1, and TU2, and the left boundary of TU0, TU4, TU8, and TU12 may be subject to deblocking filtering. Since the first sub-block is located above TU7, the upper boundary of TU7 may be subject to deblocking filtering. Boundaries other than those mentioned above may be determined not to be subject to deblocking filtering.

[0380] In the case of the third current block (2550), since TU12 corresponds to the first sub-block, the left boundary and the upper boundary of TU12 may be subject to deblocking filtering. Additionally, since the upper boundary of TU0, TU1, TU2, and TU3, and the left boundary of TU0, TU4, and TU8 correspond to the boundaries of the third current block (2550), the upper boundary of TU0, TU1, TU2, and TU3, and the left boundary of TU0, TU4, and TU8 may be subject to deblocking filtering. Since the first sub-block is located to the left of TU13, the left boundary of TU13 may be subject to deblocking filtering. Boundaries other than those mentioned above may be determined not to be subject to deblocking filtering.

[0381] In the case of the fourth current block (2570), since TU15 corresponds to the first sub-block, the left boundary and upper boundary of TU115 may be subject to deblocking filtering. Additionally, since the upper boundary of TU0, TU1, TU2, and TU3, and the left boundary of TU0, TU4, TU8, and TU12 correspond to the boundaries of the fourth current block (2570), the upper boundary of TU0, TU1, TU2, and TU3, and the left boundary of TU0, TU4, TU8, and TU12 may be subject to deblocking filtering. Boundaries other than those mentioned above may be determined not to be subject to deblocking filtering.

[0382] Meanwhile, in the aforementioned sub-block conversion mode, the position of the first sub-block within the current block is determined based on information obtained from the bitstream, but in one embodiment, the image decoding device (2000) may directly determine the position of the first sub-block according to a predetermined standard.

[0383] The mode in which the image decoder (2000) directly determines the location of the first sub-block can be referred to as an adaptive sub-block transform mode.

[0384] FIG. 29 is a diagram illustrating an adaptive sub-block conversion mode according to one embodiment.

[0385] In one embodiment, the inverse conversion unit (2030) searches for an optimal location while changing the location of candidate blocks (2910, 2930) within the current block (2900), and can determine the searched location as the location of the first sub-block (2950).

[0386] In one embodiment, information indicating the size of the first sub-block (2950) may be obtained from a bitstream. The inverse conversion unit (2030) may set candidate blocks (2910, 2930) having the size of the first sub-block (2950) and search for an optimal position while moving the positions of the candidate blocks (2910, 2930).

[0387] As illustrated in FIG. 29, when the size of the first sub-block (2950) is confirmed, the inverse transformation unit (2030) can search for an optimal position by moving a vertical candidate block (2910) having the size of the first sub-block (2950) left and right, and search for an optimal position by moving a horizontal candidate block (2930) having the size of the first sub-block (2950) up and down. Then, the inverse transformation unit (2030) can determine the position of the first sub-block (2950) by comparing the optimal position of the vertical candidate block (2910) and the optimal position of the horizontal candidate block (2930).

[0388] The shape of the candidate blocks (2910, 2930) illustrated in FIG. 29 is an example, and the size and shape of the candidate blocks (2910, 2930) may be varied according to the embodiment. For example, if the size of the first sub-block (2950) corresponds to a size obtained by dividing the width and height of the current block (2900) in half, the inverse conversion unit (2030) may determine the position of the first sub-block (2950) by moving the candidate block having a size obtained by dividing the width and height of the current block (2900) in half in the left-right and up-down directions.

[0389] FIG. 29 illustrates that candidate blocks (2910, 2930) are moved in the left-right or up-down direction within the current block (2900) to determine the location of the first sub-block (2950). However, since the restoration of the current block (2900) is not completed before the location of the first sub-block (2950) is determined—that is, since the image decoding device (2000) has not yet acquired the block corresponding to the current block (2900)—the inverse conversion unit (2030) can determine the location of the first sub-block (2950) using the predicted block of the current block (2900). This will be explained with reference to FIG. 30.

[0390] FIG. 30 is a diagram illustrating a method for determining the location of a first sub-block in an adaptive sub-block conversion mode according to one embodiment.

[0391] In one embodiment, the inverse transformation unit (2030) can determine the location of the first sub-block (2950) based on the amount of sample value change of samples included in the prediction block (3000) of the current block (2900). Since the first sub-block (2950) is the subject of transformation / inverse transformation, the part of the prediction block (3000) with a large amount of sample value change can be determined as the first sub-block (2950). In other words, because the part of the prediction block (3000) with a large amount of sample value change can contain many residuals, the part of the prediction block (3000) with a large amount of sample value change can be determined as the first sub-block (2950) of the current block (2900).

[0392] The inverse transformation unit (2030) can calculate the sample value change amounts of each candidate block having the size of the first sub-block (2950) within the prediction block (3000), and determine the location of the first sub-block (2950) by comparing the sample value change amounts of each candidate block. The inverse transformation unit (2030) can determine the location of the selected candidate block based on the sample value change amount as the location of the first sub-block (2950) within the current block (2900).

[0393] As illustrated in FIG. 30, the inverse transformation unit (2030) can compare the sample value changes of each of the vertical candidate blocks (3010-1, 3010-2, 3010-3, ..., 3010-p) having the size of the first sub-block (2950) with the sample value changes of each of the horizontal candidate blocks (3030-1, 3030-2, 3030-3, ..., 3030-q) having the size of the first sub-block (2950). In one embodiment, the inverse transformation unit (2030) can determine the location of the candidate block with the largest sample value change among the vertical candidate blocks (3010-1, 3010-2, 3010-3, ..., 3010-p) and the horizontal candidate blocks (3030-1, 3030-2, 3030-3, ..., 3030-q) as the location of the first sub-block (2950).

[0394] In one embodiment, the amount of change in sample values ​​of a candidate block may include the sum of the gradients of samples within the candidate block. The inverse transform unit (2030) may calculate the gradients of samples within the candidate block and sum the calculated gradients to determine the amount of change in sample values ​​corresponding to the candidate block. In one embodiment, the gradient of any one sample within the candidate samples may be calculated as the difference between the sample values ​​of surrounding samples adjacent to any one sample.

[0395] In one embodiment, adjacent candidate blocks used to determine the location of the first sub-block (2950) may be separated from each other by n samples (n is a natural number).

[0396] The reason for separating candidate blocks by a distance of n is that the process of finding the boundary of a sub-block within a restoration block can be performed for every n samples (or nxn blocks). Instead of considering all boundaries of samples within the restoration block to find the boundary of a transformation block (or sub-block) within the restoration block, the filter unit (2070) can determine whether the boundary of a sample corresponds to the boundary of a sub-block for every n samples in the horizontal or vertical direction.

[0397] That is, by separating the candidate blocks by a distance of n, the boundary of the first sub-block can be accurately found by the filter unit (2070).

[0398] FIG. 31 is a drawing illustrating adjacent candidate blocks for determining the location of a first sub-block within a current block according to one embodiment.

[0399] In one embodiment, if the coordinates of a sample included in one candidate group are (x, y), the coordinates of a corresponding sample included in an adjacent candidate group may be (x+n, y) or (x, y+n). Here, n may be a natural number such as 2, 4, or 8.

[0400] Assuming n is 2, as illustrated in FIG. 31, if the coordinates of the top-left sample (3011-1) within the first candidate block (3010-1) in the vertical direction are (x, y), then the coordinates of the top-left sample (3011-2) within the second candidate block (3010-2) in the vertical direction may be (x+2, y). Additionally, if the coordinates of the top-left sample within the first candidate block in the horizontal direction are (x, y), then the coordinates of the top-left sample within the second candidate block in the horizontal direction may be (x, y+2).

[0401] If a first sub-block is determined among candidate blocks separated by a distance of 2 from each other, and the filter unit (2070) determines whether the boundary corresponds to every two samples in the horizontal direction or every two samples in the vertical direction within the restoration block, the boundary of the first sub-block can be accurately identified.

[0402] As described above, in the adaptive sub-block conversion mode, the location of the first sub-block can be directly determined by the image decoder (2000), for example, the inverse conversion unit (2030), and the inverse conversion unit (2030) may not determine the first sub-block and the part other than the first sub-block among the current blocks as conversion units.

[0403] In other words, in the adaptive sub-block conversion mode, if the first sub-block is not recognized as a conversion unit, the filter unit (2070) may perform deblocking filtering only on the boundary of the current block and not perform deblocking filtering on the boundary of the first sub-block.

[0404] Since the first sub-block is a region containing non-zero transformation coefficients, it may be desirable to perform deblocking filtering on the boundaries of the first sub-block to reduce block artifacts.

[0405] FIG. 32 is a diagram showing that deblocking filtering is applied to the boundary of a first sub-block within a current block in an adaptive sub-block conversion mode according to one embodiment.

[0406] In one embodiment, when the first sub-block is determined within the current block to which the adaptive sub-block conversion mode is applied, the filter unit (2070) may determine the boundary of the first sub-block and the boundary of the current block (or restored block) as targets for deblocking filtering.

[0407] In one embodiment, the boundary of the first sub-block may include at least one of the boundary of the first sub-block located within the current block, for example, the left boundary, the right boundary, the upper boundary, or the lower boundary of the first sub-block. The reason for determining the right boundary or the lower boundary of the first sub-block as the target of deblocking filtering is that, as the part of the current block other than the first sub-block is not recognized as a transformation unit, the boundary of the part other than the first sub-block (for example, the right boundary or the lower boundary of the first sub-block) is not determined as the target of deblocking filtering.

[0408] As illustrated in FIG. 32, when a first sub-block (2950) is determined within the current block (2900), regions (2970, 2990) that do not correspond to the first sub-block (2950) within the current block (2900) can be identified. If both regions (2970, 2990) are not recognized as transformation units, the left boundary of the right region (2990) can be determined not to be subject to deblocking filtering. Accordingly, the filter unit (2070) can determine the left boundary and the upper boundary of the current block (2900), as well as the left boundary and the right boundary of the first sub-block (2950), as subjects for deblocking filtering.

[0409] FIG. 33 is a diagram showing boundaries to which deblocking filtering is applied among boundaries related to the maximum encoding unit according to one embodiment.

[0410] In FIG. 33, SBT represents a first sub-block within the current block to which a sub-block conversion mode is applied, and ASBT represents a first sub-block within the current block to which an adaptive sub-block conversion mode is applied. Additionally, CU is a coding unit and may correspond to the current block.

[0411] The maximum encoding unit (3300) may be divided into one or more encoding units, and an SBT and / or ASBT may be determined within the encoding unit. As illustrated in FIG. 33, in one embodiment, an ASBT (3330) may be determined within an SBT (3310).

[0412] Referring to FIG. 33, the boundaries of SBT, ASBT, and CU can be determined as the boundaries to be deblocked filtered. According to one embodiment of the present disclosure, deblocking filtering is efficiently performed by considering the boundaries of SBT and ASBT, thereby reducing the amount of computation for encoding / decoding and simultaneously improving the quality of the reconstructed image.

[0413] FIG. 34 is a flowchart of an image decoding method according to one embodiment.

[0414] Each step illustrated in FIG. 34 can be performed by the aforementioned image decoding device (2000).

[0415] In step S3410, the image decoder (2000) can generate a predicted block of the current block through a prediction of the current block.

[0416] In one embodiment, the image decoding device (2000) obtains information indicating the prediction mode of the current block from a bitstream and can generate a prediction block of the current block according to the prediction mode of the current block.

[0417] In one embodiment, the size of the current block and the size of the predicted block may be the same.

[0418] In step S3420, the image decoding device (2000) can identify a first sub-block within the current block.

[0419] In one embodiment, the image decoding device (2000) may obtain at least one of first information indicating the size of a sub-block, second information indicating the direction (or shape) of a sub-block, or third information indicating the location of a first sub-block from a bitstream. The image decoding device (2000) may divide the current block into a plurality of sub-blocks based on the first information and / or the second information, and identify a first sub-block among the plurality of sub-blocks based on the third information.

[0420] In one embodiment, the image decoding device (2000) may obtain information indicating the size of a sub-block from a bitstream and identify the location of a first sub-block within a current block by comparing the sample value changes of several candidate blocks within a prediction block having the size of the sub-block. In this case, the information indicating the location of the first sub-block may not be included in the bitstream.

[0421] In step S3430, the image decoder (2000) can obtain the conversion coefficients of the first sub-block from the bitstream and inversely convert the conversion coefficients of the first sub-block to obtain residual samples of the first sub-block.

[0422] In one embodiment, the size of the residual block containing the residual samples may be the same as the size of the current block, and all sample values ​​in the residual block other than the part corresponding to the first sub-block may be 0.

[0423] In step S3440, the image decoder (2000) can generate a restoration block using the prediction block of the current block and the residual samples of the first sub-block.

[0424] In one embodiment, the image decoding device (2000) can obtain a restoration block by combining the sample values ​​in the prediction block and the sample values ​​of the residual samples.

[0425] In step S3450, the image decoding device (2000) can generate a filtered block by performing deblocking filtering on the boundary of the first sub-block within the recovery block.

[0426] The filtered block can be output for playback. In one embodiment, the filtered block can be used to predict the next block.

[0427] In one embodiment, the image decoding device (2000) can determine, based on a predetermined criterion, whether to apply deblocking filtering to the boundary of the current sub-block within the restoration block or not to apply deblocking filtering.

[0428] As the method for determining whether the boundary of a sub-block is subject to deblocking filtering has been described previously, a detailed explanation is omitted.

[0429] FIG. 35 is a diagram illustrating the configuration of an image encoding device (3500) according to one embodiment.

[0430] Referring to FIG. 35, the image encoding device (3500) may include a prediction unit (3510), a conversion unit (3520), a generation unit (3530), an inverse conversion unit (3540), a restoration unit (3550), and a filter unit (3560).

[0431] The prediction unit (3510), conversion unit (3520), generation unit (3530), inverse conversion unit (3540), restoration unit (3550), and filter unit (3560) may be implemented with at least one processor. At least one processor may include processing circuitry.

[0432] The prediction unit (3510), conversion unit (3520), generation unit (3530), inverse conversion unit (3540), restoration unit (3550), and filter unit (3560) can operate according to at least one instruction stored in at least one memory.

[0433] In one embodiment, the image encoding device (3500) may be an electronic device comprising at least one processor and at least one memory. The at least one processor of the electronic device may perform image encoding according to instructions stored in at least one memory.

[0434] In one embodiment, the prediction unit (3510), the conversion unit (3520), and the generation unit (3530) may correspond to the prediction encoding unit (1915), the conversion and quantization unit (1920), and the entropy encoding unit (1925) shown in FIG. 19, respectively. In one embodiment, the inverse conversion unit (3540) may correspond to the inverse quantization and inverse conversion unit (1930) shown in FIG. 19, and the restoration unit (3550) may correspond to an adder that combines the output of the prediction encoding unit (1915) shown in FIG. 19 and the output of the inverse quantization and inverse conversion unit (1930). Additionally, the filter unit (3560) may correspond to the deblocking filtering unit (1935) shown in FIG. 19.

[0435] The prediction unit (3510) can predict the current block according to the prediction mode and generate a prediction block corresponding to the current block.

[0436] In one embodiment, the prediction mode of the current block may be selected from several modes including an intra prediction mode, an inter prediction mode, a CIIP (combined intra / inter prediction) mode, an IBC (Intra Block Copy) mode, a GPM (Geometric Partitioning Mode) intra mode, etc.

[0437] The transformation unit (3520) can obtain residual samples of the current block using the current block and the prediction block. In one embodiment, the transformation unit (3520) can obtain residual samples corresponding to the difference between the samples of the current block and the samples of the prediction block.

[0438] The conversion unit (3520) can convert the residual samples of the current block to obtain the conversion coefficients of the current block.

[0439] In one embodiment, the conversion unit (3520) determines one or more conversion units within the current block and can perform conversion for each of the one or more conversion units.

[0440] In one embodiment, the conversion unit (3520) may determine a first sub-block within the current block and apply a conversion to the first sub-block. If the conversion unit (3520) decides to apply a sub-block conversion mode to the current block, it may determine a first sub-block within the current block. Conversion may not be performed on parts of the current block other than the first sub-block.

[0441] In one embodiment, the conversion unit (3520) can divide the current block into a plurality of sub-blocks and determine a first sub-block among the plurality of sub-blocks.

[0442] In one embodiment, the conversion unit (3520) may determine the size of the sub-block and identify the location of the first sub-block within the current block by comparing the sample value changes of several candidate blocks within the prediction block having the size of the sub-block.

[0443] In one embodiment, the conversion unit (3520) can quantize the conversion coefficients of the first sub-block to obtain quantized conversion coefficients.

[0444] The generating unit (3530) can generate a bitstream containing the encoding result for the current block. The generating unit (3530) can generate a bitstream containing values ​​corresponding to syntax elements generated through encoding for the current block. Values ​​corresponding to syntax elements can be included in the bitstream according to the syntax structure.

[0445] The generation unit (3530) can generate a bitstream by entropy encoding the syntax elements.

[0446] In one embodiment, the generating unit (3530) may generate a bitstream containing information about the conversion coefficient of the first sub-block. In one embodiment, the bitstream may further include information indicating the prediction mode of the current block, information indicating whether a sub-block conversion mode is applied to the current block, and information used to identify the first sub-block within the current block. The information used to identify the first sub-block within the current block may include at least one of first information indicating the size of the sub-block, second information indicating the orientation (or shape) of the sub-block, or third information indicating the location of the first sub-block.

[0447] In one embodiment, the bitstream may be transmitted to a video decoding device (2000) via a network. In one embodiment, the bitstream may be stored in a data storage medium including a magnetic medium (e.g., a hard disk, a floppy disk, or a magnetic tape), an optical recording medium (e.g., a CD-ROM or a DVD), and a magneto-optical medium (e.g., a floptical disk).

[0448] The inverse transformation unit (3540) can inversely transform the transformation coefficients of the first sub-block to obtain residual samples of the first sub-block.

[0449] In one embodiment, inverse quantization may be applied to the transformation coefficients before the inverse transformation. In other words, residual samples of the first sub-block may be obtained by applying inverse quantization and inverse transformation to the quantized transformation coefficients of the first sub-block.

[0450] The restoration unit (3550) can generate a restoration block by combining the prediction block generated by the prediction unit (3510) and the residual samples generated by the inverse transformation unit (3540).

[0451] In one embodiment, the restoration unit (3550) can generate a restoration block containing restoration samples by combining the prediction samples and residual samples included in the prediction block.

[0452] The filter unit (3560) can filter the restoration block to generate a filtered block. In one embodiment, deblocking filtering may be applied to the restoration block.

[0453] The filtered block can be output for playback. In one embodiment, the filtered block can be used as a reference block for the next block to predict the next block.

[0454] In one embodiment, the filter unit (3560) can perform deblocking filtering on the boundary of the first sub-block within the restoration block.

[0455] The filter unit (3560) can determine, based on a predetermined standard, whether the boundary of the current sub-block within the restoration block is subject to deblocking filtering or not subject to deblocking filtering.

[0456] As the method for determining whether the boundary of the current sub-block is subject to deblocking filtering has been explained in relation to the image decoding device (2000), a detailed explanation is omitted.

[0457] FIG. 36 is a flowchart of an image encoding method according to one embodiment.

[0458] Each step illustrated in FIG. 36 can be performed by the aforementioned image encoding device (3500).

[0459] In step S3610, the video encoding device (3500) can generate a prediction block of the current block through a prediction for the current block.

[0460] In one embodiment, the image encoding device (3500) can determine the prediction mode of the current block and generate a prediction block of the current block according to the prediction mode of the current block.

[0461] In one embodiment, the size of the current block and the size of the predicted block may be the same.

[0462] In step S3620, the image encoding device (3500) can acquire residual samples using the current block and the prediction block.

[0463] The image encoding device (3500) can obtain residual samples corresponding to the difference between the samples of the current block and the samples of the prediction block.

[0464] In one embodiment, the size of the residual block containing the residual samples may be the same as the size of the current block.

[0465] In step S3630, the video encoding device (3500) can determine a first sub-block within the current block.

[0466] In one embodiment, the image encoding device (3500) determines the size and / or shape of a sub-block and can determine a plurality of sub-blocks having the determined size and / or shape within the current block. Then, the image encoding device (3500) can select a first sub-block among the plurality of sub-blocks.

[0467] In one embodiment, the image encoding device (3500) may determine the size of a sub-block and identify the location of a first sub-block within a current block by comparing the sample value changes of several candidate blocks within a prediction block having the determined size.

[0468] In step S3640, the image encoding device (3500) can perform a transformation on the residual samples of the first sub-block to obtain transformation coefficients.

[0469] In one embodiment, residual samples of parts of the current block other than the first sub-block may not be subject to transformation. Accordingly, all transformation coefficients of parts of the current block other than the first sub-block may be determined to be 0.

[0470] In one embodiment, the image encoding device (3500) can quantize the transformation coefficients of the first sub-block to generate quantized transformation coefficients.

[0471] In step S3650, the video encoding device (3500) can generate a bitstream containing information about the conversion coefficients of the first sub-block.

[0472] In one embodiment, the bitstream may further include information indicating a prediction mode of the current block, information indicating whether a sub-block conversion mode is applied to the current block, and information used to identify a first sub-block within the current block. The information used to identify a first sub-block within the current block may include at least one of first information indicating the size of the sub-block, second information indicating the orientation (or shape) of the sub-block, or third information indicating the location of the first sub-block.

[0473] In step S3660, the image encoding device (3500) can inversely transform the transformation coefficients of the first sub-block to obtain residual samples of the first sub-block.

[0474] In one embodiment, the size of the residual block containing the residual samples may be the same as the size of the current block, and all sample values ​​in the residual block other than the part corresponding to the first sub-block may be 0.

[0475] In step S3670, the image encoding device (3500) can generate a restoration block using the prediction block of the current block and the residual samples of the first sub-block.

[0476] In one embodiment, the image encoding device (3500) can obtain a restoration block by summing the sample values ​​in the prediction block and the sample values ​​of the residual samples.

[0477] In step S3680, the image encoding device (3500) can generate a filtered block by performing deblocking filtering on the boundary of the first sub-block within the restoration block.

[0478] The filtered block can be output for playback. In one embodiment, the filtered block can be used to predict the next block.

[0479] In one embodiment, the image encoding device (3500) can determine, based on a predetermined criterion, whether to apply deblocking filtering to the boundary of the current sub-block within the restoration block or not to apply deblocking filtering.

[0480] As the method for determining whether the boundary of a sub-block is subject to deblocking filtering has been described previously, a detailed explanation is omitted.

[0481] One embodiment has the objective of efficiently applying deblocking filtering to the current block to which the sub-block conversion mode is applied.

[0482] One embodiment aims to improve the quality of a restored image through efficient deblocking filtering.

[0483] One embodiment aims to reduce the amount of computation in the encoding and decoding processes by skipping unnecessary deblocking filtering.

[0484] 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.

[0485] A decoding method for an image according to one embodiment may include a step (S3410) of generating a prediction block through a prediction for the current block.

[0486] A decoding method for an image according to one embodiment may include the step (S3420) of identifying a first sub-block within the current block.

[0487] A decoding method for an image according to one embodiment may include the step (S3430) of obtaining residual samples of the first sub-block by performing an inverse transformation on the transformation coefficients of the first sub-block, and the sample value of the residual samples of the portion of the current block other than the first sub-block may be determined to be 0.

[0488] A decoding method for an image according to one embodiment may include the step (S3440) of generating a restoration block using residual samples of the prediction block and the first sub-block.

[0489] A decoding method for an image according to one embodiment may include the step (S3450) of generating a filtered block by performing deblocking filtering on the boundary of the first sub-block within the restoration block.

[0490] In one embodiment, the inverse transformation may not be performed on the portion of the current block other than the first sub-block.

[0491] In one embodiment, the decoding method of the image may further include the step of determining the boundary of the first sub-block as a target for deblocking filtering when the current sub-block within the restoration block corresponds to the first sub-block.

[0492] In one embodiment, the portion of the current block other than the first sub-block includes at least one second sub-block, and when the current sub-block within the restoration block corresponds to the second sub-block and the first sub-block is adjacent to the current sub-block, deblocking filtering may be performed on the boundary of the current sub-block.

[0493] In one embodiment, if the current sub-block corresponds to the second sub-block and another second sub-block is adjacent to the current sub-block, the boundary of the current sub-block may be determined not to be subject to the deblocking filtering.

[0494] In one embodiment, when the current sub-block corresponds to the second sub-block, if the first sub-block is adjacent to either the left boundary or the upper boundary of the current sub-block, deblocking filtering is performed on either boundary, and if another second sub-block is adjacent to the other boundary among the left boundary and the upper boundary of the current sub-block, the other boundary may be determined not to be subject to deblocking filtering.

[0495] In one embodiment, when the current sub-block corresponds to the second sub-block, if either the left boundary or the upper boundary of the current sub-block corresponds to the boundary of the restoration block, deblocking filtering is performed on either boundary, and if another second sub-block is adjacent to the other boundary among the left boundary and the upper boundary of the current sub-block, the other boundary may be determined not to be subject to the deblocking filtering.

[0496] In one embodiment, the step of identifying the first sub-block within the current block may include: obtaining from a bitstream first information indicating the size of the sub-block and second information indicating the location of the first sub-block among the sub-blocks within the current block; and determining sub-blocks within the current block having the size indicated by the first information, and identifying the sub-block indicated by the second information among the determined sub-blocks as the first sub-block.

[0497] In one embodiment, the step of identifying the first sub-block within the current block may include: obtaining information indicating the size of the sub-block from a bitstream; and determining the location of the first sub-block within the current block based on the sample value changes of candidate blocks within the prediction block having the size of the sub-block.

[0498] In one embodiment, the step of determining the location of the first sub-block includes comparing the sample value changes of candidate blocks within the prediction block and determining the location of a selected candidate block based on the comparison result as the location of the first sub-block, wherein any one candidate block and a candidate block adjacent to any one candidate block may be separated from each other by n samples (n is a predetermined natural number).

[0499] In one embodiment, the decoding method of the image may further include the step of determining whether the boundary of a sample corresponds to the boundary of a sub-block in units of n samples within the restoration block.

[0500] An image encoding method according to one embodiment may include a step (S3610) of generating a prediction block through a prediction for the current block.

[0501] An image encoding method according to one embodiment may include a step (S3620) of obtaining residual samples using the current block and the prediction block.

[0502] A method for encoding an image according to one embodiment may include the step (S3630) of determining a first sub-block within the current block.

[0503] An image encoding method according to one embodiment may include a step (S3640) of performing a transformation on residual samples of the first sub-block to obtain transformation coefficients.

[0504] A method for encoding an image according to one embodiment may include the step (S3650) of generating a bitstream containing information about the conversion coefficients.

[0505] An image encoding method according to one embodiment may include a step (S3660) of obtaining residual samples of the first sub-block by performing an inverse transformation on the transformation coefficients of the first sub-block, and the sample value of the residual samples of the portion of the current block other than the first sub-block may be determined to be 0.

[0506] An image encoding method according to one embodiment may include the step (S3670) of generating a restoration block using residual samples of the prediction block and the first sub-block.

[0507] An image encoding method according to one embodiment may include the step (S3680) of generating a filtered block by performing deblocking filtering on the boundary of a first sub-block within the restoration block.

[0508] In one embodiment, a bitstream generated by an image encoding method can be transmitted.

[0509] An image decoding device according to one embodiment may include a prediction unit (2010) that generates a prediction block through a prediction of the current block.

[0510] An image decoding device according to one embodiment may include an inverse transformation unit (2030) that identifies a first sub-block within the current block and performs an inverse transformation on the transformation coefficients of the first sub-block to obtain residual samples of the first sub-block.

[0511] An image decoding device according to one embodiment may include a restoration unit (2050) that generates a restoration block using residual samples of the prediction block and the first sub-block.

[0512] An image decoding device according to one embodiment may include a filter unit (2070) that performs deblocking filtering on the boundary of the first sub-block within the restoration block to generate a filtered block.

[0513] In one embodiment, the sample value of the residual sample of the portion of the current block other than the first sub-block may be determined to be 0.

[0514] An image encoding device according to one embodiment may include a prediction unit (3510) that generates a prediction block through a prediction of the current block.

[0515] An image encoding device according to one embodiment may include a conversion unit (3520) that obtains residual samples using the current block and the prediction block, determines a first sub-block within the current block, and obtains conversion coefficients by performing a conversion on the residual samples of the first sub-block.

[0516] An image encoding device according to one embodiment may include a generating unit (3530) that generates a bitstream including information about the conversion coefficient.

[0517] An image encoding device according to one embodiment may include an inverse transformation unit (3540) that performs an inverse transformation on the transformation coefficients of the first sub-block to obtain residual samples of the first sub-block.

[0518] An image encoding device according to one embodiment may include a restoration unit (3550) that generates a restoration block using residual samples of the prediction block and the first sub-block.

[0519] An image encoding device according to one embodiment may include a filter unit (3560) that generates a filtered block by performing deblocking filtering on the boundary of a first sub-block within the restoration block.

[0520] In one embodiment, the sample value of the residual sample of the portion of the current block other than the first sub-block may be determined to be 0.

[0521] One embodiment can efficiently apply deblocking filtering to the current block to which the sub-block conversion mode is applied.

[0522] One embodiment can improve the quality of the restored image through efficient deblocking filtering.

[0523] One embodiment can reduce the amount of computation in the encoding and decoding processes by skipping unnecessary deblocking filtering.

[0524] 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.

[0525] 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.

[0526] 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

1. In a method for decoding an image, Step of generating a prediction block through a prediction for the current block (S3410); Step of identifying a first sub-block within the current block (S3420); A step (S3430) of obtaining residual samples of the first sub-block by performing an inverse transformation on the transformation coefficients of the first sub-block, wherein the sample value of the residual samples of the portion of the current block other than the first sub-block is determined to be 0; A step of generating a restoration block using residual samples of the prediction block and the first sub-block (S3440); and A method for decoding an image, comprising the step (S3450) of generating a filtered block by performing deblocking filtering on the boundary of the first sub-block within the restoration block.

2. In Paragraph 1, A method for decoding an image in which the inverse transformation is not performed on parts of the current block other than the first sub-block.

3. In any one of paragraphs 1 to 2, The decoding method of the above image is, A method for decoding an image, further comprising the step of determining the boundary of the first sub-block as a target for deblocking filtering when the current sub-block within the restoration block corresponds to the first sub-block.

4. In any one of paragraphs 1 through 3, The portion of the current block other than the first sub-block comprises at least one second sub-block, and A method for decoding an image, wherein if the current sub-block within the restoration block corresponds to the second sub-block and the first sub-block is adjacent to the current sub-block, deblocking filtering is performed on the boundary of the current sub-block.

5. In any one of paragraphs 1 through 4, A method for decoding an image, wherein if the current sub-block corresponds to the second sub-block and another second sub-block is adjacent to the current sub-block, the boundary of the current sub-block is determined not to be subject to the deblocking filtering.

6. In any one of paragraphs 1 through 5, If the above current sub-block corresponds to the above second sub-block, If the first sub-block is adjacent to either the left boundary or the upper boundary of the current sub-block, deblocking filtering is performed on either boundary, and A method for decoding an image, wherein if another second sub-block is adjacent to the other boundary among the left boundary and the upper boundary of the current sub-block, the other boundary is determined not to be subject to the deblocking filtering.

7. In any one of paragraphs 1 through 6, If the above current sub-block corresponds to the above second sub-block, If either the left boundary or the upper boundary of the current sub-block corresponds to the boundary of the restoration block, deblocking filtering is performed on either boundary, and A method for decoding an image, wherein if another second sub-block is adjacent to the other boundary among the left boundary and the upper boundary of the current sub-block, the other boundary is determined not to be subject to the deblocking filtering.

8. In any one of paragraphs 1 through 7, The step of identifying the first sub-block within the current block is: A step of obtaining from a bitstream first information indicating the size of a sub-block, and second information indicating the position of the first sub-block among the sub-blocks within the current block; and A method for decoding an image, comprising the step of determining sub-blocks having a size represented by the first information within the current block, and identifying the sub-block represented by the second information among the determined sub-blocks as the first sub-block.

9. In any one of paragraphs 1 through 8, The step of identifying the first sub-block within the current block is: A step of obtaining information indicating the size of a sub-block from a bitstream; and A method for decoding an image, comprising the step of determining the position of the first sub-block within the current block based on the sample value changes of candidate blocks within the prediction block having the size of the sub-block.

10. In any one of paragraphs 1 through 9, The step of determining the location of the first sub-block above is, The method includes the step of comparing the sample value change amounts of candidate blocks within the prediction block and determining the location of the selected candidate block as the location of the first sub-block based on the comparison result. A method for decoding an image in which one candidate block and a candidate block adjacent to the one candidate block are separated from each other by n samples (n is a predetermined natural number).

11. In any one of paragraphs 1 through 10, The decoding method of the above image is, A method for decoding an image, further comprising the step of determining whether the boundary of a sample corresponds to the boundary of a sub-block in units of n samples within the above-mentioned restoration block.

12. In a method for encoding images, Step of generating a prediction block through a prediction for the current block (S3610); A step of obtaining residual samples using the current block and the prediction block (S3620); Step of determining the first sub-block within the current block (S3630); A step of obtaining transformation coefficients by performing a transformation on the residual sample of the first sub-block (S3640); A step of generating a bitstream containing information about the above conversion coefficients (S3650); A step (S3660) of obtaining residual samples of the first sub-block by performing an inverse transformation on the transformation coefficients of the first sub-block, wherein the sample value of the residual samples of the portion of the current block other than the first sub-block is determined to be 0; A step of generating a restoration block using residual samples of the prediction block and the first sub-block (S3670); and A method for encoding an image, comprising the step (S3680) of generating a filtered block by performing deblocking filtering on the boundary of a first sub-block within the above-mentioned restoration block.

13. A method for transmitting a bitstream generated by the image encoding method of paragraph 12.

14. In an image decoding device, A prediction unit (2010) that generates a prediction block through a prediction of the current block; An inverse transformation unit (2030) that identifies a first sub-block within the current block and performs an inverse transformation on the transformation coefficients of the first sub-block to obtain residual samples of the first sub-block; A restoration unit (2050) that generates a restoration block using residual samples of the prediction block and the first sub-block; and It includes a filter unit (2070) that generates a filtered block by performing deblocking filtering on the boundary of the first sub-block within the restoration block, An image decoding device in which the sample value of the residual sample of the portion other than the first sub-block among the above current blocks is determined to be 0.

15. In an image encoding device, A prediction unit (3510) that generates a prediction block through a prediction of the current block; A transformation unit (3520) that obtains residual samples using the current block and the prediction block, determines a first sub-block within the current block, and performs a transformation on the residual samples of the first sub-block to obtain transformation coefficients; A generating unit (3530) that generates a bitstream containing information about the above conversion coefficients; An inverse transformation unit (3540) that performs an inverse transformation on the transformation coefficients of the first sub-block to obtain residual samples of the first sub-block; A restoration unit (3550) that generates a restoration block using residual samples of the prediction block and the first sub-block; and It includes a filter unit (3560) that generates a filtered block by performing deblocking filtering on the boundary of a first sub-block within the above-mentioned restoration block, wherein An image encoding device in which the sample value of the residual sample of the portion other than the first sub-block among the above current blocks is determined to be 0.