Encoding device and method using entropy encoding, and decoding device and method using entropy decoding

WO2026205745A1PCT designated stage Publication Date: 2026-10-01SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2026/001767
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-09-09
Filing Date
2026-01-29
Publication Date
2026-10-01

Smart Images

  • Figure KR2026001767_01102026_PF_FP_ABST
    Figure KR2026001767_01102026_PF_FP_ABST
Patent Text Reader

Abstract

A video decoding method using entropy decoding, according to one embodiment, comprises the steps of: determining, from among a context-based decoding scheme and a bypass decoding scheme, a decoding scheme of a first bin of a first syntax element for the current block; obtaining the first bin from a bitstream through arithmetic decoding according to the determined decoding scheme; determining the value of the first syntax element on the basis of the obtained first bin; and reconstructing the current block by using the value of the first syntax element, wherein the decoding scheme of the first bin can be determined on the basis of at least one from among the size of the current block, the size of a neighboring block adjacent to the current block, the value of a second syntax element and the value of the first syntax element for the neighboring block.
Need to check novelty before this filing date? Find Prior Art

Description

Encoding apparatus and method using entropy encoding, and decoding apparatus and method using entropy decoding

[0001] The present disclosure relates to image processing, and specifically, the present disclosure relates to a method for encoding and decoding an image using entropy encoding and entropy decoding.

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

[0003] Inter-prediction is a technique that compresses images by eliminating temporal redundancy between images. In inter-prediction, blocks of the current image can be predicted using a reference image. The reference block most similar to the current block can be searched within the reference image. The current block is predicted based on the reference block, and a residual block can be generated by subtracting the predicted block resulting from the prediction result from the current block.

[0004] Intra prediction is a technique that compresses images by eliminating spatial redundancy within the image. In intra prediction, depending on the intra prediction mode, a prediction block can be generated based on the surrounding pixels of the current block. Additionally, a residual block can be generated by subtracting the prediction block from the current block.

[0005] Various syntax elements, including information about residual blocks generated during the video encoding process, can be entropy-encoded and included in the bitstream, and the decoder can recover the syntax elements by entropy-decoding the bitstream.

[0006] A method for decoding an image using entropy decoding according to one embodiment may include a step of determining a decoding method for a first bin of a first syntax element for a current block from among a context-based decoding method and a bypass decoding method.

[0007] A method for decoding an image using entropy decoding according to one embodiment may include the step of obtaining a first bin through arithmetic decoding from a bitstream according to a determined decoding method.

[0008] A method for decoding an image using entropy decoding according to one embodiment may include the step of determining the value of a first syntax element based on a first bin obtained.

[0009] A method for decoding an image using entropy decoding according to one embodiment may include a step of restoring the current block using the value of a first syntax element.

[0010] In one embodiment, the decoding method of the first bin may be determined based on at least one of the size of the current block, the size of a neighboring block adjacent to the current block, the value of the second syntax element, or the value of the first syntax element for the neighboring block.

[0011] A method for encoding an image using entropy encoding according to one embodiment may include the step of determining the value of a first syntax element for encoding a current block.

[0012] A method for encoding an image using entropy encoding according to one embodiment may include the step of determining the encoding method of a first bin corresponding to the value of a first syntax element among a context-based encoding method and a bypass encoding method.

[0013] A method for encoding an image using entropy encoding according to one embodiment may include the step of generating a bitstream by performing arithmetic encoding on a first bin according to a determined encoding method.

[0014] In one embodiment, the encoding method of the first bin may be determined based on at least one of the size of the current block, the size of a neighboring block adjacent to the current block, the value of the second syntax element, or the value of the first syntax element for the neighboring block.

[0015] A method for transmitting a bitstream generated by an image encoding method according to one embodiment may include the step of transmitting a bitstream generated by an image encoding method.

[0016] A decoding device using entropy decoding according to one embodiment may include a memory for storing at least one instruction and at least one processor for executing at least one instruction.

[0017] In one embodiment, as at least one instruction is executed, the decoding device may determine the decoding method of the first bin of the first syntax element for the current block from among a context-based decoding method and a bypass decoding method.

[0018] In one embodiment, as at least one instruction is executed, the decoding device can obtain a first bin through arithmetic decoding from a bitstream according to a determined decoding method.

[0019] In one embodiment, as at least one instruction is executed, the decoding device can determine the value of a first syntax element based on a first bin obtained.

[0020] In one embodiment, as at least one instruction is executed, the decoding device can restore the current block using the value of the first syntax element.

[0021] In one embodiment, the decoding method of the first bin may be determined based on at least one of the size of the current block, the size of a neighboring block adjacent to the current block, the value of the second syntax element, or the value of the first syntax element for the neighboring block.

[0022] An encoding device using entropy encoding according to one embodiment may include a memory for storing at least one instruction and at least one processor for executing at least one instruction.

[0023] In one embodiment, as at least one instruction is executed, the encoding device can determine the value of a first syntax element for encoding the current block.

[0024] In one embodiment, as at least one instruction is executed, the encoding device may determine the encoding method of the first bin corresponding to the value of the first syntax element among a context-based encoding method and a bypass encoding method.

[0025] In one embodiment, as at least one instruction is executed, the encoding device may generate a bitstream by performing arithmetic encoding on a first bin according to a determined encoding method.

[0026] In one embodiment, the encoding method of the first bin may be determined based on at least one of the size of the current block, the size of a neighboring block adjacent to the current block, the value of the second syntax element, or the value of the first syntax element for the neighboring block.

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

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

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

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

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

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

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

[0034] FIG. 8 illustrates a process for determining that, according to one embodiment, when the encoding unit cannot be processed in a predetermined order, the current encoding unit is divided into an odd number of encoding units.

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

[0036] FIG. 10 illustrates that, according to one embodiment, the shape that can be divided is limited when a second encoding unit of a non-square shape determined by dividing a first encoding unit satisfies a predetermined condition.

[0037] FIG. 11 illustrates a process of dividing square-shaped encoding units when, according to one embodiment, the divided shape mode information cannot represent division into four square-shaped encoding units.

[0038] FIG. 12 illustrates that, according to one embodiment, the processing order between a plurality of encoding units may vary depending on the division process of the encoding unit.

[0039] FIG. 13 illustrates a process in which, according to one embodiment, a encoding unit is recursively divided to determine a plurality of encoding units, and the depth of the encoding unit is determined as the shape and size of the encoding unit change.

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

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

[0042] FIG. 16 illustrates the encoding units that can be determined for each picture when the combination of forms in which the encoding units can be divided according to one embodiment is different for each picture.

[0043] FIG. 17 illustrates various forms of encoding units that can be determined based on partitioned form mode information expressed as binary code according to one embodiment.

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

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

[0046] FIG. 20 is a diagram illustrating the configuration of a decoding device according to one embodiment.

[0047] FIG. 21 is a diagram illustrating the configuration of an entropy decoder according to one embodiment.

[0048] FIG. 22 is a diagram illustrating the initialization process of a context according to one embodiment.

[0049] FIG. 23 is a diagram illustrating a method for obtaining an initialization value (initValue) of a context according to one embodiment.

[0050] FIG. 24 is a diagram illustrating a method for updating the initialization value of a context according to one embodiment.

[0051] FIG. 25 is a diagram illustrating an arithmetic encoding process according to one embodiment.

[0052] FIG. 26 is a diagram illustrating an arithmetic decoding process according to one embodiment.

[0053] FIG. 27 is a diagram illustrating a method for determining a bin decoding method according to one embodiment.

[0054] FIG. 28 is a drawing illustrating the segmented structure of the current picture according to one embodiment.

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

[0056] FIG. 30 is a diagram illustrating the configuration of an encoding device according to one embodiment.

[0057] FIG. 31 is a diagram illustrating the configuration of an entropy encoding unit according to one embodiment.

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

[0059] A method for decoding an image using entropy decoding according to one embodiment may include a step of determining a decoding method for a first bin of a first syntax element for a current block from among a context-based decoding method and a bypass decoding method.

[0060] A method for decoding an image using entropy decoding according to one embodiment may include the step of obtaining a first bin through arithmetic decoding from a bitstream according to a determined decoding method.

[0061] A method for decoding an image using entropy decoding according to one embodiment may include the step of determining the value of a first syntax element based on a first bin obtained.

[0062] A method for decoding an image using entropy decoding according to one embodiment may include a step of restoring the current block using the value of a first syntax element.

[0063] In one embodiment, the decoding method of the first bin may be determined based on at least one of the size of the current block, the size of a neighboring block adjacent to the current block, the value of the second syntax element, or the value of the first syntax element for the neighboring block.

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

[0065] In describing the embodiments, if it is determined that a detailed description of related prior art could unnecessarily obscure the gist of the present disclosure, such detailed description may be omitted. Additionally, numbers used in the description of the embodiments (e.g., first, second, etc.) may correspond to identification symbols to distinguish one component from another.

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

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

[0068] In this disclosure, components expressed as ‘~part (unit)’, ‘module’, etc. may consist of two or more components combined into a single component, or a single component may be divided into two or more more subdivided components. Additionally, each component described below may additionally perform some or all of the functions of other components in addition to the primary function it is responsible for, and some of the primary functions of each component may be performed by other components.

[0069] In the present disclosure, 'image' may refer to a picture, a still image, a frame, a video composed of a plurality of consecutive still images, or a video.

[0070] In the present disclosure, 'sample' may refer to data assigned to a sampling location of an image that is subject to processing. For example, a pixel within a frame in a spatial domain may correspond to a sample. A unit comprising a plurality of samples may be defined as a block.

[0071] Hereinafter, with reference to FIGS. 1 to 19, an image encoding method and apparatus based on a tree structure encoding unit and a conversion unit according to one embodiment, an image decoding method and apparatus are disclosed.

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

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

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

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

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

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

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

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

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

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

[0082] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) is a unit comprising a coding block for luminance samples and two coding blocks for corresponding chroma samples, and syntax structures used to encode the luminance samples and chroma samples. When a picture is a monochrome picture, a coding unit is a unit comprising a coding block for monochrome samples and syntax structures used to encode the monochrome samples. When a picture is a picture encoded in color planes separated by color components, a coding unit is a unit comprising the picture and syntax structures used to encode the samples of the picture.

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

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

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

[0086] For example, information regarding the maximum size of a two-divisionable luminance coding block and the difference in luminance block size can be obtained from a bitstream. The information regarding the difference in luminance block size may represent the size difference between the maximum luminance coding unit and the maximum two-divisionable luminance coding block. Therefore, by combining the information regarding the maximum size of the two-divisionable luminance coding block obtained from the bitstream with the information regarding the difference in luminance block size, the size of the maximum luminance coding unit can be determined. Using the size of the maximum luminance coding unit, the size of the maximum chroma coding unit can also be determined. For example, if the Y:Cb:Cr ratio according to the color format is 4:2:0, the size of the chroma block may be half the size of the luminance block, and similarly, the size of the maximum chroma coding unit may be half the size of the maximum luminance coding unit.

[0087] According to one embodiment, information regarding the maximum size of a binary splittable luminous encoding block is obtained from a bitstream, so the maximum size of the binary splittable luminous encoding block can be determined variably. Alternatively, the maximum size of a ternary splittable luminous encoding block can be fixed. For example, the maximum size of a ternary splittable luminous encoding block in picture I may be 32x32, and the maximum size of a ternary splittable luminous encoding block in picture P or picture B may be 64x64.

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

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

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

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

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

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

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

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

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

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

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

[0099] The division of the encoding unit is described in more detail in FIGS. 3 through 16. The current block and surrounding block of the present disclosure may represent one of the maximum encoding unit, the encoding unit, the prediction block, and the transformation block. Additionally, the current block or the current encoding unit is a block currently undergoing decoding or encoding, or a block currently undergoing division. The surrounding block may be a block restored prior to the current block. The surrounding block may be spatially or temporally adjacent to the current block. The surrounding block may be located on one of the lower-left, left, upper-left, upper, upper-right, right, or lower-right sides of the current block.

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

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

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

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

[0104] According to one embodiment, the image decoding device (100) can determine the form of the encoding unit using block form information and can determine how the encoding unit is divided using division form mode information. That is, depending on what block form the block form information used by the image decoding device (100) represents, the method of dividing the encoding unit represented by the division form mode information can be determined.

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

[0106] According to one embodiment, the image decoding device (100) may use block shape information indicating that the current encoding unit is in the shape of a square. For example, the image decoding device (100) may determine whether to not divide the square encoding unit, to divide it vertically, to divide it horizontally, or to divide it into four encoding units, etc., according to the division shape mode information. Referring to FIG. 3, when the block shape information of the current encoding unit (300) indicates a square shape, the decoding unit (120) may not divide the encoding unit (310a) having the same size as the current encoding unit (300) according to the division shape mode information indicating that it is not divided, or may determine the divided encoding units (310b, 310c, 310d, 310e, 310f, etc.) based on the division shape mode information indicating a predetermined division method.

[0107] Referring to FIG. 3, the image decoding device (100) can determine two encoding units (310b) that divide the current encoding unit (300) in the vertical direction based on splitting form mode information indicating that it is divided in the vertical direction according to one embodiment. The image decoding device (100) can determine two encoding units (310c) that divide the current encoding unit (300) in the horizontal direction based on splitting form mode information indicating that it is divided in the horizontal direction. The image decoding device (100) can determine four encoding units (310d) that divide the current encoding unit (300) in the vertical direction and the horizontal direction based on splitting form mode information indicating that it is divided in the vertical direction and the horizontal direction. The image decoding device (100) can determine three encoding units (310e) that divide the current encoding unit (300) in the vertical direction based on splitting form mode information indicating that it is divided ternary in the vertical direction according to one embodiment. The image decoding device (100) can determine three encoding units (310f) that divide the current encoding unit (300) horizontally based on division form mode information indicating horizontal division. However, the division form in which the square encoding unit can be divided should not be interpreted as being limited to the form described above, and may include various forms that the division form mode information can represent. The specific division forms in which the square encoding unit is divided will be described in detail below through various embodiments.

[0108] FIG. 4 illustrates a process in which, according to one embodiment, an image decoding device (100) divides a non-square-shaped encoding unit to determine at least one encoding unit.

[0109] According to one embodiment, the image decoding device (100) may use block shape information indicating that the current encoding unit is in a non-square shape. The image decoding device (100) may determine whether to not divide the current encoding unit of the non-square shape or to divide it in a predetermined way according to the division shape mode information. Referring to FIG. 4, when the block shape information of the current encoding unit (400 or 450) indicates a non-square shape, the image decoding device (100) may determine an encoding unit (410 or 460) having the same size as the current encoding unit (400 or 450) based on division shape mode information indicating that it is not divided, or determine divided encoding units (420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, 480c) based on division shape mode information indicating a predetermined division method. A predetermined division method in which a non-square encoding unit is divided will be specifically described below through various embodiments.

[0110] According to one embodiment, the image decoding device (100) can determine the form in which the encoding unit is divided using the division form mode information, and in this case, the division form mode information may indicate the number of at least one encoding unit generated by dividing the encoding unit. Referring to FIG. 4, when the division form mode information indicates that the current encoding unit (400 or 450) is divided into two encoding units, the image decoding device (100) can determine two encoding units (420a, 420b, or 470a, 470b) included in the current encoding unit by dividing the current encoding unit (400 or 450) based on the division form mode information.

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

[0112] According to one embodiment, when the segmentation mode information indicates that the encoding unit is divided into an odd number of blocks (terminal segmentation), the image decoder (100) can determine an odd number of encoding units included in the current encoding unit (400 or 450). For example, when the segmentation mode information indicates that the current encoding unit (400 or 450) is divided into three encoding units, the image decoder (100) can divide the current encoding unit (400 or 450) into three encoding units (430a, 430b, 430c, 480a, 480b, 480c).

[0113] According to one embodiment, the ratio of the width to the height of the current encoding unit (400 or 450) may be 4:1 or 1:4. When the ratio of the width to the height is 4:1, the block shape information may be in the horizontal direction because the width is longer than the height. When the ratio of the width to the height is 1:4, the block shape information may be in the vertical direction because the width is shorter than the height. The image decoder (100) may determine to divide the current encoding unit into an odd number of blocks based on the division shape mode information. Additionally, the image decoder (100) may determine the division direction of the current encoding unit (400 or 450) based on the block shape information of the current encoding unit (400 or 450). For example, if the current encoding unit (400) is in a vertical direction, the image decoding device (100) can determine the encoding units (430a, 430b, 430c) by dividing the current encoding unit (400) in a horizontal direction. Also, if the current encoding unit (450) is in a horizontal direction, the image decoding device (100) can determine the encoding units (480a, 480b, 480c) by dividing the current encoding unit (450) in a vertical direction.

[0114] According to one embodiment, the image decoding device (100) may determine an odd number of encoding units included in the current encoding unit (400 or 450), and the sizes of the determined encoding units may not all be the same. For example, among the determined odd number of encoding units (430a, 430b, 430c, 480a, 480b, 480c), the size of a certain encoding unit (430b or 480b) may have a different size from the other encoding units (430a, 430c, 480a, 480c). That is, the current encoding unit (400 or 450) can be divided and determined as a encoding unit, and the encoding unit can have multiple types of sizes, and in some cases, an odd number of encoding units (430a, 430b, 430c, 480a, 480b, 480c) may each have different sizes.

[0115] According to one embodiment, if the segmentation mode information indicates that the encoding unit is divided into an odd number of blocks, the image decoding device (100) can determine the odd number of encoding units included in the current encoding unit (400 or 450), and furthermore, the image decoding device (100) can impose a predetermined limit on at least one encoding unit among the odd number of encoding units generated by the segmentation. Referring to FIG. 4, the image decoding device (100) can perform the decoding process for the central encoding unit (430b, 480b) among the three encoding units (430a, 430b, 430c, 480a, 480b, 480c) generated by the segmentation of the current encoding unit (400 or 450) differently from the other encoding units (430a, 430c, 480a, 480c). For example, the video decoding device (100) may restrict the centrally located encoding unit (430b, 480b) from being further divided unlike other encoding units (430a, 430c, 480a, 480c), or restrict it to being divided only a predetermined number of times.

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

[0117] According to one embodiment, the image decoding device (100) may determine whether to divide a square-shaped first encoding unit (500) into encoding units or not to divide it based on at least one of block shape information and division shape mode information. According to one embodiment, if the division shape mode information indicates that the first encoding unit (500) is divided in a horizontal direction, the image decoding device (100) may divide the first encoding unit (500) in a horizontal direction to determine a second encoding unit (510). The first encoding unit, the second encoding unit, and the third encoding unit used according to one embodiment are terms used to understand the relationship before and after division between the encoding units. For example, if the first encoding unit is divided, the second encoding unit may be determined, and if the second encoding unit is divided, the third encoding unit may be determined. In the following, the relationship between the first encoding unit, the second encoding unit, and the third encoding unit used may be understood as following the features described above.

