Video decoding method and apparatus using sub-block transformation, and video encoding method and apparatus using sub-block transformation
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SAMSUNG ELECTRONICS CO LTD
- Filing Date
- 2025-10-20
- Publication Date
- 2026-05-21
Smart Images

Figure KR2025016620_21052026_PF_FP_ABST
Abstract
Description
Video decoding method and apparatus using sub-block transformation, video encoding method and apparatus using sub-block transformation
[0001] The present disclosure relates to the field of image encoding and decoding. More specifically, it relates to an encoding and decoding method and apparatus for predicting samples of an image.
[0002] In image encoding and decoding, the image is divided into blocks, and each block is predictively encoded and predictedly decoded through inter-prediction or intra-prediction.
[0003] Inter prediction is a technique that compresses images by eliminating temporal redundancy between images. In inter prediction, blocks of the current image are 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 is generated by subtracting the predicted block resulting from the prediction result from the current block.
[0004] Intra prediction is a technique that compresses images by eliminating spatial redundancy within the image. Depending on the prediction mode, intra prediction generates a prediction block based on the surrounding pixels of the current block. Then, it generates a residual block by subtracting the prediction block from the current block.
[0005] Residual blocks generated through inter-prediction or intra-prediction are passed to a decoder after undergoing transformation and quantization. The decoder inversely quantizes and inversely transforms the residual blocks, and reconstructs the current block by combining the predicted block of the current block with the residual blocks. The decoder can filter the reconstructed current block to remove artifacts within it.
[0006] The present disclosure proposes a method for performing a sub-block transformation in a video encoding process or a video decoding process.
[0007] In one embodiment of the present disclosure, a method for decoding video is provided. The video decoding method may include the step of obtaining from a bitstream size information indicating the size of a sub-block to be used for a sub-block transformation performed on a current block, and candidate information pointing to one sub-block among a plurality of candidate sub-blocks. The video decoding method may include the step of determining the size of a sub-block to be used for a sub-block transformation of the current block based on the size information. The video decoding method may include the step of determining two or more candidate sub-blocks among the sub-blocks by comparing the sum of the change amounts of the predicted samples of the current block corresponding to the sub-blocks of the determined sub-block size. The video decoding method may include the step of obtaining residual data by performing an inverse transformation based on one sub-block pointed to by the candidate information among the two or more candidate sub-blocks. The video decoding method may include the step of obtaining a residual block containing the residual data by considering the position and orientation of the sub-block. The video decoding method may include the step of generating a restoration block of the current block based on the residual block of the current block and the prediction block.
[0008] According to one embodiment of the present disclosure, since a sub-block for transformation can be determined using prediction samples generated by performing prediction in inter-mode, the amount of information required for signaling to determine the sub-block is reduced and the computational complexity is lowered, thereby increasing compression efficiency.
[0009] FIG. 1 is a block diagram of an image decoding device according to one embodiment of the present disclosure.
[0010] FIG. 2 is a block diagram of an image encoding device according to one embodiment of the present disclosure.
[0011] FIG. 3 illustrates a process of determining at least one encoding unit by dividing a current encoding unit according to one embodiment of the present disclosure.
[0012] 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 of the present disclosure.
[0013] 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 of the present disclosure.
[0014] FIG. 6 illustrates a method for determining a predetermined encoding unit among an odd number of encoding units according to one embodiment of the present disclosure.
[0015] 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 of the present disclosure.
[0016] FIG. 8 illustrates a process for determining that, in accordance with one embodiment of the present disclosure, when the encoding unit cannot be processed in a predetermined order, the current encoding unit is divided into an odd number of encoding units.
[0017] FIG. 9 illustrates a process of determining at least one encoding unit by dividing a first encoding unit according to one embodiment of the present disclosure.
[0018] FIG. 10 illustrates that, according to one embodiment of the present disclosure, 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.
[0019] FIG. 11 illustrates a process of dividing square-shaped encoding units when the divided shape mode information cannot represent division into four square-shaped encoding units according to one embodiment of the present disclosure.
[0020] FIG. 12 illustrates that, according to one embodiment of the present disclosure, the processing order between a plurality of encoding units may vary depending on the division process of the encoding unit.
[0021] FIG. 13 illustrates a process in which, according to one embodiment of the present disclosure, 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.
[0022] 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 of the present disclosure.
[0023] 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 of the present disclosure.
[0024] FIG. 16 illustrates encoding units that can be determined for each picture when the combination of forms in which encoding units can be divided according to one embodiment of the present disclosure is different for each picture.
[0025] FIG. 17 illustrates various forms of encoding units that can be determined based on partitioned form mode information expressed in binary code according to one embodiment of the present disclosure.
[0026] 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 of the present disclosure.
[0027] FIG. 19 is a block diagram of an image encoding and decoding system that performs loop filtering according to one embodiment of the present disclosure.
[0028] FIG. 20 is a block diagram showing the configuration of a video decoding device according to one embodiment of the present disclosure.
[0029] FIG. 21 is a drawing for explaining the process of determining a sub-block according to one embodiment of the present disclosure.
[0030] FIG. 22 is a drawing for explaining the process of determining a sub-block according to one embodiment of the present disclosure.
[0031] FIG. 23 is a drawing for explaining the process of determining a sub-block according to one embodiment of the present disclosure.
[0032] FIG. 24 is a drawing for explaining the process of determining a sub-block according to one embodiment of the present disclosure.
[0033] FIG. 25 is a drawing for explaining the process of determining a sub-block according to one embodiment of the present disclosure.
[0034] FIG. 26 is a flowchart illustrating a video decoding method according to one embodiment of the present disclosure.
[0035] FIG. 27 is a diagram illustrating the process of determining a sub-block among candidate sub-blocks according to a plurality of sub-block sizes according to one embodiment of the present disclosure.
[0036] FIG. 28 is a diagram illustrating a set of conversion kernels according to the location of a sub-block according to one embodiment of the present disclosure.
[0037] FIG. 29 is a diagram illustrating the process of determining the location of a sub-block when the conversion kernel set is changed according to the location of the sub-block in accordance with one embodiment of the present disclosure.
[0038] FIG. 30 is a diagram illustrating the process of determining a subblock among candidate subblocks according to a plurality of subblock sizes according to one embodiment of the present disclosure.
[0039] FIG. 31 is a drawing for explaining the locations of possible candidate sub-blocks for each of the multiple sub-block sizes according to one embodiment of the present disclosure.
[0040] FIG. 32 is a drawing for explaining the locations of possible candidate sub-blocks for each sub-block size according to one embodiment of the present disclosure.
[0041] FIG. 33 is a diagram illustrating the process of determining a sub-block among candidate sub-blocks according to a plurality of sub-block sizes according to one embodiment of the present disclosure.
[0042] FIG. 34 is a block diagram showing the configuration of a video encoding device according to one embodiment of the present disclosure.
[0043] FIG. 35 is a flowchart illustrating a video encoding method according to one embodiment of the present disclosure.
[0044] In one embodiment of the present disclosure, a method for decoding video is provided. The video decoding method may include the step of obtaining from a bitstream size information indicating the size of a sub-block to be used for a sub-block transformation performed on a current block, and candidate information pointing to one sub-block among a plurality of candidate sub-blocks. The video decoding method may include the step of determining the size of a sub-block to be used for a sub-block transformation of the current block based on the size information. The video decoding method may include the step of determining two or more candidate sub-blocks among the sub-blocks by comparing the sum of the change amounts of the predicted samples of the current block corresponding to the sub-blocks of the determined sub-block size. The video decoding method may include the step of obtaining residual data by performing an inverse transformation based on one sub-block pointed to by the candidate information among the two or more candidate sub-blocks. The video decoding method may include the step of obtaining a residual block containing the residual data by considering the position and orientation of the sub-block. The video decoding method may include the step of generating a restoration block of the current block based on the residual block of the current block and the prediction block.
[0045] In one embodiment of the present disclosure, a video decoding device is provided. The video decoding device may include a memory for storing instructions; and at least one processor operably coupled to the memory and comprising a processing circuit. The video decoding device, by which the at least one processor executes the instructions alone or in cooperation, may obtain from a bitstream size information indicating the size of a sub-block to be used for a sub-block transformation performed on a current block, and candidate information pointing to one sub-block among a plurality of candidate sub-blocks. By which the at least one processor executes the instructions alone or in cooperation, the video decoding device may determine the size of a sub-block to be used for a sub-block transformation of the current block based on the size information obtained from the bitstream. By which the at least one processor executes the instructions alone or in cooperation, the video decoding device may determine two or more candidate sub-blocks among the sub-blocks by comparing the sum of the changes in predicted samples of the current block corresponding to the sub-blocks of the determined sub-block size. By having at least one processor execute the instructions alone or in cooperation, the video decoder can obtain residual data by performing an inverse transformation based on one sub-block pointed to by the candidate information among the two or more candidate sub-blocks. By having at least one processor execute the instructions alone or in cooperation, the video decoder can restore the residual block of the current block containing the residual data by considering the location and orientation of the sub-block.By having at least one processor execute the instructions alone or in cooperation, the video decoding device can generate a restoration block of the current block based on the residual block of the current block and the prediction block.
[0046] In one embodiment of the present disclosure, a method for encoding video is provided. The video encoding method may include the step of determining two or more candidate sub-blocks for each of the plurality of sub-block sizes by comparing the sum of the change amounts of the predicted samples of the current block corresponding to the sub-blocks of the respective sub-block sizes. The video encoding method may include the step of determining one sub-block to be used for the sub-block transformation of the current block by comparing the costs generated by the transformation of the two or more candidate sub-blocks determined for each of the plurality of sub-block sizes. The video encoding method may include the step of generating transformation coefficients for the current block by performing a transformation on residual data corresponding to the determined one sub-block. The video encoding method may include the step of encoding size information indicating the size of the one sub-block determined to be used for the sub-block transformation of the current block. The video encoding method may include the step of encoding candidate information pointing to the one sub-block among the two or more candidate sub-blocks corresponding to the size of the determined one sub-block. The video encoding method may include the step of generating a bitstream including the transform coefficient of the current block, the size information, and the candidate information.
[0047] In one embodiment of the present disclosure, a video encoding device is provided. The video encoding device may include a memory for storing instructions; and at least one processor operably coupled to the memory and comprising a processing circuit. The video encoding device, by which the at least one processor executes the instructions alone or in cooperation, may determine two or more candidate sub-blocks for each of the plurality of sub-block sizes by comparing the sum of the change amounts of the predicted samples of the current block corresponding to the sub-blocks of the respective sub-block sizes. The video encoding device, by which the at least one processor executes the instructions alone or in cooperation, may determine one sub-block to be used for the sub-block transformation of the current block by comparing the costs generated by the transformation of the two or more candidate sub-blocks determined for each of the plurality of sub-block sizes. The video encoding device, by which the at least one processor executes the instructions alone or in cooperation, may generate a transformation coefficient for the current block by performing a transformation on the residual data corresponding to the determined one sub-block. By executing the instructions, the device encoding the video can encode size information indicating the size of a sub-block determined to be used for sub-block conversion of the current block. By executing the instructions, the device encoding the video can encode candidate information pointing to one sub-block among two or more candidate sub-blocks corresponding to the size of one determined sub-block.A device for encoding the video by having at least one processor execute the instructions alone or in cooperation can generate a bitstream including the transformation coefficient of the current block, the size information, and the candidate information.
[0048] In one embodiment of the present disclosure, a method for transmitting a bitstream is provided. The bitstream transmission method may include the step of determining two or more candidate sub-blocks for each of the plurality of sub-block sizes by comparing the sum of the change amounts of predicted samples of a current block corresponding to the sub-blocks of the respective sub-block sizes. The bitstream transmission method may include the step of determining one sub-block to be used for the sub-block transformation of the current block by comparing the costs generated by the transformation of the two or more candidate sub-blocks determined for each of the plurality of sub-block sizes. The bitstream transmission method may include the step of generating a transformation coefficient of the current block by performing a transformation on residual data corresponding to the determined one sub-block. The bitstream transmission method may include the step of encoding size information indicating the size of the one sub-block determined to be used for the sub-block transformation of the current block. The bitstream transmission method may include the step of encoding candidate information pointing to the one sub-block among the two or more candidate sub-blocks corresponding to the determined one sub-block size. The bitstream transmission method may include the step of generating a bitstream including the conversion factor of the current block, the size information, and the candidate information.
[0049] 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.
[0050] In the present disclosure, the expression "a, b and / or c" may be replaced with "at least one of a, b or c." That is, the expression "a, b and / or c" may refer to "a," "b," "c," "a and b," "a and c," "b and c," "all of a, b and c," or variations thereof.
[0051] 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.
[0052] The terms used in this disclosure have been selected to be as widely used and general as possible, taking into account their functions within this disclosure; however, these terms may vary depending on the intent of those skilled in the art, case law, the emergence of new technologies, etc. Additionally, in specific cases, terms have been arbitrarily selected by the applicant, the meaning of which can be understood through the relevant explanatory sections. Therefore, the terms used in this disclosure should be defined not merely by their names, but based on their meanings and the overall content of this disclosure.
[0053] In this disclosure, singular expressions may include plural expressions unless the context clearly indicates otherwise. In describing the embodiments, detailed descriptions of related prior art are omitted if it is determined that such detailed descriptions would unnecessarily obscure the essence of this disclosure. Additionally, numbers used in the description of the embodiments (e.g., first, second, etc.) correspond to identification symbols for distinguishing one component from another.
[0054] 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.
[0055] In the present disclosure, when a part is described as "comprising" a certain component, this means that, unless specifically stated otherwise, it does not exclude other components but may include additional components. Components expressed in the present disclosure 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. Furthermore, each component described below may additionally perform some or all of the functions of other components in addition to its own primary function, and some of the primary functions of each component may be exclusively performed by other components.
[0056] As used in this disclosure, the expression “configured to” may be replaced, depending on the context, with, for example, “suitable for,” “having the capacity to,” “designed to,” “adapted to,” “made to,” or “capable of.” The term “configured to” may not necessarily mean only “specifically designed to” in hardware. Alternatively, in some situations, the expression “system configured to” may include that the system is “capable of” in conjunction with other devices or components. For example, the phrase “processor configured to perform A, B, and C” may include a dedicated processor for performing the said operations (e.g., an embedded processor), or a generic-purpose processor (e.g., a CPU or an application processor) capable of performing said operations by executing one or more software programs stored in memory.
[0057] At least one processor according to an embodiment of the present disclosure may include various processing circuits and / or multiple processors. For example, the term “processor” as used in the present disclosure, including in the claims, may include various processing circuits including at least one processor, and at least one of the at least one processor is configured to perform the various functions described herein individually and / or collectively in a distributed manner. Where “processor,” “at least one processor,” and “one or more processors” are described as being configured to perform various functions as used in the specification, these terms may include, for example, without limitation, situations in which a single processor performs. There may be situations in which some of the cited functions and other processor(s) perform other functions among the cited functions, and also situations in which a single processor can perform all the cited functions. Additionally, at least one processor may include a combination of processors that perform the various enumerated / disclosed functions, for example, in a distributed manner. At least one processor may execute program instructions to achieve or perform the various functions.
[0058] In the present disclosure, 'image' may include a picture, a still image, a frame, a video composed of a plurality of consecutive still images, or a video.
[0059] In the present disclosure, 'sample' may include data to be processed as data assigned to a sampling location of an image. For example, a sample may include pixels within a frame in a spatial region. A block may refer to a unit comprising a plurality of samples.
[0060] 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 of the present disclosure, an image decoding method and apparatus are disclosed.
[0061] FIG. 1 illustrates a block diagram of an image decoding device (100) according to one embodiment of the present disclosure.
[0062] 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.
[0063] 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.
[0064] To explain in detail the operation of the video decoding device (100), the bitstream acquisition unit (110) can receive a bitstream.
[0065] 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.
[0066] In the following, the division of a encoding unit according to one embodiment of the present disclosure will be described in detail.
[0067] 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.
[0068] 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.
[0069] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), the maximum encoding unit (CTU) is a unit that includes 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 that includes a maximum encoding block for monochrome samples and syntax structures used to encode the monochrome samples. When a picture is encoded into color planes separated by color components, the maximum encoding unit is a unit that includes syntax structures used to encode the samples of the picture and the image.
[0070] A single maximum coding block (CTB) can be divided into MxN coding blocks containing MxN samples (M and N are integers). In one embodiment, a coding block may be referred to as a coding unit.
[0071] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) is a unit that includes a coding block for luminance samples and two coding blocks for corresponding chroma samples, and syntax structures used to encode the luminance samples and chroma samples. When a picture is a monochrome picture, a coding unit is a unit that includes a coding block for monochrome samples and syntax structures used to encode the monochrome samples. When a picture is a picture encoded in color planes separated by color components, a coding unit is a unit that includes syntax structures used to encode the corresponding picture and image samples.
[0072] 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.
[0073] 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.
[0074] 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.
[0075] For example, information regarding the maximum size of a two-divisionable luma encoding block and the difference in luma block size can be obtained from a bitstream. The information regarding the difference in luma block size may indicate the size difference between the maximum luma encoding unit and the maximum two-divisionable luma encoding block. Therefore, by combining the information regarding the maximum size of the two-divisionable luma encoding block obtained from the bitstream with the information regarding the difference in luma block size, the size of the maximum luma encoding unit can be determined. Using the size of the maximum luma encoding unit, the size of the maximum chroma encoding 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 luma block, and similarly, the size of the maximum chroma encoding unit may be half the size of the maximum luma encoding unit.
[0076] 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 image I may be 32x32, and the maximum size of a ternary splittable luminous encoding block in picture P or image B may be 64x64.
[0077] 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.
[0078] For example, information indicating whether quad splitting is performed can indicate whether the current encoding unit will be quad split or not.
[0079] 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.
[0080] 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.
[0081] 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.
[0082] 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).
[0083] 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.
[0084] 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.
[0085] 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. The transformation blocks may be referred to as the transformation unit.
[0086] The shape and size of the transformation block and the prediction block may not be related to each other.
[0087] 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.
[0088] The division of the encoding unit is described in more detail in FIGS. 3 through 16. The current block and neighbor 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 neighbor block may be a block restored prior to the current block. The neighbor block may be spatially or temporally adjacent to the current block. The neighbor 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.
[0089] The above-described embodiment explains 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 an embodiment of the present disclosure.
[0090] 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 of the present disclosure.
[0091] 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.
[0092] The bitstream generation unit (210) can generate a bitstream based on an encoded input image. For example, the bitstream generation unit (210) can generate a bitstream by entropy encoding syntax elements based on a context model. In one embodiment of the present disclosure, the image encoding device (100) can generate a bitstream according to an image encoding method to be described later. The image encoding device (100) can store the bitstream in a computer-readable storage medium.
[0093] In one embodiment of the present disclosure, the image encoding device (200) can transmit a bitstream to the image decoding device (100). For example, the image encoding device (200) can transmit a bitstream generated by an image encoding method.
[0094] According to one embodiment of the present disclosure, 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.
[0095] According to one embodiment of the present disclosure, the encoding unit (220) may determine how the encoding unit will be divided. The encoding unit (220) may determine the form of at least one encoding unit included in the encoding unit, and the bitstream generation unit (210) may generate a bitstream including division form mode information including information about the form of such encoding unit.
[0096] According to one embodiment of the present disclosure, 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.
[0097] According to one embodiment of the present disclosure, 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.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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 of the present disclosure.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] According to one embodiment of the present disclosure, 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.
[0108] 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.
[0109] According to one embodiment of the present disclosure, 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.
[0110] 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 of the present disclosure. 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) may determine three encoding units (310e) that divide the current encoding unit (300) in the vertical direction based on division form mode information indicating ternary division in the vertical direction according to one embodiment of the present disclosure. The image decoding device (100) may determine three encoding units (310f) that divide the current encoding unit (300) in the horizontal direction based on division form mode information indicating ternary division in the horizontal direction. 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 predetermined division forms in which the square encoding unit is divided will be specifically described below through one embodiment of the present disclosure.
[0111] FIG. 4 illustrates a process in which an image decoding device (100) determines at least one encoding unit by dividing a non-square encoding unit according to one embodiment of the present disclosure.
[0112] According to one embodiment of the present disclosure, 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) according to 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 an embodiment of the present disclosure.
[0113] According to one embodiment of the present disclosure, 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.
[0114] According to one embodiment of the present disclosure, 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).
[0115] According to one embodiment of the present disclosure, 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).
[0116] According to one embodiment of the present disclosure, 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.
[0117] According to one embodiment of the present disclosure, an image decoding device (100) may determine an odd number of encoding units included in a 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.
[0118] According to one embodiment of the present disclosure, when 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.
[0119] 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 of the present disclosure.
[0120] According to one embodiment of the present disclosure, an 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 of the present disclosure, 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 of the present disclosure 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.
[0121] According to one embodiment of the present disclosure, 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 divide a first encoding unit (500) based on the obtained split-form mode information to divide a plurality of second encoding units (e.g., 510) of various forms, and the second encoding units (510) can be divided according to the method in which the first encoding unit (500) was divided based on the split-form mode information. According to one embodiment of the present disclosure, when the first encoding unit (500) is divided into a 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 a third encoding unit (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.
[0122] 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 of the present disclosure, 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 subdivided into an odd number of encoding units. A method that can be used for the recursive subdivision of encoding units will be described later through an embodiment of the present disclosure.
[0123] According to one embodiment of the present disclosure, 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 of the present disclosure, 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.
[0124] 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).
[0125] According to one embodiment of the present disclosure, an image decoding device (100) can obtain splitting form mode information used to split a current encoding unit at a predetermined location within the current encoding unit.
[0126] 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 of the present disclosure.
[0127] 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.
[0128] According to one embodiment of the present disclosure, 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 plurality of encoding units, and such methods will be described later through one embodiment of the present disclosure.
[0129] According to one embodiment of the present disclosure, 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.
[0130] According to one embodiment of the present disclosure, an image decoding device (100) may use information indicating the position 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 positions 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).
[0131] According to one embodiment of the present disclosure, 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 of the present disclosure, 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.
[0132] According to one embodiment of the present disclosure, information indicating the location of a sample (630a) at the upper left of an upper encoding unit (620a) may be represented by the (xa, ya) coordinates, information indicating the location of a sample (530b) at the upper left of a middle encoding unit (620b) may be represented by the (xb, yb) coordinates, and information indicating the location of a sample (630c) at the upper left of a lower encoding unit (620c) may be represented by the (xc, yc) coordinates. An image decoding device (100) may 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.
[0133] According to one embodiment of the present disclosure, 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).
[0134] According to one embodiment of the present disclosure, an 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 a sample (630a) at the top left of the upper encoding unit (620a); the (xb, yb) coordinates, which are information indicating the location of a sample (630b) at the top left of the middle encoding unit (620b); and the (xc, yc) coordinates, which are information indicating the location of a sample (630c) at the top left 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 coordinates (xa, ya), (xb, yb), and (xc, yc) which represent the positions of the encoding units (620a, 620b, 620c). According to one embodiment of the present disclosure, the image decoding device (100) can determine the width of the upper encoding unit (620a) as the width of the current encoding unit (600). The image decoding device (100) can determine the height of the upper encoding unit (620a) as yb-ya. According to one embodiment of the present disclosure, the image decoding device (100) can determine the width of the middle encoding unit (620b) as the width of the current encoding unit (600). The image decoding device (100) can determine the height of the middle encoding unit (620b) as yc-yb. According to one embodiment of the present disclosure, the image decoding device (100) can 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 image decoding device (100) can determine an 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.
[0135] 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).
[0136] According to one embodiment of the present disclosure, 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 of the present disclosure, 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 of the present disclosure, 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.
[0137] 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.
[0138] According to one embodiment of the present disclosure, 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 consideration 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 a different position in the horizontal direction and impose 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 a different position in the vertical direction and impose a restriction on that encoding unit.
[0139] According to one embodiment of the present disclosure, an image decoding device (100) may use information indicating the location of each of an even number of encoding units to determine an encoding unit at a predetermined location among an even number of encoding units. The image decoding device (100) may determine an even number of encoding units by dividing (binary division) the current encoding unit and may determine an encoding unit at a predetermined location using information regarding the locations of the even number of encoding units. A specific process for this may be omitted as it may correspond to the process of determining an encoding unit at a predetermined location (e.g., a middle location) among an odd number of encoding units described above in FIG. 6.
[0140] According to one embodiment of the present disclosure, when a current encoding unit of 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, an 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.
[0141] 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.
[0142] According to one embodiment of the present disclosure, 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 a predetermined location 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 of the present disclosure, the image decoding device (100) can determine a sample (640) located in the middle of the current encoding unit (600) as a sample from which certain information can be obtained, and the image decoding device (100) can impose a certain limit on the encoding unit (620b) containing such a sample (640) during the decoding process. However, the location of the sample from which the specified information can be obtained should not be interpreted as being limited to the location described above, but can be interpreted as samples at any location included in the encoding unit (620b) to be determined for the purpose of imposing a limitation.
[0143] According to one embodiment of the present disclosure, 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 of the present disclosure, 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.
[0144] According to one embodiment of the present disclosure, 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 of the present disclosure, 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.
[0145] According to one embodiment of the present disclosure, 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).
[0146] FIG. 7 illustrates the order in which a plurality of encoding units are processed when an image decoding device (100) determines a plurality of encoding units by dividing a current encoding unit according to one embodiment of the present disclosure.
[0147] According to one embodiment of the present disclosure, 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.
[0148] 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.).
[0149] According to one embodiment of the present disclosure, 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).
[0150] According to one embodiment of the present disclosure, 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.
[0151] According to one embodiment of the present disclosure, 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.
[0152] FIG. 8 illustrates a process in which, according to one embodiment of the present disclosure, 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.
[0153] According to one embodiment of the present disclosure, 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 of the present disclosure, 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).
[0154] According to one embodiment of the present disclosure, the image decoding device (100) can determine whether there exists 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.
[0155] According to one embodiment of the present disclosure, an image decoding device (100) can determine whether a third encoding unit (820a, 820b, 820c, 820d, 820e) included in a 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 may 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 of the present disclosure, 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 one embodiment of the present disclosure, a detailed explanation will be omitted.
[0156] 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 of the present disclosure.
[0157] According to one embodiment of the present disclosure, an image decoding device (100) may divide a first encoding unit (900) based on division shape mode information obtained through a bitstream acquisition unit (110). A square-shaped first encoding unit (900) 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, if the first encoding unit (900) is square and the division shape mode information indicates that it is divided into non-square encoding units, 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.
[0158] According to one embodiment of the present disclosure, an image decoding device (100) can determine whether a second encoding unit (910a, 910b, 910c, 920a, 920b, 920c) included in a 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 of the present disclosure, 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, etc., have been described in detail through one embodiment of the present disclosure, a detailed explanation will be omitted.
[0159] According to one embodiment of the present disclosure, the image decoding device (100) can divide the first encoding unit to determine various forms of encoding units.
[0160] 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.
[0161] FIG. 10 illustrates that, according to one embodiment of the present disclosure, when a second encoding unit in a non-square shape determined by dividing a first encoding unit (1000) satisfies a predetermined condition, the shape in which the second encoding unit can be divided is limited.
[0162] According to one embodiment of the present disclosure, an 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 of the present disclosure, the image decoding device (100) may determine a third encoding unit (1012a, 1012b) by dividing a left second encoding unit (1010a), which is a non-square shape determined by dividing a first encoding unit (1000) in a vertical direction, in a horizontal direction. However, when the image decoding device (100) divides the left second encoding unit (1010a) in a 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) was divided. 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.
[0163] According to one embodiment of the present disclosure, 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) for the reasons described above.
[0164] FIG. 11 illustrates the process of a video decoder (100) dividing square-shaped encoding units when the divided shape mode information cannot be divided into four square-shaped encoding units according to one embodiment of the present disclosure.
[0165] According to one embodiment of the present disclosure, an image decoding device (100) can determine a second encoding unit (1110a, 1110b, 1120a, 1120b, etc.) by dividing a first encoding unit (1100) based on division form mode information. The division form mode information may include information on various forms in which the encoding unit can be divided, but the information on various forms may not include information for dividing into four square-shaped encoding units. According to such division form 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.).
[0166] According to one embodiment of the present disclosure, 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.
[0167] 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).
[0168] 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).
[0169] FIG. 12 illustrates that, according to one embodiment of the present disclosure, the processing order between a plurality of encoding units may vary depending on the division process of the encoding unit.
[0170] According to one embodiment of the present disclosure, an 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 a horizontal direction and a 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 a horizontal direction or a 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.
[0171] According to one embodiment of the present disclosure, 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 description 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 of the present disclosure, 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.
[0172] According to one embodiment of the present disclosure, 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 a vertical direction into the horizontal direction, and the image decoding device (100) can process the third encoding unit (1216a, 1216c) included in the left second encoding unit (1210a) first in a vertical direction, and then process the third encoding unit (1216b, 1216d) included in the right second encoding unit (1210b) in a vertical direction according to the order (1217).
[0173] According to one embodiment of the present disclosure, 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 a 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 a horizontal direction, and then processing the third encoding unit (1226c, 1226d) included in the lower second encoding unit (1220b) in a horizontal direction.
[0174] 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.
[0175] FIG. 13 illustrates a process in which, according to one embodiment of the present disclosure, 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.
[0176] According to one embodiment of the present disclosure, the image decoding device (100) may determine the depth of an 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 an encoding unit of lower depth.
[0177] Referring to FIG. 13, according to one embodiment of the present disclosure, 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.
[0178] According to one embodiment of the present disclosure, 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), an 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.
[0179] 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.
[0180] According to one embodiment of the present disclosure, 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.
[0181] According to one embodiment of the present disclosure, 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.
[0182] According to one embodiment of the present disclosure, 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.
[0183] According to one embodiment of the present disclosure, 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.
[0184] According to one embodiment of the present disclosure, an 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 of the present disclosure, 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).
[0185] According to one embodiment of the present disclosure, 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.
[0186] 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 of the present disclosure.
[0187] According to one embodiment of the present disclosure, an 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).
[0188] According to one embodiment of the present disclosure, 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).
[0189] According to one embodiment of the present disclosure, an 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 of the present disclosure, an 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.
[0190] According to one embodiment of the present disclosure, 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).
[0191] 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).
[0192] According to one embodiment of the present disclosure, an image decoding device (100) may determine an index (PID) for distinguishing divided encoding units, and when the odd number of divided encoding units are not of the same size, the index may be determined based on the size ratio between the encoding units. Referring to FIG. 14, among the odd number of divided encoding units (1414a, 1414b, 1414c), the encoding unit (1414b) located in the middle 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). 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 value of the index. According to one embodiment of the present disclosure, 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.
[0193] According to one embodiment of the present disclosure, an image decoding device (100) may determine whether a plurality of encoding units determined by dividing from a 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 of the present disclosure, the PID may be obtained from a sample at a predetermined position of each encoding unit (e.g., the upper left sample).
[0194] According to one embodiment of the present disclosure, an image decoding device (100) may determine a coding unit at a predetermined position among the coding units determined by division using an index for distinguishing coding units. According to one embodiment of the present disclosure, 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) may divide the first coding unit (1410) into three coding units (1414a, 1414b, 1414c). The image decoding device (100) may assign an index to each of the three coding units (1414a, 1414b, 1414c). The image decoding device (100) may 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 of the present disclosure, 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 be twice the height of the encoding units (1414a, 1414c) which have different heights. 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 and then 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 the case where the division type mode information indicates that the current encoding unit is divided into an odd number of encoding units according to one embodiment of the present disclosure, 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.
[0195] According to one embodiment of the present disclosure, an image decoding device (100) may use a predetermined data unit in which recursive division of the encoding unit begins.
[0196] 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 of the present disclosure.
[0197] According to one embodiment of the present disclosure, a predetermined data unit may be defined as a data unit in which an encoding unit begins to recursively divide using partitioning mode information. That is, it may correspond to the highest depth encoding unit used in the process of determining a plurality of 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.
[0198] According to one embodiment of the present disclosure, a reference data unit may have a predetermined size and shape. According to one embodiment of the present disclosure, 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.
[0199] According to one embodiment of the present disclosure, the image decoding device (100) can divide the current picture into a plurality of reference data units. According to one embodiment of the present disclosure, 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.
[0200] According to one embodiment of the present disclosure, 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 segmented form mode information based on the determined reference data unit.
[0201] 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 of the present disclosure, 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.
[0202] According to one embodiment of the present disclosure, 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.
[0203] According to one embodiment of the present disclosure, an image decoding device (100) may use an index to identify the size and shape of a reference coding unit in order to determine the size and shape of a reference coding unit according to a portion of data units that are predetermined based on a predetermined condition. That is, a bitstream acquisition unit (110) may acquire only an index for identifying the size and shape of a reference coding unit for each slice, slice segment, tile, tile group, maximum coding unit, etc., among the various data units (e.g., sequence, picture, slice, slice segment, tile, tile group, maximum coding 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) may 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.
[0204] According to one embodiment of the present disclosure, the image decoding device (100) may utilize at least one reference encoding unit included in one maximum encoding unit (1510). That is, the maximum encoding unit (1510) 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 of the present disclosure, at least one of the width and height of the maximum encoding unit (1510) may correspond to an integer multiple of at least one of the width and height of the reference encoding unit. According to one embodiment of the present disclosure, the size of the reference encoding unit may be the size obtained by dividing the maximum encoding unit (1510) 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 (1510) n times according to a quad tree structure, and according to one embodiment of the present disclosure, the reference encoding unit may be divided based on at least one of block shape information and division shape mode information.
[0205] According to one embodiment of the present disclosure, an image decoding device (100) may obtain and use block form information indicating the form of a current encoding unit or division form mode information indicating a method of dividing a current encoding unit from a bitstream. The division form mode information may be included in a bitstream 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.
[0206] A method for determining a division rule according to one embodiment of the present disclosure will be described in detail below.
[0207] 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.
[0208] 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).
[0209] The shape of the encoding unit may include square and non-square. If the width and height of the encoding unit are the same, the image decoder (100) may determine the shape of the encoding unit as square. Additionally, if the width and height of the encoding unit are not the same, the image decoder (100) may determine the shape of the encoding unit as non-square.
[0210] 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.
[0211] 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.
[0212] 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.
[0213] 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.
[0214] 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.
[0215] 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.
[0216] FIG. 16 illustrates encoding units that can be determined for each picture when the combination of forms in which encoding units can be divided according to one embodiment of the present disclosure is different for each picture.
[0217] 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.
[0218] According to one embodiment of the present disclosure, 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) 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.
[0219] 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 of the present disclosure.
[0220] According to one embodiment of the present disclosure, 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 described above.
[0221] 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.
[0222] According to one embodiment of the present disclosure, if an 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 of the present disclosure, the division form mode information may be expressed as a two-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.
[0223] According to one embodiment of the present disclosure, when the image decoding device (100) divides a non-square 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, the image decoding device (100) may divide a non-square encoding unit into up to three units according to one embodiment of the present disclosure. 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 image decoding device (100) can use variable length coding (VLC) rather than fixed length coding (FLC) to use binary code representing segmented form mode information.
[0224] Referring to FIG. 17 according to one embodiment of the present disclosure, the binary code of the division form mode information indicating that the encoding unit is not divided can be represented as (0)b. If the binary code of the division form 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 form mode information must be used even though there is no division form mode information set to (01)b. However, as illustrated in FIG. 17, if three division forms 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 form mode information, thus allowing for efficient use of the bitstream. However, the division form of the non-square encoding unit indicated by the division form mode information should not be interpreted as being limited only to the three forms illustrated in FIG. 17, but should be interpreted as various forms including the embodiments described above.
[0225] FIG. 18 illustrates another form of encoding unit that can be determined based on partitioned form mode information that can be represented as a binary code according to one embodiment of the present disclosure.
[0226] 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.
[0227] According to one embodiment of the present disclosure, 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).
[0228] According to one embodiment of the present disclosure, an image decoding device (100) describes a process of obtaining syntax for block form information or partition form mode information through CABAC. A bitstream including 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 of the present disclosure, 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 syntax elements by performing inverse binarization of an empty string.
[0229] According to one embodiment of the present disclosure, an 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 bins obtained through a bitstream acquisition unit (110). Referring to FIG. 17, the bitstream acquisition unit (110) of the image decoding device (100) can acquire a bitstream representing a binary code representing partitioned mode information according to one embodiment of the present disclosure. Using the acquired 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.
[0230] According to one embodiment of the present disclosure, 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.
[0231] 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 form 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 form mode information by determining whether the second bin is 0 or 1 only when the first bin of the segmentation form mode information is 1. According to one embodiment of the present disclosure, the image decoding device (100) can decode the bin by considering that when the first bin of the segmentation form mode information is 1, the probability that the second bin is 0 or 1 is equal to the probability.
[0232] According to one embodiment of the present disclosure, 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 of the present disclosure, 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 of the present disclosure, 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 of the present disclosure, 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.
[0233] According to one embodiment of the present disclosure, 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.
[0234] According to one embodiment of the present disclosure, 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).
[0235] Figure 19 is a block diagram of an image encoding and decoding system that performs loop filtering.
[0236] 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).
[0237] 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 transformed coefficients (or quantized coefficients) of residual data between the prediction data and the current input image. For example, the transform coefficients may be generated using a transformation kernel that includes at least one of the Discrete Cosine Transform (DT), Discrete Sine Transform (DST), Hadamard transform, Karhunen-Loeve Transform (KLT), or Wavelet Transform. The residual data may have its information compressed as the transformation is performed. For example, the residual data may be represented using a small number of frequencies as the transformation is performed. In one embodiment, the conversion and quantization unit (1920) may omit the conversion of residual data between the prediction data and the current input image. For example, if the distribution of residual data makes it inefficient to perform the conversion, the conversion process for residual data may be omitted and the quantization process may be performed. In one embodiment, information regarding whether the conversion is omitted (or whether the conversion is performed) may be transmitted to the decoding unit (1950) via a bitstream. The entropy encoding unit (1925) encodes and converts the quantized conversion coefficients and outputs them as a bitstream. The quantized conversion coefficients may be restored to spatial domain data through the inverse quantization and inverse conversion unit (1930). The inverse quantization and inverse conversion unit (1930) may perform inverse quantization on the quantized conversion coefficients and determine residual data by applying a conversion kernel. In one embodiment, the inverse quantization and inverse conversion unit (1930) may not perform inverse conversion.For example, if the transformation for residual data is omitted, the inverse quantization and inverse transformation unit (1930) may not perform the inverse transformation. The inverse quantization and inverse transformation unit (1930) can determine residual data by performing inverse quantization on the quantized transformation coefficients. The data in the restored spatial domain is output as a restored image after passing 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 predictive encoding unit (1915).
[0238] 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).
[0239] 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).
[0240] FIG. 20 is a block diagram showing the configuration of an image decoding device according to one embodiment of the present disclosure.
[0241] Referring to FIG. 20, the video decoding device (2000) may include a processor (2010) and a memory (2020).
[0242] In one embodiment of the present disclosure, the processor (2010) may include processing circuits and / or multiple processors. For example, the processor (2010) may include various processing circuits including at least one processor, and at least one of the at least one processor may be configured to perform the various functions described in the present disclosure individually and / or collectively in a distributed manner.
[0243] In one embodiment of the present disclosure, the memory (2020) may include one or more storage media that store at least one instruction. A processor (2010) may control a video decoder (2000) by executing an instruction stored in the memory (2020). For example, the processor (2010) may control the video decoder (2000) to perform an operation by executing the instructions stored in the memory (2020) individually or collectively. In one embodiment of the present disclosure, the operation performed by the video decoder (2000) may be an operation performed by the processor (2010) of the video decoder (2000).
[0244] In one embodiment of the present disclosure, the video decoding device (2000) may correspond to the image decoding device (100) shown in FIG. 1 and / or the decoding unit (1950) shown in FIG. 19.
[0245] The video decoder (2000) can obtain a bitstream generated as a result of encoding by the video encoding device (3430). The bitstream may contain the result of encoding for the current block. The configuration and operation of the video encoding device (3430) will be described later through FIGS. 34 and 35.
[0246] In one embodiment of the present disclosure, a video decoding device (2000) may receive a bitstream from a video decoding device (3400) via a network. In one embodiment of the present disclosure, the video decoding device (2000) may obtain a bitstream from a data storage medium comprising at least one of a magnetic medium such as a hard disk, a floppy disk, and a magnetic tape, an optical recording medium such as a CD-ROM and a DVD, or a magneto-optical medium such as a floptical disk.
[0247] A video decoding device (2000) can obtain syntax elements for decoding an image from a bitstream. Values corresponding to the syntax elements may be included in the bitstream according to the hierarchical structure of the image. In one embodiment of the present disclosure, the video decoding device (2000) can obtain empty strings by entropy decoding bit sequences included in the bitstream, and obtain syntax elements corresponding to the empty strings.
[0248] In one embodiment of the present disclosure, the bitstream may include information regarding the prediction mode of the current block within the current image. The current block may include at least one of a maximum encoding unit, an encoding unit, a transform unit, or a prediction unit divided from the current image to be decoded. In one embodiment of the present disclosure, the prediction mode of the current block may include at least one of an intra mode, an inter mode, a combined mode, a geometric partitioning mode, a block copy mode, or a template matching prediction mode.
[0249] The video decoder (2000) can determine a prediction mode based on information regarding the prediction mode of the current block. The video decoder (2000) can generate a prediction block of the current block by performing a prediction according to the prediction mode.
[0250] The video decoder (2000) can generate a restored current block using a prediction block. In one embodiment of the present disclosure, the video decoder (2000) can determine the prediction block as the restored current block. In one embodiment of the present disclosure, the video decoder (2000) can generate a restored current block by combining the prediction block with residual data obtained from the bitstream by the video decoder (2000). The restored current block can be used as a reference block for the next block.
[0251] In one embodiment, the video decoder (2000) may obtain residual data from a bitstream. The residual data may include information regarding the difference between the original image (or original sample) and the predicted image (or predicted sample). In one embodiment, the video decoder (2000) may obtain a transformation coefficient of a residual block corresponding to a transformation unit from the bitstream. In one embodiment, the video decoder (2000) may obtain a residual sample of a residual block based on the transformation coefficient of the residual block. For example, the video decoder (2000) may obtain a residual sample of a residual block by performing at least one of inverse quantization or inverse transformation on the transformation coefficient of the residual block. In one embodiment, the video decoder (2000) may determine a residual sample of the encoding unit using at least a portion of a portion of the residual samples of the residual block. If the size of the residual block is larger than the size of the conversion unit, the video decoder (2000) may determine a portion of the residual samples of the residual block as residual samples of the encoding unit. Alternatively, the video decoder (2000) may determine a portion of the residual samples of the residual block, after filtering has been performed, as residual samples of the encoding unit. The video decoder (2000) may restore samples of the encoding unit based on the residual samples of the encoding unit.
[0252] The video decoder (2000) can perform sub-block inverse transformation to perform inverse transformation on a number of residual samples smaller than the size of the transformation unit corresponding to the encoding unit. Since the video decoder (2000) must determine which region of the transformation unit to acquire residual samples, it can determine the position, direction, and size of the sub-block within the encoding unit.
[0253] The video decoder (2000) can obtain candidate information pointing to a sub-block to be used for a sub-block transformation performed on the current block. The video decoder (2000) can determine the size of the sub-block to be used for the sub-block transformation of the current block. The size of the sub-block may be obtained from signaled syntax elements or determined using prediction information. Two or more candidate sub-blocks can be determined among the sub-blocks of the current sub-block size by comparing the sum of the change amounts of the prediction samples of the current block corresponding to the sub-blocks of the determined sub-block size. At this time, the location and direction of two or more candidate sub-blocks can be determined among the various locations and directions of the sub-blocks that may exist within the current block.
[0254] The video decoding device (2000) can obtain residual data by performing an inverse transformation based on one sub-block pointed to by candidate information among two or more candidate sub-blocks.
[0255] The video decoding device (2000) can obtain a residual block of the current block containing residual data by taking into account the position and orientation of the sub-block.
[0256] The video decoding device (2000) can generate a restoration block of the current block based on the current block's residual block and prediction block.
[0257] When the video decoder (2000) performs inter-prediction for the current image by referring to a reference image rather than the current image, it may refer to an image generated as a result of performing at least one in-loop filtering among deblocking filtering, SAO filtering, BIF, and ALF. The video decoder (2000) may generate a restoration block of the current block by combining the prediction block obtained by referring to the image in which in-loop filtering was performed with the residual block of the current block.
[0258] FIG. 21 is a drawing for explaining the process of determining a sub-block according to one embodiment of the present disclosure.
[0259] In one embodiment of the present disclosure, a encoding unit may be divided into one or more transformation units. When a subblock transform is applied to the encoding unit, only one of the one or more transformation units of the encoding unit may have residual data. For example, among the plurality of transformation units of the encoding unit, one transformation unit may obtain residual data from information parsed through a bitstream, and the remaining transformation units may be determined to have a residual coefficient of 0. In one embodiment of the present disclosure, a subblock may refer to a transformation unit having residual data among one or more transformation units.
[0260] In one embodiment, the video decoding device (2000) can obtain at least one of information related to the division size of a encoding unit, information regarding the division direction of a encoding unit, or information regarding the location of a sub-block inside a encoding unit from a bitstream.
[0261] In one embodiment, the video decoder (2000) can obtain information regarding whether a sub-block conversion is applied (e.g., cu_sbt_flag) through a bitstream. For example, if a sub-block conversion is applied, the video decoder (2000) can obtain at least one of information regarding the division size of the encoding unit, information regarding the division direction of the encoding unit, or information regarding the location of the sub-block within the encoding unit from the bitstream. In one embodiment, the video decoder (2000) can obtain information regarding whether a sub-block conversion is applied from the bitstream when the encoding unit is predicted using inter-prediction.
[0262] In one embodiment, information regarding the division size (e.g., cu_sbt_quad_flag) may indicate the size of the sub-block. For example, the video decoder (2000) may determine, based on the information regarding the division size, whether the size of the sub-block corresponds to 1 / 2 (e.g., cu_sbt_quad_flag == 0) or 1 / 4 (e.g., cu_sbt_quad_flag == 1) the width of the encoding unit.
[0263] In one embodiment, the video decoder (2000) may determine the size of a sub-block without obtaining information regarding the division size. The video decoder (2000) may determine the division size based on at least one of the height or width of the encoding unit. For example, the video decoder (2000) may determine the size of the sub-block to be 1 / 4 of the encoding unit when the height of the encoding unit in the horizontal division is greater than or equal to a predetermined value. For example, the video decoder (2000) may determine the size of the sub-block to be 1 / 2 of the encoding unit when the height of the encoding unit in the horizontal division is smaller than a predetermined value. In one embodiment, the sub-block may be a division of the encoding unit into N equal parts (e.g., N is a power of 2).
[0264] In one embodiment, information regarding the division direction (cu_sbt_horizontal_flag) may indicate the division direction of the encoding unit. For example, the video decoder (2000) may determine whether to divide the encoding unit in a horizontal direction (e.g., cu_sbt_horizontal_flag == 0) or in a vertical direction (e.g., cu_sbt_horizontal_flag == 1) based on the information regarding the division direction.
[0265] In one embodiment, information regarding the location of a sub-block (cu_sbt_pos_flag) may indicate the location of the sub-block in a divided encoding unit. For example, a video decoder (2000) may determine that the location of the sub-block is one of the upper, lower, left, or right side based on the information regarding the location of the sub-block.
[0266] Referring to FIG. 21, a sub-block can be determined based on information regarding the division size (cu_sbt_quad_flag), information regarding the division direction (cu_sbt_horizontal_flag), and information regarding the position of the sub-block (cu_sbt_pos_flag). In one embodiment, the shaded area of the encoding unit in FIG. 21 may represent a sub-block. The square area outside the shaded area may represent the encoding unit. Although the encoding unit in FIG. 27 according to one embodiment is depicted as a square, it is not limited thereto, and the encoding unit may be rectangular.
[0267] Referring to FIG. 21, in one embodiment, when a sub-block is half of a encoding unit (cu_sbt_quad_flag==0), the encoding unit is horizontally divided (cu_sbt_horizontal_flag==1), and the sub-block is located below the encoding unit (cu_sbt_pos_flag==1), the video decoder (2000) determines that the sub-block is located below the encoding unit and can perform decoding for the conversion coefficient of the sub-block.
[0268] In one embodiment of the present disclosure, the video decoder (2000) may apply an inverse transform kernel to a sub-block. For example, the video decoder (2000) may obtain a residual sample by applying an inverse transform kernel to a transform coefficient. The inverse transform kernel may include at least one of DCT8, DST7, or DCT2. The transform kernel type refers to a combination of a transform kernel for horizontal inverse transform and a transform kernel for vertical inverse transform. The transform kernel type may also be referred to as a transform kernel set. The transform kernel type may be determined according to the position of the sub-block. For example, if the sub-block is located to the left of the encoding unit, the transform kernel type may be (DCT8, DST7). For example, if the sub-block is located to the upper side of the encoding unit, the transform kernel type may be (DST7, DCT8). If the sub-block is located to the right or lower side of the encoding unit, the transform kernel type may be (DST7, DST7).
[0269] In one embodiment of the present disclosure, the video decoding device (2000) can obtain a restored sample based on the sum of a residual sample and a predicted sample.
[0270] A video decoding device (2000) according to one embodiment may perform entropy decoding using two context information to obtain information (cu_sbt_flag) regarding whether a sub-block conversion is applied from a bitstream. For example, depending on whether the product of the width and height of the encoding unit is less than or equal to 256, context increment information for obtaining information regarding whether a sub-block conversion is applied may be determined to be 1 or 0.
[0271] A video decoding device (2000) according to one embodiment may perform entropy decoding using one context information to obtain information regarding the partition size (cu_sbt_quad_flag) from a bitstream. For example, the context increment information for obtaining information regarding the partition size may be determined to be 0.
[0272] A video decoding device (2000) according to one embodiment may perform entropy decoding using three context information to obtain information regarding the division direction (cu_sbt_horizontal_flag) from a bitstream. For example, context increment information may be determined as 0, 1, or 2 depending on whether the width and height of the encoding unit are the same, or whether the width is larger or the height is larger.
[0273] A video decoding device (2000) according to one embodiment may perform entropy decoding using one context information to obtain information (cu_sbt_pos_flag) regarding the location of a sub-block from a bitstream. For example, the context increment information for the information regarding the location of a sub-block may be determined to be 0.
[0274] FIG. 22 is a drawing for explaining the process of determining a sub-block according to one embodiment of the present disclosure.
[0275] The video decoding device (2000) can determine the sub-blocks included in the encoding unit based on information obtained from the bitstream.
[0276] In one embodiment, the video decoder (2000) may obtain at least one of information related to the division size of a encoding unit, information regarding the division direction of a encoding unit, or information regarding the location of a sub-block within a encoding unit from a bitstream. For convenience of explanation, among the information obtained from the bitstream, the details described with reference to FIG. 21 are omitted.
[0277] In one embodiment, information regarding the location of a sub-block (cu_sbt_pos_flag) may indicate the location of a sub-block in a divided encoding unit. For example, a video decoder (2000) may determine, based on the information regarding the location of a sub-block, that the location of the sub-block is at least one of the upper, middle, lower, left, or right side. In one embodiment, the information regarding the location of a sub-block may be represented as index information, such as cu_sbt_pos_idx.
[0278] Referring to FIG. 22, a conversion unit can be determined based on information regarding the division size (cu_sbt_quad_flag), information regarding the division direction (cu_sbt_horizontal_flag), and information regarding the position of the sub-block (cu_sbt_pos_flag). In one embodiment, the shaded area of the encoding unit in FIG. 22 may represent a sub-block.
[0279] Referring to FIG. 22, in one embodiment, when the size of a sub-block is half the size of a encoding unit (cu_sbt_quad_flag==0), the encoding unit is horizontally divided (cu_sbt_horizontal_flag==1), and the sub-block is located in the middle of the encoding unit (cu_sbt_pos_flag==1), the video decoder (2000) can perform decoding for a sub-block that has the same width as the encoding unit located in the middle area of the encoding unit and half the height.
[0280] Referring to FIG. 22, in one embodiment, when the size of a sub-block is 1 / 4 of the size of a encoding unit (cu_sbt_quad_flag==1), the encoding unit is vertically divided (cu_sbt_horizontal_flag==0), and the sub-block is located at the right edge of the encoding unit (cu_sbt_pos_flag==3), the video decoder (2000) can perform decoding for a sub-block that has the same height as the encoding unit located in the right edge area of the encoding unit and has a width of 1 / 4.
[0281] In one embodiment, the transform tree syntax structure can be represented as shown in Table 1. In the transform tree syntax, the transform unit can be determined based on information related to the division size of the encoding unit (cu_sbt_quad_flag), information regarding the division direction of the encoding unit (cu_sbt_horizontal_flag), and information regarding the position of the current sub-block within the encoding unit (cu_sbt_pos_flag). For example, when cu_sbt_horizontal_flag == 0 and cu_sbt_pos_flag == 1, the encoding unit is divided into three transform units, and the width ratio of each transform unit is 1:2:1.
[0282] transform_tree( x0, y0, tbWidth, tbHeight, treeType, chType ) {DescriptorInferTuCbfLuma = 1if( IntraSubPartitionsSplitType = = ISP_NO_SPLIT && !cu_sbt_flag ) {...}} else if( cu_sbt_flag ) {if( !cu_sbt_horizontal_flag ) {if( cu_sbt_pos_flag = = 0 ) {...} else if( cu_sbt_pos_flag = = 1 ) {if( cu_sbt_quad_flag = = 0 ) {transform_unit( x0, y0, tbWidth / 4, tbHeight, treeType, 0, 0, 1 )transform_unit( x0 + tbWidth / 4, y0, tbWidth / 2, tbHeight, treeType, 1, 0, 0 )transform_unit( x0 + tbWidth * 3 / 4, y0, tbWidth / 4, tbHeight, treeType, 2, 0, 1 )} else { / ( cu sbt_quad_flag = = 1 )transform_unit( x0, y0, tbWidth / 4, tbHeight, treeType, 0, 0, 1 )transform_unit( x0 + tbWidth / 4, y0, tbWidth / 4, tbHeight, treeType, 1, 0, 0 )transform_unit( x0 + tbWidth / 2, y0, tbWidth / 2, tbHeight, treeType, 2, 0, 1 )}} else if( cu_sbt_pos_flag = = 2 ) {...}} else { / ( cu_sbt_pos_flag = = 3 )...}}} else { / horizontal split cases}...}
[0283] In one embodiment, information regarding the location of a sub-block (cu_sbt_pos_flag) may indicate that the sub-block is located on the upper, lower, left, and right sides of the encoding unit, as shown in FIG. 21. In this example, information regarding the location of the sub-block may be represented by 1 bit. In one embodiment, information regarding the location of the sub-block (cu_sbt_pos_flag) may indicate that the sub-block is located on at least one of the upper, middle, lower, left, and right sides of the encoding unit, as shown in FIG. 22. In this example, information regarding the location of the sub-block may be represented by 2 bits. In one embodiment, information regarding the location of a sub-block may be included in the header of the bitstream (e.g., Sequence Parameter Set, Video Parameter Set, Picture Header, Slice Header, CTU (coding tree unit) unit, CU (coding unit) unit, PU (prediction unit), TU (transform unit) unit) as to whether the information regarding the location of a sub-block indicates that the transformation unit is located in the intermediate region of the coding unit. For a specific unit, it may be determined whether the information regarding the location of a sub-block indicates that the transformation unit is located in the intermediate region of the coding unit.
[0284] In one embodiment, information regarding the location of a sub-block is represented by 1 bit, and an extension flag indicating whether the conversion unit represents the middle region and / or both edge regions of the encoding unit may be used. For example, the video decoder (2000) can determine the sub-block shown in FIG. 21 when the extension flag is 0. For example, the video decoder (2000) can determine a sub-block not represented in FIG. 21 among the sub-blocks shown in FIG. 22 when the extension flag is 1.
[0285] FIG. 23 is a drawing for explaining the process of determining a sub-block according to one embodiment of the present disclosure.
[0286] In one embodiment, the height and width of the sub-block may be smaller than the height and width of the encoding unit, respectively. Referring to FIG. 21 and FIG. 22, the width or height of the sub-block according to one embodiment is equal to the encoding unit, but as shown in FIG. 23, the width of the sub-block according to one embodiment may be smaller than the width of the encoding unit, and the height of the sub-block may be smaller than the height of the encoding unit.
[0287] In one embodiment, the width of the sub-block may be 1 / N of the encoding unit, and the height of the conversion unit may be 1 / M of the encoding unit. For example, the width and height of the sub-block may each be half the width and height of the encoding unit (e.g., N = 2, M = 2). FIG. 23 is an example of a case where the width and height of the sub-block according to one embodiment of the present disclosure are each half the width and height of the encoding unit, and the shaded area may represent the sub-block.
[0288] In one embodiment, information regarding the division size may include information regarding the division ratio of the height of the encoding unit and the division ratio of the width of the encoding unit. For example, information regarding the division size may include information indicating the values of N and M (e.g., N is the ratio of the width of the encoding unit to the width of the encoding unit, and M is the ratio of the height). In one embodiment of the present disclosure, a video decoder (2000) may obtain information indicating whether the height of a sub-block is smaller than the height of the encoding unit and the width of the sub-block is smaller than the width of the encoding unit. For example, the video decoder (2000) may obtain information (e.g., sbt_corner_flag) indicating whether the sub-block is located at the corner or center of the encoding unit. If the sub-block is located at the corner or center of the encoding unit, it may mean that the height and width of the sub-block are smaller than the height and width of the encoding unit, respectively.
[0289] In one embodiment, the video decoder (2000) may omit information regarding the division direction and determine the conversion unit based on information regarding the location of the sub-block. Information regarding the location of the sub-block may indicate one of the predetermined locations of the conversion unit. For example, with reference to FIG. 23, information regarding the location of the sub-block may indicate one of the locations of five sub-blocks (2310-2350). In one embodiment, the sub-blocks (2310, 2320, 2330, 2340) may be adjacent to two intersecting edges of the encoding unit. In one embodiment, the sub-block (2350) may not be adjacent to an edge. However, not limited thereto, in one embodiment, the sub-block may be adjacent to one edge of the encoding unit. For example, the sub-block may be adjacent to only one of the upper, lower, left, or right boundaries of the encoding unit.
[0290] FIG. 24 is a drawing for explaining the process of determining a sub-block according to one embodiment of the present disclosure.
[0291] The video decoding device (2000) and the video encoding device (3430) can perform conversion using corner sub-blocks (2410, 2420, 2430, 2440, 2460, 2470, 2480, 2490) adjacent to only one corner of the encoding unit (2400) or a center sub-block (2450) located in the center.
[0292] According to one embodiment, the width and height of the corner sub-blocks (2410, 2420, 2430, 2440, 2460, 2470, 2480, 2490) and the center sub-block (2450) may each be 1 / 2 of the width and 1 / 2 of the height of the encoding unit, or 1 / 4 of the width and 1 / 4 of the height of the encoding unit.
[0293] The conversion kernel type can be determined according to the positions of the corner sub-blocks (2410, 2420, 2430, 2440, 2460, 2470, 2480, 2490) and the center sub-block (2450). For example, if the corner sub-blocks (2410, 2460) are located at the upper-left corner of the encoding unit (2400), the conversion kernel type may be (DCT8, DCT8). For example, if the corner sub-blocks (2420, 2470) are located at the upper-right corner of the encoding unit (2400), the conversion kernel type may be (DST7, DCT8). If the corner sub-blocks (2430, 2480) are located at the lower-left corner of the encoding unit (2400), the conversion kernel type may be (DCT8, DST7). If the corner sub-block (2440, 2490) is located at the lower right corner of the encoding unit (2400), the conversion kernel type may be (DST7, DST7). The conversion kernel type for the center sub-block (2450) may be (DST1, DST1).
[0294] A video decoding device (2000) according to one embodiment can obtain from a bitstream information for determining the size of a subblock, side / corner subblock information, information on the division direction of a coding unit, and position information within a coding unit in order to determine which mode among subblock modes including a corner / center subblock will be used.
[0295] According to one embodiment, a video decoding device (2000) may obtain information from a bitstream indicating whether a sub-block is 1 / 2 the size of the width or height of a coding unit or a sub-block is 1 / 4 the size. Side / corner sub-block information may be obtained from a bitstream indicating whether a conversion using a corner / center sub-block as in FIG. 24 is performed, or whether a conversion using a side sub-block generated by a vertical or horizontal division of a coding unit of FIG. 21 or 22 is performed.
[0296] If a side sub-block is used for conversion based on corner sub-block information, information indicating whether the division for generating a sub-block from the encoding unit is a vertical division or a horizontal division, and the position information of the sub-block (left or right / upper or lower side) can be additionally obtained as a bitstream.
[0297] If a corner / center sub-block is used for transformation based on corner sub-block information, position information indicating whether it is a sub-block for the upper-left corner, upper-right corner, lower-left corner, lower-right corner, or center can be additionally obtained from the bitstream.
[0298] Hereinafter, with reference to FIGS. 25 to 35, a method for determining a sub-block for the inverse transformation of a current block using the amount of change of predicted samples is described in detail, in which a video decoding device (2000) and a video encoding device (3430) obtain information regarding the division direction of the encoding unit and information regarding the position of the current sub-block within the encoding unit from the bitstream or do not encode it.
[0299] The region within a coding unit where non-zero residuals exist is the part that actually requires inverse transformation. Since regions within a coding unit with large variations in predicted samples are likely to contain non-zero residuals, if transformation / inverse transformation is selectively performed on residuals corresponding to the region with the largest sum of variations in predicted samples, the amount of computation required for transformation / inverse transformation of residuals within the coding unit can be reduced compared to performing transformation / inverse transformation on the entire region of the coding unit.
[0300] According to one embodiment, the video decoding device (2000) and the video encoding device (3430) can determine sub-blocks using prediction samples of the current block generated by performing prediction in inter-mode, thereby minimizing the amount of information required for signaling to determine sub-blocks and reducing the computational complexity for determining sub-blocks, so that compression efficiency can be increased.
[0301] A video decoding device (2000) according to one embodiment may acquire sub-block conversion mode information for a encoding unit or a conversion unit. For example, sub-block conversion mode information may be acquired at the encoding unit syntax level or sub-block conversion mode information may be acquired at the conversion unit syntax level. The sub-block conversion mode information according to one embodiment may indicate whether to perform sub-block conversion using either a first sub-block conversion mode or a second sub-block conversion mode. The sub-block conversion mode information according to one embodiment may indicate whether to perform sub-block conversion using a mode that does not perform sub-block conversion, or a mode among the first sub-block conversion mode and the second sub-block conversion mode. According to the first sub-block conversion mode, in order to determine the sub-blocks to be used for conversion, information regarding the division direction of the encoding unit and information regarding the position of the current sub-block within the encoding unit may be acquired from the bitstream. According to the second sub-block conversion mode, information regarding the division direction of the encoding unit and information regarding the position of the current sub-block within the encoding unit are not obtained from the bitstream, and the sub-blocks to be used for conversion can be determined.
[0302] A video encoding device (3430) according to one embodiment may encode sub-block conversion mode information for an encoding unit or a conversion unit. For example, sub-block conversion mode information may be encoded at the encoding unit syntax level or sub-block conversion mode information may be encoded at the conversion unit syntax level. According to the first sub-block conversion mode, information regarding the division direction of the encoding unit and information regarding the location of the current sub-block within the encoding unit may be encoded to determine the sub-blocks to be used for conversion. According to the second sub-block conversion mode, information regarding the division direction of the encoding unit and information regarding the location of the current sub-block within the encoding unit are not encoded to determine the sub-blocks to be used for conversion.
[0303] FIG. 25 is a drawing for explaining the process of determining a sub-block according to one embodiment of the present disclosure.
[0304] A video decoding device (2000) according to one embodiment can obtain sub-block conversion mode information from a bitstream. Sub-block conversion mode information for a encoding unit (2500) can be obtained at an encoding unit syntax level or a conversion unit syntax level.
[0305] A video decoding device (2000) according to one embodiment may obtain information regarding the size of a sub-block of an encoding unit (2500) from a bitstream to determine sub-blocks (2510, 2520, 2560, 2570). The information regarding the size of a sub-block according to one embodiment may be information encoded by the video encoding device (3430) through a comparison process (2505) of the RD cost for each size of the sub-block. The RD cost comparison process (2505) of the video encoding device (3430) will be described in detail later with reference to FIGS. 34 and 35.
[0306] A video decoding device (2000) according to one embodiment may not obtain information regarding the division direction of a encoding unit (2500) and information regarding the position of a current sub-block within an encoding unit from a bitstream in order to determine sub-blocks (2510, 2520, 2560, 2570).
[0307] Depending on whether the sub-block conversion mode information represents the first sub-block conversion mode or the second sub-block conversion mode, information regarding the division direction of the encoding unit (2500) and information regarding the position of the current sub-block inside the encoding unit may or may not be obtained from the bitstream.
[0308] If the sub-block conversion mode information indicates a first sub-block conversion mode, the video decoder (2000) can obtain information regarding the division direction of the encoding unit and information regarding the location of the current sub-block within the encoding unit from the bitstream. If the sub-block conversion mode information indicates a second sub-block conversion mode, the video decoder (2000) may not obtain information regarding the division direction of the encoding unit and information regarding the location of the current sub-block within the encoding unit from the bitstream.
[0309] The size of a sub-block of a encoding unit (2500) may be limited to a specific size. For example, it may be 1 / 2, 1 / 4, ..., 1 / N of the width of the encoding unit (2500) (hereinafter referred to as 1 / 2 size, 1 / 4 size, ..., 1 / N size). N may be a power of 2. In the embodiment illustrated in FIG. 25, only sub-blocks of 1 / 2 and 1 / 4 of the width of the encoding unit (2500) are allowed. However, it should be noted that this is a size set only for convenience of explanation, and the size of the sub-block is not limited only to 1 / 2 and 1 / 4 of the width of the encoding unit.
[0310] A video decoding device (2000) according to one embodiment may use the change amount of a predicted sample of a coding unit (2500) to determine the position and direction of a sub-block. Sub-block conversion may be allowed in a coding unit predicted in inter-mode. Among the predicted samples of a coding unit generated by prediction in inter-mode, the value of the change amount of the predicted samples belonging to the region corresponding to the sub-block within the coding unit (2500) may be obtained. Here, as the change amount of the predicted samples, the gradient value of the predicted samples, or the variance value and standard deviation value of the predicted samples may be used.
[0311] According to one embodiment, the amount of change of the prediction samples may be the amount of change between adjacent prediction samples. For example, the gradient value between prediction samples adjacent to the left and right may be the amount of change of the prediction samples. The gradient value between prediction samples adjacent to the top and bottom may be the amount of change of the prediction samples. Alternatively, the gradient value between prediction samples adjacent to the left, right, top, and bottom may be the amount of change of the prediction samples. Alternatively, the variance value or standard deviation value of the prediction samples included in a defined area may be the amount of change between the prediction samples.
[0312] A video decoding device (2000) according to one embodiment may utilize the amount of change of predicted samples corresponding to the area of the sub-blocks among the sub-blocks of size 1 / 2 that may exist within the encoding unit (2500) when the sub-block size is 1 / 2 size. Among the sub-blocks of size 1 / 2 that may exist, the location of the sub-blocks (2510, 2520) that maximize the sum of the amount of change of the predicted samples may be determined. Similarly, a video decoding device (2000) according to one embodiment may determine the direction of the sub-block (2530) that maximizes the sum of the amount of change of the corresponding predicted samples among the previously selected sub-blocks of size 1 / 2 (2510, 2520). A video decoding device (2000) according to one embodiment may simultaneously select the location and direction of the sub-block (2530) that maximizes the value of the amount of change of the predicted samples corresponding to the area of the sub-blocks among the sub-blocks of size 1 / 2 that may exist within the encoding unit (2500). Therefore, the sub-block (2530) can be determined as the final sub-block.
[0313] A video decoding device (2000) according to one embodiment may utilize the amount of change of predicted samples corresponding to the area of the sub-blocks among the 1 / 4 size sub-blocks that may exist within the encoding unit (2500) when the sub-block size is 1 / 4 size. Among the 1 / 4 size sub-blocks that may exist, the location of the sub-blocks (2560, 2570) that maximize the sum of the amount of change of the predicted samples may be determined. Similarly, a video decoding device (2000) according to one embodiment may determine the direction of the sub-block (2580) that maximizes the sum of the amount of change of the corresponding predicted samples among the previously selected 1 / 4 size sub-blocks (2560, 2570). A video decoding device (2000) according to one embodiment may simultaneously select the location and direction of the sub-block (2580) that maximizes the value of the amount of change of the predicted samples corresponding to the area of the sub-blocks among the 1 / 4 size sub-blocks that may exist within the encoding unit (2500). Therefore, the sub-block (2580) can be determined as the final sub-block.
[0314] When determining the position of a sub-block, the optimal position can be determined by moving the sub-block area by 1 pixel to the left / right or by 1 pixel to the upper / lower side. However, considering that deblocking filtering must be performed even at the boundary of the conversion unit, it may be desirable to determine the conversion unit in units of 4 pixels. Accordingly, a video decoding device (2000) according to one embodiment can determine the optimal position of a sub-block by moving the sub-block area to the left / right or to the upper / lower side in units of 4 pixels.
[0315] According to one embodiment, the conversion kernel type for sub-block conversion may be (DCT2, DCT2).
[0316] Referring to FIGS. 26 to 33 below, a method for a video decoding device (2000) to minimize signaling of information regarding the position, direction, and size of a sub-block and to select a more accurate sub-block is described in detail.
[0317] FIG. 26 is a flowchart illustrating a video decoding method according to one embodiment of the present disclosure.
[0318] In step s2610, a video decoding device (2000) according to one embodiment may obtain from a bitstream size information indicating the size of a sub-block to be used for sub-block conversion performed on the current block, and candidate information pointing to one sub-block among a plurality of candidate sub-blocks. Hereinafter, the current block may be an encoding unit.
[0319] In step s2620, a video decoding device (2000) according to one embodiment can determine the size of a sub-block to be used for sub-block conversion of the current block based on size information obtained from a bitstream.
[0320] In step s2630, a video decoder (2000) according to one embodiment can compare the sum of the changes in the predicted samples of the current block corresponding to sub-blocks of a determined sub-block size. Based on the comparison of the sum of the changes in the predicted samples corresponding to the sub-blocks, the video decoder (2000) according to one embodiment can determine two or more candidate sub-blocks among the sub-blocks.
[0321] In step s2640, a video decoding device (2000) according to one embodiment may perform inverse transformation based on one sub-block pointed to by candidate information among two or more candidate sub-blocks. A video decoding device (2000) according to one embodiment may obtain residual data as a result of the inverse transformation of the sub-block.
[0322] In step s2650, a video decoding device (2000) according to one embodiment can restore a residual block of a current block containing residual data by considering the location and orientation of a sub-block. The video decoding device (2000) can determine a residual block corresponding to a current block and a current encoding unit by considering that only the area corresponding to the sub-block has a residual value, and the area not corresponding to the sub-block has a value of 0.
[0323] In step s2660, a video decoding device (2000) according to one embodiment can generate a restoration block of the current block based on the residual block and the prediction block of the current block.
[0324] In step s2630, a video decoding device (2000) according to one embodiment may sort the subblocks in order of the largest value of change by comparing the sum of the change amounts of prediction samples in the region corresponding to each subblock within the prediction block used in the inter-prediction of the current block for each subblock of the corresponding subblock size. Among the sorted subblocks, the position and orientation of two or more candidate subblocks may be determined. The above embodiment is described in detail with reference to FIGS. 25, 27 to 32.
[0325] A sub-block transformation according to one embodiment may be one of a transformation applied to sub-blocks created by dividing the current encoding unit in the horizontal direction, a transformation applied to sub-blocks created by dividing the current encoding unit in the vertical direction, or a transformation applied to sub-blocks corresponding to an arbitrary area of a predetermined size within the current encoding unit.
[0326] In step s2630, a video decoding device (2000) according to one embodiment may determine two or more candidate subblocks among subblocks of the corresponding subblock size generated by dividing the current block in the horizontal direction and subblocks of the corresponding subblock size generated by dividing the current block in the vertical direction, when the subblock transformation is a side subblock transformation. The subblocks in FIG. 27 may be subblocks for side subblock transformation.
[0327] In step s2630, a video decoding device (2000) according to one embodiment may determine one or more candidate sub-blocks among the sub-blocks generated by dividing the current block into a first size in the horizontal direction and a second size in the vertical direction when the sub-block transformation is a corner sub-block transformation. The sub-blocks in FIG. 30 may be sub-blocks for corner sub-block transformation.
[0328] In step s2640, a video decoding device (2000) according to one embodiment may determine a combination of a horizontal conversion kernel and a vertical conversion kernel according to the position of a sub-block. A conversion kernel type may be determined according to the position of a sub-block. The position of the sub-block may be any one of a left sub-block, a right sub-block, an upper sub-block, a lower sub-block, a horizontal center sub-block, and a vertical center sub-block. The above embodiment is described in detail with reference to FIGS. 28, 29, and 30.
[0329] In step s2620, a video decoding device (2000) according to one embodiment may obtain information from a bitstream indicating the size of a sub-block conversion to be used for sub-block conversion of the current block. Based on the information indicating the size of the sub-block conversion, the size of a sub-block to be used for sub-block conversion of the current block may be determined. The size of the sub-block may be 1 / 2, 1 / 4, ..., 1 / N (where N is a power of 2). The above embodiment is described in detail with reference to FIGS. 25, 27, 29 and 30.
[0330] In step s2620, a video decoder (2000) according to one embodiment may determine the size of a subblock to be used for subblock transformation of the current block based on the result of comparing values related to the amount of change of prediction samples in the region corresponding to each candidate subblock within the prediction block used in the inter-prediction of the current block for one candidate subblock determined for each of the plurality of subblock sizes. The amount of change of prediction samples may be any one of the gradient, variance, and standard deviation values between adjacent prediction samples. The above embodiment is described in detail with reference to FIG. 33.
[0331] FIG. 27 is a diagram illustrating the process of determining a sub-block among candidate sub-blocks according to a plurality of sub-block sizes according to one embodiment of the present disclosure.
[0332] A video decoding device (2000) according to one embodiment can sort subblocks in order of largest change amount by comparing the sum of the change amounts of prediction samples in the region corresponding to each subblock within the prediction block used in the inter-prediction of the current block for each subblock of a currently determined subblock size. Among the sorted subblocks, the location and direction of two or more candidate subblocks can be determined. That is, among the subblocks sorted in order of largest sum of change amounts of prediction samples, two or more candidate subblocks with the largest sum of change amounts can be determined.
[0333] Specifically, in FIG. 27, the video decoding device (2000) may determine a subblock from among 1 / 2 size subblocks (2710, 2720) or 1 / 4 size subblocks (2760, 2770) to determine a subblock of the encoding unit (2700). The video decoding device (2000) according to one embodiment may obtain from the bitstream information regarding whether to use 1 / 2 size or 1 / 4 size among the 1 / 2 size subblocks (2710, 2720) or 1 / 4 size subblocks (2760, 2770), that is, information regarding the size of the subblock. The information regarding the size of the subblock according to one embodiment may be information encoded by the video encoding device (3430) through a comparison process (2705) of the RD cost for each size of the subblock. The RD cost comparison process (2705) of the video encoding device (3430) will be described in detail later through FIGS. 34 and 35.
[0334] First, when information regarding the size of the sub-block indicates a size of 1 / 2, the video decoder (2000) may select (2750) two or more candidate sub-blocks (2730, 2740) from among vertical sub-blocks (2710) of 1 / 2 size created by dividing the encoding unit (2700) in the vertical direction and horizontal sub-blocks (2720) of 1 / 2 size created by dividing the encoding unit (2700) in the horizontal direction. The vertical sub-blocks (2710) are sub-blocks having a size of 1 / 2 of the width of the encoding unit (2700) and can be positioned by moving left and right within the encoding unit (2700). The horizontal sub-blocks (2720) are sub-blocks having a size of 1 / 2 of the height of the encoding unit (2700) and can be positioned by moving up and down within the encoding unit (2700). When selecting candidate sub-blocks (2730, 2740) from among vertical sub-blocks (2710) and horizontal sub-blocks (2720), one vertical sub-block and one horizontal sub-block may be selected from among the vertical sub-blocks (2710) and horizontal sub-blocks (2720). One vertical sub-block may be selected by comparing the sum of the changes in the prediction samples corresponding to the vertical sub-blocks (2710), and one horizontal sub-block may be selected by comparing the sum of the changes in the prediction samples corresponding to the horizontal sub-blocks (2720).
[0335] Alternatively, when selecting candidate sub-blocks (2730, 2740) from among the vertical sub-blocks (2710) and horizontal sub-blocks (2720), the amount of change in the prediction samples corresponding to the corresponding area can be detected for each of the vertical sub-blocks (2710) and the horizontal sub-blocks (2720). By comparing the sum of the amounts of change in the prediction samples for each of the vertical sub-blocks (2710) and the horizontal sub-blocks (2720), two or more sub-blocks (2730, 2740) with the largest amount of change can be obtained. That is, the sum of the amounts of change in the prediction samples corresponding to the sub-block (2730) and the sum of the amounts of change in the prediction samples corresponding to the sub-block (2740) are greater than the sum of the amounts of change in the prediction samples corresponding to any other 1 / 2 size sub-block.
[0336] A video decoding device (2000) according to one embodiment may obtain candidate information from a bitstream that points to a sub-block to be used for sub-block conversion of a encoding unit (2700). The video decoding device (2000) may determine one candidate sub-block pointed to by the candidate information among two or more candidate sub-blocks of half size (2730, 2740). For example, if the candidate information indicates 0, the candidate sub-block (2730) may be selected as the final sub-block among the candidate sub-blocks of half size (2730, 2740). If the candidate information indicates 1, the candidate sub-block (2740) may be selected as the final sub-block among the candidate sub-blocks of half size (2730, 2740).
[0337] Additionally, when information regarding the size of the sub-block indicates a 1 / 4 size, the video decoder (2000) may select (2795) two or more candidate sub-blocks (2780, 2790) from among vertical sub-blocks (2760) of 1 / 4 size created by dividing the encoding unit (2700) in the vertical direction and horizontal sub-blocks (2770) of 1 / 4 size created by dividing the encoding unit (2700) in the horizontal direction. The vertical sub-blocks (2760) are sub-blocks having a size of 1 / 4 of the width of the encoding unit (2700) and can be positioned by moving left and right within the encoding unit (2700). The horizontal sub-blocks (2770) are sub-blocks having a size of 1 / 4 of the height of the encoding unit (2700) and can be positioned by moving up and down within the encoding unit (2700). When selecting candidate sub-blocks (2780, 2790) from among vertical sub-blocks (2760) and horizontal sub-blocks (2770), one vertical sub-block (2790) and one horizontal sub-block (2780) may be selected from among the vertical sub-blocks (2760) and horizontal sub-blocks (2770). One vertical sub-block may be selected by comparing the sum of the changes in the prediction samples corresponding to the vertical sub-blocks (2760), and one horizontal sub-block may be selected by comparing the sum of the changes in the prediction samples corresponding to the horizontal sub-blocks (2770).
[0338] Alternatively, when selecting (2795) candidate sub-blocks (2780, 2790) from among the vertical sub-blocks (2760) and horizontal sub-blocks (2770), the amount of change in the prediction samples corresponding to the area for each of the vertical sub-blocks (2760) and horizontal sub-blocks (2770) may be detected. By comparing the sum of the amounts of change in the prediction samples for each of the vertical sub-blocks (2760) and horizontal sub-blocks (2770), two or more sub-blocks (2780, 2790) with the largest amount of change may be obtained. That is, the sum of the amounts of change in the prediction samples corresponding to the sub-block (2780) and the sum of the amounts of change in the prediction samples corresponding to the sub-block (2790) are greater than the sum of the amounts of change in the prediction samples corresponding to any other 1 / 4 size sub-block.
[0339] A video decoding device (2000) according to one embodiment may obtain candidate information from a bitstream that points to a sub-block to be used for sub-block conversion of a encoding unit (2700). The video decoding device (2000) may determine one candidate sub-block pointed to by the candidate information among two or more candidate sub-blocks (2780, 2790) determined in 1 / 4 size. For example, if the candidate information indicates 0, the candidate sub-block (2780) may be selected as the final sub-block among the candidate sub-blocks (2780, 2790) of 1 / 4 size. If the candidate information indicates 1, the candidate sub-block (2790) may be selected as the final sub-block among the candidate sub-blocks (2780, 2790) of 1 / 4 size.
[0340] According to one embodiment, if there may be N (N: integer) candidate sub-blocks for each size of sub-block, the candidate information may be information pointing to one of the N sub-blocks. According to one embodiment, the candidate information may be binarized using a truncation unary code method. Accordingly, the video decoding device (2000) can determine a candidate index corresponding to the candidate information according to the truncation unary code method.
[0341] If the information regarding the size of the sub-block indicates half the size, the video decoder (2000) can perform an inverse conversion using the candidate sub-block (2730) to obtain residual data, and can restore the residual block of the encoding unit (2700) using the residual data of the sub-block.
[0342] FIG. 28 is a diagram illustrating a set of conversion kernels according to the location of a sub-block according to one embodiment of the present disclosure.
[0343] A video decoding device (2000) and a video encoding device (3430) according to one embodiment can determine a conversion kernel type to be used for sub-block conversion according to the position of sub-blocks (2810, 2820, 2850, 2860, 2870, 2880) within an encoding unit (2800).
[0344] For example, vertical sub-blocks (2850) may be determined for sub-block conversion / inverse conversion of the encoding unit (2800).
[0345] Among the vertical sub-blocks (2850), for the vertical sub-block (2810) located in the left region from the point (2830) at half the width of the encoding unit (2800), a left conversion kernel set may be used for conversion / inversion. Among the vertical sub-blocks (2850), for the vertical sub-block (2820) located in the right region from the point (2830) at half the width of the encoding unit (2800), a right conversion kernel set may be used for conversion / inversion. For example, the left conversion kernel set may be (DCT8, DST7), and the right conversion kernel set may be (DST7, DST7).
[0346] Similarly, horizontal sub-blocks may be determined for sub-block conversion / inverse conversion of the encoding unit (2800). Among the horizontal sub-blocks, an upper conversion kernel set may be used for conversion / inverse conversion for a horizontal sub-block located in an upper region from half the height of the encoding unit. A lower conversion kernel set may be used for conversion / inverse conversion for a horizontal sub-block located in a lower region from half the height of the encoding unit. For example, the upper conversion kernel set may be (DST7, DCT8) and the lower conversion kernel set may be (DST7, DST7).
[0347] As another example, among the vertical sub-blocks (2850), for a vertical sub-block (2870) located in the left region from the point (2840) at 1 / 4 of the width of the encoding unit (2800), a left transformation kernel set may be used for transformation / inverse transformation. Among the vertical sub-blocks (2850), for a vertical sub-block (2880) located in the right region from the point (2860) at 3 / 4 of the width of the encoding unit (2800), a right transformation kernel set may be used for transformation / inverse transformation. Among the vertical sub-blocks (2850), for a vertical sub-block (2890) located in the region between the point (2840) at 1 / 4 of the width of the encoding unit (2800) and the point (2860) at 3 / 4 of the width, a center transformation kernel set may be used for transformation / inverse transformation. For example, the left transformation kernel set can be (DCT8, DST7), the right transformation kernel set can be (DST7, DST7), and the center transformation kernel set can be (DCT2, DST7).
[0348] Similarly, among the horizontal sub-blocks of the encoding unit (2800), for the horizontal sub-block located in the upper region from the 1 / 4 point of the height of the encoding unit (2800), an upper conversion kernel set may be used for conversion / inversion. Among the horizontal sub-blocks, for the horizontal sub-block located in the lower region from the 3 / 4 point of the height of the encoding unit (2800), a lower conversion kernel set may be used for conversion / inversion. Among the horizontal sub-blocks, for the horizontal sub-block located in the region between the 1 / 4 point and the 3 / 4 point of the height of the encoding unit (2800), a central conversion kernel set may be used for conversion / inversion. For example, the upper conversion kernel set may be (DST7, DCT8), the lower conversion kernel set may be (DST7, DST7), and the central conversion kernel set may be (DST7, DCT2).
[0349] With reference to FIG. 28, the set of conversion kernels described above is merely an example for illustrative purposes, and other combinations of conversion kernels may be used, and are not limited to the set of conversion kernels described above.
[0350] As described above with reference to FIG. 28, a video encoding device (3430) according to one embodiment may selectively use a conversion kernel set according to the location of the sub-block in the process of determining the sub-block to perform sub-block conversion on the encoding unit (2800).
[0351] Additionally, as described above with reference to FIG. 28, the video decoding device (2000) and the video encoding device (3430) may selectively use a conversion kernel set according to the location of the sub-block in the process of determining the sub-block according to each method described with reference to FIG. 27, 29 to 33. Among these, a method for determining the final sub-block using a conversion kernel set that changes according to the location of the candidate sub-block in FIG. 29 is described above.
[0352] FIG. 29 is a diagram illustrating the process of determining the location of a sub-block when the conversion kernel set is changed according to the location of the sub-block in accordance with one embodiment of the present disclosure.
[0353] A video decoding device (2000) according to one embodiment can determine the size of a subblock to be used for subblock conversion of an encoding unit (2900) by using information regarding the size of a subblock obtained from a bitstream. The information regarding the size of a subblock according to one embodiment may be information encoded by a video encoding device (3430) through a comparison process (2905) of the RD costs by size of the subblocks (2910, 2920, 2960, 2970). The RD cost comparison process (2905) of the video encoding device (3430) will be described in detail later through FIGS. 34 and 35.
[0354] The video decoding device (2000) can determine the final sub-block (2980) among the 1 / 4 size sub-blocks (2960, 2970) indicated by information about the sub-block size or the size index among the 1 / 2 size sub-blocks (2910, 2920) and the 1 / 4 size sub-blocks (2960, 2970).
[0355] A video decoding device (2000) according to one embodiment can obtain the amount of change of predicted samples corresponding to the area of the sub-blocks among the 1 / 4 size sub-blocks (2960, 2970) that may exist within the encoding unit (2900). Among the 1 / 4 size sub-blocks (2960, 2970) that may exist, the position and direction of the sub-block (2980) that maximizes the sum of the amount of change of the predicted samples can be determined (2990). At this time, the conversion kernel set may vary depending on the position or direction of the sub-blocks. For example, since the sub-block (2980) is a horizontally divided sub-block located on the upper side, the conversion kernel set (DST7, DCT8) may be used.
[0356] The video decoding device (2000) can obtain residual data by performing an inverse transformation on transformation coefficients corresponding to a 1 / 4 size sub-block (2980), and obtain a residual block of a encoding unit (2900) containing residual data of the sub-block (2980).
[0357] FIG. 30 is a diagram illustrating the process of determining a subblock among candidate subblocks according to a plurality of subblock sizes according to one embodiment of the present disclosure.
[0358] A video decoding device (2000) according to one embodiment can perform conversion using corner sub-blocks (3010, 3015, 3020, 3025, 3060, 3065, 3070, 3075) of a encoding unit (3000) generated by predicting in inter mode or a center sub-block located in the center.
[0359] According to one embodiment, the width and height of the corner sub-blocks (3010, 3015, 3020, 3025) and the center sub-block are each half the width and half the height of the encoding unit (3000), so the size of the corner sub-blocks (3010, 3015, 3020, 3025) and the center sub-block may be 1 / 4 the size of the encoding unit (3000). Accordingly, the corner sub-blocks (3010, 3015, 3020, 3025) and the center sub-block are referred to as corner sub-blocks of 1 / 4 size. Additionally, since the width and height of the corner sub-blocks (3060, 3065, 3070, 3075) and the center sub-block are each 1 / 4 of the width and 1 / 4 of the height of the encoding unit (3000), the size of the corner sub-blocks (3060, 3065, 3070, 3075) and the center sub-block may be 1 / 16 of the size of the encoding unit (3000). Accordingly, the corner sub-blocks (3060, 3065, 3070, 3075) and the center sub-block are referred to as corner sub-blocks of 1 / 16 size.
[0360] A video decoding device (2000) according to one embodiment can obtain information about the size of a sub-block to be used for sub-block conversion of a coding unit (3000) from a bitstream. For example, the video decoding device (2000) can perform a sub-block determination process for a corner sub-block (3065) of 1 / 16 size indicated by information about the size of the sub-block among a corner sub-block (3020) of 1 / 4 size and a corner sub-block (3065) of 1 / 16 size.
[0361] A video decoding device (2000) according to one embodiment can obtain a change amount of predicted samples corresponding to the area of the subblocks among corner subblocks (3060, 3065, 3070, 3075) and center subblocks of 1 / 16 size that may exist within the encoding unit (3000). Among the corner subblocks (3060, 3065, 3070, 3075) and center subblocks of 1 / 16 size, the location of the subblock (3065) that maximizes the sum of the change amounts of the predicted samples can be determined (3090) as the location of the final subblock.
[0362] A video decoding device (2000) according to one embodiment can restore a residual block of a coding unit (3000) by performing an inverse transformation on a transformation coefficient corresponding to a corner sub-block (3065) of size 1 / 16. When the prediction block and the residual block of the coding unit (3000) are combined, the restoration block of the coding unit (3000) can be determined.
[0363] Hereinafter, corner sub-blocks according to various embodiments that can be used by the video decoding device (2000) and the video encoding device (3430) are described in detail through FIGS. 31 and 32.
[0364] FIG. 31 is a drawing for explaining the locations of possible candidate sub-blocks for each of the multiple sub-block sizes according to one embodiment of the present disclosure.
[0365] In the sub-block group (3110), 1 / 4 size sub-blocks (3105, 3110, 3115, 3120, 3125, 3130, 3135, 3140, 3145) having 1 / 2 the width and 1 / 2 the height of the encoding unit (3100) are shown. The locations of the 1 / 4 size sub-blocks (3105, 3110, 3115, 3120, 3125, 3130, 3135, 3140, 3145) are possible in all areas within the encoding unit (3100).
[0366] In the sub-block group (3150), 1 / 16 size sub-blocks (3155, 3160, 3165, 3170, 3175, 3180, 3185, 3190, 3195) having 1 / 4 of the width and 1 / 4 of the height of the encoding unit (3100) are shown. The locations of the 1 / 16 size sub-blocks (3155, 3160, 3165, 3170, 3175, 3180, 3185, 3190, 3195) are possible in all areas within the encoding unit (3100).
[0367] However, when considering the deblocking filtering process, it is desirable to determine sub-blocks of 1 / 4 size (3105, 3110, 3115, 3120, 3125, 3130, 3135, 3140, 3145) and / or sub-blocks of 1 / 16 size (3155, 3160, 3165, 3170, 3175, 3180, 3185, 3190, 3195) by moving in 4 pixel units in the horizontal and vertical directions.
[0368] FIG. 32 is a drawing for explaining the locations of possible candidate sub-blocks for each sub-block size according to one embodiment of the present disclosure.
[0369] In the sub-block group (3210), 1 / 8 size sub-blocks (3205, 3210, 3215, 3220, 3225, 3230, 3235, 3240, 3245) having 1 / 2 the width and 1 / 4 the height of the encoding unit (3200) are shown. The locations of the 1 / 8 size sub-blocks (3205, 3210, 3215, 3220, 3225, 3230, 3235, 3240, 3245) are possible in any area within the encoding unit (3200).
[0370] In the sub-block group (3250), 1 / 8 size sub-blocks (3255, 3260, 3265, 3270, 3275, 3280, 3285, 3290, 3295) having 1 / 4 of the width and 1 / 2 of the height of the encoding unit (3200) are shown. The locations of the 1 / 8 size sub-blocks (3255, 3260, 3265, 3270, 3275, 3280, 3285, 3290, 3295) are possible in all areas within the encoding unit (3200).
[0371] However, when considering the deblocking filtering process, it is desirable to determine sub-blocks of size 1 / 8 (3205, 3210, 3215, 3220, 3225, 3230, 3235, 3240, 3245) and / or sub-blocks of size 1 / 8 (3255, 3260, 3265, 3270, 3275, 3280, 3285, 3290, 3295) by moving in units of 4 pixels in the horizontal and vertical directions.
[0372] In addition to the sub-blocks shown in FIGS. 31 and 32, a sub-block having a width of 1 / N (N is a power of 2) and a height of 1 / M (M is a power of 2) of the encoding unit (3100, 3200) may be used for sub-block conversion of the encoding unit (3100, 3200).
[0373] Additionally, with reference to FIGS. 25 to 29, sub-blocks of the positions, directions, and sizes illustrated in FIGS. 31 and 32 may be applied to various embodiments of the present disclosure described above. As a specific example, a sub-block may be determined from among 1 / 4 size sub-blocks (3105, 3110, 3115, 3120, 3125, 3130, 3135, 3140, 3145) belonging to sub-block group (3110) and 1 / 8 size sub-blocks (3205, 3210, 3215, 3220, 3225, 3230, 3235, 3240, 3245) belonging to sub-block group (3210). To this end, the video decoding device (2000) can determine two or more candidate sub-blocks of 1 / 4 size having the largest value by comparing the sums of the changes in predicted samples corresponding to each of the 1 / 4 size sub-blocks (3105, 3110, 3115, 3120, 3125, 3130, 3135, 3140, 3145). By comparing the sums of the changes in predicted samples corresponding to each of the 1 / 8 size sub-blocks (3205, 3210, 3215, 3220, 3225, 3230, 3235, 3240, 3245), two or more candidate sub-blocks of 1 / 8 size having the largest value can be determined.
[0374] A video decoding device (2000) according to one embodiment can select one candidate subblock of 1 / 4 size and one candidate subblock of 1 / 8 size from among two or more candidate subblocks of 1 / 4 size and two or more candidate subblocks of 1 / 8 size based on candidate information obtained from a bitstream. The candidate information according to one embodiment is binarized according to a truncation unary code method. A video decoding device (2000) according to one embodiment can determine a final subblock from among one candidate subblock of 1 / 4 size and one candidate subblock of 1 / 8 size based on size information obtained from a bitstream. A set of transformation kernels can be determined according to the position of the final subblock. By performing an inverse transformation on the transformation coefficients corresponding to the final subblock using the determined set of transformation kernels, a residual block of the encoding unit (3100, 3200) can be determined.
[0375] FIG. 33 is a diagram illustrating the process of determining a sub-block among candidate sub-blocks according to a plurality of sub-block sizes according to one embodiment of the present disclosure.
[0376] A video decoding device (2000) according to one embodiment can determine a sub-block for sub-block conversion by using the amount of change of prediction samples generated by inter-prediction without needing to obtain information about the division direction, the position of the sub-block, and the size of the sub-block from the bitstream.
[0377] A video decoding device (2000) according to one embodiment can sort subblocks in order of the largest value of change by comparing the sum of the change amounts of prediction samples in the region corresponding to each subblock within the prediction block used in the inter-prediction of the current block for each subblock of the corresponding subblock size. For each size, the position and direction of the subblock with the largest change amount of the prediction sample can be selected.
[0378] Specifically, in FIG. 27, the video decoding device (2000) can determine a subblock from among 1 / 2 size subblocks (3310, 3320) and 1 / 4 size subblocks (3360, 3370) to determine a subblock of the encoding unit (3300).
[0379] First, the video decoding device (2000) can determine a subblock from among 1 / 2 size subblocks (3310, 3320) and 1 / 4 size subblocks (3360, 3370) to determine a subblock of the encoding unit (3300).
[0380] A video decoding device (2000) according to one embodiment may utilize the amount of change of predicted samples corresponding to the area of the sub-blocks among the 1 / 2 size sub-blocks that may exist within the encoding unit (3300). Among the 1 / 2 size sub-blocks that may exist, the positions of the sub-blocks (3310, 3320) that maximize the sum of the amount of change of predicted samples may be determined.
[0381] Likewise, a video decoding device (2000) according to one embodiment may determine the direction of a sub-block (3330) that maximizes the sum of the changes of corresponding prediction samples among previously selected 1 / 2 size sub-blocks (3310, 3320).
[0382] A video decoding device (2000) according to one embodiment may simultaneously select the position and direction of a sub-block (3300) that maximizes the value of the change amount of the prediction samples corresponding to the area of the sub-blocks among the 1 / 2 size sub-blocks that may exist within the encoding unit (3300).
[0383] A video decoding device (2000) according to one embodiment may utilize the amount of change of predicted samples corresponding to the area of the sub-blocks among the 1 / 4 size sub-blocks that may exist within the encoding unit (3300). Among the 1 / 4 size sub-blocks that may exist, the positions of the sub-blocks (3360, 3370) that maximize the sum of the amount of change of the predicted samples may be determined.
[0384] Likewise, a video decoding device (2000) according to one embodiment may determine the direction of a sub-block (3380) that maximizes the sum of the changes of corresponding prediction samples among previously selected 1 / 4 size sub-blocks (3360, 3370).
[0385] A video decoding device (2000) according to one embodiment may simultaneously select the position and direction of a sub-block (3380) that maximizes the value of the change amount of the prediction samples corresponding to the area of the sub-blocks among the 1 / 4 size sub-blocks that may exist within the encoding unit (3300).
[0386] A video decoding device (2000) according to one embodiment can determine the size of a sub-block to be used for sub-block conversion of a encoding unit (3300) by using the amount of change of predicted samples corresponding to the area of the sub-blocks. Therefore, information regarding the size of the sub-block does not need to be obtained from the bitstream.
[0387] A video decoding device (2000) according to one embodiment can determine a final sub-block to be used for sub-block conversion of a coding unit (3300) by comparing the average of the changes in predicted samples corresponding to a 1 / 2 size sub-block (3330) and the average of the changes in predicted samples corresponding to a 1 / 4 size sub-block (3380).
[0388] For example, the averages of the gradients of the prediction samples corresponding to the sub-blocks can be compared. For example, if the value obtained by multiplying the average of the gradients of the prediction samples corresponding to the 1 / 2 size sub-block (3330) by T is greater than the average of the gradients of the prediction samples corresponding to the 1 / 4 size sub-block (3380), the final sub-block may be determined to be the 1 / 2 size sub-block (3330). If the value obtained by multiplying the average of the gradients of the prediction samples corresponding to the 1 / 2 size sub-block (3330) by T is less than or equal to the average of the gradients of the prediction samples corresponding to the 1 / 4 size sub-block (3380), the final sub-block may be determined to be the 1 / 4 size sub-block (3380). Here, T may be a threshold greater than 1.x.
[0389] For example, the sums of the gradients of the prediction samples corresponding to the sub-blocks can be compared. Specifically, if the sum of the gradients of the prediction samples corresponding to the 1 / 2 size sub-block (3330) is greater than the sum of the gradients of the prediction samples corresponding to the 1 / 4 size sub-block (3380) multiplied by T, the final sub-block may be determined to be the 1 / 2 size sub-block (3330). If the sum of the gradients of the prediction samples corresponding to the 1 / 2 size sub-block (3330) is less than or equal to the sum of the gradients of the prediction samples corresponding to the 1 / 4 size sub-block (3380) multiplied by T, the final sub-block may be determined to be the 1 / 4 size sub-block (3380). Here, T may be a threshold greater than 1.x.
[0390] For example, the variances of the predicted samples corresponding to the sub-blocks can be compared. For example, if the variance of the predicted samples corresponding to the 1 / 2 size sub-block (3330) is smaller than the variance of the predicted samples corresponding to the 1 / 4 size sub-block (3380), the final sub-block may be determined to be the 1 / 2 size sub-block (3330). If the variance of the predicted samples corresponding to the 1 / 2 size sub-block (3330) is greater than or equal to the variance of the predicted samples corresponding to the 1 / 4 size sub-block (3380), the final sub-block may be determined to be the 1 / 4 size sub-block (3380).
[0391] For example, the sum of gradients and variances of the predicted samples corresponding to the sub-blocks may be compared. Specifically, if the weighted sum of the sum of gradients and variances of the predicted samples corresponding to the 1 / 2 size sub-block (3330) is greater than the weighted sum of the sum of gradients and variances of the predicted samples corresponding to the 1 / 4 size sub-block (3380), the final sub-block may be determined to be the 1 / 2 size sub-block (3330). If the weighted sum of the sum of gradients and variances of the predicted samples corresponding to the 1 / 2 size sub-block (3330) is less than or equal to the weighted sum of gradients and variances of the predicted samples corresponding to the 1 / 4 size sub-block (3380), the final sub-block may be determined to be the 1 / 4 size sub-block (3380). Here, T may be a threshold greater than 1.x. The weights for the sum of the gradients of the predicted samples and the weights for the variances of the predicted samples in the weighted sum may be values set according to the size of the sub-blocks (3330, 3380), respectively.
[0392] A video decoding device (2000) according to one embodiment can arrange conversion coefficients in a finally determined sub-block to perform inverse conversion on the conversion coefficients according to the size of the determined sub-block.
[0393] For example, when a 1 / 2 size sub-block (3330) is finally determined, the video decoder (2000) may arrange the conversion coefficients corresponding to the 1 / 4 size sub-block at the low-frequency positions of the 1 / 2 size sub-block (3330) and fill the high-frequency positions of the 1 / 2 size sub-block (3330) with 0. The video decoder (2000) may perform a 1 / 2 sub-block inverse conversion on the 1 / 2 size sub-block (3330).
[0394] For example, when a 1 / 4 size sub-block (3380) is finally determined, the video decoder (2000) can arrange conversion coefficients corresponding to the 1 / 4 size sub-block in the 1 / 4 size sub-block (3380) and perform a 1 / 4 size sub-block inverse conversion on the 1 / 4 size sub-block (3380).
[0395] FIG. 34 is a block diagram showing the configuration of a video encoding device according to one embodiment of the present disclosure.
[0396] A video encoding device (3430) according to one embodiment may include a processor (3410) and a memory (3420).
[0397] In one embodiment of the present disclosure, the processor (3410) may include processing circuits and / or multiple processors. For example, the processor (3410) may include various processing circuits including at least one processor, and at least one of the at least one processor may be configured to perform the various functions described in the present disclosure individually and / or collectively in a distributed manner.
[0398] In one embodiment of the present disclosure, the memory (3420) may include one or more storage media that store at least one instruction. The processor (3410) may control the video encoding device (3430) by executing the instruction stored in the memory (3420). For example, the processor (3410) may control the video encoding device (3430) to perform an operation by executing the instruction stored in the memory (3420) individually or collectively. In one embodiment of the present disclosure, the operation performed by the video encoding device (3430) may be an operation performed by the processor (3410) of the video decoding device (3430).
[0399] In one embodiment of the present disclosure, the video encoding device (3430) may correspond to the image encoding device (200) shown in FIG. 2 and / or the encoding unit (1910) shown in FIG. 19.
[0400] In one embodiment of the present disclosure, the video encoding device (3430) may generate residual data corresponding to the difference between the prediction block and the current block. If the prediction block is determined to be the current block, residual data may not be generated.
[0401] The video encoding device (3430) can generate a bitstream containing the encoding result of the image. The bitstream may contain the encoding result for the current block.
[0402] In one embodiment, the video encoding device (3430) may generate a bitstream containing residual data. The residual data may contain information regarding the difference between the original image (or original sample) and the predicted image (or predicted sample). In one embodiment, the video encoding device (3430) may generate a bitstream containing a transformation coefficient of a residual block corresponding to a transformation unit. In one embodiment, the video encoding device (3430) may obtain a transformation coefficient of a residual block based on a residual sample of a residual block. For example, the video encoding device (3430) may obtain a transformation coefficient of a residual block by performing at least one of transformation or quantization on a residual sample of a residual block. In one embodiment, the video encoding device (3430) may determine a transformation coefficient of a residual block using a residual sample of a transformation unit. If the size of the residual block corresponding to the conversion unit is larger than the size of the conversion unit, the video encoding device (3430) may determine a portion of the residual samples of the residual block as residual samples of the conversion unit. Alternatively, the video encoding device (3430) may determine the residual samples of the residual block as residual samples of the conversion unit to which filtering has been performed. The video encoding device (3430) may generate a bitstream containing residual samples of the conversion unit.
[0403] When a video encoding device performs a sub-block transformation that performs transformation on only a portion of residual samples, it can determine the location, orientation, and size of the sub-block. For each of the multiple sub-block sizes, the video encoding device (3430) can determine two or more candidate sub-blocks for each of the multiple sub-block sizes by comparing the sum of the changes in the predicted samples of the current block corresponding to the sub-blocks of the respective sub-block sizes. For each of the multiple sub-block sizes, the video encoding device (3430) can determine one sub-block to be used for the sub-block transformation of the current block by comparing the costs generated by the transformation of the two or more candidate sub-blocks determined for each of the multiple sub-block sizes.
[0404] The video encoding device (3430) can perform a conversion on the residual data corresponding to a determined sub-block to generate the conversion coefficient of the current block.
[0405] The video encoding device (3430) can encode size information indicating the size of one sub-block determined to be used for sub-block conversion of the current block. The video encoding device (3430) can encode candidate information pointing to one sub-block among two or more candidate sub-blocks corresponding to the size of one determined sub-block.
[0406] The video encoding device (3430) can generate a bitstream including the conversion factor, size information, and candidate information of the current block.
[0407] In one embodiment of the present disclosure, the video encoding device (3430) can transmit or output a bitstream to or from a video decoding device (2000) through a network.
[0408] In one embodiment of the present disclosure, the video encoding device (3430) may store a bitstream in a data storage medium comprising at least one of a magnetic medium such as a hard disk, a floppy disk and a magnetic tape, an optical recording medium such as a CD-ROM and a DVD, or a magneto-optical medium such as a floptical disk.
[0409] A video encoding device (3430) can generate a bitstream containing syntax elements generated through video encoding. Values corresponding to the syntax elements are formed into bins through binarization, and the bins can be included in a bitstream according to the hierarchical structure of the video through entropy encoding.
[0410] The video encoding device (3430) can obtain bit sequences included in the bitstream by entropy encoding bins corresponding to syntax elements.
[0411] In one embodiment of the present disclosure, the bitstream may include information about the prediction mode of the current block in the current image.
[0412] A video encoding device (3430) according to one embodiment can determine the position, direction, and size of a sub-block within a encoding unit by utilizing information related to inter-prediction of the encoding unit when sub-block conversion is performed. Accordingly, by minimizing the signaling of separate information for determining the sub-block of the encoding unit, compression efficiency can be maximized.
[0413] FIG. 35 is a flowchart illustrating a video encoding method according to one embodiment of the present disclosure.
[0414] In step s3510, a video encoding device (3430) according to one embodiment can determine two or more candidate sub-blocks for each of the plurality of sub-block sizes by comparing the sum of the changes in the predicted samples of the current block corresponding to the sub-blocks of the respective sub-block sizes. For example, a plurality of sub-blocks for a 1 / 4 size sub-block and a plurality of sub-blocks for a 1 / 2 size sub-block can each be determined.
[0415] In step s3510, a video encoding device (3430) according to one embodiment may sort the subblocks in order of the largest value of change by comparing the sum of the change values of prediction samples in the region corresponding to each subblock within the prediction block used in the inter-prediction of the current block for each subblock of the corresponding subblock size. Among the sorted subblocks, two or more candidate subblocks may be determined.
[0416] A sub-block transformation according to one embodiment may be one of a transformation applied to a sub-block created by dividing the current block in the horizontal direction, a transformation applied to a sub-block created by dividing the current block in the vertical direction, or a transformation applied to a sub-block corresponding to an arbitrary area of a predetermined size within the current block.
[0417] In step s3510, the video encoding device (3430) according to one embodiment can determine two or more candidate subblocks among subblocks of the corresponding subblock size generated by dividing the current block in the horizontal direction and subblocks of the corresponding subblock size generated by dividing the current block in the vertical direction, when the subblock conversion is a side subblock conversion.
[0418] In step s3510, a video encoding device (3430) according to one embodiment can determine two or more candidate sub-blocks among the sub-blocks generated by dividing the current block into a first size in the horizontal direction and a second size in the vertical direction when the sub-block transformation is a corner sub-block transformation.
[0419] In step s3520, a video encoding device (3430) according to one embodiment can determine one subblock to be used for subblock conversion of the current block by comparing the costs generated by the conversion of two or more candidate subblocks determined for each of the plurality of subblock sizes. For example, one subblock can be determined as the final subblock from among two or more candidate subblocks of 1 / 4 size and two or more subblocks of 1 / 2 size.
[0420] Specifically, a video encoding device (3430) according to one embodiment can compare the RD costs resulting from performing a conversion on residual data corresponding to two or more candidate sub-blocks for each of the plurality of sub-block sizes, and determine the candidate sub-block with the lowest RD cost as the final sub-block to be used for sub-block conversion of the current block. In the process of comparing the RD costs, a conversion is performed on the residual data corresponding to each sub-block to generate conversion coefficients.
[0421] For example, if the RD cost by transformation of two candidate sub-blocks of 1 / 4 size and two candidate sub-blocks of 1 / 2 size is compared and the RD cost of the first candidate block of 1 / 4 size is the lowest, the first candidate block of 1 / 4 size can be determined as the final candidate block.
[0422] The video encoding device (3430) can determine the RD cost of each candidate sub-block by considering all of the candidate information indicating the candidate sub-block selected according to the conversion result, the bit amount including the conversion coefficient of the candidate sub-block, and the numerical value indicating the degree of distortion.
[0423] In step s3530, a video encoding device (3430) according to one embodiment can generate a conversion coefficient of the current block by performing a conversion on residual data corresponding to one sub-block determined in s3520.
[0424] A video encoding device (3430) according to one embodiment can determine a combination of a horizontal conversion kernel and a vertical conversion kernel to be used for sub-block conversion depending on the position of the sub-block.
[0425] In step s3540, a video encoding device (3430) according to one embodiment can encode size information representing the size of one sub-block determined to be used for sub-block conversion of the current block.
[0426] In step s3550, a video encoding device (3430) according to one embodiment can encode candidate information pointing to one sub-block among two or more candidate sub-blocks corresponding to the size of one determined sub-block.
[0427] For example, in the previous example, if the first candidate subblock of size 1 / 4 is determined as the final subblock as a result of comparing the RD costs of two candidate subblocks of size 1 / 4 and two candidate subblocks of size 1 / 2, then size 1 / 4 is encoded as size information, and candidate information pointing to the first of the two candidate subblocks can be encoded.
[0428] In step s3560, a video encoding device (3430) according to one embodiment can generate a bitstream including a transform factor, size information, and candidate information of the current block.
[0429] A video encoding device (3430) according to one embodiment may transmit the generated bitstream to a video decoding device (3400) via a network. In one embodiment of the present disclosure, the video encoding device (3430) may store the bitstream in a data storage medium comprising at least one of a magnetic medium such as a hard disk, a floppy disk, and a magnetic tape, an optical recording medium such as a CD-ROM and a DVD, or a magneto-optical medium such as a floptical disk.
[0430] Hereinafter, the operations performed by the video encoding device (3430) in correspondence with the operations previously performed by the video decoding device (2000) to determine a sub-block in the embodiments of FIGS. 25, 27, 29, 30, 31, 32, and 31 are described in detail.
[0431] In the embodiment of FIG. 25, a method for determining a sub-block for sub-block conversion of a encoding unit by a video encoding device (3430) is described below. In order for a video decoding device (2000) according to one embodiment to determine a sub-block for sub-block conversion without using information regarding the division direction of the encoding unit and information regarding the position of the current sub-block within the encoding unit, the video encoding device (3430) can also determine a sub-block for sub-block conversion of the encoding unit through the same process.
[0432] A video encoding device (3430) according to one embodiment can encode sub-block conversion mode information. Sub-block conversion mode information for an encoding unit (2500) may be located as a syntax element at an encoding unit syntax level or a conversion unit syntax level. The sub-block conversion mode may be encoded to indicate one of the cases where sub-block conversion is not performed, a first sub-block conversion mode, or a second sub-block conversion mode.
[0433] When the sub-block conversion mode information is encoded to represent a first sub-block conversion mode, the video encoding device (3430) may encode information regarding the division direction of the encoding unit and information regarding the location of the current sub-block within the encoding unit. When the sub-block conversion mode information is encoded to represent a second sub-block conversion mode, the video encoding device (3430) may not encode information regarding the division direction of the encoding unit and information regarding the location of the current sub-block within the encoding unit.
[0434] The video encoding device (3430) and the video decoding device (2000) can determine the size of the sub-block within the same range. Accordingly, an embodiment in FIG. 25 is described in which only sub-blocks of 1 / 2 and 1 / 4 size are allowed.
[0435] When the sub-block conversion mode is the second sub-block conversion mode, the video encoding device (3430) according to one embodiment may use the amount of change of the predicted samples of the encoding unit (2500) predicted in inter mode to determine the position and direction of the sub-block. Among the predicted samples of the encoding unit generated by predicting in inter mode, the value of the amount of change of the predicted samples belonging to the region corresponding to the sub-block within the encoding unit (2500) may be obtained. Here, as the amount of change of the predicted samples, the gradient value of the predicted samples, or the variance value and standard deviation value of the predicted samples may be used.
[0436] A video encoding device (3430) according to one embodiment may utilize the amount of change of predicted samples corresponding to the area of the sub-blocks among the 1 / 2 size sub-blocks that may exist within the encoding unit (2500). Among the 1 / 2 size sub-blocks that may exist, the positions of the sub-blocks (2510, 2520) that maximize the sum of the amount of change of predicted samples may be determined.
[0437] Likewise, a video encoding device (3430) according to one embodiment may determine the direction of a sub-block (2530) that maximizes the sum of the changes of corresponding prediction samples among previously selected 1 / 2 size sub-blocks (2510, 2520).
[0438] A video encoding device (3430) according to one embodiment may simultaneously select the position and direction of a sub-block (2530) that maximizes the value of the change amount of the prediction samples corresponding to the area of the sub-blocks among the 1 / 2 size sub-blocks that may exist within the encoding unit (2500).
[0439] In a video encoding device (3430) according to one embodiment, among sub-blocks of 1 / 4 size that may exist within an encoding unit (2500), the positions of sub-blocks (2560, 2570) that maximize the sum of the changes in predicted samples corresponding to the areas of the sub-blocks can be determined.
[0440] Likewise, a video encoding device (3430) according to one embodiment may determine the direction of a sub-block (2580) that maximizes the sum of the changes of corresponding prediction samples among previously selected 1 / 4 size sub-blocks (2560, 2570).
[0441] A video encoding device (3430) according to one embodiment may simultaneously select the position and direction of a sub-block (2580) that maximizes the value of the change amount of the prediction samples corresponding to the area of the sub-blocks among the 1 / 4 size sub-blocks that may exist within the encoding unit (2500).
[0442] A video encoding device (3430) according to one embodiment determines the position and direction of a sub-block using the value of the change amount of the predicted samples corresponding to the area of the sub-blocks, so that information regarding the division direction of the encoding unit (2500) and information regarding the position of the current sub-block within the encoding unit may not be encoded.
[0443] A video encoding device (3430) according to one embodiment can determine (2505) the size of a sub-block to be used for sub-block conversion of an encoding unit (2500) by comparing RD costs. Among a 1 / 2 size sub-block (2530) and a 1 / 4 size sub-block (2580), the sub-block (2580) that generates a smaller RD cost when used for sub-block conversion of the encoding unit (2500) can be finally determined by comparing the RD costs (2505). Accordingly, the video encoding device (3430) can generate information indicating the size of the sub-block (2580) to be finally used for sub-block conversion of the encoding unit (2500) among the 1 / 2 size sub-block (2530) and the 1 / 4 size sub-block (2580). Information regarding the size of the sub-block can be encoded as a syntax element in the syntax for the encoding unit (2500).
[0444] When determining the position of a sub-block, a video encoding device (3430) according to one embodiment can determine the optimal position of a sub-block by moving the sub-block area to the left / right or upward / downward in units of 1 pixel or 4 pixels.
[0445] According to one embodiment, the conversion kernel type for sub-block conversion may be (DCT2, DCT2).
[0446] In the embodiment of FIG. 27, a video encoding device (3430) according to one embodiment can also determine two or more candidate sub-blocks based on the amount of change of predicted samples for each of the plurality of sub-block sizes. The video encoding device (3430) can determine candidate sub-blocks for sub-block conversion of an encoding unit (2700) by performing the same operation as the video decoding device (2000). First, two or more candidate sub-blocks (2730, 2740) can be selected (2750) from vertical sub-blocks (2710) of 1 / 2 size and horizontal sub-blocks (2720) of 1 / 2 size. By comparing the sum of the amounts of change of predicted samples for each of the vertical sub-blocks (2710) and the horizontal sub-blocks (2720), two or more sub-blocks (2730, 2740) with the largest amount of change can be obtained. Additionally, two or more candidate sub-blocks (2780, 2790) can be selected (2795) from among the 1 / 4 size vertical sub-blocks (2760) and the 1 / 4 size horizontal sub-blocks (2770). By comparing the sum of the changes in the predicted samples of each of the vertical sub-blocks (2760) and the horizontal sub-blocks (2770), two or more sub-blocks (2780, 2790) with the largest change can be obtained.
[0447] The video encoding device (3430) can select one candidate subblock that generates the minimum RD cost by conversion from among two or more candidate subblocks (2730, 2740, 2780, 2790) determined for each of the multiple subblock sizes. The RD cost may be determined by applying a different conversion kernel set depending on the position of the subblock. For example, the video encoding device (3430) can determine the RD cost generated by performing conversion using 1 / 2 size candidate subblocks (2730, 2740) and the RD cost generated by performing conversion using 1 / 4 size candidate subblocks (2780, 2790) as the final subblock by comparing (2705) the RD costs generated by performing conversion using 1 / 4 size candidate subblocks (2780, 2790).
[0448] A video encoding device (3430) according to one embodiment can generate a conversion coefficient of the current encoding unit (2700) by performing a conversion on the residual data corresponding to the sub-block (2780) determined as the final sub-block.
[0449] A video encoding device (3430) according to one embodiment may encode information indicating the size of a sub-block (2780) that is finally selected as a result of comparing RD costs, and may encode candidate information indicating a sub-block (2780) among two candidate sub-blocks (2780, 2790). That is, size information indicating a 1 / 4 size and candidate information indicating the first candidate among two candidates may be encoded. In addition, according to one embodiment, if there may be N (N: integer) candidate sub-blocks for each size sub-block, the candidate information may be information indicating one of the N sub-blocks. According to one embodiment, the candidate information may be binarized using a truncation unary code method.
[0450] The video encoding device (3430) can generate a bitstream including a conversion factor corresponding to a sub-block (2780), size information indicating a 1 / 4 size, and candidate information pointing to the sub-block (2780).
[0451] In the embodiment of FIG. 29, the video encoding device (3430) can determine the location of a sub-block by applying a different set of conversion kernels depending on the location of the sub-block.
[0452] A video encoding device (3430) according to one embodiment can obtain a change amount of predicted samples corresponding to the area of sub-blocks among 1 / 2 size sub-blocks (2910, 2920) that may exist within an encoding unit (2900) generated by prediction in inter-mode. Among the 1 / 2 size sub-blocks (2910, 2920) that may exist, the position and direction of a sub-block (2930) that maximizes the sum of the change amounts of predicted samples can be determined (2940).
[0453] A video encoding device (3430) according to one embodiment can obtain a change amount of predicted samples corresponding to the area of sub-blocks among 1 / 4 size sub-blocks (2960, 2970) that may exist within an encoding unit (2900) generated by prediction in inter-mode. Among the 1 / 4 size sub-blocks (2960, 2970) that may exist, the position and direction of a sub-block (2980) that maximizes the sum of the change amounts of predicted samples can be determined (2990).
[0454] The video encoding device (3430) can select a 1 / 4 size subblock (2980) that generates less cost as a result of comparing (2905) the RD cost using a conversion kernel set according to the location of a 1 / 2 size subblock (2930) and the RD cost using a conversion kernel set according to the location of a 1 / 4 size subblock (2930). The video encoding device (3430) can perform a conversion on the residual of the corresponding area using the 1 / 4 size subblock (2980) and obtain a conversion coefficient.
[0455] According to the example of FIG. 29, the RD cost resulting from a transformation performed using the right transformation kernel set (DST7, DST7) can be obtained for the 1 / 2 size sub-block (2930). At this time, the transformation kernel set for the 1 / 2 size sub-block (2930) and the 1 / 4 size sub-block (2930) can be determined according to the sub-block location. For example, since the 1 / 2 size sub-block (2930) is located in the right region, the RD cost resulting from a transformation performed using the right transformation kernel set (DST7, DST7) can be obtained. Since the 1 / 4 size sub-block (2980) is located in the upper region, the RD cost resulting from a transformation performed using the upper transformation kernel set (DST7, DCT8) can be obtained. As a result of comparing (2905) the RD cost using the right transformation kernel set (DST7, DST7) in the 1 / 2 size sub-block (2930) and the RD cost using the upper transformation kernel set (DST7, DCT8) in the 1 / 4 size sub-block (2980), the video encoding device (3430) according to one embodiment can determine the 1 / 4 size sub-block (2980) that generates less cost as the final sub-block. The video encoding device (3430) according to one embodiment can encode information about the size of the sub-block to indicate the final sub-block (2980) among the 1 / 2 size sub-block (2930) and the 1 / 4 size sub-block (2980).
[0456] According to the example of FIG. 30, a video encoding device (3430) according to one embodiment can determine (3040) the position of a sub-block (3020) that maximizes the sum of the changes in predicted samples among corner sub-blocks (3010, 3015, 3020, 3025) and a center sub-block of 1 / 4 size within an encoding unit (3000).
[0457] A video encoding device (3430) according to one embodiment can determine (3090) the position of a sub-block (3065) that maximizes the sum of the changes in predicted samples among corner sub-blocks (3060, 3065, 3070, 3075) and a center sub-block of size 1 / 16 within an encoding unit (3000).
[0458] In a video encoding device (3430) according to one embodiment, the size of a sub-block to be used for sub-block conversion of an encoding unit (3000) can be determined (3005) by comparing the RD cost. At this time, the conversion kernel set for a corner sub-block (3020) of 1 / 4 size and a corner sub-block (3065) of 1 / 16 size can be determined according to the sub-block location. For example, since the corner sub-block (3020) of 1 / 4 size is located in the lower-left area, the RD cost resulting from the inverse conversion performed using the conversion kernel set (DCT8, DST7) can be obtained. Since the sub-block (3065) of 1 / 16 size is located in the upper-right area, the RD cost resulting from the inverse conversion performed using the conversion kernel set (DST7, DCT8) can be obtained.
[0459] As a result of comparing (3005) the RD cost of a corner sub-block (3020) of 1 / 4 size and the RD cost of a corner sub-block (3065) of 1 / 16 size, a video decoding device (2000) according to one embodiment can determine the corner sub-block (3065) of 1 / 16 size that generates less cost as the final sub-block. A video encoding device (3430) according to one embodiment can obtain a conversion coefficient of the encoding unit (3000) by performing a conversion on the residual corresponding to the corner sub-block (3065) of 1 / 16 size. Additionally, the video encoding device (3430) can encode information regarding the size of the sub-block indicating 1 / 16 size. The RD cost may be determined for each candidate sub-block by applying a different conversion kernel set depending on the location of the candidate sub-block. In addition, when two or more candidate sub-blocks are used for each sub-block size, size information and candidate information for pointing to the finally selected sub-block based on the result of comparing the RD costs of the candidate sub-blocks can also be encoded.
[0460] In the embodiments of FIG. 31 and 32, a video encoding device (3430) according to one embodiment can perform sub-block conversion using sub-blocks located at various positions. The video encoding device (3430) can determine two or more candidate sub-blocks of size 1 / 16 having the largest value by comparing the sums of the changes in predicted samples corresponding to each of the 1 / 16 size sub-blocks (3155, 3160, 3165, 3170, 3175, 3180, 3185, 3190, 3195). Two or more candidate sub-blocks of size 1 / 8 having the largest value can be determined by comparing the sums of the changes in predicted samples corresponding to each of the 1 / 8 size sub-blocks (3255, 3260, 3265, 3270, 3275, 3280, 3285, 3290, 3295).
[0461] A video encoding device (3430) according to one embodiment can encode candidate information for pointing to one candidate sub-block of 1 / 16 size and one candidate sub-block of 1 / 8 size among two or more candidate sub-blocks of 1 / 16 size and two or more candidate sub-blocks of 1 / 8 size. Candidate information for pointing to one candidate sub-block among two or more candidate sub-blocks of 1 / 16 size and candidate information for pointing to one candidate sub-block among two or more candidate sub-blocks of 1 / 8 size may be encoded separately. As another example, a unified candidate information for pointing to one candidate sub-block of 1 / 16 size and one candidate sub-block of 1 / 8 size among two or more candidate sub-blocks of 1 / 16 size and two or more candidate sub-blocks of 1 / 8 size may be encoded. The candidate information may be binarized according to a truncation unary code method. A video encoding device (3430) according to one embodiment can compare the RD cost resulting from a conversion using one 1 / 4 size candidate sub-block and the RD cost resulting from a conversion using one 1 / 8 size candidate sub-block based on size information. As a result of the RD cost comparison, the candidate sub-block that generates a lower cost can be determined as the final sub-block. The conversion kernel set can be determined differently depending on the location of one 1 / 16 size candidate sub-block. Similarly, the conversion kernel set can be determined differently depending on the location of one 1 / 8 size candidate sub-block. By performing a conversion using the conversion kernel set corresponding to the determined final sub-block, the conversion coefficient of the encoding unit (3100, 3200) can be generated.
[0462] In the embodiment of FIG. 33, a video encoding device (3430) according to one embodiment can determine the division direction, the location of the sub-block, and the size of the sub-block using the amount of change of the prediction samples generated by inter-prediction. Therefore, the video encoding device (3430) does not need to encode information regarding the division direction of the sub-block, the location of the sub-block, and the size of the sub-block.
[0463] Specifically, the video encoding device (3430) according to one embodiment can determine the sub-block for sub-block conversion by using the amount of change of prediction samples generated by inter-prediction, so there is no need to encode information regarding the division direction, the location of the sub-block, and the size of the sub-block.
[0464] A video encoding device (3430) according to one embodiment can sort sub-blocks in order of the largest value of change by comparing the sum of the change amounts of prediction samples in the region corresponding to each sub-block within the prediction block used in the inter-prediction of the current block for each sub-block of the corresponding sub-block size. For each size, the position and direction of the sub-block with the largest change amount of the prediction sample can be selected.
[0465] A video encoding device (3430) according to one embodiment can determine the size of a sub-block to be used for sub-block conversion of an encoding unit (3300) by using the amount of change of predicted samples corresponding to the area of the sub-blocks. Therefore, information regarding the size of the sub-block does not need to be encoded.
[0466] A video encoding device (3430) according to one embodiment can determine a final sub-block to be used for sub-block conversion of an encoding unit (3300) by comparing the mean / sum / variance of the change amounts of predicted samples corresponding to a 1 / 2 size sub-block (3330) and the mean / sum / variance of the change amounts of predicted samples corresponding to a 1 / 4 size sub-block (3380).
[0467] A video encoding device (3430) according to one embodiment can perform a conversion according to the finally determined sub-block and select a conversion coefficient to be encoded in order to perform a conversion on the conversion coefficient according to the size of the determined sub-block.
[0468] For example, when a 1 / 2 size sub-block (3330) is finally determined, the video encoding device (3430) generates conversion coefficients of the 1 / 2 size sub-block by performing a 1 / 2 sub-block conversion on the 1 / 2 size sub-block (3330), and may not encode high-frequency coefficients of the 1 / 4 size of the 1 / 2 size sub-block (3330).
[0469] For example, when a 1 / 4 size sub-block (3380) is finally determined, the video encoding device (3430) can obtain conversion coefficients by performing a 1 / 4 sub-block conversion corresponding to the 1 / 4 size sub-block.
[0470] 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.
[0471] According to one embodiment, the method according to the various embodiments disclosed herein may be provided by being included in a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)), or distributed online (e.g., download or upload) through an application store or directly between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product (e.g., downloadable app) may be temporarily stored or temporarily created on a device-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or a relay server.
Claims
In the method of decoding video, A step (2610) of obtaining from a bitstream size information indicating the size of a sub-block to be used for a sub-block transformation performed on the current block and candidate information pointing to one sub-block among a plurality of candidate sub-blocks; A step (2620) of determining the size of a sub-block to be used for sub-block conversion of the current block based on the above size information; A step (2630) of determining two or more candidate sub-blocks among the sub-blocks by comparing the sum of the changes in the predicted samples of the current block corresponding to the sub-blocks of the determined sub-block size; Among the above two or more candidate sub-blocks, a step (2640) of obtaining residual data by performing an inverse transformation based on one sub-block pointed to by the candidate information; A step (2650) of restoring the residual block of the current block containing the residual data, taking into account the position and orientation of the sub-block; and A method characterized by including the step (2660) of generating a restoration block of the current block based on the residual block of the current block and the prediction block. In paragraph 1, the step of determining the two or more candidate sub-blocks is A method characterized by including the step of, for each sub-block of the determined sub-block size, comparing the sum of the changes in the prediction samples in the region corresponding to each sub-block within the prediction block used in the inter-prediction of the current block, sorting the sub-blocks in order of the largest change value, and determining the position and direction of two or more candidate sub-blocks among the sorted sub-blocks. In any one of paragraphs 1 to 2, A method characterized in that the above sub-block transformation is one of the following: a transformation applied to sub-blocks created by dividing the current block in a horizontal direction, a transformation applied to sub-blocks created by dividing the current block in a vertical direction, or a transformation applied to sub-blocks corresponding to an arbitrary area of a predetermined size within the current block. In any one of paragraphs 1 to 3, the step of determining the two or more candidate sub-blocks is A method characterized by including the step of determining two or more candidate sub-blocks among sub-blocks of the corresponding sub-block size generated by dividing the current block in the horizontal direction and sub-blocks of the corresponding sub-block size generated by dividing the current block in the vertical direction, wherein the above sub-block transformation is a side sub-block transformation. In any one of paragraphs 1 to 4, the step of determining the two or more candidate sub-blocks is A method characterized by including the step of determining one or more candidate sub-blocks among sub-blocks generated by dividing the current block into a first size in the horizontal direction and a second size in the vertical direction, when the above sub-block transformation is a corner sub-block transformation. In any one of claims 1 to 5, the step of obtaining the residual data by performing the inverse transformation is A method characterized by including the step of determining a combination of a horizontal transformation kernel and a vertical transformation kernel according to the position of the above sub-block. In terms of video encoding methods, A step (3510) of determining two or more candidate sub-blocks for each of the plurality of sub-block sizes by comparing the sum of the changes in the predicted samples of the current block corresponding to the sub-blocks of the respective sub-block sizes. A step (3520) of determining one sub-block to be used for the sub-block transformation of the current block by comparing the costs generated by the transformation of two or more candidate sub-blocks determined for each of the plurality of sub-block sizes; A step (3530) of generating a transformation coefficient of the current block by performing a transformation on the residual data corresponding to the one sub-block determined above; A step (3540) of encoding size information representing the size of one sub-block determined to be used for sub-block conversion of the current block; A step (3550) of encoding candidate information pointing to one sub-block among two or more candidate sub-blocks corresponding to the size of one sub-block determined above; and A method characterized by including the step (3560) of generating a bitstream including the transformation coefficient of the current block, the size information, and the candidate information. In claim 7, the step of determining two or more candidate sub-blocks for each of the plurality of sub-block sizes is A method characterized by including the step of, for each sub-block of the size of the said sub-block, comparing the sum of the changes in the prediction samples in the region corresponding to each sub-block within the prediction block used in the inter-prediction of the said current block, sorting the sub-blocks in order of the largest change value, and determining two or more candidate sub-blocks among the sorted sub-blocks. In any one of paragraphs 7 through 8, A method characterized in that the above sub-block transformation is one of a transformation applied to a sub-block created by dividing the current block in a horizontal direction, a transformation applied to a sub-block created by dividing the current block in a vertical direction, or a transformation applied to a sub-block corresponding to an arbitrary area of a predetermined size within the current block. In any one of claims 7 to 9, the step of determining two or more candidate sub-blocks for each of the plurality of sub-block sizes is A method characterized by including the step of determining two or more candidate sub-blocks among sub-blocks of the corresponding sub-block size generated by dividing the current block in the horizontal direction and sub-blocks of the corresponding sub-block size generated by dividing the current block in the vertical direction, wherein the above sub-block transformation is a side sub-block transformation. In any one of claims 7 to 10, the step of determining two or more candidate sub-blocks for each of the plurality of sub-block sizes is A method characterized by including the step of determining two or more candidate sub-blocks among sub-blocks generated by dividing the current block into a first size in the horizontal direction and a second size in the vertical direction, when the above sub-block transformation is a corner sub-block transformation. In any one of claims 7 to 11, the step of performing a transformation on the residual data to generate the transformation coefficients of the current block A method characterized by including the step of determining a combination of a horizontal transformation kernel and a vertical transformation kernel according to the position of the above sub-block. In the method of transmitting a bitstream, A step of determining two or more candidate sub-blocks for each of the plurality of sub-block sizes by comparing the sum of the changes in the predicted samples of the current block corresponding to the sub-blocks of the respective sub-block sizes. A step of determining one sub-block to be used for the sub-block transformation of the current block by comparing the costs generated by the transformation of two or more candidate sub-blocks determined for each of the plurality of sub-block sizes; A step of generating a transformation coefficient of the current block by performing a transformation on residual data corresponding to one sub-block determined above; A step of encoding size information representing the size of one sub-block determined to be used for sub-block conversion of the current block; A step of encoding candidate information pointing to one sub-block among two or more candidate sub-blocks corresponding to the size of one sub-block determined above; and A method characterized by including the step of outputting the bitstream including the transformation coefficient of the current block, the size information, and the candidate information. In a device (2000) for decoding video, Memory for storing instructions (2020); and It includes at least one processor (2010) operably coupled to the memory and including a processing circuit, and By the above at least one processor (2010) executing the above instructions alone or in cooperation, the device (2000) is: Size information indicating the size of a sub-block to be used for a sub-block transformation performed on the current block and candidate information pointing to one sub-block among a plurality of candidate sub-blocks are obtained from a bitstream, and Based on size information obtained from the bitstream, the size of the sub-block to be used for sub-block conversion of the current block is determined, and Two or more candidate sub-blocks are determined among the sub-blocks by comparing the sum of the changes in the predicted samples of the current block corresponding to the sub-blocks of the determined sub-block size, and Among the two or more candidate sub-blocks mentioned above, residual data is obtained by performing an inverse transformation based on one sub-block pointed to by the candidate information, and Considering the location and orientation of the above sub-block, restore the residual block of the current block containing the above residual data, and A device characterized by generating a restoration block of the current block based on the residual block of the current block and the prediction block. In a video encoding device (3430), Memory for storing instructions (3420); and It includes at least one processor (3410) operably coupled to the memory and including a processing circuit, By the above at least one processor (3410) executing the above instructions alone or in cooperation, the device (3430): For each of the plurality of sub-block sizes, the sum of the changes in the predicted samples of the current block corresponding to the sub-blocks of the said sub-block size is compared to determine two or more candidate sub-blocks for each of the plurality of sub-block sizes, and By comparing the costs generated by the transformation of the two or more candidate sub-blocks determined for each of the plurality of sub-block sizes, one sub-block to be used for the sub-block transformation of the current block is determined, and A transformation is performed on the residual data corresponding to the one sub-block determined above to generate the transformation coefficient of the current block, and Encode size information representing the size of the one sub-block determined to be used for sub-block transformation of the current block, and Encoding candidate information pointing to one sub-block among two or more candidate sub-blocks corresponding to the size of one sub-block determined above, and A device characterized by generating a bitstream including the transformation coefficient of the current block, the size information, and the candidate information.