[0118] According to one embodiment, the image decoding device (100) may determine whether to divide the determined second encoding unit (510) into encoding units or not to divide it based on the division shape mode information. Referring to FIG. 5, the image decoding device (100) may divide the determined non-square second encoding unit (510) into at least one third encoding unit (520a, 520b, 520c, 520d, etc.) by dividing the first encoding unit (500) based on the division shape mode information, or may not divide the second encoding unit (510). The image decoding device (100) can obtain split-form mode information, and the image decoding device (100) can obtain a plurality of second encoding units (e.g., 510) of various forms by dividing the first encoding unit (500) based on the obtained split-form mode information, and the second encoding unit (510) can be divided according to the method in which the first encoding unit (500) was divided based on the split-form mode information. According to one embodiment, when the first encoding unit (500) is divided into the second encoding unit (510) based on the split-form mode information for the first encoding unit (500), the second encoding unit (510) can also be divided into third encoding units (e.g., 520a, 520b, 520c, 520d, etc.) based on the split-form mode information for the second encoding unit (510). That is, the encoding unit can be recursively partitioned based on partitioning mode information associated with each encoding unit. Thus, a square encoding unit can be determined from a non-square encoding unit, and a non-square encoding unit can be determined by recursively partitioning this square encoding unit.

[0119] Referring to FIG. 5, among the odd number of third encoding units (520b, 520c, 520d) determined by dividing a second encoding unit (510) of a non-square shape, a predetermined encoding unit (e.g., a central encoding unit or a square encoding unit) may be recursively divided. According to one embodiment, a third encoding unit (520b) of a non-square shape, which is one of the odd number of third encoding units (520b, 520c, 520d), may be divided horizontally into a plurality of fourth encoding units. A fourth encoding unit (530b or 530d) of a non-square shape, which is one of the plurality of fourth encoding units (530a, 530b, 530c, 530d), may again be divided into a plurality of encoding units. For example, a non-square fourth encoding unit (530b or 530d) may be further divided into an odd number of encoding units. Methods that can be used for the recursive division of encoding units will be described later through various embodiments.

[0120] According to one embodiment, the image decoding device (100) may divide each of the third encoding units (520a, 520b, 520c, 520d, etc.) into encoding units based on the division shape mode information. Additionally, the image decoding device (100) may decide not to divide the second encoding unit (510) based on the division shape mode information. According to one embodiment, the image decoding device (100) may divide the non-square second encoding unit (510) into an odd number of third encoding units (520b, 520c, 520d). The image decoding device (100) may place a certain limit on a certain third encoding unit among the odd number of third encoding units (520b, 520c, 520d). For example, the video decoding device (100) may limit the encoding unit (520c) located in the middle of the odd number of third encoding units (520b, 520c, 520d) so that it is not further divided or is limited to being divided a set number of times.

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

[0122] According to one embodiment, the image decoding device (100) can obtain splitting form mode information used to split the current encoding unit at a predetermined location within the current encoding unit.

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

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

[0125] According to one embodiment, the image decoding device (100) may select one of the encoding units when the current encoding unit is divided into a predetermined number of encoding units. There may be various methods for selecting one of the multiple encoding units, and such methods will be described later through various embodiments below.

[0126] According to one embodiment, the image decoding device (100) can divide the current encoding unit into a plurality of encoding units and determine the encoding unit at a predetermined position.

[0127] According to one embodiment, the image decoding device (100) may use information indicating the location of each of the odd number of encoding units to determine the encoding unit located in the middle among the odd number of encoding units. Referring to FIG. 6, the image decoding device (100) may divide the current encoding unit (600) or the current encoding unit (650) to determine the odd number of encoding units (620a, 620b, 620c) or the odd number of encoding units (660a, 660b, 660c). The image decoding device (100) may determine the middle encoding unit (620b) or the middle encoding unit (660b) by using information regarding the location of the odd number of encoding units (620a, 620b, 620c) or the odd number of encoding units (660a, 660b, 660c). For example, the image decoding device (100) can determine the centrally located encoding unit (620b) by determining the positions of the encoding units (620a, 620b, 620c) based on information indicating the positions of a predetermined sample included in the encoding units (620a, 620b, 620c). Specifically, the image decoding device (100) can determine the centrally located encoding unit (620b) by determining the positions of the encoding units (620a, 620b, 620c) based on information indicating the positions of the upper-left samples (630a, 630b, 630c) of the encoding units (620a, 620b, 620c).

[0128] According to one embodiment, information indicating the location of the upper-left sample (630a, 630b, 630c) included in each of the encoding units (620a, 620b, 620c) may include information regarding the location or coordinates within the picture of the encoding units (620a, 620b, 620c). According to one embodiment, information indicating the location of the upper-left sample (630a, 630b, 630c) included in each of the encoding units (620a, 620b, 620c) may include information indicating the width or height of the encoding units (620a, 620b, 620c) included in the current encoding unit (600), and such width or height may correspond to information indicating the difference between coordinates within the picture of the encoding units (620a, 620b, 620c). That is, the image decoding device (100) can determine the centrally located encoding unit (620b) by directly using information about the position or coordinates of the encoding units (620a, 620b, 620c) within the picture, or by using information about the width or height of the encoding unit corresponding to the difference value between the coordinates.

[0129] According to one embodiment, information indicating the location of the upper left sample (630a) of the upper encoding unit (620a) may be represented by the (xa, ya) coordinates, information indicating the location of the upper left sample (530b) of the middle encoding unit (620b) may be represented by the (xb, yb) coordinates, and information indicating the location of the upper left sample (630c) of the lower encoding unit (620c) may be represented by the (xc, yc) coordinates. The image decoding device (100) can determine the middle encoding unit (620b) using the coordinates of the upper left samples (630a, 630b, 630c) included in each of the encoding units (620a, 620b, 620c). For example, when the coordinates of the upper-left samples (630a, 630b, 630c) are sorted in ascending or descending order, the encoding unit (620b) containing the coordinates (xb, yb) of the sample (630b) located in the middle can be determined as the encoding unit located in the middle among the encoding units (620a, 620b, 620c) determined by dividing the current encoding unit (600). However, the coordinates indicating the position of the upper-left samples (630a, 630b, 630c) may represent absolute positions within the picture, and furthermore, based on the position of the upper-left sample (630a) of the upper-left of the upper-left of the middle encoding unit (620b), the (dxb, dyb) coordinates, which represent the relative position of the upper-left sample (630b) of the middle encoding unit (620b), and the (dxc, dyc) coordinates, which represent the relative position of the upper-left sample (630c) of the lower encoding unit (620c) may also be used. In addition, the method of determining the encoding unit of a predetermined position by using the coordinates of the corresponding sample as information indicating the position of the sample included in the encoding unit should not be interpreted as being limited to the method described above, but should be interpreted as various arithmetic methods that can utilize the coordinates of the sample.

[0130] According to one embodiment, the image decoding device (100) can divide the current encoding unit (600) into a plurality of encoding units (620a, 620b, 620c) and select an encoding unit among the encoding units (620a, 620b, 620c) according to a predetermined criterion. For example, the image decoding device (100) can select an encoding unit (620b) of a different size among the encoding units (620a, 620b, 620c).

[0131] According to one embodiment, the image decoding device (100) can determine the width or height of each of the encoding units (620a, 620b, 620c) using the (xa, ya) coordinates, which are information indicating the location of the upper left sample (630a) of the upper encoding unit (620a), the (xb, yb) coordinates, which are information indicating the location of the upper left sample (630b) of the middle encoding unit (620b), and the (xc, yc) coordinates, which are information indicating the location of the upper left sample (630c) of the lower encoding unit (620c). The image decoding device (100) can determine the size of each of the encoding units (620a, 620b, 620c) using the (xa, ya), (xb, yb), and (xc, yc) coordinates, which are information indicating the location of the encoding units (620a, 620b, 620c). According to one embodiment, the image decoding device (100) may determine the width of the upper encoding unit (620a) as the width of the current encoding unit (600). The image decoding device (100) may determine the height of the upper encoding unit (620a) as yb-ya. According to one embodiment, the image decoding device (100) may determine the width of the middle encoding unit (620b) as the width of the current encoding unit (600). The image decoding device (100) may determine the height of the middle encoding unit (620b) as yc-yb. According to one embodiment, the image decoding device (100) may determine the width or height of the lower encoding unit using the width or height of the current encoding unit and the width and height of the upper encoding unit (620a) and the middle encoding unit (620b). The video decoding device (100) can determine a encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (620a, 620b, 620c).Referring to FIG. 6, the image decoding device (100) can determine a middle encoding unit (620b) having a size different from that of the upper encoding unit (620a) and the lower encoding unit (620c) as the encoding unit of a predetermined position. However, since the process of the image decoding device (100) described above determining the encoding unit having a size different from other encoding units is merely one embodiment of determining the encoding unit of a predetermined position using the size of the encoding unit determined based on sample coordinates, various processes of determining the encoding unit of a predetermined position by comparing the size of the encoding unit determined according to the predetermined sample coordinates may be used.

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

[0133] According to one embodiment, the image decoding device (100) may determine the width of the left encoding unit (660a) as xe-xd. The image decoding device (100) may determine the height of the left encoding unit (660a) as the height of the current encoding unit (650). According to one embodiment, the image decoding device (100) may determine the width of the middle encoding unit (660b) as xf-xe. The image decoding device (100) may determine the height of the middle encoding unit (660b) as the height of the current encoding unit (600). According to one embodiment, the image decoding device (100) may determine the width or height of the right encoding unit (660c) using the width or height of the current encoding unit (650) and the width and height of the left encoding unit (660a) and the middle encoding unit (660b). The image decoding device (100) can determine a encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (660a, 660b, 660c). Referring to FIG. 6, the image decoding device (100) can determine a middle encoding unit (660b) having a different size from the left encoding unit (660a) and the right encoding unit (660c) as the encoding unit of a predetermined position. However, since the process of the image decoding device (100) described above determining a encoding unit having a different size from other encoding units is merely one embodiment of determining the encoding unit of a predetermined position using the size of the encoding unit determined based on sample coordinates, various processes of determining the encoding unit of a predetermined position by comparing the size of the encoding unit determined according to the predetermined sample coordinates may be used.

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

[0135] According to one embodiment, the image decoding device (100) may select an encoding unit at a predetermined position among an odd number of encoding units determined by dividing the current encoding unit, taking into account the shape of the current encoding unit. For example, if the current encoding unit is a non-square shape where the width is longer than the height, the image decoding device (100) may determine an encoding unit at a predetermined position according to the horizontal direction. That is, the image decoding device (100) may determine one of the encoding units at different positions in the horizontal direction and place a restriction on that encoding unit. If the current encoding unit is a non-square shape where the height is longer than the width, the image decoding device (100) may determine an encoding unit at a predetermined position according to the vertical direction. That is, the image decoding device (100) may determine one of the encoding units at different positions in the vertical direction and place a restriction on that encoding unit.

[0136] According to one embodiment, the image decoding device (100) may use information indicating the location of each of the even number of encoding units to determine the encoding unit at a predetermined location among the even number of encoding units. The image decoding device (100) may determine the even number of encoding units by dividing (binary division) the current encoding unit and may determine the encoding unit at a predetermined location using information regarding the locations of the even number of encoding units. Since the specific process for this may correspond to the process of determining the encoding unit at a predetermined location (e.g., the middle location) among the odd number of encoding units described above in FIG. 6, it is omitted.

[0137] According to one embodiment, when a current encoding unit in a non-square shape is divided into a plurality of encoding units, certain information regarding the encoding unit at a certain position may be used during the division process to determine the encoding unit at a certain position among the plurality of encoding units. For example, the image decoding device (100) may use at least one of block shape information and division shape mode information stored in a sample included in the middle encoding unit during the division process to determine the encoding unit located in the middle among the encoding units into which the current encoding unit is divided into a plurality of encoding units.

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

[0139] According to one embodiment, a predetermined information for identifying a coding unit at a predetermined location may be obtained from a predetermined sample included in the coding unit to be determined. Referring to FIG. 6, an image decoding device (100) may use a segmentation mode information obtained from a sample at a predetermined location within the current coding unit (600) (for example, a sample at the center of the current coding unit (600)) to determine a coding unit at a predetermined location (for example, a coding unit located in the center of the multiple divided coding units) among a plurality of coding units (620a, 620b, 620c) determined by dividing the current coding unit (600). That is, the image decoding device (100) can determine a sample at the predetermined position by considering the block shape of the current encoding unit (600), and the image decoding device (100) can determine a encoding unit (620b) containing a sample from which certain information (e.g., division shape mode information) can be obtained among a plurality of encoding units (620a, 620b, 620c) from which the current encoding unit (600) is divided and determined, and can impose a certain limit. Referring to FIG. 6, according to one embodiment, the image decoding device (100) can determine a sample (640) located in the middle of the current encoding unit (600) as a sample from which certain information can be obtained, and the image decoding device (100) can impose a certain limit on the encoding unit (620b) containing such a sample (640) during the decoding process. However, the location of the sample from which the specified information can be obtained should not be interpreted as being limited to the location described above, but can be interpreted as samples at any location included in the encoding unit (620b) to be determined for the purpose of imposing a limitation.

[0140] According to one embodiment, the location of a sample from which a predetermined information can be obtained may be determined according to the shape of the current encoding unit (600). According to one embodiment, block shape information may determine whether the shape of the current encoding unit is square or non-square, and may determine the location of a sample from which a predetermined information can be obtained according to the shape. For example, the image decoding device (100) may determine a sample located on a boundary that divides at least one of the width and height of the current encoding unit in half using at least one of the information regarding the width and height of the current encoding unit as a sample from which a predetermined information can be obtained. As another example, if the block shape information related to the current encoding unit indicates that it is a non-square shape, the image decoding device (100) may determine one of the samples adjacent to the boundary that divides the long side of the current encoding unit in half as a sample from which a predetermined information can be obtained.

[0141] According to one embodiment, when the image decoding device (100) divides the current encoding unit into a plurality of encoding units, it may use division form mode information to determine the encoding unit at a predetermined position among the plurality of encoding units. According to one embodiment, the image decoding device (100) may obtain division form mode information from a sample at a predetermined position included in the encoding unit, and the image decoding device (100) may divide the plurality of encoding units generated by dividing the current encoding unit using the division form mode information obtained from a sample at a predetermined position included in each of the plurality of encoding units. That is, the encoding unit may be recursively divided using the division form mode information obtained from a sample at a predetermined position included in each of the encoding units. Since the recursive division process of the encoding unit has been described in detail through FIG. 5, a detailed explanation will be omitted.

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

[0143] FIG. 7 illustrates the order in which a plurality of encoding units are processed when an image decoding device (100) divides a current encoding unit to determine a plurality of encoding units according to one embodiment.

[0144] According to one embodiment, the image decoding device (100) may determine a second encoding unit (710a, 710b) by dividing a first encoding unit (700) in a vertical direction according to the splitting form mode information, determine a second encoding unit (730a, 730b) by dividing the first encoding unit (700) in a horizontal direction, or determine a second encoding unit (750a, 750b, 750c, 750d) by dividing the first encoding unit (700) in both a vertical and a horizontal direction.

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

[0146] According to one embodiment, the image decoding device (100) can recursively divide the encoding units. Referring to FIG. 7, the image decoding device (100) can divide the first encoding unit (700) to determine a plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d), and can recursively divide each of the determined plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d). A method of dividing multiple encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may be a method corresponding to a method of dividing the first encoding unit (700). Accordingly, the multiple encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may each be independently divided into multiple encoding units. Referring to FIG. 7, the image decoding device (100) may determine the second encoding units (710a, 710b) by dividing the first encoding unit (700) in a vertical direction, and furthermore, may determine whether to independently divide or not divide each of the second encoding units (710a, 710b).

[0147] According to one embodiment, the image decoding device (100) may divide the second encoding unit (710a) on the left side horizontally into third encoding units (720a, 720b), and may not divide the second encoding unit (710b) on the right side.

[0148] According to one embodiment, the processing order of the encoding units may be determined based on the process of dividing the encoding units. In other words, the processing order of the divided encoding units may be determined based on the processing order of the encoding units immediately before they are divided. The image decoding device (100) may determine the processing order of the third encoding units (720a, 720b), which are determined by dividing the second encoding unit (710a) on the left, independently of the second encoding unit (710b) on the right. Since the third encoding units (720a, 720b) ​​are determined by dividing the second encoding unit (710a) on the left in a horizontal direction, the third encoding units (720a, 720b) ​​may be processed in a vertical direction (720c). In addition, since the processing order of the second encoding unit (710a) on the left and the second encoding unit (710b) on the right corresponds to the horizontal direction (710c), the third encoding unit (720a, 720b) ​​included in the second encoding unit (710a) on the left can be processed in the vertical direction (720c) before the right encoding unit (710b) is processed. The above description is intended to explain the process in which the processing order of the encoding units is determined according to the encoding unit before division, and therefore should not be interpreted as being limited to the above-described embodiment, but should be interpreted as being used in various ways in which encoding units determined by division in various forms can be processed independently according to a predetermined order.

[0149] FIG. 8 illustrates a process in which, according to one embodiment, an image decoding device (100) determines that the current encoding unit is divided into an odd number of encoding units when the encoding unit cannot be processed in a predetermined order.

[0150] According to one embodiment, the image decoding device (100) may determine that the current encoding unit is divided into an odd number of encoding units based on acquired segmentation mode information. Referring to FIG. 8, a square-shaped first encoding unit (800) may be divided into non-square-shaped second encoding units (810a, 810b), and the second encoding units (810a, 810b) may each be independently divided into third encoding units (820a, 820b, 820c, 820d, 820e). According to one embodiment, the image decoding device (100) can determine a plurality of third encoding units (820a, 820b) by dividing the left encoding unit (810a) among the second encoding units in a horizontal direction, and the right encoding unit (810b) can be divided into an odd number of third encoding units (820c, 820d, 820e).

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

[0152] According to one embodiment, the image decoding device (100) can determine whether the third encoding unit (820a, 820b, 820c, 820d, 820e) included in the first encoding unit (800) satisfies a condition that the third encoding unit (820a, 820b, 820c, 820d, 820e) can be processed in a predetermined order, and the condition relates to whether at least one of the width and height of the second encoding unit (810a, 810b) is divided in half according to the boundary of the third encoding unit (820a, 820b, 820c, 820d, 820e). For example, the third encoding unit (820a, 820b) determined by dividing the height of the left second encoding unit (810a) in a non-square shape in half can satisfy the condition. Since the boundaries of the third encoding units (820c, 820d, 820e), which are determined by dividing the right second encoding unit (810b) into three encoding units, do not divide the width or height of the right second encoding unit (810b) in half, the third encoding units (820c, 820d, 820e) may be determined not to satisfy the condition. In the case of such non-satisfaction of the condition, the image decoding device (100) determines that there is a disconnection in the scan order, and based on the result of the determination, the right second encoding unit (810b) may be determined to be divided into an odd number of encoding units. According to one embodiment, when the image decoding device (100) is divided into an odd number of encoding units, it may place a certain restriction on the encoding unit at a certain position among the divided encoding units, and since the details of such restriction or the certain position, etc., have been described in detail through various embodiments, a detailed explanation will be omitted.

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

[0154] According to one embodiment, the image decoding device (100) may divide the first encoding unit (900) based on the segmentation form mode information obtained through the bitstream acquisition unit (110). The first encoding unit (900) in a square shape may be divided into four square-shaped encoding units or into a plurality of non-square-shaped encoding units. For example, referring to FIG. 9, the first encoding unit (900) is square and the segmentation form mode information indicates that it is divided into non-square encoding units, so the image decoding device (100) may divide the first encoding unit (900) into a plurality of non-square encoding units. Specifically, when the splitting mode information indicates that the first encoding unit (900) is divided in a horizontal or vertical direction to determine an odd number of encoding units, the image decoding device (100) can divide the square-shaped first encoding unit (900) into an odd number of encoding units, such as a second encoding unit (910a, 910b, 910c) determined by dividing in a vertical direction or a second encoding unit (920a, 920b, 920c) determined by dividing in a horizontal direction.

[0155] According to one embodiment, the image decoding device (100) can determine whether the second encoding unit (910a, 910b, 910c, 920a, 920b, 920c) included in the first encoding unit (900) satisfies a condition that the second encoding unit (910a, 910b, 910c, 920a, 920b, 920c) can be processed in a predetermined order, and the condition relates to whether at least one of the width and height of the first encoding unit (900) is divided in half according to the boundary of the second encoding unit (910a, 910b, 910c, 920a, 920b, 920c). Referring to FIG. 9, the boundaries of the second encoding units (910a, 910b, 910c), which are determined by dividing the square-shaped first encoding unit (900) in the vertical direction, do not divide the width of the first encoding unit (900) in half, so the first encoding unit (900) may be determined not to satisfy the condition of being processed in a predetermined order. Additionally, the boundaries of the second encoding units (920a, 920b, 920c), which are determined by dividing the square-shaped first encoding unit (900) in the horizontal direction, do not divide the height of the first encoding unit (900) in half, so the first encoding unit (900) may be determined not to satisfy the condition of being processed in a predetermined order. The image decoding device (100) determines that if these conditions are not satisfied, there is a disconnection in the scan order, and based on the result of the determination, the first encoding unit (900) may be divided into an odd number of encoding units. According to one embodiment, when the image decoding device (100) is divided into an odd number of encoding units, it may place a certain restriction on the encoding unit at a certain position among the divided encoding units. Since the details of such restriction or the certain position have been described in detail through various embodiments, a detailed explanation will be omitted.

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

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

[0158] FIG. 10 illustrates that, according to one embodiment, when a video decoding device (100) divides a first encoding unit (1000) and a second encoding unit of a non-square shape determined by the division satisfies a predetermined condition, the shape in which the second encoding unit can be divided is limited.

[0159] According to one embodiment, the image decoding device (100) may decide to divide a square-shaped first encoding unit (1000) into non-square-shaped second encoding units (1010a, 1010b, 1020a, 1020b) based on division shape mode information obtained through a bitstream acquisition unit (110). The second encoding units (1010a, 1010b, 1020a, 1020b) may be divided independently. Accordingly, the image decoding device (100) may decide to divide into a plurality of encoding units or not divide based on division shape mode information related to each of the second encoding units (1010a, 1010b, 1020a, 1020b). According to one embodiment, the image decoding device (100) may determine a third encoding unit (1012a, 1012b) by dividing the left second encoding unit (1010a), which is a non-square shape determined by dividing the first encoding unit (1000) in the vertical direction, in the horizontal direction. However, when the image decoding device (100) divides the left second encoding unit (1010a) in the horizontal direction, the right second encoding unit (1010b) may be restricted so that it cannot be divided in the same horizontal direction as the left second encoding unit (1010a). If the right second encoding unit (1010b) is divided in the same direction to determine the third encoding unit (1014a, 1014b), the left second encoding unit (1010a) and the right second encoding unit (1010b) may be divided independently in the horizontal direction to determine the third encoding unit (1012a, 1012b, 1014a, 1014b). However, this is the same result as the image decoding device (100) dividing the first encoding unit (1000) into four square-shaped second encoding units (1030a, 1030b, 1030c, 1030d) based on the division shape mode information, and this may be inefficient in terms of image decoding.

[0160] According to one embodiment, the image decoding device (100) may determine a third encoding unit (1022a, 1022b, 1024a, 1024b) by dividing a first encoding unit (1000) in a horizontal direction and a second encoding unit (1020a or 1020b) in a non-square shape in a vertical direction. However, if the image decoding device (100) divides one of the second encoding units (e.g., the upper second encoding unit (1020a)) in a vertical direction, it may restrict the other second encoding unit (e.g., the lower encoding unit (1020b)) from being divided in the same vertical direction as the upper second encoding unit (1020a) in accordance with the above-described reason.

[0161] FIG. 11 illustrates the process of a video decoder (100) dividing square-shaped encoding units when, according to one embodiment, the divided shape mode information cannot be divided into four square-shaped encoding units.

[0162] According to one embodiment, the image decoding device (100) can determine the second encoding unit (1110a, 1110b, 1120a, 1120b, etc.) by dividing the first encoding unit (1100) based on the division shape mode information. The division shape mode information may include information on various shapes in which the encoding unit can be divided, but the information on various shapes may not include information for dividing into four square-shaped encoding units. According to this division shape mode information, the image decoding device (100) cannot divide the square-shaped first encoding unit (1100) into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d). Based on the segmented form mode information, the image decoding device (100) can determine a non-square second encoding unit (1110a, 1110b, 1120a, 1120b, etc.).

[0163] According to one embodiment, the image decoding device (100) can independently divide each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) in a non-square shape. Each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) can be divided in a predetermined order through a recursive method, and this may be a division method corresponding to the method in which the first encoding unit (1100) is divided based on division shape mode information.

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

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

[0166] FIG. 12 illustrates that, according to one embodiment, the processing order between a plurality of encoding units may vary depending on the division process of the encoding unit.

[0167] According to one embodiment, the image decoding device (100) may divide a first encoding unit (1200) based on division shape mode information. When the block shape is square and the division shape mode information indicates that the first encoding unit (1200) is divided in at least one of the horizontal direction and the vertical direction, the image decoding device (100) may divide the first encoding unit (1200) to determine a second encoding unit (e.g., 1210a, 1210b, 1220a, 1220b, etc.). Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) in a non-square shape determined by dividing the first encoding unit (1200) only in the horizontal direction or the vertical direction may be divided independently based on the division shape mode information for each. For example, the video decoding device (100) can determine the third encoding unit (1216a, 1216b, 1216c, 1216d) by dividing the second encoding unit (1210a, 1210b) generated by dividing the first encoding unit (1200) in the vertical direction, and can determine the third encoding unit (1226a, 1226b, 1226c, 1226d) by dividing the second encoding unit (1220a, 1220b) generated by dividing the first encoding unit (1200) in the horizontal direction, respectively, in the vertical direction. Since the process of dividing these second encoding units (1210a, 1210b, 1220a, 1220b) has been described in detail in relation to FIG. 11, a detailed explanation will be omitted.

[0168] According to one embodiment, the image decoding device (100) can process encoding units in a predetermined order. Since the characteristics of processing encoding units in a predetermined order have been described in detail in relation to FIG. 7, a detailed explanation will be omitted. Referring to FIG. 12, the image decoding device (100) can divide a square-shaped first encoding unit (1200) to determine four square-shaped third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d). According to one embodiment, the image decoding device (100) can determine the processing order of the third encoding unit (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) according to the form in which the first encoding unit (1200) is divided.

[0169] According to one embodiment, the image decoding device (100) can determine the third encoding unit (1216a, 1216b, 1216c, 1216d) by dividing the second encoding unit (1210a, 1210b) generated by dividing in the vertical direction into the horizontal direction, and the image decoding device (100) can process the third encoding unit (1216a, 1216b, 1216c, 1216d) according to the order (1217) of first processing the third encoding unit (1216a, 1216c) included in the left second encoding unit (1210a) in the vertical direction, and then processing the third encoding unit (1216b, 1216d) included in the right second encoding unit (1210b) in the vertical direction.

[0170] According to one embodiment, the image decoding device (100) can determine the third encoding unit (1226a, 1226b, 1226c, 1226d) by dividing the second encoding unit (1220a, 1220b) generated by dividing in the horizontal direction into the vertical direction, and the image decoding device (100) can process the third encoding unit (1226a, 1226b, 1226c, 1226d) according to the order (1227) of first processing the third encoding unit (1226a, 1226b) included in the upper second encoding unit (1220a) in the horizontal direction, and then processing the third encoding unit (1226c, 1226d) included in the lower second encoding unit (1220b) in the horizontal direction.

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

[0172] FIG. 13 illustrates a process in which, according to one embodiment, a encoding unit is recursively divided to determine a plurality of encoding units, and the depth of the encoding unit is determined as the shape and size of the encoding unit change.

[0173] According to one embodiment, the image decoding device (100) may determine the depth of the encoding unit according to a predetermined standard. For example, the predetermined standard may be the length of the long side of the encoding unit. The image decoding device (100) may determine that if the length of the long side of the current encoding unit is divided by 2n (n>0) times the length of the long side of the encoding unit before division, the depth of the current encoding unit is increased by n compared to the depth of the encoding unit before division. In the following, the encoding unit with increased depth is expressed as a lower depth encoding unit.

[0174] Referring to FIG. 13, according to one embodiment, based on block shape information indicating that it is a square shape (for example, the block shape information may indicate '0: SQUARE'), an image decoding device (100) can determine a second encoding unit (1302), a third encoding unit (1304), etc. of a lower depth by dividing a first encoding unit (1300) that is square in shape. If the size of the first encoding unit (1300) that is square in shape is 2Nx2N, the second encoding unit (1302), which is determined by dividing the width and height of the first encoding unit (1300) by half, may have a size of NxN. Furthermore, the third encoding unit (1304), which is determined by dividing the width and height of the second encoding unit (1302) by half, may have a size of N / 2xN / 2. In this case, the width and height of the third encoding unit (1304) correspond to 1 / 4 times the width and height of the first encoding unit (1300). When the depth of the first encoding unit (1300) is D, the depth of the second encoding unit (1302), which is 1 / 2 times the width and height of the first encoding unit (1300), may be D+1, and the depth of the third encoding unit (1304), which is 1 / 4 times the width and height of the first encoding unit (1300), may be D+2.

[0175] According to one embodiment, based on block shape information representing a non-square shape (for example, the block shape information may represent '1: NS_VER' indicating that the height is longer than the width, or '2: NS_HOR' indicating that the width is longer than the height), the image decoding device (100) may divide a first encoding unit (1310 or 1320) that is a non-square shape to determine a second encoding unit (1312 or 1322), a third encoding unit (1314 or 1324), etc. of a lower depth.

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

[0177] According to one embodiment, the image decoding device (100) may determine a second encoding unit (e.g., 1302, 1312, 1322, etc.) by dividing at least one of the width and height of a first encoding unit (1320) of size 2NxN. That is, the image decoding device (100) may determine a second encoding unit (1302) of size NxN or a second encoding unit (1312) of size N / 2xN by dividing the first encoding unit (1320) in the vertical direction, and may determine a second encoding unit (1322) of size NxN / 2 by dividing it in the horizontal and vertical directions.

[0178] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of a second encoding unit (1302) of size NxN. That is, the image decoding device (100) may determine a third encoding unit (1304) of size N / 2xN / 2 by dividing the second encoding unit (1302) in a vertical direction and a horizontal direction, or determine a third encoding unit (1314) of size N / 4xN / 2, or determine a third encoding unit (1324) of size N / 2xN / 4.

[0179] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of a second encoding unit (1312) of size N / 2xN. That is, the image decoding device (100) may determine a third encoding unit (1304) of size N / 2xN / 2 or a third encoding unit (1324) of size N / 2xN / 4 by dividing the second encoding unit (1312) in a horizontal direction, or determine a third encoding unit (1314) of size N / 4xN / 2 by dividing it in a vertical direction and a horizontal direction.

[0180] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by dividing at least one of the width and height of a second encoding unit (1322) of size NxN / 2. That is, the image decoding device (100) may determine a third encoding unit (1304) of size N / 2xN / 2 or a third encoding unit (1314) of size N / 4xN / 2 by dividing the second encoding unit (1322) in the vertical direction, or determine a third encoding unit (1324) of size N / 2xN / 4 by dividing it in the vertical and horizontal directions.

[0181] According to one embodiment, the image decoding device (100) may divide square-shaped encoding units (e.g., 1300, 1302, 1304) in a horizontal or vertical direction. For example, a first encoding unit (1300) of size 2Nx2N may be divided in a vertical direction to determine a first encoding unit (1310) of size Nx2N, or divided in a horizontal direction to determine a first encoding unit (1320) of size 2NxN. According to one embodiment, when the depth is determined based on the length of the longest side of the encoding unit, the depth of the encoding unit determined by dividing the first encoding unit (1300) of size 2Nx2N in a horizontal or vertical direction may be the same as the depth of the first encoding unit (1300).

[0182] According to one embodiment, the width and height of the third encoding unit (1314 or 1324) may correspond to 1 / 4 times the width and height of the first encoding unit (1310 or 1320). If the depth of the first encoding unit (1310 or 1320) is D, the depth of the second encoding unit (1312 or 1322), which is 1 / 2 times the width and height of the first encoding unit (1310 or 1320), may be D+1, and the depth of the third encoding unit (1314 or 1324), which is 1 / 4 times the width and height of the first encoding unit (1310 or 1320), may be D+2.

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

[0184] According to one embodiment, the image decoding device (100) can determine various shapes of second encoding units by dividing a square-shaped first encoding unit (1400). Referring to FIG. 14, the image decoding device (100) can determine second encoding units (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) by dividing the first encoding unit (1400) in at least one of a vertical direction and a horizontal direction according to the division shape mode information. That is, the image decoding device (100) can determine the second encoding unit (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) based on the segmented form mode information for the first encoding unit (1400).

[0185] According to one embodiment, the depth of the second encoding unit (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d), which is determined according to the segmented shape mode information for the first encoding unit (1400) in a square shape, can be determined based on the length of the longer side. For example, since the length of one side of the first encoding unit (1400) in a square shape and the length of the longer side of the second encoding unit (1402a, 1402b, 1404a, 1404b) in a non-square shape are the same, the depth of the first encoding unit (1400) and the second encoding unit (1402a, 1402b, 1404a, 1404b) in a non-square shape can be considered to be the same as D. In contrast, when the video decoding device (100) divides the first encoding unit (1400) into four square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) based on the division shape mode information, since the length of one side of the square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) is half the length of one side of the first encoding unit (1400), the depth of the second encoding units (1406a, 1406b, 1406c, 1406d) may be a depth of D+1, which is one depth lower than the depth D of the first encoding unit (1400).

[0186] According to one embodiment, the image decoding device (100) may divide a first encoding unit (1410), in which the height is longer than the width, into a plurality of second encoding units (1412a, 1412b, 1414a, 1414b, 1414c) by dividing it in a horizontal direction according to the division shape mode information. According to one embodiment, the image decoding device (100) may divide a first encoding unit (1420), in which the width is longer than the height, into a plurality of second encoding units (1422a, 1422b, 1424a, 1424b, 1424c) by dividing it in a vertical direction according to the division shape mode information.

[0187] According to one embodiment, a second encoding unit (1412a, 1412b, 1414a, 1414b, 1414c, 1422a, 1422b, 1424a, 1424b, 1424c) determined according to the segmented shape mode information for a first encoding unit (1410 or 1420) of a non-square shape may have its depth determined based on the length of the longer side. For example, since the length of one side of the square-shaped second encoding unit (1412a, 1412b) is half the length of one side of the non-square-shaped first encoding unit (1410) in which the height is longer than the width, the depth of the square-shaped second encoding unit (1412a, 1412b) is D+1, which is one depth lower than the depth D of the non-square-shaped first encoding unit (1410).

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

[0189] According to one embodiment, when determining an index (PID) for distinguishing divided encoding units, the video decoding device (100) may determine the index based on the size ratio between the encoding units when the odd number of divided encoding units are not of the same size. Referring to FIG. 14, the encoding unit (1414b) located in the middle among the odd number of divided encoding units (1414a, 1414b, 1414c) may have the same width as the other encoding units (1414a, 1414c) but may have twice the height of the other encoding units (1414a, 1414c). That is, in this case, the encoding unit (1414b) located in the middle may include two of the other encoding units (1414a, 1414c). Accordingly, if the index (PID) of the encoding unit (1414b) located in the middle according to the scan order is 1, the encoding unit (1414c) located in the next order may have an index of 3, which is an increase of 2. That is, there may be a discontinuity in the index values. According to one embodiment, the image decoding device (100) may determine whether the encoding units divided into an odd number are not of the same size based on whether there is a discontinuity in the index for distinguishing between these divided encoding units.

[0190] According to one embodiment, the image decoding device (100) may determine whether a plurality of encoding units determined by dividing from the current encoding unit are divided into a specific division form based on the value of an index for distinguishing the plurality of encoding units. Referring to FIG. 14, the image decoding device (100) may divide a first encoding unit (1410) in the shape of a rectangle whose height is greater than its width to determine an even number of encoding units (1412a, 1412b) or an odd number of encoding units (1414a, 1414b, 1414c). The image decoding device (100) may use an index (PID) representing each encoding unit to distinguish each of the plurality of encoding units. According to one embodiment, the PID may be obtained from a sample at a predetermined position of each encoding unit (e.g., the upper left sample).

[0191] According to one embodiment, the image decoding device (100) can determine a coding unit at a predetermined position among the coding units determined by division using an index for distinguishing the coding units. According to one embodiment, if the division shape mode information for a first coding unit (1410) in the form of a rectangle whose height is longer than its width indicates that it is divided into three coding units, the image decoding device (100) can divide the first coding unit (1410) into three coding units (1414a, 1414b, 1414c). The image decoding device (100) can assign an index to each of the three coding units (1414a, 1414b, 1414c). The image decoding device (100) can compare the indices for each coding unit to determine the middle coding unit among the odd number of divided coding units. The image decoding device (100) may determine a encoding unit (1414b) having an index corresponding to the middle value among the indices based on the indices of the encoding units, as the encoding unit at the middle position among the encoding units determined by dividing the first encoding unit (1410). According to one embodiment, when determining an index for distinguishing the divided encoding units, the image decoding device (100) may determine the index based on the size ratio between the encoding units if the encoding units are not of the same size. Referring to FIG. 14, the encoding unit (1414b) generated by dividing the first encoding unit (1410) may have the same width as the other encoding units (1414a, 1414c) but may have a height twice that of the other encoding units (1414a, 1414c). In this case, if the index (PID) of the encoding unit (1414b) located in the middle is 1, the encoding unit (1414c) located in the next order may have an index of 3, which is increased by 2.In cases where the index increases uniformly but the rate of increase changes, such as in this case, the image decoding device (100) may determine that the current encoding unit is divided into a plurality of encoding units, including encoding units having different sizes from other encoding units. In one embodiment, if the division type mode information indicates that the current encoding unit is divided into an odd number of encoding units, the image decoding device (100) may divide the current encoding unit in such a way that the encoding unit at a predetermined position among the odd number of encoding units (e.g., the middle encoding unit) has a different size from other encoding units. In this case, the image decoding device (100) may determine the middle encoding unit having a different size by using an index (PID) for the encoding unit. However, the aforementioned index, the size or position of the encoding unit at a predetermined position to be determined, is specific for the purpose of explaining one embodiment and should not be interpreted as being limited thereto, and should be interpreted as allowing various indices, positions, and sizes of encoding units to be used.

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

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

[0194] According to one embodiment, a predetermined data unit may be defined as a data unit in which the encoding unit begins to recursively divide using the division form mode information. That is, it may correspond to the highest depth encoding unit used in the process of determining multiple encoding units that divide the current picture. For convenience of explanation, such a predetermined data unit will be referred to as a reference data unit below.

[0195] According to one embodiment, the reference data unit may have a predetermined size and shape. According to one embodiment, the reference data unit may include MxN samples. Here, M and N may be the same and may be integers expressed as powers of 2. That is, the reference data unit may have a square or non-square shape and may subsequently be divided into an integer number of encoding units.

[0196] According to one embodiment, the image decoding device (100) can divide the current picture into a plurality of reference data units. According to one embodiment, the image decoding device (100) can divide the current picture into a plurality of reference data units using division form mode information for each reference data unit. This division process of reference data units may correspond to a division process using a quad-tree structure.

[0197] According to one embodiment, the image decoding device (100) can predetermine the minimum size that a reference data unit included in the current picture may have. Accordingly, the image decoding device (100) can determine reference data units of various sizes having a size greater than or equal to the minimum size, and can determine at least one encoding unit using segmentation form mode information based on the determined reference data unit.

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

[0199] According to one embodiment, the bitstream acquisition unit (110) of the image decoding device (100) can acquire at least one of information regarding the shape of the reference encoding unit and information regarding the size of the reference encoding unit from the bitstream for each of the various data units. The process of determining at least one encoding unit included in the square-shaped reference encoding unit (1500) has been described in detail through the process of dividing the current encoding unit (300) of FIG. 3, and the process of determining at least one encoding unit included in the non-square-shaped reference encoding unit (1502) has been described in detail through the process of dividing the current encoding unit (400 or 450) of FIG. 4, so a detailed explanation is omitted.

[0200] According to one embodiment, the image decoding device (100) may use an index to identify the size and shape of a reference encoding unit in order to determine the size and shape of a reference encoding unit according to a portion of data units that are predetermined based on a predetermined condition. That is, the bitstream acquisition unit (110) may acquire only an index for identifying the size and shape of a reference encoding unit for each slice, slice segment, tile, tile group, maximum encoding unit, etc., among the various data units (e.g., sequence, picture, slice, slice segment, tile, tile group, maximum encoding unit, etc.) from the bitstream, as a data unit that satisfies a predetermined condition (e.g., a data unit having a size smaller than or equal to a slice). By using the index, the image decoding device (100) can determine the size and shape of a reference data unit for each data unit that satisfies the predetermined condition. When information regarding the form of the reference encoding unit and information regarding the size of the reference encoding unit are obtained from the bitstream for each data unit of a relatively small size and used, the utilization efficiency of the bitstream may be poor; therefore, instead of directly obtaining information regarding the form of the reference encoding unit and information regarding the size of the reference encoding unit, only the index may be obtained and used. In this case, at least one of the size and form of the reference encoding unit corresponding to the index representing the size and form of the reference encoding unit may be predetermined. That is, the image decoding device (100) can determine at least one of the size and form of the reference encoding unit included in the data unit that serves as the basis for obtaining the index by selecting at least one of the predetermined size and form of the reference encoding unit according to the index.

[0201] According to one embodiment, the image decoding device (100) may utilize at least one reference encoding unit included in one maximum encoding unit. That is, the maximum encoding unit that divides the image may include at least one reference encoding unit, and the encoding unit may be determined through a recursive division process of each reference encoding unit. According to one embodiment, at least one of the width and height of the maximum encoding unit may correspond to an integer multiple of at least one of the width and height of the reference encoding unit. According to one embodiment, the size of the reference encoding unit may be the size obtained by dividing the maximum encoding unit n times according to a quad tree structure. That is, the image decoding device (100) may determine the reference encoding unit by dividing the maximum encoding unit n times according to a quad tree structure, and according to various embodiments, the reference encoding unit may be divided based on at least one of block form information and division form mode information.

[0202] According to one embodiment, the image decoding device (100) may obtain and use block form information indicating the form of the current encoding unit or division form mode information indicating a method of dividing the current encoding unit from a bitstream. The division form mode information may be included in bitstreams associated with various data units. For example, the image decoding device (100) may use division form mode information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, and a tile group header. Furthermore, the image decoding device (100) may obtain and use syntax elements corresponding to the block form information or division form mode information from the bitstream for each maximum encoding unit and reference encoding unit.

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

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

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

[0206] The shape of the encoding unit may include square and non-square. When the width and height of the encoding unit are the same, the image decoder (100) may determine the shape of the encoding unit as square. Additionally, when the width and height of the encoding unit are not the same, the image decoder (100) may determine the shape of the encoding unit as non-square.

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

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

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

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

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

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

[0213] FIG. 16 illustrates the encoding units that can be determined for each picture when the combination of forms in which the encoding units can be divided according to one embodiment is different for each picture.

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

[0215] According to one embodiment, a bitstream acquisition unit (110) of an image decoding device (100) may acquire a bitstream including an index representing a combination of division form information for each predetermined data unit (e.g., sequence, picture, slice, slice segment, tile, or tile group, etc.). For example, the bitstream acquisition unit (110) may acquire an index representing a combination of division form information from a sequence parameter set, a picture parameter set, a slice header, a tile header, or a tile group header. The image decoding device (100) of the image decoding device (100) may determine a combination of division forms in which the encoding unit can be divided for each predetermined data unit using the acquired index, and accordingly, different combinations of division forms may be used for each predetermined data unit.

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

[0217] According to one embodiment, the image decoding device (100) can divide the encoding unit into various forms using block form information and division form mode information obtained through the bitstream acquisition unit (110). The forms of the encoding unit that can be divided may correspond to various forms including the forms described through the embodiments above.

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

[0219] According to one embodiment, if the image decoding device (100) can divide a square-shaped encoding unit into four square encoding units by dividing it in the horizontal and vertical directions, there may be four types of division forms that can be represented by the division form mode information for the square encoding unit. According to one embodiment, the division form mode information may be expressed as a 2-digit binary code, and a binary code may be assigned to each division form. For example, if the encoding unit is not divided, the division form mode information may be expressed as (00)b; if the encoding unit is divided in the horizontal and vertical directions, the division form mode information may be expressed as (01)b; if the encoding unit is divided in the horizontal direction, the division form mode information may be expressed as (10)b; and if the encoding unit is divided in the vertical direction, the division form mode information may be expressed as (11)b.

[0220] According to one embodiment, when the image decoding device (100) divides a non-square-shaped encoding unit in a horizontal or vertical direction, the type of division form that can be represented by the division form mode information may be determined by how many encoding units are divided. Referring to FIG. 17, according to one embodiment, the image decoding device (100) may divide a non-square-shaped encoding unit into up to three. The image decoding device (100) may divide the encoding unit into two encoding units, in which case the division form mode information may be expressed as (10)b. The image decoding device (100) may divide the encoding unit into three encoding units, in which case the division form mode information may be expressed as (11)b. The image decoding device (100) may decide not to divide the encoding unit, in which case the division form mode information may be expressed as (0)b. That is, the 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.

[0221] Referring to FIG. 17 according to one embodiment, the binary code of the division type mode information indicating that the encoding unit is not divided can be represented as (0)b. If the binary code of the division type mode information indicating that the encoding unit is not divided is set to (00)b, then all 2 bits of the binary code of the division type mode information must be used even though there is no division type mode information set to (01)b. However, as illustrated in FIG. 17, if three division types for a non-square encoding unit are used, the image decoding device (100) can determine that the encoding unit is not divided even if a 1-bit binary code (0)b is used as the division type mode information, thus allowing for efficient use of the bitstream. However, the division type of the non-square encoding unit indicated by the division type mode information should not be interpreted as being limited only to the three types illustrated in FIG. 17, but should be interpreted as various types including the embodiments described above.

[0222] FIG. 18 illustrates another form of encoding unit that can be determined based on partitioned form mode information that can be represented as binary code according to one embodiment.

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

[0224] According to one embodiment, block form information or partition form mode information can be represented using binary code, and such information can be immediately generated as a bitstream. Additionally, block form information or partition form mode information that can be represented by binary code may not be immediately generated as a bitstream but may be used as binary code input in CABAC (context adaptive binary arithmetic coding).

[0225] According to one embodiment, the image decoding device (100) describes a process of obtaining syntax for block form information or partition form mode information through CABAC. A bitstream containing a binary code for the syntax can be obtained through a bitstream acquisition unit (110). The image decoding device (100) can detect a syntax element representing block form information or partition form mode information by debinding a bin string included in the obtained bitstream. According to one embodiment, the image decoding device (100) obtains a set of binary bin strings corresponding to the syntax element to be decoded, and can decode each bin using probability information, and the image decoding device (100) can repeat this process until the bin string composed of these decoded bins becomes equal to one of the previously obtained bin strings. The image decoding device (100) can determine the syntax element by performing debinding of the bin string.

[0226] According to one embodiment, the image decoding device (100) can determine the syntax for a bin string by performing a decoding process of adaptive binary arithmetic coding, and the image decoding device (100) can update a probability model for the bins obtained through a bitstream acquisition unit (110). Referring to FIG. 17, the bitstream acquisition unit (110) of the image decoding device (100) can obtain a bitstream representing a binary code representing partitioned mode information according to one embodiment. Using the obtained binary code having a size of 1 bit or 2 bits, the image decoding device (100) can determine the syntax for the partitioned mode information. To determine the syntax for the partitioned mode information, the image decoding device (100) can update the probability for each bit of the 2-bit binary code. That is, the image decoding device (100) can update the probability of having a value of 0 or 1 when decoding the next bin, depending on whether the value of the first bin of the 2-bit binary code is 0 or 1.

[0227] According to one embodiment, the image decoding device (100) can update the probability for the bins used in the process of decoding the bins of the empty string for the syntax during the process of determining the syntax, and the image decoding device (100) can determine that the probability is not updated for certain bits of the empty string and has the same probability.

[0228] Referring to FIG. 17, in the process of determining syntax using an empty string representing segmentation mode information for a non-square type encoding unit, the image decoder (100) can determine syntax for the segmentation mode information using one bin having a value of 0 when the non-square type encoding unit is not segmented. That is, when block type information indicates that the current encoding unit is a non-square type, the first bin of the empty string for the segmentation mode information may be 0 when the non-square type encoding unit is not segmented, and 1 when it is segmented into two or three encoding units. Accordingly, the probability that the first bin of the empty string for the segmentation mode information for a non-square type encoding unit is 0 may be 1 / 3, and the probability that it is 1 may be 2 / 3. As described above, since the image decoding device (100) can represent only a 1-bit empty string having a value of 0 as the segmentation mode information indicating that a non-square type encoding unit is not segmented, the image decoding device (100) can determine the syntax for the segmentation mode information by determining whether the second bin is 0 or 1 only when the first bin of the segmentation mode information is 1. According to one embodiment, the image decoding device (100) can decode the bin by considering that when the first bin of the segmentation mode information is 1, the probability that the second bin is 0 or 1 is equal to the probability.

[0229] According to one embodiment, the image decoding device (100) may use various probabilities for each bin in the process of determining the bins of the bin string for the segmented form mode information. According to one embodiment, the image decoding device (100) may determine the probability of the bins for the segmented form mode information differently depending on the direction of the non-square block. According to one embodiment, the image decoding device (100) may determine the probability of the bins for the segmented form mode information differently depending on the width or the length of the long side of the current encoding unit. According to one embodiment, the image decoding device (100) may determine the probability of the bins for the segmented form mode information differently depending on at least one of the shape of the current encoding unit and the length of the long side.

[0230] According to one embodiment, the image decoding device (100) may determine that the probability of bins for segmented form mode information is the same for encoding units of a predetermined size or larger. For example, based on the length of the long side of the encoding unit, the probability of bins for segmented form mode information is determined to be the same for encoding units of a size of 64 samples or larger.

[0231] According to one embodiment, the image decoding device (100) may determine the initial probability for the bins constituting the empty string of the segmented form mode information based on the slice type (e.g., I slice, P slice, or B slice).

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

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

[0234] In the encoding unit (1910), the prediction encoding unit (1915) outputs prediction data through inter-prediction and intra-prediction, and the transformation and quantization unit (1920) outputs quantized transformation coefficients of residual data between the prediction data and the current input image. The entropy encoding unit (1925) encodes and transforms the quantized transformation coefficients and outputs them as a bitstream. The quantized transformation coefficients are restored to spatial domain data through the inverse quantization and inverse transformation unit (1930), and the restored spatial domain data is output as a restored image through the deblocking filtering unit (1935) and the loop filtering unit (1940). The restored image can be used as a reference image for the next input image after passing through the prediction encoding unit (1915).

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

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

[0237] The various embodiments described above explain the operation related to the image decoding method performed by the image decoding device (100). Below, the operation of the image encoding device (200) that performs an image encoding method corresponding to the reverse process of the image decoding method will be explained through various embodiments.

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

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

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

[0241] According to one embodiment, the encoding unit (220) of the image encoding device (200) can determine the shape of the encoding unit. For example, the encoding unit may be square or non-square in shape, and information indicating such shape may be included in block shape information.

[0242] According to one embodiment, the encoding unit (220) can determine how the encoding unit will be divided. The encoding unit (220) can determine the form of at least one encoding unit included in the encoding unit, and the bitstream generation unit (210) can generate a bitstream including division form mode information that includes information about the form of such encoding unit.

[0243] According to one embodiment, the encoding unit (220) may determine whether the encoding unit is divided or not. If the encoding unit (220) determines that only one encoding unit is included in the encoding unit or that the encoding unit is not divided, the bitstream generation unit (210) may generate a bitstream including division type mode information indicating that the encoding unit is not divided. Additionally, the encoding unit (220) may divide the encoding unit into a plurality of encoding units, and the bitstream generation unit (210) may generate a bitstream including division type mode information indicating that the encoding unit is divided into a plurality of encoding units.

[0244] According to one embodiment, information indicating how many encoding units to divide or in which direction to divide may be included in the division type mode information. For example, the division type mode information may indicate dividing in at least one of the vertical direction and the horizontal direction, or not dividing.

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

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

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

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

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

[0250] Hereinafter, the encoding process and the decoding process using entropy encoding and entropy decoding will be described with reference to FIGS. 20 to 32.

[0251] In the present disclosure, 'context' may refer to state information determined according to information associated with a binary symbol in order to estimate the probability of occurrence of the binary symbol. Additionally, in the present disclosure, 'context' may refer to a context index (ctxIdx) determined according to surrounding information associated with the binary symbol.

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

[0253] Referring to FIG. 20, the decoding device (2000) may include an entropy decoding unit (2010) and a prediction decoding unit (2030).

[0254] According to one embodiment, the entropy decoding unit (2010) and the prediction decoding unit (2030) may be implemented with at least one processor. In one embodiment, the entropy decoding unit (2010) and the prediction decoding unit (2030) may operate according to at least one instruction stored in at least one memory.

[0255] The decoding device (2000) may include at least one memory that stores input / output data of the entropy decoding unit (2010) and the prediction decoding unit (2030). Additionally, the decoding device (2000) may include a memory control unit that controls the data input / output of at least one memory.

[0256] In one embodiment, the entropy decoding unit (2010) and the prediction decoding unit (2030) may correspond to the entropy decoding unit (1955) and the prediction decoding unit (1975) shown in FIG. 19.

[0257] In one embodiment, the decoding device (2000) may further include at least one of the inverse quantization and inverse transformation unit (1960), deblocking filtering unit (1965), or loop filtering unit (1970) shown in FIG. 19.

[0258] The decoding device (2000) can obtain a bitstream corresponding to the encoding result for the picture and restore the picture from the bitstream.

[0259] In one embodiment, the decoding device (2000) can receive a bitstream from the encoding device through a network.

[0260] In one embodiment, the decoding device (2000) can obtain a bitstream from a data storage medium including a magnetic medium such as a hard disk, a floppy disk and a magnetic tape, an optical recording medium such as a CD-ROM and a DVD, a magneto-optical medium such as a floptical disk, etc.

[0261] In one embodiment, the bits included in the bitstream may correspond to the result of entropy encoding empty strings corresponding to syntax elements. Syntax elements may be generated through encoding of the picture. The result of entropy encoding of the syntax elements may be included in the bitstream according to the hierarchy.

[0262] In one embodiment, the entropy decoding unit (2010) may determine contexts of syntax elements to restore bins from values ​​included in a bitstream, and may determine probability values ​​of bins constituting syntax elements using the determined contexts. Here, a probability value may mean the probability of occurrence of a specific symbol (e.g., 0 or 1). In one embodiment, the probability value may represent the probability value of the symbol with the lower probability of occurrence between 0 and 1 (Least Probable Symbol, LPS).

[0263] When the probability value of a specific bin is determined according to the context, the entropy decoding unit (2010) can arithmetic decode the bin according to the determined probability value.

[0264] In one embodiment, the entropy decoding unit (2010) may apply bypass decoding to bins of syntax elements that satisfy specific conditions. Bypass decoding can be distinguished from context-based decoding, which adaptively determines the probability value of a bin by considering the context. In bypass decoding, the probability of 0 and the probability of 1 may be determined equally, for example, as 0.5.

[0265] An empty string corresponding to a syntax element can be obtained from a bitstream according to a context-based decoding method and / or a bypass decoding method. In one embodiment, the empty string can be converted into a value of a syntax element through a debinding process.

[0266] The prediction decoding unit (2030) can restore the picture using the value of the syntax element obtained by the entropy decoding unit (2010).

[0267] In one embodiment, the predictive decoder (2030) can restore the current block using the value of the syntax element for the current block. Here, the current block may be a slice, tile, maximum encoding unit, encoding unit, prediction unit, or transformation unit divided from the current picture.

[0268] The prediction decoding unit (2030) can restore the current block according to the prediction mode indicated by the syntax element for the current block (e.g., pred_mode_flag, cu_skip_flag, etc.).

[0269] For example, the prediction decoding unit (2030) can generate prediction sample values ​​of the current block based on an intra prediction mode or an inter prediction mode, obtain residual sample values ​​from syntax elements (e.g., sig_coeff_flag, abs_level_gtx_flag, etc.) included in the bitstream, and obtain the restored current block by combining the residual sample values ​​and the prediction sample values.

[0270] Referring to FIG. 21, the entropy decoding unit (2010) will be explained in more detail.

[0271] FIG. 21 is a diagram illustrating the configuration of an entropy decoding unit (2010) according to one embodiment.

[0272] Referring to FIG. 21, the entropy decoding unit (2010) may include a context initialization unit (2110), a decision unit (2130), a context modeler (2150), a context-based decoding unit (2170), and a bypass decoding unit (2190).

[0273] The context initialization unit (2110) can initialize the contexts of the syntax elements if the current situation satisfies a predetermined condition before entropy decoding for the syntax elements of the current block. The context initialization process can be understood as a process of initializing probability values ​​corresponding to each context to predetermined values.

[0274] In one embodiment, when parsing of a syntax element of a maximum encoding unit begins, the context initializer (2110) may perform context initialization if i) the maximum encoding unit is the first maximum encoding unit within a slice, ii) the maximum encoding unit is the first maximum encoding unit within a tile, or iii) the maximum encoding unit is the first maximum encoding unit of a row of maximum encoding units.

[0275] For example, if the current block is the maximum encoding unit, and the current block corresponds to any one of the three conditions above, the context initialization unit (2110) can initialize the contexts before restoring the syntax element.

[0276] Additionally, for example, if the current block is a encoding unit, and the maximum encoding unit containing the current block corresponds to any one of the three conditions above, the context initialization unit (2110) can initialize the contexts before restoring the syntax elements.

[0277] The conditions under which the context is initialized are not limited to the three conditions mentioned above. In other words, the context may be initialized when conditions not mentioned above are met.

[0278] Through the initialization of the context, probability values ​​corresponding to the contexts of the syntax elements can be initialized. In one embodiment, the probability value may represent the probability value of LPS. In one embodiment, the probability value may represent the range corresponding to LPS (ivlLpsRange) among a predetermined total range. In the arithmetic decoding process of the bean, the LPS range and the MPS range obtained by subtracting the LPS range from the total range may be used. The arithmetic decoding of the bean will be described later with reference to FIGS. 25 and FIGS. 26.

[0279] FIG. 22 is a diagram illustrating the initialization process of a context according to one embodiment.

[0280] The context initializer (2110) can select a context that needs to be initialized among the contexts of the syntax elements.

[0281] In one embodiment, the context initializer (2110) may select a context that requires initialization by considering the type of slice containing the current block and / or information obtained from the bitstream (e.g., sh_cabac_init_flag).

[0282] In one embodiment, the context initializer (2110) may determine the initType to 0 if the type of the slice containing the current block is an intra slice. If the type of the slice containing the current block is a predictive slice or a bi-predictive slice, the context initializer (2110) may determine the initType to 1 or 2 based on information obtained from the bitstream (e.g., sh_cabac_init_flag).

[0283] The initialization type can be used to select the context that requires initialization. Referring to FIG. 22, there may be a total of 9 contexts for cu_skip_flag. cu_skip_flag may be a flag indicating whether a skip mode is applied to a coding unit.

[0284] In FIG. 22, if the initialization type is 0, contexts with context indices (ctxIdx) (2210) of 0, 1, and 2 can be initialized, and if the initialization type is 1, contexts with context indices (2220) of 3, 4, and 5 can be initialized. Also, if the initialization type is 2, contexts with context indices (2230) of 6, 7, and 8 can be initialized.

[0285] For convenience of explanation, the context having a context index of n (n is an integer greater than or equal to 0) will be referred to as 'context n' below.

[0286] When a context requiring initialization is selected from the initialization type, the context initialization unit (2110) can determine a probability value based on an initialization value (initValue) corresponding to the selected context.

[0287] In one embodiment, the initialization process specified in the VVC (Versatile Video Coding) standard can be performed according to the following Table 1.

[0288]

[0289] Referring to steps (1) through (7) of Table 1, slope index (slopeIdx), offset index (offsetIdx), m, n, preCtxState, pStateIdx0, and pStateIdx1 can be sequentially derived from the initialization value (initValue). In formula (5), SliceQpy may be a quantization parameter for the slice.

[0290] When pStateIdx0 and pStateIdx1 are derived according to steps (6) and (7), the value of MPS (valMps) and the range of LPS (ivlLpsRange) can be calculated based on pStateIdx0 and pStateIdx1.

[0291] The initialization process illustrated in Table 1 is an example, and the initialization process for calculating the value of MPS (valMps) and / or the range of LPS (ivlLpsRange) using the initialization value corresponding to the context can be performed in various ways.

[0292] In order to initialize the context, an initialization value corresponding to the context must be obtained. If all initialization values ​​corresponding to multiple contexts are stored in the decoding device (2000), it may place a load on the memory capacity.

[0293] Accordingly, in one embodiment, the context initialization unit (2110) may derive the initialization value of another context using the previously stored initialization value of some contexts when the initialization value of some contexts is stored in the decoding device (2000) and the initialization of another context is required.

[0294] FIG. 23 is a diagram illustrating a method for obtaining an initialization value of a context according to one embodiment.

[0295] Referring to FIG. 23, initialization values ​​of 0, 26, 28, 57, 59, and 45 corresponding to contexts 0 through 5 of cu_skip_flag may be stored in advance in the decoding device (2000). Initialization values ​​for contexts 6 through 8 (2230) may not be stored in advance in the decoding device (2000), but instead difference values ​​may be stored.

[0296] The difference value may correspond to the difference between the initialization value of the corresponding context and the initialization value of another context. By applying the difference value to the initialization value of another context, the initialization value of a context that was not stored in the decoding device (2000) may be derived. It may be determined in advance which context's initialization value the difference value should be applied to.

[0297] For example, the difference value of 0 in context 6 can be applied to the initial value of context 3, and accordingly, as shown in the table below in FIG. 23, the initial value of context 6 can be derived as 57 (57+0). Also, the difference value of +1 in context 7 can be applied to the initial value of context 4, and accordingly, the initial value of context 7 can be derived as 60 (59+1). Also, the difference value of -1 in context 8 can be applied to the initial value of context 5, and accordingly, the initial value of context 8 can be derived as 44 (45-1).

[0298] In one embodiment, the difference value for any one context may be applied to the initial value of the immediately preceding context. For example, the difference value of context 6 may be applied to the initial value of context 5, and the difference value of context 7 may be applied to the initial value of context 6.

[0299] According to one embodiment, instead of storing all initialization values ​​of a plurality of contexts in the decoding device (2000), the memory load can be reduced by storing difference values ​​instead of initialization values ​​for some contexts.

[0300] In one embodiment, the context initialization unit (2110) can optimize the initialization value of the context requiring initialization based on information obtained from the bitstream.

[0301] As mentioned above, initialization values ​​can be used to calculate probability values; in entropy coding, the probability value of a symbol must be calculated accurately to encode a large amount of data with fewer bits. In other words, the higher the prediction accuracy of the probability value, the lower the bit rate of the bitstream can be.

[0302] FIG. 24 is a diagram illustrating a method for updating the initialization value of a context according to one embodiment.

[0303] In one embodiment, the context initialization unit (2110) can update the initialization values ​​of the contexts based on update information obtained from the bitstream. Here, the initialization values ​​to be updated may include not only initialization values ​​stored in advance in the decoding device (2000), but also initialization values ​​obtained based on difference values. In other words, when the initialization values ​​of the contexts are obtained based on difference values ​​according to the embodiment described with reference to FIG. 23, the context initialization unit (2110) can update the initialization values ​​of the contexts based on the update information.

[0304] In one embodiment, update information may be included in at least one of the picture header or slice header of the bitstream.

[0305] Referring to FIG. 24, if initialization is required for contexts 3 to 5 (2220) among a plurality of contexts, the context initialization unit (2110) can update the initialization values ​​of contexts 3 to 5 (2220) based on update information obtained from a bitstream.

[0306] As shown in FIG. 24, the initial values ​​of contexts 3 to 5 (2220), 57, 59, and 45, can be changed to 56, 60, and 44 through an update process.

[0307] In one embodiment, the update information may include the initial value itself after the update.

[0308] In addition, in one embodiment, the update information may include the difference value between the initialization value before the update and the initialization value after the update.

[0309] Additionally, in one embodiment, the update information may include a slope index after the update or an offset index after the update.

[0310] Referring to steps (1) and (2) of Table 1 above, the slope index (slopeIdx) may be a value corresponding to a predetermined number (e.g., 3) of the upper bits (or most significant bits) of the binary bits corresponding to the initial value, and the offset index (offsetIdx) may be a value corresponding to a predetermined number (e.g., 3) of the lower bits (or least significant bits) of the binary bits corresponding to the initial value. For example, if the initial value is 011101, 011 corresponding to the 3 upper bits may be determined as the slope index, and 101 corresponding to the 3 lower bits may be determined as the offset index.

[0311] In one embodiment, the amount of information included in the bitstream can be reduced by including only the slope index or offset index of the initialization value in the update information.

[0312] Additionally, in one embodiment, the update information may include the difference between the slope index of the initial value before the update and the slope index of the initial value after the update, or the difference between the offset index of the initial value before the update and the offset index of the initial value after the update.

[0313] In one embodiment, the update information may further include information indicating a syntax element requiring an update and / or information indicating a context requiring an update.

[0314] Meanwhile, the initType for selecting the context requiring initialization can be determined based on the slice type and / or information transmitted through the slice header (e.g., sh_cabac_init_flag). Therefore, if context initialization is performed before entropy decoding the syntax elements of the first max coding unit within a slice, the same contexts can be used for all subsequent max coding units within that slice.

[0315] For example, in FIG. 22, if the initialization type for the first maximum encoding unit in the slice is determined to be 0, then context 0, context 1, and context 2 (2210) corresponding to the initialization type of 0 can be used in all subsequent maximum encoding units. If only context 0, context 1, and context 2 (2210) are applied to all maximum encoding units in the slice, there may be cases where the accuracy of the probability value is reduced.

[0316] In one embodiment, the context initializer (2110) may perform context initialization using a different context instead of the context selected according to the initialization type in certain cases. The process of performing context initialization using a different context instead of the context selected according to the initialization type may be referred to as a context re-selection process.

[0317] In one embodiment, when parsing of a syntax element of a maximum encoding unit begins, the context initializer (2110) may perform a context reselection process if i) the corresponding maximum encoding unit is the first maximum encoding unit within a tile, or ii) the corresponding maximum encoding unit is the first maximum encoding unit of a row of maximum encoding units.

[0318] In one embodiment, the conditions for performing the context reselection process are not limited to the two cases above. For example, when starting the parsing of syntax elements of a coding unit, the context reselection process may be performed when the coding unit is the first coding unit of the maximum coding unit.

[0319] According to the context initialization conditions described above, if multiple tiles are included within a single slice, context initialization may be performed for the first maximum encoding unit within each tile. However, when a context reselection process is used, the context initialization process is performed for the first maximum encoding unit of the first tile among the multiple tiles within the slice, but the context reselection process may be performed for the first maximum encoding unit within the tiles after the first tile. Accordingly, for the first maximum encoding unit of the first tile among the multiple tiles within the slice, at least one first context selected based on the type of the slice, etc., may be initialized, and for the first maximum encoding unit within the tiles after the first tile, at least one second context different from the at least one first context may be initialized.

[0320] Information indicating a newly used context in a context reselection process according to one embodiment can be obtained from a bitstream.

[0321] During the context initialization process, if the slice type is an intra-slice, the initialization type may be determined to be 0, which means that the same contexts are used for syntax elements within the intra-slice. In one embodiment, even if the slice type is an intra-slice, any one of several initialization types may be selected.

[0322] For example, if the type of slice is an intra-slice, the context initializer (2110) can select one of several initialization types based on information obtained from the bitstream.

[0323] Additionally, in one embodiment, if the type of picture containing the slice corresponds to a bi-predictive picture, a context requiring initialization among several contexts may be selected based on the difference in POC (picture order count) with the reference picture and / or the prediction direction.

[0324] For example, if the type of the current picture containing the slice corresponds to a paired-predicted picture, and the reference picture list of the current picture contains both a reference picture having a POC larger than the current picture's POC and a reference picture having a POC smaller than the current picture's POC, then at least one first context among several contexts may be selected as the context requiring initialization. Additionally, if the reference picture list of the current picture contains only a reference picture having a POC larger than the current picture's POC, or only a reference picture having a POC smaller than the current picture's POC, then at least one second context among several contexts may be selected as the context requiring initialization. In this case, at least one first context may be different from at least one second context.

[0325] Additionally, for example, if the type of the current picture containing the slice corresponds to a paired-predicted picture, a context requiring initialization may be selected based on the difference between the POC of the current picture and the POC of a reference picture included in the reference picture list. For example, among the reference pictures included in the reference picture list, a reference picture having the smallest difference from the POC of the current picture may be identified. And, if the difference between the identified reference picture's POC and the current picture's POC is m (where m is an integer greater than or equal to 0, e.g., 1), at least one first context among several contexts may be selected as the context requiring initialization. Additionally, if the difference between the identified reference picture's POC and the current picture's POC is n (where n is an integer greater than or equal to 0 that is different from m, e.g., 2), at least one second context among several contexts may be selected as the context requiring initialization. In this case, at least one first context may be different from at least one second context.

[0326] When the initialization of the context is complete, or when the initialization of the context is not required, an arithmetic decoding process is performed for each bin of the syntax element, which is explained with reference to FIGS. 25 and 26.

[0327] FIG. 25 is a diagram for schematically explaining an arithmetic encoding process according to one embodiment.

[0328] In one embodiment, the probability value of a symbol of a bin may be determined for arithmetic encoding of a bin. For example, to arithmetic encode a binary sequence (bin string) of 01111, the initial probability value p(0) of 0 may be set to 0.25, and the initial probability value p(1) of 1 may be set to 0.75. In FIG. 25, C(0) is the value accumulated from the occurrence of 0, and C(1) is the value accumulated from the occurrence of 1.

[0329] The predetermined range of 0 to 1 can be divided into a range of 0 to 0.25 and a range of 0.25 to 1, depending on the initial probability value of 0 of 0.25 and the initial probability value of 1 of 0.75.

[0330] Since the first empty value to be encoded is 0, a range of 0 to 0.25 is selected, and since the value of C(0) is changed to 2, the probability value of 0 p(0) can be updated to 0.4 and the probability value of 1 p(1) can be updated to 0.6.

[0331] The range from 0 to 0.25 can be divided into the range from 0 to 0.1 and the range from 0.1 to 0.25 according to the probability value of 0, 0.4 and the probability value of 1, 0.6. Since the next empty value to be encoded is 1, the range from 0.1 to 0.25 is selected, and since the value of C (1) is changed to 4, the probability value of 0, p (0), is updated to 2 / 6 and the probability value of 1, p (1), is updated to 4 / 6.

[0332] The range of 0.1 to 0.25 can be divided into the range of 0.1 to 0.15 and the range of 0.15 to 0.25 according to the probability value of 0 2 / 6 and the probability value of 1 4 / 6. Since the next empty value to be encoded is 1, the range of 0.15 to 0.25 is selected, and since the value of C(1) is changed to 5, the probability value of 0 p(0) is updated to 2 / 7 and the probability value of 1 p(1) is updated to 5 / 7.

[0333] The range of 0.15 to 0.25 can be divided into the range of 0.15 to 0.1786 and the range of 0.1786 to 0.25 according to the probability value of 0 2 / 7 and the probability value of 1 5 / 7. Since the next empty value to be encoded is 1, the range of 0.1786 to 0.25 is selected, and since the value of C(1) is changed to 6, the probability value of 0 p(0) is updated to 2 / 8 and the probability value of 1 p(1) can be changed to 6 / 8.

[0334] The range from 0.1786 to 0.25 can be divided into the range from 0.1786 to 0.19645 and the range from 0.19645 to 0.25 according to the probability value of 0 2 / 8 and the probability value of 1 6 / 8. Since the next empty value to be encoded is 1, the range from 0.19645 to 0.25 can be selected.

[0335] Since there are no more bins to encode, bits representing any value within the range of 0.19645 to 0.25 (e.g., 001111) that were finally selected can be output as the arithmetic encoding result.

[0336] FIG. 26 is a diagram for schematically explaining an arithmetic decoding process according to one embodiment.

[0337] The arithmetic decoding process illustrated in Fig. 26 may correspond to the inverse process of the arithmetic encoding process described with reference to Fig. 25.

[0338] Similar to the arithmetic encoding process, in the arithmetic decoding process, the initial probability value of 0 p(0) can be set to 0.25 and the initial probability value of 1 p(1) can be set to 0.75.

[0339] The predetermined range of 0 to 1 can be divided into a range of 0 to 0.25 and a range of 0.25 to 1, depending on the initial probability value of 0 of 0.25 and the initial probability value of 1 of 0.75.

[0340] Since the value represented by the bits of the bitstream (e.g., any value within the range of 0.19645 to 0.25) is included in the range of 0 to 0.25, the range of 0 to 0.25 is selected, and accordingly, the bin of 0 can be restored.

[0341] As 0 is restored, the value of C(0) is changed to 2, the probability value of 0 p(0) is updated to 0.4, and the probability value of 1 p(1) is updated to 0.6.

[0342] The range from 0 to 0.25 can be divided into a range from 0 to 0.1 and a range from 0.1 to 0.25 according to the probability value of 0 of 0.4 and the probability value of 1 of 0.6. Since the value represented by the bits of the bit stream is included in the range from 0.1 to 0.25, the range from 0.1 to 0.25 is selected, and accordingly, 1 can be restored.

[0343] As 1 is restored, the value of C(1) is changed to 4, the probability value of 0 p(0) is updated to 2 / 6, and the probability value of 1 p(1) can be updated to 4 / 6.

[0344] The range of 0.1 to 0.25 can be divided into the range of 0.1 to 0.15 and the range of 0.15 to 0.25 according to the probability value of 0 2 / 6 and the probability value of 1 4 / 6. Since the value represented by the bits of the bit stream is included in the range of 0.15 to 0.25, the range of 0.15 to 0.25 is selected, and accordingly, 1 can be restored.

[0345] As 1 is restored, the value of C(1) is changed to 5, the probability value of 0 p(0) is updated to 2 / 7, and the probability value of 1 p(1) is updated to 5 / 7.

[0346] The range of 0.15 to 0.25 can be divided into the range of 0.15 to 0.1786 and the range of 0.1786 to 0.25 according to the probability value of 0 2 / 7 and the probability value of 1 5 / 7. Since the value represented by the bits of the bit stream is included in the range of 0.1786 to 0.25, the range of 0.1786 to 0.25 is selected, and 1 can be restored accordingly.

[0347] As 1 is restored, the value of C(1) is changed to 6, the probability value of 0 p(0) is updated to 2 / 8, and the probability value of 1 p(1) is updated to 6 / 8.

[0348] The range from 0.1786 to 0.25 can be divided into the range from 0.1786 to 0.19645 and the range from 0.19645 to 0.25 according to the probability value of 0 2 / 8 and the probability value of 1 6 / 8. Since the value represented by the bits of the bit stream is included in the range from 0.19645 to 0.25, 1 can be restored accordingly.

[0349] If there are no more bins to restore, an empty string of 01111 can be output as the result of arithmetic decoding.

[0350] In FIGS. 25 and 26, the range from 0 to 1 is divided according to the probability value of 0 and the probability value of 1, whereas in HEVC (High Efficiency Video Coding) standards or VVC standards, an integer range from 0 to 510 is used, and the integer range from 0 to 510 can be divided into an MPS range and an LPS range according to MPS probability and LPS probability. At this time, the process of dividing the integer range from 0 to 510 into an MPS range and an LPS range can be performed by referring to a predetermined table.

[0351] According to one embodiment, a bin can be arithmetic decoded according to a bypass decoding method, in which the probability value of 0 and the probability value of 1 can both be fixed at 0.5, and even if the bin is restored, the update of the probability value of the symbol may not be performed.

[0352] Hereinafter, an arithmetic decoding process performed by an entropy decoding unit (2010) according to one embodiment is described.

[0353] Referring again to FIG. 21, when the decision unit (2130) receives a request for a syntax element of the current block, it can determine the decoding method of the bins constituting the syntax element to restore the requested syntax element.

[0354] In the following, for the purpose of distinguishing syntax elements, the syntax element requested by the decision unit (2130) is referenced as the first syntax element (e.g., cu_skip_flag), and a syntax element different from the first syntax element (e.g., split_cu_flag) is referenced as the second syntax element, the third syntax element, etc.

[0355] In one embodiment, the decision unit (2130) can select a decoding method for a bin from a context-based decoding method and a bypass decoding method by considering the index of the bin to be decoded, the size of the current block, the size of the surrounding blocks, etc.

[0356] In HEVC or VVC standards, a bean is restored according to the decoding method pointed to by the bean index, but in one embodiment, the decoding method of the bean can be adaptively determined by considering not only the bean index but also context information related to the bean to be restored.

[0357] For example, in HEVC or VVC standards, when the decoding method for a bean with an index of 0 is fixed as a context-based decoding method, the context-based decoding method is used regardless of the surrounding circumstances. However, in certain cases, the probability of 0 and the probability of 1 for a bean with an index of 0 may both be 0.5, and in such cases, restoring the bean using the context-based decoding method may not be desirable in terms of efficiency.

[0358] A decision unit (2130) according to one embodiment adaptively selects a decoding method for a bin by considering situational information related to the bin to be restored, thereby improving the efficiency of the arithmetic decoding process.

[0359] In one embodiment, various information may be used to select one of a decoding method among a context-based decoding method and a bypass decoding method. The decision unit (2130) may determine the decoding method of the bin constituting the first syntax element based on at least one of the size of the current block, the size of the surrounding block adjacent to the current block, the value of the second syntax element restored in advance, or the value of the first syntax element restored in advance for the surrounding block.

[0360] In one embodiment, if the decoding method of the bin of the first syntax element is determined to be a context-based decoding method, the context modeler (2150) can determine the probability value of the bin to be restored by considering the probability value initialized through the context initializer (2110) or the probability value updated during the restoration process of the previous bin.

[0361] In one embodiment, the context modeler (2150) selects one of a plurality of contexts for the restoration of bins and can determine the probability value of MPS (or range of MPS) and / or the probability value of LPS (or range of LPS) according to the selected context.

[0362] When the probability value of MPS and / or the probability value of LPS is determined by the context modeler (2150), the context-based decoding unit (2170) can arithmetic decode the bin based on the determined probability value.

[0363] In one embodiment, if the decoding method of the bin of the first syntax element is determined to be a bypass decoding method, the bypass decoding unit (2190) can fix the probability value of 0 and the probability value of 1 to 0.5 and arithmetic decode the bin.

[0364] When the restoration of the beans constituting the first syntax element is completed, an empty string containing the restored beans is output, and the value of the first syntax element can be obtained through a debinaryization process on the empty string.

[0365] In one embodiment, the restoration process of the bins constituting the first syntax element can be performed sequentially until the first syntax element becomes identical to any one of the empty strings for the values ​​that the first syntax element may have.

[0366] Referring to FIGS. 27 and 28, a method for determining the decoding method of a bin will be explained.

[0367] FIG. 27 is a diagram illustrating a method for determining a bin decoding method according to one embodiment, and FIG. 28 is a diagram illustrating a partitioning structure of a current picture according to one embodiment.

[0368] In one embodiment, the decision unit (2130) may consider at least one of the size of the current block, the size of a surrounding block adjacent to the current block, the value of a second syntax element different from the first syntax element, or the value of the first syntax element for the surrounding block in order to select the decoding method of the bin of the requested first syntax element from a context-based decoding method and a bypass decoding method.

[0369] Here, the surrounding blocks may include at least one of a left surrounding block adjacent to the left of the current block or an upper surrounding block adjacent to the top of the current block.

[0370] Referring to FIG. 28, the current picture (2800) can be divided into a plurality of maximum encoding units. A left peripheral block (2840) adjacent to the left of the current block (2820) within the current maximum encoding unit (2810) and an upper peripheral block (2860) adjacent to the upper of the current block (2820) are illustrated in FIG. 28.

[0371] In one embodiment, a left peripheral block adjacent to the left of the current block may mean a block containing a sample located to the left of the upper-left sample of the current block. Additionally, an upper peripheral block adjacent to the top of the current block may mean a block containing a sample located to the top of the upper-left sample of the current block.

[0372] In one embodiment, the determination unit (2130) may determine the decoding method of the bin of the first syntax element as a bypass decoding method if the result of combining at least one of the size of the current block, the size of the surrounding block, the value of the second syntax element restored in advance, or the value of the first syntax element restored in advance for the surrounding block corresponds to a predetermined value. Additionally, the determination unit (2130) may determine the decoding method of the bin of the first syntax element as a context-based decoding method if the result corresponds to a value other than the predetermined value.

[0373] For example, if the result of combining the value of the first syntax element of the left peripheral block of the current block and the value of the first syntax element of the upper peripheral block of the current block corresponds to a predetermined value, the decision unit (2130) can determine the decoding method of the bin of the first syntax element as a bypass decoding method. Additionally, if the result of combining the value of the first syntax element of the left peripheral block and the value of the first syntax element of the upper peripheral block of the current block corresponds to a value other than a predetermined value, the decision unit (2130) can determine the decoding method of the bin of the first syntax element as a context-based decoding method.

[0374] In addition, as an example, the decision unit (2130) may determine the decoding method of the bin of the first syntax element as a bypass decoding method if the size of the current block is less than or equal to a predetermined size, and determine the decoding method of the bin of the first syntax element as a context-based decoding method if the size of the current block is greater than or equal to a predetermined size.

[0375] In addition, as an example, the decision unit (2130) may determine the decoding method of the bin of the first syntax element based on a value representing the result of comparing the size of the current block and the size of the surrounding block.

[0376] Referring to FIG. 27, a specific embodiment for determining the decoding method of bins of syntax elements is described.

[0377] The table shown in FIG. 27 indicates the decoding method of the bins constituting each of the syntax elements.

[0378] For example, 'bypass' indicates that bypass decoding is applied to the bean, and 'numbers' such as 0, 2, 5 indicate that context-based decoding is applied to the bean.

[0379] For example, since 'bypass' is marked for the bin with index 1 (binIdx) constituting merge_idx, the bypass decryption method can be applied to that bin. Additionally, since '5' is marked for the bin with index 1 constituting inter_pred_idc, the context-based decryption method can be applied to that bin. The '5' marked for the bin with index 1 in inter_pred_idc can be used to select a context for arithmetic decryption. For example, '5' can be used as the ctxInc value to derive the context index (ctxIdx).

[0380] In Fig. 27, 'na' may indicate that there is no bean. Additionally, for beans with an index of 0 such as cu_skip_flag and split_cu_flag, 'number' and 'bypass' are displayed together, which indicates that a context-based decoding method or a bypass decoding method may be selectively applied depending on the state information.

[0381] In the following, for the sake of convenience of explanation, the bin with index n is referred to as '#nbin'.

[0382] In one embodiment, the determination unit (2130) may determine the decoding method of bin #0 of cu_skip_flag as a bypass decoding method or a context-based decoding method. If the decoding method of bin #0 of cu_skip_flag is determined as a context-based decoding method, ctxInc may be determined to be 0 or 2, and the context used for arithmetic decoding of bin #0 may be determined according to ctxInc.

[0383] cu_skip_flag is a flag indicating whether skip mode is applied to the current block. If skip mode is applied to surrounding blocks, it is highly likely that skip mode will also be applied to the current block. Therefore, in such cases, a probability value of 1 can be predicted with high probability. Conversely, if skip mode is not applied to surrounding blocks, it is highly likely that skip mode will not be applied to the current block. Therefore, in such cases, a probability value of 0 can be predicted with high probability.

[0384] In one embodiment, the determination unit (2130) can determine the decoding method of cu_skip_flag based on the following mathematical formula 1.

[0385]

[0386] In mathematical formula 1, availableL is a value indicating the availability of the left surrounding blocks of the current block, and availableA may be a value indicating the availability of the upper surrounding blocks of the current block.

[0387] In one embodiment, the values ​​of availableL and availableA may be determined based on whether the surrounding block exists within the current picture, and whether the surrounding block is included in the same slice as the current block, etc.

[0388] In one embodiment, availableL and availableA may be omitted from Equation 1. For example, condL, condA, and ctxSetIdx may be used to determine the decoding method of the bin.

[0389] Equation 1 can be used to determine the decoding method of bins of various syntax elements. In one embodiment, for cu_skip_flag, ctxSetIdx of Equation 1 may be determined to be 0. Also, for cu_skip_flag, condL may be a value indicating whether the cu_skip_flag of the left peripheral block is 1, and condA may be a value indicating whether the cu_skip_flag of the upper peripheral block is 1.

[0390] In one embodiment, the determining unit (2130) determines the decoding method of bin #0 of cu_skip_flag as a bypass decoding method if the result of Equation 1 for cu_skip_flag is 1, and determines the decoding method of bin #0 of cu_skip_flag as a context-based decoding method if the result of Equation 1 for cu_skip_flag is a value other than 1.

[0391] A result of Equation 1 of 1 means that there is availability of one of the left surrounding blocks and one of the upper surrounding blocks, and that the cu_skip_flag of the corresponding surrounding block is 1. In other words, if the skip mode is applied only to one of the left surrounding blocks and one of the upper surrounding blocks, it is predicted that the probability of applying the skip mode to the current block is 50%, and the bypass decoding method is applied.

[0392] In one embodiment, the #0 bin of cu_skip_flag may have a ctxInc of 0 or 2, and the result of Equation 1 may be determined as ctxInc when the result of Equation 1 has a value other than 1. For example, if skip mode is applied to both the left surrounding block and the top surrounding block, ctxInc is determined as 2, and if skip is not applied to both the left surrounding block and the top surrounding block, ctxInc is determined as 0.

[0393] The embodiment for determining the decryption method of bin #0 of cu_skip_flag may also be applied when determining the decryption method of bin of a flag indicating the prediction mode of the current block. For example, merge_flag is a flag indicating whether a merge mode is applied to the current block, and the decryption method of bin #0 of merge_flag may be determined based on Equation 1. In other words, if there is availability of one of the left surrounding blocks and one of the upper surrounding blocks, and the merge_flag of said surrounding block is 1, the decryption method of bin #0 may be determined as a bypass decryption method. If the merge_flag of both the left surrounding block and the upper surrounding block is 0, or if the merge_flag of both the left surrounding block and the upper surrounding block is 1, the decryption method of bin #0 may be determined as a context-based decryption method.

[0394] In one embodiment, the decision unit (2130) may consider the size of the current block when determining the decoding method of the bin of the syntax element related to the division of the current block.

[0395] For example, if the size of the current block is less than or equal to a predetermined size (or smaller than the predetermined size), the decoding method of the bin of the syntax element related to the division of the current block is determined as a bypass decoding method, and if the size of the current block is greater than or equal to a predetermined size (or larger than the predetermined size), the decoding method of the bin of the syntax element related to the division of the current block is determined as a context-based decoding method.

[0396] Syntax elements related to the current block splitting may include split_cu_flag, split_qt_flag, mtt_split_cu_vertical_flag and mtt_split_cu_binary_flag as shown in FIG. 27.

[0397] split_cu_flag is a flag indicating whether the current block is split into sub-blocks, and split_qt_flag may be a flag indicating whether the current block is quad-split. mtt_split_cu_vertical_flag is a flag indicating whether the current block is vertically split, and mtt_split_cu_binary_flag may be a flag indicating whether the current block is binary-split.

[0398] In one embodiment, the syntax elements related to the division of the current block are not limited to the syntax elements illustrated in FIG. 27. For example, the syntax elements related to the division of the current block may further include a flag indicating whether the current block is territorially divided and a flag indicating whether the current block is horizontally divided.

[0399] The decision unit (2130) can determine the decoding method of bin #0 of the syntax element related to the division of the current block as a bypass decoding method when the size of the current block is less than or equal to a predetermined size (e.g., 8x8), and when the size of the current block is greater than a predetermined size (e.g., 8x8), the decoding method of bin #0 of the syntax element related to the division of the current block as a context-based decoding method.

[0400] In one embodiment, to determine the decoding method of the bin of the syntax element related to the division of the current block, the result of comparing the height or width of the current block with a predetermined height or width may be considered. Additionally, in one embodiment, to determine the decoding method of the bin of the syntax element related to the division of the current block, the result of comparing the width of the current block with a predetermined width may be considered.

[0401] If the decryption method of the #0 bin of the syntax element related to the current block splitting is determined as a context-based decryption method, the context modeler (2150) may select one of the multiple ctxInc based on information such as the depth of the current block. The ctxInc selected from the multiple ctxInc may be used to determine the context of the #0 bin of the syntax element related to the current block splitting.

[0402] In one embodiment, the decision unit (2130) may determine the decoding method of bin #0 of the syntax elements related to the division of the current block based on the result of comparing the size of the current block and the size of the surrounding blocks.

[0403] For example, when the decision unit (2130) determines the decoding method of bin #0 of split_cu_flag, it may consider at least one of the result of comparing the height of the current block with the height of the left surrounding block, the result of comparing the width of the current block with the width of the upper surrounding block, or whether at least one splitting mode is allowed for the current block.

[0404] In one embodiment, the determination unit (2130) can determine the decoding method of bin #0 of split_cu_flag according to Equation 1, where condL, condA, and ctxSetIdx of Equation 1 can be set as shown in Table 2 below.

[0405]

[0406] In Table 2, if the height of the left surrounding block is less than the height of the current block, condL has a value of 1, and if the height of the left surrounding block is not less than the height of the current block, condL has a value of 0. Also, if the width of the top surrounding block is less than the width of the current block, condA has a value of 1, and if the width of the top surrounding block is not less than the width of the current block, condA has a value of 0.

[0407] In Table 2, allowSplitBtVer, allowSplitBtHor, allowSplitTtVer, allowSplitTtHor, and allowSplitQ may be values ​​indicating whether splitting modes are allowed for the current block. For example, allowSplitBtVer may indicate whether binary splitting in the vertical direction of the current block is allowed, and allowSplitBtHor may indicate whether binary splitting in the horizontal direction of the current block is allowed. Additionally, allowSplitTtVer may indicate whether territorial splitting in the vertical direction of the current block is allowed, and allowSplitTtHor may indicate whether territorial splitting in the horizontal direction of the current block is allowed. Furthermore, allowSplitQ may indicate whether quad splitting of the current block is allowed. allowSplitBtVer, allowSplitBtHor, allowSplitTtVer, allowSplitTtHor, and allowSplitQ may be values ​​set based on conditions such as the size of the current block.

[0408] In one embodiment, the decision unit (2130) determines the decoding method of bin #0 of split_cu_flag as a bypass decoding method if the result value according to Equation 1 corresponds to a predetermined value, and determines the decoding method of bin #0 of split_cu_flag as a context-based decoding method if the result value according to Equation 1 corresponds to a value other than the predetermined value.

[0409] For example, if the result value according to mathematical formula 1 is 1, the decision unit (2130) determines the decoding method of #0 bin of split_cu_flag as a bypass decoding method, and if the result value according to mathematical formula 1 is a value other than 1, the decoding method of #0 bin of split_cu_flag as a context-based decoding method.

[0410] Additionally, for example, if the decision unit (2130) determines from allowSplitBtVer, allowSplitBtHor, allowSplitTtVer, allowSplitTtHor, and allowSplitQ that only two or fewer split modes are allowed for the current block, and only one of condL and condA has a value of 1, the decoding method of #0 of split_cu_flag can be determined as a bypass decoding method.

[0411] In one embodiment, when the decoding method of #0 bin of split_cu_flag is determined to be a context-based decoding method, the context modeler (2150) can determine the context using the ctxInc corresponding to the result value according to Equation 1 among a plurality of ctxInc.

[0412] Next, an example is described regarding the decoding method of the beans constituting merge_idx, inter_pred_idc, and amvr_flag.

[0413] merge_idx may be an index pointing to the merge candidate used for the current block among multiple merge candidates. Additionally, inter_pred_idc may be an index indicating which prediction—List 0-based prediction, List 1-based prediction, or paired prediction—is applied for the current block. Additionally, amvr_flag may be a flag indicating the resolution of the motion vector or motion vector difference used for the current block.

[0414] In one embodiment, the decision unit (2130) may determine the decryption method for bin #0 of merge_idx as a bypass decryption method or a context-based decryption method based on at least one of the size of the current block, the size of the surrounding block, the value of another syntax element restored in advance, or the value of merge_idx restored in advance for the surrounding block. Additionally, the decision unit (2130) may determine the decryption method for bins #1, #2, #3, and #4 of merge_idx as a bypass decryption method. Since 'bypass' is indicated for bins #1, #2, #3, and #4 of merge_idx, it can be seen that only the bin index is used to determine the decryption method.

[0415] In one embodiment, the decision unit (2130) may determine the decoding method for bin #0 of inter_pred_idc as a bypass decoding method or a context-based decoding method based on at least one of the size of the current block, the size of the surrounding block, the value of another syntax element that has been restored in advance, or the value of inter_pred_idc that has been restored in advance for the surrounding block. Additionally, the decision unit (2130) may determine the decoding method for bin #1 of inter_pred_idc as a context-based decoding method. Since 5 is indicated for bin #1 of inter_pred_idc in the table of FIG. 27, ctcInc may be determined as 5.

[0416] In one embodiment, the decision unit (2130) may determine the decoding method as a context-based decoding method if the inter_affine_flag for the current block is 1 for the #0 bin of amvr_flag, and determine the decoding method as a bypass decoding method if the inter_affine_flag is 0. The inter_affine_flag may be a flag indicating whether motion compensation based on an affine model is applied to the current block.

[0417] Meanwhile, in the preceding embodiment, the decoding method of the bin under specific conditions may be determined as a bypass decoding method, and in one embodiment, the bypass decoding method may include a plurality of bypass modes.

[0418] For example, the bypass decoding method may include a first bypass mode in which the probabilities of 0 and 1 are both equal, for example, both are 0.5, and a second bypass mode in which the probabilities of 0 and 1 are not equal. In the second bypass mode, the probability values ​​of 0 and 1 may be set to predetermined values ​​other than 0.5. For example, in the second bypass mode, the probability value of 0 may be 0.3 and the probability value of 1 may be 0.7.

[0419] Under the second bypass mode, just like in the first bypass mode, there is no need to derive the context for the arithmetic decoding of the bin, and the probability value may not be updated.

[0420] In one embodiment, when the determining unit (2130) determines the decoding method of the bin of the first syntax element, it may consider a value determined based on at least one of the size of the current block, the size of the surrounding block, the value of the second syntax element, or the value of the first syntax element for the surrounding block (e.g., the result value of Equation 1).

[0421] In one embodiment, the determining unit (2130) can determine the decoding method of the bin of the first syntax element as a bypass decoding method based on the first bypass mode if the value determined based on at least one of the size of the current block, the size of the surrounding block, the value of the second syntax element, or the value of the first syntax element for the surrounding block corresponds to a predetermined first value.

[0422] Additionally, in one embodiment, the determining unit (2130) may determine the decoding method of the bin of the first syntax element as a bypass decoding method based on the second bypass mode if the value determined based on at least one of the size of the current block, the size of the surrounding block, the value of the second syntax element, or the value of the first syntax element for the surrounding block corresponds to a predetermined second value.

[0423] Additionally, in one embodiment, the determination unit (2130) may determine the decoding method of the bin of the first syntax element as a context-based decoding method if the value determined based on at least one of the size of the current block, the size of the surrounding block, the value of the second syntax element, or the value of the first syntax element for the surrounding block corresponds to a value other than the predetermined first value and second value.

[0424] FIG. 29 is a flowchart of a method for decoding an image by a decoding device (2000) according to one embodiment.

[0425] In step S2910, the decoding device (2000) can initialize the contexts of the syntax elements before recovering the syntax elements from the bitstream.

[0426] In one embodiment, when the decoding device (2000) starts parsing a syntax element of a maximum encoding unit, it may perform context initialization if i) the maximum encoding unit is the first maximum encoding unit in a slice, ii) the maximum encoding unit is the first maximum encoding unit in a tile, or iii) the maximum encoding unit is the first maximum encoding unit of a row of maximum encoding units.

[0427] In one embodiment, when the decoding device (2000) starts parsing the syntax elements of a maximum encoding unit after the context initialization is completed, i) if the maximum encoding unit is the first maximum encoding unit within the tile, or ii) if the maximum encoding unit is the first maximum encoding unit of the row of the maximum encoding units, the context reselection process may be performed.

[0428] In one embodiment, if a slice includes a plurality of tiles or a plurality of rows of maximum encoding units, a context initialization process may be performed if the maximum encoding unit is the first maximum encoding unit within the first tile or the first row of maximum encoding units. In one embodiment, if the maximum encoding unit is the first maximum encoding unit within the row of maximum encoding units after the first tile or the first row of maximum encoding units after the first row of maximum encoding units, a context reselection process may be performed.

[0429] In one embodiment, when a context requiring initialization is selected, the decoding device (2000) can initialize the probability value of a bin based on the initialization value of the selected context. In one embodiment, the initialization value of the context requiring initialization can be obtained by applying a difference value to the initialization value of another context.

[0430] In one embodiment, the decoding device (2000) may update the initialization value of the context according to update information obtained from the bitstream.

[0431] In one embodiment, since the context initialization process can be performed under specific conditions, step S2910 of FIG. 29 can be omitted in the image decoding method.

[0432] In step S2920, the decoding device (2000) can determine the decoding method of the first bin of the first syntax element of the current block.

[0433] In one embodiment, the decoding device (2000) obtains a result value by applying at least one of the size of the current block, the size of a surrounding block adjacent to the current block, the value of a second syntax element different from the first syntax element, or the value of a first syntax element for a surrounding block to a predetermined mathematical formula (e.g., mathematical formula 1), and based on the result value, can determine a decoding method for the first bin of the first syntax element of the current block among a context-based decoding method and a bypass decoding method.

[0434] In one embodiment, the bypass decoding method may include a first bypass mode and a second bypass mode. In this case, the decoding device (2000) may obtain a result value by applying at least one of the size of the current block, the size of a surrounding block adjacent to the current block, the value of a second syntax element different from the first syntax element, or the value of the first syntax element for the surrounding block to a predetermined mathematical formula (e.g., mathematical formula 1). Based on the obtained result value, the decoding device (2000) may select any one of a bypass decoding method according to the first bypass mode, a bypass decoding method according to the second bypass mode, and a context-based decoding method.

[0435] In step S2930, the decoding device (2000) can obtain the first bin from the bitstream through arithmetic decoding according to the decoding method of the first bin.

[0436] In step S2940, the decoding device (2000) can determine the value of the first syntax element based on the acquired first bin.

[0437] In one embodiment, the value of the first syntax element can be determined through inverse binary conversion of an empty string obtained through arithmetic decoding.

[0438] In step S2950, ​​the decoding device (2000) can restore the current block using the value of the first syntax element.

[0439] In one embodiment, the decoding device (2000) can generate predicted sample values ​​of the current block based on an intra prediction mode or an inter prediction mode, obtain residual sample values ​​from syntax elements (e.g., sig_coeff_flag, abs_level_gtx_flag, etc.) included in the bitstream, and obtain the restored current block by combining the residual sample values ​​and the predicted sample values.

[0440] FIG. 30 is a diagram illustrating the configuration of an encoding device (3000) according to one embodiment.

[0441] Referring to FIG. 30, the encoding device (3000) may include a prediction encoding unit (3010) and an entropy encoding unit (3030).

[0442] According to one embodiment, the prediction encoding unit (3010) and the entropy encoding unit (3030) may be implemented with at least one processor. In one embodiment, the prediction encoding unit (3010) and the entropy encoding unit (3030) may operate according to at least one instruction stored in at least one memory.

[0443] The encoding device (3000) may include at least one memory that stores input / output data of the prediction encoding unit (3010) and the entropy encoding unit (3030). Additionally, the encoding device (3000) may include a memory control unit that controls the data input / output of at least one memory.

[0444] In one embodiment, the prediction encoding unit (3010) and the entropy encoding unit (3030) may correspond to the prediction encoding unit (1915) and the entropy encoding unit (1925) shown in FIG. 19.

[0445] In one embodiment, the encoding device (3000) may further include at least one of the transform and quantization unit (1920), inverse quantization and inverse transform unit (1930), deblocking filtering unit (1935), or loop filtering unit (1940) shown in FIG. 19.

[0446] The encoding device (3000) can encode a picture to generate a bitstream.

[0447] In one embodiment, the encoding device (3000) can transmit the bitstream to the decoding device (2000) through a network.

[0448] In one embodiment, the encoding device (3000) can store a bitstream in a data storage medium including a magnetic medium such as a hard disk, a floppy disk and a magnetic tape, an optical recording medium such as a CD-ROM and a DVD, a magneto-optical medium such as a floptical disk, etc.

[0449] In one embodiment, the bits included in the bitstream may correspond to the entropy-encoded result of empty strings corresponding to the values ​​of syntax elements. Syntax elements may be generated through encoding of the picture. The entropy-encoded result of the syntax elements may be included in the bitstream according to the hierarchy.

[0450] In one embodiment, the predictive encoding unit (3010) can determine the values ​​of the syntax elements by encoding the picture. For example, the predictive encoding unit (3010) can determine the values ​​of the syntax elements for encoding the current block.

[0451] In one embodiment, the syntax element generated for encoding the current block may include a syntax element representing the partitioning form of the current block, a syntax element representing the prediction mode of the current block, and a syntax element representing the residual sample value of the current block.

[0452] The prediction encoding unit (3010) can predict the current block according to a predetermined prediction mode and determine the value of a syntax element (e.g., pred_mode_flag, cu_skip_flag, etc.) representing the predetermined prediction mode. Additionally, the prediction encoding unit (3010) can generate prediction sample values ​​of the current block based on an intra prediction mode or an inter prediction mode, and obtain residual sample values ​​using the sample values ​​of the current block and the prediction sample values. Furthermore, the prediction encoding unit (3010) can generate values ​​of a syntax element (e.g., sig_coeff_flag, abs_level_gtx_flag, etc.) representing the residual sample values.

[0453] The value of a syntax element generated by the prediction encoding unit (3010) can be entropy encoded by the entropy encoding unit (3030). In one embodiment, the value of a syntax element can be converted into an empty string through binarization, and the entropy encoding unit (3030) can arithmetic-encode the bins included in the empty string.

[0454] In one embodiment, the entropy encoding unit (3030) may determine contexts of syntax elements to encode the values ​​of syntax elements, and may determine probability values ​​of bins constituting syntax elements using the determined contexts. Here, a probability value may mean the probability of occurrence of a specific symbol (e.g., 0 or 1). In one embodiment, the probability value may represent the probability value of the symbol with the lower probability of occurrence between 0 and 1 (Least Probable Symbol, LPS).

[0455] When the probability value of a specific bin is determined according to the context, the entropy encoding unit (3030) can arithmetic-encode the bin according to the determined probability value.

[0456] In one embodiment, the entropy encoding unit (3030) may apply bypass encoding to bins of syntax elements that satisfy specific conditions. Bypass encoding can be distinguished from context-based encoding, which adaptively determines the probability value of a bin by considering the context. In bypass encoding, the probability of 0 and the probability of 1 may be determined equally, for example, as 0.5.

[0457] Depending on the context-based encoding method and / or bypass encoding method, the empty strings corresponding to the values ​​of the syntax elements may be arithmetic encoded.

[0458] Referring to FIG. 31, the entropy encoding unit (3030) will be described in more detail.

[0459] FIG. 31 is a diagram illustrating the configuration of an entropy encoding unit (3030) according to one embodiment.

[0460] Referring to FIG. 31, the entropy encoding unit (3030) may include a context initialization unit (3110), a decision unit (3130), a context modeler (3150), a context-based encoding unit (3170), and a bypass encoding unit (3190).

[0461] The context initialization unit (3110) can initialize the contexts of the syntax elements if the current situation satisfies a predetermined condition before entropy encoding for the syntax elements of the current block.

[0462] The operation of the context initialization unit (3110) can correspond to the operation of the context initialization unit (2110) of the aforementioned entropy decoding unit (2010).

[0463] In one embodiment, when entropy encoding of a syntax element of a maximum encoding unit begins, the context initializer (3110) may perform context initialization if i) the maximum encoding unit is the first maximum encoding unit within a slice, ii) the maximum encoding unit is the first maximum encoding unit within a tile, or iii) the maximum encoding unit is the first maximum encoding unit of a row of maximum encoding units.

[0464] Through the initialization of the contest, probability values ​​corresponding to the contexts of the syntax elements can be initialized.

[0465] The context initializer (3110) can select a context that needs to be initialized among the contexts of the syntax elements.

[0466] In one embodiment, the context initializer (3110) may select a context that requires initialization by considering the type of slice containing the current block and / or information indicating the context that requires initialization (e.g., sh_cabac_init_flag).

[0467] In one embodiment, the context initializer (3110) may determine the initType to 0 if the type of the slice containing the current block is an intra slice. If the type of the slice containing the current block is a predictive slice or a bi-predictive slice, the context initializer (3110) may determine the initType to 1 or 2 based on information indicating the context requiring initialization (e.g., sh_cabac_init_flag).

[0468] The initialization type can be used to select a context that requires initialization. When a context that requires initialization is selected from the initialization type, the context initialization unit (3110) can determine a probability value based on an initialization value corresponding to the selected context.

[0469] In one embodiment, the context initialization unit (3110) can derive the initialization value of another context using the previously stored initialization value of some contexts when the initialization value of some contexts is stored in the encoding device (3000) and the initialization of another context is required.

[0470] For example, the context initialization unit (3110) can derive the initialization value of the second context by applying a difference value corresponding to the second context to the initialization value of the first context when the initialization value of the first context is stored in the encoding device (3000) and the initialization of the second context is required.

[0471] In one embodiment, the context initializer (3110) can update the initialization values ​​of the contexts based on update information.

[0472] In one embodiment, the update information may include the initial value itself after the update. In one embodiment, the update information may include the difference value between the initial value before the update and the initial value after the update.

[0473] Additionally, in one embodiment, the update information may include a slope index after the update or an offset index after the update.

[0474] Additionally, in one embodiment, the update information may include the difference between the slope index of the initial value before the update and the slope index of the initial value after the update, or the difference between the offset index of the initial value before the update and the offset index of the initial value after the update.

[0475] In one embodiment, the update information may further include information indicating a syntax element requiring an update and / or information indicating a context requiring an update.

[0476] In one embodiment, the context initializer (3110) can generate update information that enables encoding empty strings of syntax elements with a small number of bits. For example, when performing context initialization, initialization values ​​can be determined to encode empty strings of syntax elements of the maximum encoding unit with a small number of bits. And, the context initializer (3110) can generate update information based on previously stored initialization values ​​and newly determined initialization values.

[0477] Update information may be included in at least one of the picture header or slice header of the bitstream.

[0478] In one embodiment, the context initializer (3110) may perform context initialization using a different context instead of the context selected according to the initialization type in certain cases. The process of performing context initialization using a different context instead of the context selected according to the initialization type may be referred to as a context re-selection process.

[0479] In one embodiment, when entropy encoding of a syntax element of a maximum encoding unit begins, the context initializer (3110) may perform a context reselection process if i) the maximum encoding unit is the first maximum encoding unit within a tile, or ii) the maximum encoding unit is the first maximum encoding unit of a row of maximum encoding units.

[0480] In one embodiment, the conditions for performing the context reselection process are not limited to the two cases above. For example, when entropy coding of a syntax element of a coding unit begins, if the coding unit is the first coding unit of the maximum coding unit, the context reselection process may be performed.

[0481] Information indicating a newly used context in a context reselection process according to one embodiment may be included in a bitstream.

[0482] During the context initialization process, if the slice type is an intra-slice, the initialization type may be determined to be 0, which means that the same contexts are used for syntax elements within the intra-slice. In one embodiment, even if the slice type is an intra-slice, any one of several initialization types may be selected.

[0483] Additionally, in one embodiment, if the type of picture containing the slice corresponds to a bi-predictive picture, a context requiring initialization among several contexts may be selected based on the difference in POC (picture order count) with the reference picture and / or the prediction direction.

[0484] If the context initialization is complete, or if the context initialization is not required, the arithmetic encoding process can be performed for each bin of the syntax element.

[0485] Referring to FIG. 31, when the decision unit (3130) receives an empty string of the first syntax element of the current block, it can determine the encoding method of the bins constituting the empty string.

[0486] In one embodiment, the decision unit (3130) can select a bin encoding method from a context-based encoding method and a bypass encoding method by considering the index of the bin to be encoded, the size of the current block, the size of the surrounding blocks, etc.

[0487] In one embodiment, various information may be used to select one of a context-based encoding method and a bypass encoding method. The determination unit (3130) may determine the encoding method of a bin constituting a first syntax element based on at least one of the size of the current block, the size of a surrounding block adjacent to the current block, the value of a pre-encoded second syntax element, or the value of a pre-encoded first syntax element for the surrounding block.

[0488] In one embodiment, if the encoding method of the bin of the first syntax element is determined to be a context-based encoding method, the context modeler (3150) can determine the probability value of the bin to be encoded by considering the probability value initialized through the context initializer (3110) or the probability value updated during the encoding process of the previous bin.

[0489] In one embodiment, the context modeler (3150) selects one of a plurality of contexts for encoding a bin and can determine the probability value of MPS (or range of MPS) and / or the probability value of LPS (or range of LPS) according to the selected context.

[0490] When the probability values ​​of MPS and / or LPS are determined by the context modeler (3150), the context-based encoding unit (3170) can arithmetic-encode the bins based on the determined probability values.

[0491] In one embodiment, if the encoding method of the bin of the first syntax element is determined to be a bypass encoding method, the bypass encoding unit (3190) can fix the probability value of 0 and the probability value of 1 to 0.5 and arithmetic-encode the bin.

[0492] When the arithmetic encoding of the bins constituting the first syntax element is completed, a bitstream containing the arithmetic encoding result of the bins can be generated.

[0493] Below, the method for determining the encoding method of a bean is explained in more detail.

[0494] In one embodiment, the decision unit (3130) may consider at least one of the size of the current block, the size of a surrounding block adjacent to the current block, the value of a second syntax element different from the first syntax element, or the value of the first syntax element for the surrounding block in order to determine the encoding method of the bin of the first syntax element among a context-based encoding method and a bypass encoding method.

[0495] Here, the surrounding blocks may include at least one of a left surrounding block adjacent to the left of the current block or an upper surrounding block adjacent to the top of the current block.

[0496] In one embodiment, a left peripheral block adjacent to the left of the current block may mean a block containing a sample located to the left of the upper-left sample of the current block. Additionally, an upper peripheral block adjacent to the top of the current block may mean a block containing a sample located to the top of the upper-left sample of the current block.

[0497] In one embodiment, the determination unit (3130) may determine the encoding method of the bin of the first syntax element as a bypass encoding method if the result of combining at least one of the size of the current block, the size of the surrounding block, the value of the pre-encoded second syntax element, or the value of the pre-encoded first syntax element for the surrounding block corresponds to a predetermined value. Additionally, the determination unit (3130) may determine the encoding method of the bin of the first syntax element as a context-based encoding method if the result corresponds to a value other than the predetermined value.

[0498] For example, the decision unit (3130) can determine the encoding method of the bin of the first syntax element as a bypass encoding method if the result of combining the value of the first syntax element of the left surrounding block of the current block and the value of the first syntax element of the upper surrounding block of the current block corresponds to a predetermined value. Additionally, the decision unit (3130) can determine the encoding method of the bin of the first syntax element as a context-based encoding method if the result of combining the value of the first syntax element of the left surrounding block and the value of the first syntax element of the upper surrounding block of the current block corresponds to a value other than a predetermined value.

[0499] In addition, as an example, the decision unit (3130) may determine the encoding method of the bin of the first syntax element as a bypass encoding method if the size of the current block is less than or equal to a predetermined size, and determine the encoding method of the bin of the first syntax element as a context-based encoding method if the size of the current block is greater than or equal to a predetermined size.

[0500] In addition, as an example, the decision unit (3130) may determine the encoding method of the bin of the first syntax element based on a value representing the result of comparing the size of the current block and the size of the surrounding block.

[0501] The content regarding the adaptive determination of the bin encoding method among the bypass encoding method and the context-based encoding method corresponds to the content regarding the determination unit (2130) of the aforementioned entropy decoding unit (2010) determining the bin decoding method, so a detailed explanation is omitted.

[0502] According to the preceding embodiment, the encoding method of a bin can be determined as a bypass encoding method under specific conditions, and in one embodiment, the bypass encoding method may include a plurality of bypass modes.

[0503] For example, the bypass encoding method may include a first bypass mode in which the probabilities of 0 and 1 are both equal, for example, both are 0.5, and a second bypass mode in which the probabilities of 0 and 1 are not equal. In the second bypass mode, the probability values ​​of 0 and 1 may be set to predetermined values ​​other than 0.5. For example, in the second bypass mode, the probability value of 0 may be 0.3 and the probability value of 1 may be 0.7.

[0504] In one embodiment, when the determining unit (3130) determines the encoding method of the bin of the first syntax element, it may consider a value determined based on at least one of the size of the current block, the size of the surrounding block, the value of the second syntax element, or the value of the first syntax element for the surrounding block (e.g., the result of Equation 1).

[0505] In one embodiment, the determining unit (3130) can determine the encoding method of the bin of the first syntax element as a bypass encoding method based on the first bypass mode if the value determined based on at least one of the size of the current block, the size of the surrounding block, the value of the second syntax element, or the value of the first syntax element for the surrounding block corresponds to a predetermined first value.

[0506] Additionally, in one embodiment, the determining unit (3130) may determine the encoding method of the bin of the first syntax element as a bypass encoding method based on the second bypass mode if the value determined based on at least one of the size of the current block, the size of the surrounding block, the value of the second syntax element, or the value of the first syntax element for the surrounding block corresponds to a predetermined second value.

[0507] Additionally, in one embodiment, the determination unit (3130) may determine the encoding method of the bin of the first syntax element as a context-based encoding method if the value determined based on at least one of the size of the current block, the size of the surrounding block, the value of the second syntax element, or the value of the first syntax element for the surrounding block corresponds to a value other than the predetermined first value and the second value.

[0508] FIG. 32 is a flowchart of an image encoding method by an encoding device (3000) according to one embodiment.

[0509] In step S3210, the encoding device (3000) can determine the value of the first syntax element of the current block.

[0510] In one embodiment, the first syntax element of the current block may include at least one of a syntax element representing the partitioning form of the current block, a syntax element representing the prediction mode of the current block, or a syntax element representing the residual sample value of the current block.

[0511] In step S3220, the encoding device (3000) may initialize the contexts of the syntax elements before encoding the value of the first syntax element.

[0512] In one embodiment, when the encoding device (3000) starts entropy encoding of a syntax element of a maximum encoding unit, it may perform context initialization if i) the maximum encoding unit is the first maximum encoding unit within a slice, ii) the maximum encoding unit is the first maximum encoding unit within a tile, or iii) the maximum encoding unit is the first maximum encoding unit of a row of maximum encoding units.

[0513] In one embodiment, when the encoding device (3000) starts entropy encoding of the syntax elements of the maximum encoding unit after the context initialization is completed, i) if the maximum encoding unit is the first maximum encoding unit within the tile, or ii) if the maximum encoding unit is the first maximum encoding unit of the row of the maximum encoding unit, the context reselection process may be performed.

[0514] In one embodiment, if a slice includes a plurality of tiles or a plurality of rows of maximum encoding units, a context initialization process may be performed if the maximum encoding unit is the first maximum encoding unit within the first tile or the first row of maximum encoding units. In one embodiment, if the maximum encoding unit is the first maximum encoding unit within the row of maximum encoding units after the first tile or the first row of maximum encoding units after the first row of maximum encoding units, a context reselection process may be performed.

[0515] In one embodiment, when a context requiring initialization is selected, the encoding device (3000) can initialize the probability value of a bin based on the initialization value of the selected context. In one embodiment, the initialization value of the context requiring initialization can be obtained by applying a difference value to the initialization value of another context.

[0516] In one embodiment, the encoding device (3000) may update the initialization value of the context according to the update information.

[0517] In one embodiment, since the context initialization process can be performed under specific conditions, step S3220 of FIG. 32 can be omitted from the image encoding method.

[0518] In step S3230, the encoding device (3000) can determine the encoding method of the first bin of the first syntax element of the current block.

[0519] In one embodiment, the encoding device (3000) obtains a result value by applying at least one of the size of the current block, the size of a surrounding block adjacent to the current block, the value of a second syntax element different from the first syntax element, or the value of a first syntax element for the surrounding block to a predetermined mathematical formula (e.g., mathematical formula 1), and based on the result value, can determine the encoding method of the first bin of the first syntax element of the current block among a context-based encoding method and a bypass encoding method.

[0520] In one embodiment, the bypass encoding method may include a first bypass mode and a second bypass mode. In this case, the encoding device (3000) may obtain a result value by applying at least one of the size of the current block, the size of a surrounding block adjacent to the current block, the value of a second syntax element different from the first syntax element, or the value of the first syntax element for the surrounding block to a predetermined mathematical formula (e.g., mathematical formula 1). Based on the obtained result value, the encoding device (3000) may select any one of the bypass encoding method according to the first bypass mode, the bypass encoding method according to the second bypass mode, and the context-based encoding method.

[0521] In step S3240, the encoding device (3000) can generate a bitstream by arithmetic encoding the first bin according to the encoding method of the first bin.

[0522] One embodiment aims to reduce the amount of computation in the entropy encoding and entropy decoding processes of syntax elements.

[0523] One embodiment has the objective of accurately predicting the probability value used in the entropy encoding and entropy decoding processes of a syntax element.

[0524] One embodiment aims to reduce the bit rate of a bitstream by entropy-coding syntax elements with a small number of bits.

[0525] The technical problems to be solved by the present disclosure are not limited to those mentioned above, and other unmentioned technical problems will be clearly understood by those skilled in the art to which the present disclosure belongs from the description below.

[0526] A method for decoding an image using entropy decoding according to one embodiment may include a step (S2920) of determining a decoding method for a first bin of a first syntax element for a current block from among a context-based decoding method and a bypass decoding method.

[0527] A method for decoding an image using entropy decoding according to one embodiment may include the step (S2930) of obtaining a first bin through arithmetic decoding from a bitstream according to a determined decoding method.

[0528] A method for decoding an image using entropy decoding according to one embodiment may include a step (S2940) of determining the value of a first syntax element based on a first bin obtained.

[0529] A method for decoding an image using entropy decoding according to one embodiment may include a step (S2950) of restoring the current block using the value of a first syntax element.

[0530] In one embodiment, the decoding method of the first bin may be determined based on at least one of the size of the current block, the size of a neighboring block adjacent to the current block, the value of the second syntax element, or the value of the first syntax element for the neighboring block.

[0531] In one embodiment, the step of determining the decoding method of the first bin may include: determining the decoding method of the first bin as a bypass decoding method if the result of combining the value of the first syntax element of the left peripheral block of the current block and the value of the first syntax element of the upper peripheral block of the current block corresponds to a predetermined value; and determining the decoding method of the first bin as a context-based decoding method if the result corresponds to a value other than the predetermined value.

[0532] In one embodiment, the step of obtaining a first bin may include, when the decoding method of the first bin is determined to be a context-based decoding method, selecting a context for arithmetic decoding of the first bin among a plurality of contexts based on a result value.

[0533] In one embodiment, the step of determining the decoding method of the first bin may include: determining the decoding method of the first bin as a bypass decoding method if the size of the current block is less than or equal to a predetermined size; and determining the decoding method of the first bin as a context-based decoding method if the size of the current block is greater than a predetermined size.

[0534] In one embodiment, the step of determining the decoding method of the first bin may include determining the decoding method of the first bin based on at least one of a value representing the result of comparing the size of the current block and the size of the surrounding blocks, or a value representing whether at least one partitioning mode is allowed for the current block.

[0535] In one embodiment, the bypass decoding method may include a first bypass mode in which the probability of 0 and the probability of 1 are the same, and a second bypass mode in which the probability of 0 and the probability of 1 are different.

[0536] In one embodiment, the image decoding method may further include the step of obtaining a second bin through arithmetic decoding from a bitstream according to a decoding method corresponding to the index of the second bin of a first syntax element among a context-based decoding method and a bypass decoding method.

[0537] In one embodiment, the image decoding method further includes a step (S2910) of performing context initialization before determining the decoding method of the first bin, and the step of performing context initialization may include: a step of selecting at least one first context that requires initialization among a plurality of contexts based on the type of slice containing the current block; a step of updating at least one initialization value corresponding to at least one first context based on update information obtained from a bitstream; and a step of deriving an LPS (least probable symbol) interval corresponding to at least one first context using the updated at least one initialization value.

[0538] In one embodiment, the update information may include at least one initialization value after the update, or a difference value between at least one initialization value before the update and at least one initialization value after the update.

[0539] In one embodiment, at least one initialization value includes a slope index (slopeIdx) consisting of a predetermined number of upper bits and an offset index (offsetIdx) consisting of a predetermined number of lower bits, and the update information may include a slope index after the update or an offset index after the update.

[0540] In one embodiment, the update information may include the difference between the slope index before the update and the slope index after the update, or the difference between the offset index before the update and the offset index after the update.

[0541] In one embodiment, the image decoding method may further include: determining that at least one first context needs to be changed after performing context initialization; selecting at least one second context different from at least one first context among a plurality of contexts based on information obtained from a bitstream; and performing context initialization using at least one second context.

[0542] In one embodiment, when the type of slice is an intra-slice, at least one of a first context and at least one second context may be selected based on information obtained from a bitstream.

[0543] In one embodiment, at least one initialization value corresponding to at least one first context can be obtained by applying a difference value to at least one initialization value corresponding to at least one second context among a plurality of contexts.

[0544] A method for encoding an image using entropy encoding according to one embodiment may include a step (S3210) of determining the value of a first syntax element for encoding a current block.

[0545] A method for encoding an image using entropy encoding according to one embodiment may include a step (S3230) of determining the encoding method of a first bin corresponding to the value of a first syntax element among a context-based encoding method and a bypass encoding method.

[0546] A method for encoding an image using entropy encoding according to one embodiment may include the step (S3240) of generating a bitstream by performing arithmetic encoding on a first bin according to a determined encoding method.

[0547] In one embodiment, the encoding method of the first bin may be determined based on at least one of the size of the current block, the size of a neighboring block adjacent to the current block, the value of the second syntax element, or the value of the first syntax element for the neighboring block.

[0548] A method for transmitting a bitstream generated by an image encoding method according to one embodiment may include the step of transmitting a bitstream generated by an image encoding method.

[0549] In one embodiment, the image encoding method may include the step of determining the value of a first syntax element for encoding the current block.

[0550] In one embodiment, the image encoding method may include the step of determining the encoding method of a first bin corresponding to the value of a first syntax element among a context-based encoding method and a bypass encoding method.

[0551] In one embodiment, the image encoding method may include the step of generating a bitstream by performing arithmetic encoding on a first bin according to a determined encoding method.

[0552] In one embodiment, the encoding method of the first bin may be determined based on at least one of the size of the current block, the size of a neighboring block adjacent to the current block, the value of the second syntax element, or the value of the first syntax element for the neighboring block.

[0553] One embodiment can reduce the amount of computation in the entropy encoding and entropy decoding processes of syntax elements.

[0554] One embodiment can accurately predict the probability values ​​used in the entropy encoding and entropy decoding processes of syntax elements.

[0555] One embodiment can reduce the bit rate of a bitstream by entropy-coding syntax elements with a small number of bits.

[0556] The effects obtainable from the present disclosure are not limited to those mentioned above, and other unmentioned effects will be clearly understood by those skilled in the art to which the present disclosure belongs from the description below.

[0557] Meanwhile, the embodiments of the present disclosure described above can be written as a program that can be executed on a computer, and the written program can be stored on a storage medium that can be read by a device.

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

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

[0560] Although the technical concept of the present disclosure has been described in detail with reference to preferred embodiments, the technical concept of the present disclosure is not limited to the above embodiments, and various modifications and changes can be made by those skilled in the art within the scope of the technical concept of the present disclosure.

Claims

In a method for decoding an image using entropy decoding, A step of determining the decoding method of the first bin of the first syntax element for the current block from among a context-based decoding method and a bypass decoding method (S2920); A step of obtaining the first bin through arithmetic decoding from a bitstream according to the decoding method determined above (S2930); A step of determining the value of the first syntax element based on the first bin obtained above (S2940); and The method includes the step (S2950) of restoring the current block using the value of the first syntax element, wherein A decoding method for an image, wherein the decoding method of the first bin is determined based on at least one of the size of the current block, the size of a surrounding block adjacent to the current block, the value of a second syntax element, or the value of a first syntax element for the surrounding block. In paragraph 1, The step of determining the decoding method of the first bin above is, A step of determining the decoding method of the first bin as the bypass decoding method if the result of combining the value of the first syntax element of the left peripheral block of the current block and the value of the first syntax element of the upper peripheral block of the current block corresponds to a predetermined value; and A method for decoding an image, comprising the step of determining the decoding method of the first bin as the context-based decoding method if the result value corresponds to a value other than the predetermined value. In any one of paragraphs 1 to 2, The step of obtaining the first bin above is, A method for decoding an image, comprising the step of selecting a context for arithmetic decoding of the first bin among a plurality of contexts based on the result value when the decoding method of the first bin is determined to be the context-based decoding method. In any one of paragraphs 1 through 3, The step of determining the decoding method of the first bin above is, If the size of the current block is less than or equal to a predetermined size, the step of determining the decoding method of the first bin as the bypass decoding method; and A method for decoding an image, comprising the step of determining the decoding method of the first bin as the context-based decoding method if the size of the current block is larger than the predetermined size. In any one of paragraphs 1 through 4, The step of determining the decoding method of the first bin above is, A method for decoding an image, comprising the step of determining a decoding method of the first bin based on at least one of a value representing a comparison result between the size of the current block and the size of the surrounding blocks, or a value representing whether at least one partitioning mode is allowed for the current block. In any one of paragraphs 1 through 5, The above bypass decoding method is, A method for decoding an image, comprising a first bypass mode in which the probability of 0 and the probability of 1 are the same, and a second bypass mode in which the probability of 0 and the probability of 1 are different. In any one of paragraphs 1 through 6, The decoding method of the above image is, A method for decoding an image, further comprising the step of obtaining the second bin through arithmetic decoding from the bitstream according to a decoding method corresponding to the index of the second bin of the first syntax element among the context-based decoding method and the bypass decoding method. In any one of paragraphs 1 through 7, The decoding method of the above image is, The method further includes a step (S2910) of performing context initialization before determining the decoding method of the first bin, and The step of performing the above context initialization is, A step of selecting at least one first context requiring initialization among a plurality of contexts based on the type of slice including the current block; A step of updating at least one initialization value corresponding to the at least one first context based on update information obtained from the bitstream; and A method for decoding an image, comprising the step of deriving an LPS (least probable symbol) interval corresponding to at least one first context using at least one updated initialization value. In any one of paragraphs 1 through 8, The above update information is, A method for decoding an image, comprising at least one initialization value after an update, or a difference value between at least one initialization value before an update and at least one initialization value after an update. In any one of paragraphs 1 through 9, The above at least one initialization value includes a slope index (slopeIdx) composed of a predetermined number of upper bits and an offset index (offsetIdx) composed of a predetermined number of lower bits, and The above update information is, A method for decoding an image, comprising a slope index after an update or an offset index after an update. In any one of paragraphs 1 through 10, The above update information is, A method for decoding an image, comprising the difference between a slope index before an update and a slope index after an update, or the difference between an offset index before an update and an offset index after an update. In any one of paragraphs 1 through 11, The decoding method of the above image is, A step of determining that a change to at least one first context is required after performing the above context initialization; A step of selecting at least one second context different from at least one first context among the plurality of contexts based on information obtained from the bitstream; and A method for decoding an image, further comprising the step of performing context initialization using at least one second context. In any one of paragraphs 1 through 12, A method for decoding an image, wherein, when the type of the slice is an intra-slice, either of the at least one first context and at least one second context is selected based on information obtained from a bitstream. In an image encoding method using entropy encoding, Step of determining the value of the first syntax element for encoding the current block (S3210); A step of determining the encoding method of the first bin corresponding to the value of the first syntax element among a context-based encoding method and a bypass encoding method (S3230); and The method includes the step (S3240) of generating a bitstream by performing arithmetic encoding on the first bin according to the above-determined encoding method, wherein An image encoding method wherein the encoding method of the first bin is determined based on at least one of the size of the current block, the size of a surrounding block adjacent to the current block, the value of a second syntax element, or the value of a first syntax element for the surrounding block. In a method for transmitting a bitstream generated by an image encoding method, The above method is, It includes the step of transmitting a bitstream generated by the encoding method of the above image, and The encoding method of the above image is, A step of determining the value of a first syntax element for encoding the current block; A step of determining the encoding method of the first bin corresponding to the value of the first syntax element among a context-based encoding method and a bypass encoding method; and The method includes the step of generating the bitstream by performing arithmetic encoding on the first bin according to the above-determined encoding method, A method in which the encoding method of the first bin is determined based on at least one of the size of the current block, the size of a surrounding block adjacent to the current block, the value of a second syntax element, or the value of a first syntax element for the surrounding block.