Method and device for coding image using probability value tuning, and method and device for decoding image

By updating the context model with probability values from previous blocks, the method enhances image encoding and decoding efficiency, addressing the limitations of existing methods in inter and intra prediction processes.

WO2025023438A1PCT designated stage expired Publication Date: 2025-01-30SAMSUNG ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2024/006505
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-10-31
Filing Date
2024-05-13
Publication Date
2025-01-30

AI Technical Summary

Technical Problem

Current image coding and decryption methods fail to effectively utilize probability values from previous blocks to enhance encoding and decoding efficiency, particularly in inter and intra prediction processes, leading to suboptimal compression and restoration of images.

Method used

The method involves using the probability value of the previous block to update the context model for entropy encoding and decoding, allowing for more accurate prediction and compression of the current block by incorporating context-specific information from adjacent coding units.

Benefits of technology

This approach improves the efficiency of image encoding and decoding by leveraging contextual probability values, reducing the number of bins required and enhancing the accuracy of residual block compression and restoration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2024006505_30012025_PF_FP_ABST
    Figure KR2024006505_30012025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed is an image decoding method according to an embodiment, the method comprising the steps of: storing bins, acquired through entropy decoding of coding units in a first maximum coding unit, according to the context of a syntax element; acquiring a probability value of the context of the syntax element in order to perform entropy decoding of the current coding unit after entropy decoding of coding units in a second maximum coding unit is completed; updating the probability value of the context on the basis of the stored bins; and recovering a syntax element for the current coding unit on the basis of the updated probability value of the context, wherein the total number bins stored is at most a predetermined first threshold value, and the number of bins stored for any one context is at most a limit value or at most the smaller value between the limit value and a predetermined second threshold value.
Need to check novelty before this filing date? Find Prior Art

Description

Image encoding method and device using probability value tuning, and image decoding method and device

[0001] The present disclosure relates to the field of video encoding and decoding, and more particularly, to a device and method for tuning a probability value of a previous block and using it for encoding and decoding a current block.

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

[0003] Inter prediction is a technique for compressing images by removing temporal redundancy between images. Inter prediction allows blocks in the current image to be predicted using a reference image. The reference block most similar to the current block can be searched within a predetermined search range within the reference image. The current block is predicted based on the reference block, and the predicted block generated as a result of the prediction is subtracted from the current block to generate a residual block.

[0004] Intra prediction is a technique for compressing images by removing spatial redundancy within the image. Intra prediction generates a predicted block based on the surrounding pixels of the current block, depending on the intra prediction mode. Then, the predicted block is subtracted from the current block to generate a residual block.

[0005] Syntax elements containing information about residual blocks generated during the video encoding process can be entropy encoded and included in a bitstream, and a decoder can entropy decode the bitstream to restore the syntax elements.

[0006] A method for decoding an image according to one embodiment may include a step of storing a bin obtained through entropy decoding for at least one coding unit within a first maximum coding unit according to a context of a syntax element, wherein at least one coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0007] A method for decoding an image according to one embodiment may include a step of obtaining a probability value of a context of a syntax element after entropy decoding for at least one coding unit within a second maximum coding unit is completed, for entropy decoding for a current coding unit within a current maximum coding unit (2350), and the first maximum coding unit and the second maximum coding unit may be restored before the current maximum coding unit (2350).

[0008] A method for decoding an image according to one embodiment may include a step of updating a probability value of a context based on a bin stored according to the context.

[0009] A method of decoding an image according to one embodiment may include a step of restoring a syntax element for a current encoding unit based on a probability value of an updated context.

[0010] In one embodiment, the total number of bins stored according to the context may be less than or equal to a predetermined first threshold value.

[0011] In one embodiment, the number of bins stored for any one context may be less than or equal to a limit value set for any one context, or less than or equal to the lesser of the limit value and a second predetermined threshold value.

[0012] A video decoding device according to one embodiment may include a context modeler (2010) that stores a bin obtained through entropy decoding for at least one coding unit within a first maximum coding unit according to a context of a syntax element, obtains a probability value of a context of a syntax element after entropy decoding for at least one coding unit within a second maximum coding unit is completed for entropy decoding for a current coding unit within a current maximum coding unit (2350), and updates the probability value of the context based on the bin stored according to the context.

[0013] An image decoding device according to one embodiment may include an arithmetic decoding unit (2030) that restores a syntax element for a current encoding unit based on a probability value of an updated context.

[0014] In one embodiment, at least one coding unit within the first maximum coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0015] In one embodiment, the first maximum coding unit and the second maximum coding unit may be restored before the current maximum coding unit (2350).

[0016] In one embodiment, the total number of bins stored according to the context may be less than or equal to a predetermined first threshold value.

[0017] In one embodiment, the number of bins stored for any one context may be less than or equal to a limit value set for any one context, or less than or equal to the lesser of the limit value and a second predetermined threshold value.

[0018] A method of encoding an image according to one embodiment includes a step of storing a bin corresponding to a syntax element of at least one coding unit within a first maximum coding unit according to a context of the syntax element, wherein at least one coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0019] A method for encoding an image according to one embodiment may include a step of obtaining a probability value of a context of a syntax element after entropy encoding for at least one encoding unit within a second maximum encoding unit is completed, for entropy encoding for a current encoding unit within a current maximum encoding unit (2350), and the first maximum encoding unit and the second maximum encoding unit may be encoded before the current maximum encoding unit (2350).

[0020] A method of encoding an image according to one embodiment may include a step of updating a probability value of a context based on a bin stored according to the context.

[0021] A method of encoding an image according to one embodiment may include a step of arithmetic encoding a syntax element for a current encoding unit based on a probability value of an updated context.

[0022] In one embodiment, the total number of bins stored according to the context may be less than or equal to a predetermined first threshold value.

[0023] In one embodiment, the number of bins stored for any one context may be less than or equal to a limit value set for any one context, or less than or equal to the lesser of the limit value and a second predetermined threshold value.

[0024] An image encoding device according to one embodiment may include a context modeler (3430) that stores a bin corresponding to a syntax element of at least one encoding unit within a first maximum encoding unit according to a context of the syntax element, obtains a probability value of a context of a syntax element after entropy encoding for at least one encoding unit within a second maximum encoding unit is completed for entropy encoding for a current encoding unit within a current maximum encoding unit (2350), and updates the probability value of the context based on the bin stored according to the context.

[0025] An image encoding device according to one embodiment may include an arithmetic encoding unit (3450) that arithmetic-encodes a syntax element for a current encoding unit based on a probability value of an updated context.

[0026] In one embodiment, at least one coding unit within the first maximum coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0027] In one embodiment, the first maximum coding unit and the second maximum coding unit may be coded before the current maximum coding unit (2350).

[0028] In one embodiment, the total number of bins stored according to the context may be less than or equal to a predetermined first threshold value.

[0029] In one embodiment, the number of bins stored for any one context may be less than or equal to a limit value set for any one context, or less than or equal to the lesser of the limit value and a second predetermined threshold value.

[0030] In a computer-readable recording medium for recording a bitstream according to one embodiment, the bitstream may correspond to a result of arithmetic encoding of a syntax element for a current encoding unit.

[0031] In one embodiment, the result of arithmetic encoding of a syntax element can be obtained by storing a bin corresponding to a syntax element of at least one coding unit within a first maximum coding unit according to the context of the syntax element.

[0032] In one embodiment, the result of arithmetic encoding of a syntax element can be obtained by obtaining a probability value of a context of a syntax element after entropy encoding for at least one encoding unit within a second maximum encoding unit is completed for entropy encoding for a current encoding unit within a current maximum encoding unit (2350).

[0033] In one embodiment, the result of arithmetic encoding of a syntax element can be obtained by updating the probability value of the context based on a bin stored according to the context.

[0034] In one embodiment, the result of arithmetic encoding of a syntax element can be obtained by arithmetic encoding of a syntax element for a current encoding unit based on a probability value of an updated context.

[0035] In one embodiment, at least one coding unit within the first maximum coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0036] In one embodiment, the first maximum coding unit and the second maximum coding unit may be coded before the current maximum coding unit (2350).

[0037] In one embodiment, the total number of bins stored according to the context may be less than or equal to a predetermined first threshold value.

[0038] In one embodiment, the number of bins stored for any one context may be less than or equal to a limit value set for any one context, or less than or equal to the lesser of the limit value and a second predetermined threshold value.

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

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

[0041] FIG. 3 illustrates a process of dividing a current encoding unit to determine at least one encoding unit according to one embodiment.

[0042] FIG. 4 illustrates a process of dividing a non-square coding unit to determine at least one coding unit according to one embodiment.

[0043] FIG. 5 illustrates a process of dividing an encoding unit based on at least one of block shape information and segmentation shape mode information according to one embodiment.

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

[0045] FIG. 7 illustrates the order in which multiple encoding units are processed when a current encoding unit is divided to determine multiple encoding units according to one embodiment.

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

[0047] FIG. 9 illustrates a process of dividing a first encoding unit to determine at least one encoding unit according to one embodiment.

[0048] FIG. 10 illustrates that, according to one embodiment, the shapes into which a first encoding unit can be divided are limited when a second encoding unit of a non-square shape determined by splitting the first encoding unit satisfies a predetermined condition.

[0049] FIG. 11 illustrates a process of splitting a square-shaped encoding unit when the split shape mode information cannot represent splitting into four square-shaped encoding units according to one embodiment.

[0050] FIG. 12 illustrates that, according to one embodiment, the processing order between multiple encoding units may vary depending on the process of splitting the encoding units.

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

[0052] FIG. 14 illustrates an index (part index, hereinafter referred to as PID) for depth and encoding unit distinction that can be determined according to the shape and size of encoding units according to one embodiment.

[0053] FIG. 15 illustrates that a plurality of coding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment.

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

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

[0056] FIG. 18 illustrates another form of a coding unit that can be determined based on segmentation mode information expressed in binary code according to one embodiment.

[0057] FIG. 19 is a block diagram of an image encoding and decoding system that performs loop filtering according to one embodiment.

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

[0059] FIG. 21 is a diagram for explaining an arithmetic encoding process according to one embodiment.

[0060] Figure 22 is a diagram for explaining an arithmetic decryption process according to one embodiment.

[0061] FIG. 23 is a diagram for explaining a method for obtaining a probability value of a context used in an entropy decoding process of a previous encoding unit for entropy decoding of a current encoding unit according to one embodiment.

[0062] FIG. 24 is a diagram for explaining a method for obtaining a probability value of a context used in an entropy decoding process of a previous encoding unit for entropy decoding of a current encoding unit according to one embodiment.

[0063] FIG. 25 is a diagram illustrating a method for updating a probability value of a context based on a bin stored according to the context according to one embodiment.

[0064] FIG. 26 is a graph showing the tendency of the first probability value and the second probability value updated according to each of the first factor and the second factor according to one embodiment.

[0065] FIG. 27 is a table showing bins obtained through entropy decoding for at least one coding unit within a maximum coding unit according to one embodiment.

[0066] FIG. 28 is a table showing the probability values ​​of the context of a stored syntax element after entropy decoding for a previous encoding unit is completed according to one embodiment.

[0067] FIG. 29 is a table showing a process in which the probability value of the context shown in FIG. 28 is updated according to the bin shown in FIG. 27 according to one embodiment.

[0068] FIG. 30 is a table comparing the number of contexts that can be tuned when the number of bins is limited to a second threshold value according to one embodiment and the number of contexts that can be tuned when the number of bins is limited to a smaller value between the second threshold value and the limit value.

[0069] FIG. 31 is a diagram illustrating a previous encoding unit that can be used to update a probability value of a context according to one embodiment.

[0070] FIG. 32 is a diagram illustrating a previous encoding unit that can be used to update a probability value of a context according to one embodiment.

[0071] Figure 33 is a flowchart of an image decoding method according to one embodiment.

[0072] Fig. 34 is a diagram illustrating a configuration of an image encoding device according to one embodiment.

[0073] Figure 35 is a flowchart of an image encoding method according to one embodiment.

[0074] A method for decoding an image according to one embodiment may include a step of storing a bin obtained through entropy decoding for at least one coding unit within a first maximum coding unit according to a context of a syntax element, wherein at least one coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0075] A method for decoding an image according to one embodiment may include a step of obtaining a probability value of a context of a syntax element after entropy decoding for at least one coding unit within a second maximum coding unit is completed, for entropy decoding for a current coding unit within a current maximum coding unit (2350), and the first maximum coding unit and the second maximum coding unit may be restored before the current maximum coding unit (2350).

[0076] A method for decoding an image according to one embodiment may include a step of updating a probability value of a context based on a bin stored according to the context.

[0077] A method of decoding an image according to one embodiment may include a step of restoring a syntax element for a current encoding unit based on a probability value of an updated context.

[0078] In one embodiment, the total number of bins stored according to the context may be less than or equal to a predetermined first threshold value.

[0079] In one embodiment, the number of bins stored for any one context may be less than or equal to a limit value set for any one context, or less than or equal to the lesser of the limit value and a second predetermined threshold value.

[0080] The present disclosure may be subject to various modifications and various embodiments. Examples 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 alternatives that fall within the spirit and technical scope of the various embodiments.

[0081] When describing embodiments, detailed descriptions of related known technologies may be omitted if they are deemed to unnecessarily obscure the gist of the present disclosure. Furthermore, numbers (e.g., "first," "second," etc.) used in the description of embodiments may correspond to identification symbols used to distinguish one component from another.

[0082] In this 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”, “all of a, b and c”, or variations thereof.

[0083] In the present disclosure, when a component is referred to as being “connected” or “connected” to another component, the component may be directly connected or connected to the other component, but unless there is a specific description to the contrary, the component may also be connected or connected via another component in between.

[0084] In the present disclosure, components expressed as "units", "modules", etc. may be two or more components combined into a single component, or a single component may be divided into two or more more detailed components. In addition, each component described below may additionally perform some or all of the functions performed by other components in addition to its own main function, and some of the main functions performed by each component may be exclusively performed by other components.

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

[0086] In this disclosure, "sample" may refer to data assigned to a sampling location in an image and thus to be processed. For example, a pixel within a frame in a spatial domain may correspond to a sample. A unit containing multiple samples may be defined as a block.

[0087] In the present disclosure, entropy decoding for a block or unit may mean a process of obtaining a syntax element of the block or unit from a bitstream (or bits included in the bitstream), or a process of obtaining an empty string corresponding to the syntax element.

[0088] In the present disclosure, entropy encoding for a block or unit may mean a process of generating a bitstream (or bits constituting a bitstream) from a syntax element of a block or unit, or a process of generating a bitstream (or bits constituting a bitstream) from an empty string corresponding to a syntax element.

[0089] Hereinafter, with reference to FIGS. 1 to 19, an image encoding method and device based on a tree-structured encoding unit and a transformation unit according to one embodiment, and an image decoding method and device are disclosed.

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

[0091] 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. In addition, the bitstream acquisition unit (110) and the decoding unit (120) may include a memory that stores commands to be executed by at least one processor.

[0092] The bitstream acquisition unit (110) can receive a bitstream. The bitstream includes information obtained by encoding an image by an image encoding device (200) described below. In addition, 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 by wire or wirelessly, and the bitstream acquisition unit (110) can receive the bitstream by wire or wirelessly. The bitstream acquisition unit (110) can receive the bitstream from a storage medium such as an optical medium, a hard disk, etc. 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.

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

[0094] The image decoding device (100) may perform an operation of obtaining a binstring corresponding to a splitting shape mode of an encoding unit from a bitstream. In addition, the image decoding device (100) may perform an operation of determining a splitting rule of the encoding unit. In addition, the image decoding device (100) may perform an operation of splitting the encoding unit into a plurality of encoding units based on at least one of the binstring corresponding to the splitting shape mode and the splitting rule. In order to determine the splitting rule, the image decoding device (100) may determine a first allowable range of the size of the encoding unit according to a ratio of the width and height of the encoding unit. In order to determine the splitting rule, the image decoding device (100) may determine a second allowable range of the size of the encoding unit according to the splitting shape mode of the encoding unit.

[0095] Below, the division of encoding units according to one embodiment of the present disclosure is described in detail.

[0096] First, a picture can be divided into one or more slices or one or more tiles. A slice or a tile can be a sequence of one or more maximum coding tree units (CTUs). Depending on the implementation, a slice may include one or more tiles, and a slice may include one or more maximum coding units. A slice including one or more tiles can be determined within a picture.

[0097] The maximum coding block (Coding Tree Block; CTB) is a concept that contrasts with the maximum coding unit (CTU). A CTB is an NxN block containing NxN samples (N is an integer). Each color component can be divided into one or more CTBs.

[0098] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), a maximum coding unit (CTU) is a unit that includes a maximum coding block of luma samples, two maximum coding blocks of corresponding chroma samples, and syntax structures used to encode the luma samples and chroma samples. When a picture is a monochrome picture, a maximum coding unit is a unit that includes a maximum coding block of monochrome samples and syntax structures used to encode the monochrome samples. When a picture is a picture that is encoded with a color plane that is separated by color components, a maximum coding unit is a unit that includes syntax structures used to encode the picture and samples of the picture.

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

[0100] When a picture has a sample array for each Y, Cr, and Cb component, a coding unit (CU) is a unit that includes a coding block for a luma sample and two coding blocks for corresponding chroma samples, and syntax structures used to encode the luma sample and the chroma samples. When a picture is a monochrome picture, a coding unit is a unit that includes a coding block for a monochrome sample and syntax structures used to encode the monochrome samples. When a picture is a picture that is encoded with a color plane that is separated by color component, a coding unit is a unit that includes syntax structures used to encode the picture and samples of the picture.

[0101] As explained above, the maximum coding block and the maximum coding unit are distinct concepts, and the coding block and the coding unit are distinct concepts. That is, the (maximum) coding unit refers to a data structure including a (maximum) coding block including the corresponding sample and a syntax structure corresponding to it. However, since a person skilled in the art can understand that the (maximum) coding unit or the (maximum) coding block refers to a block of a predetermined size including a predetermined number of samples, the following specification will refer to the maximum coding block and the maximum coding unit, or the coding block and the coding unit, without distinction unless there are special circumstances.

[0102] An image can be divided into Coding Tree Units (CTUs). The size of the CTUs can be determined based on information obtained from the bitstream. The shape of the CTUs can be a square of equal size, but is not limited thereto.

[0103] For example, information about the maximum size of a luma coding block can be obtained from the bitstream. For example, the maximum size of the luma coding block indicated by the information about the maximum size of the luma coding block can be one of 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, and 256x256.

[0104] For example, information about the maximum size of a luma coding block capable of being split into two and the luma block size difference can be obtained from the bitstream. The information about the luma block size difference can indicate the size difference between a luma maximum coding unit and a maximum luma coding block capable of being split into two. Therefore, by combining the information about the maximum size of a luma coding block capable of being split into two obtained from the bitstream and the information about the luma block size difference, the size of the luma maximum coding unit can be determined. Using the size of the luma maximum coding unit, the size of the chroma maximum coding unit can also be determined. For example, if the Y: Cb: Cr ratio is 4:2:0 according to the color format, the size of the chroma block can be half the size of the luma block, and similarly, the size of the chroma maximum coding unit can be half the size of the luma maximum coding unit.

[0105] According to one embodiment, since information about the maximum size of a luma coding block capable of binary splitting is obtained from a bitstream, the maximum size of the luma coding block capable of binary splitting can be determined variably. In contrast, the maximum size of a luma coding block capable of ternary splitting can be fixed. For example, the maximum size of a luma coding block capable of ternary splitting in an I picture may be 32x32, and the maximum size of a luma coding block capable of ternary splitting in a P picture or a B picture may be 64x64.

[0106] Additionally, the maximum coding unit can be hierarchically divided into coding units based on the division shape mode information obtained from the bitstream. As the division shape mode information, at least one of information indicating whether quad division is performed, information indicating whether multi-division is performed, division direction information, and division type information can be obtained from the bitstream.

[0107] For example, information indicating whether a quad split is present may indicate whether the current encoding unit is to be quad split (QUAD_SPLIT) or not to be quad split.

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

[0109] When the current encoding unit is binary or ternary split, the split direction information indicates that the current encoding unit is split in either the horizontal or vertical direction.

[0110] When the current encoding unit is split in the horizontal or vertical direction, the split type information indicates that the current encoding unit is split into binary split or ternary split.

[0111] Depending on the split direction information and the split type information, the split mode of the current encoding unit can be determined. The split mode when the current encoding unit is split into binaries in the horizontal direction can be determined as binary horizontal split (SPLIT_BT_HOR), the split mode when the current encoding unit is split into ternary horizontal split (SPLIT_TT_HOR), the split mode when the current encoding unit is split into binaries in the vertical direction can be determined as binary vertical split (SPLIT_BT_VER), and the split mode when the current encoding unit is split into ternary vertical split (SPLIT_TT_VER).

[0112] The image decoding device (100) can obtain segmentation shape mode information from a bitstream from a single binstring. The format of the bitstream received by the image decoding device (100) can include a fixed length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The binstring represents information as a series of binary numbers. The binstring can be composed of at least one bit. The image decoding device (100) can obtain segmentation shape mode information corresponding to the binstring based on a segmentation rule. The image decoding device (100) can determine whether to quad-segment an encoding unit, whether not to quad-segment, or the segmentation direction and segmentation type based on a single binstring.

[0113] The coding unit may be smaller than or equal to the maximum coding unit. For example, the maximum coding unit is also a coding unit with the maximum size, so it is a coding unit. If the split shape mode information for the maximum coding unit indicates that it is not split, the coding unit determined from the maximum coding unit has the same size as the maximum coding unit. If the split shape mode information for the maximum coding unit indicates that it is split, the maximum coding unit may be split into coding units. In addition, if the split shape mode information for the coding unit indicates splitting, the coding units may be split into coding units of smaller sizes. However, the splitting of the image is not limited thereto, and the maximum coding unit and the coding units may not be distinguished. The splitting of the coding unit is described in more detail with reference to FIGS. 3 to 16.

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

[0115] The shape and size of the transformation block and the prediction block may be unrelated.

[0116] In another embodiment, prediction may be performed using the encoding unit as a prediction block. Transformation may also be performed using the encoding unit as a transform block.

[0117] The division of a coding unit is described in more detail with reference to FIGS. 3 to 16. The current block and neighboring blocks of the present disclosure may represent one of a maximum coding unit, a coding unit, a prediction block, and a transform block. In addition, the current block or the current coding unit is a block currently being decoded or encoded, or a block currently being divided. The neighboring block may be a block reconstructed before the current block. The neighboring block may be spatially or temporally adjacent to the current block. The neighboring block may be located on one of the lower left, left, upper left, upper right, upper right, right, and lower right sides of the current block.

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

[0119] The block shape may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN or Nx8N, where N may be a positive integer. The block shape information is information indicating at least one of the shape, direction, width and height ratio or size of the encoding unit.

[0120] The shape of the encoding unit may include square and non-square. When the width and height of the encoding unit are equal (i.e., when the block shape of the encoding unit is 4Nx4N), the image decoding device (100) may determine the block shape information of the encoding unit as square. The image decoding device (100) may determine the shape of the encoding unit as non-square.

[0121] 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 decoding device (100) may determine the block shape information of the encoding unit to be non-square. When the shape of the encoding unit is non-square, the image decoding device (100) may determine the ratio of the width and height among the block shape information of the encoding unit to be at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. Additionally, based on the width length and height length of the encoding unit, the image decoding device (100) can determine whether the encoding unit is in the horizontal or vertical direction. Additionally, based on at least one of the width length, height length, or area of ​​the encoding unit, the image decoding device (100) can determine the size of the encoding unit.

[0122] According to one embodiment, the image decoding device (100) can determine the shape of an encoding unit using block shape information, and can determine the shape into which the encoding unit is divided using segmentation shape mode information. That is, the splitting method of the encoding unit indicated by the segmentation shape mode information can be determined depending on which block shape the block shape information used by the image decoding device (100) indicates.

[0123] The image decoding device (100) can obtain the segmentation shape mode information from the bitstream. However, the present invention is not limited thereto, and the image decoding device (100) and the image encoding device (200) can determine the pre-agreed segmentation shape mode information based on the block shape information. The image decoding device (100) can determine the pre-agreed segmentation shape mode information for the maximum coding unit or the minimum coding unit. For example, the image decoding device (100) can determine the segmentation shape mode information for the maximum coding unit as quad split. In addition, the image decoding device (100) can determine the segmentation shape mode information for the minimum coding unit as “not split.” Specifically, the image decoding device (100) can determine the size of the maximum coding unit as 256x256. The image decoding device (100) can determine the pre-agreed segmentation shape mode information as quad split. Quad splitting is a splitting mode that divides both the width and height of an encoding unit in half. The image decoding device (100) can obtain a coding unit of size 128x128 from a maximum coding unit of size 256x256 based on the splitting mode information. In addition, the image decoding device (100) can determine the size of the minimum coding unit as 4x4. The image decoding device (100) can obtain splitting mode information indicating "not splitting" for the minimum coding unit.

[0124] According to one embodiment, the image decoding device (100) may use block shape information indicating that the current encoding unit is a square shape. For example, the image decoding device (100) may determine whether to not split a square encoding unit, to split it vertically, to split it horizontally, to split it into four encoding units, etc., according to the split 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 split an encoding unit (310a) having the same size as the current encoding unit (300) according to the split shape mode information indicating that it is not split, or may determine a split encoding unit (310b, 310c, 310d, 310e, 310f, etc.) based on the split shape mode information indicating a predetermined splitting method.

[0125] Referring to FIG. 3, the image decoding device (100) may determine two coding units (310b) by vertically dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is vertically divided, according to an embodiment. The image decoding device (100) may determine two coding units (310c) by horizontally dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is horizontally divided, according to an embodiment. The image decoding device (100) may determine four coding units (310d) by vertically and horizontally dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is vertically and horizontally divided, according to an embodiment. The image decoding device (100) may determine three coding units (310e) by vertically dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is ternary divided, according to an embodiment. The image decoding device (100) can determine three coding units (310f) into which the current coding unit (300) is horizontally divided based on the division shape mode information indicating that the ternary division is horizontally divided. However, the division shapes into which a square coding unit can be divided should not be interpreted as being limited to the above-described shapes, and may include various shapes that can be indicated by the division shape mode information. Specified division shapes into which a square coding unit is divided will be specifically described below through various embodiments.

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

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

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

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

[0130] According to one embodiment, if the split shape mode information indicates that the coding unit is split into an odd number of blocks (ternary splitting), the image decoding device (100) may determine an odd number of coding units included in the current coding unit (400 or 450). For example, if the split shape mode information indicates that the current coding unit (400 or 450) is split into three coding units, the image decoding device (100) may split the current coding unit (400 or 450) into three coding units (430a, 430b, 430c, 480a, 480b, 480c).

[0131] According to one embodiment, the ratio of the width and height of the current encoding unit (400 or 450) may be 4:1 or 1:4. When the ratio of the width and height is 4:1, the block shape information may be in the horizontal direction because the length of the width is longer than the length of the height. When the ratio of the width and height is 1:4, the block shape information may be in the vertical direction because the length of the width is shorter than the length of the height. The image decoding device (100) may determine to split the current encoding unit into an odd number of blocks based on the split shape mode information. In addition, the image decoding device (100) may determine the splitting 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 the vertical direction, the image decoding device (100) can divide the current encoding unit (400) in the horizontal direction to determine encoding units (430a, 430b, 430c). Also, if the current encoding unit (450) is in the horizontal direction, the image decoding device (100) can divide the current encoding unit (450) in the vertical direction to determine encoding units (480a, 480b, 480c).

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

[0133] According to one embodiment, when the split shape mode information indicates that the coding unit is split into an odd number of blocks, the image decoding device (100) can determine an odd number of coding units included in the current coding unit (400 or 450), and further, the image decoding device (100) can place a predetermined restriction on at least one coding unit among the odd number of coding units generated by splitting. Referring to FIG. 4, the image decoding device (100) can perform a decoding process for a coding unit (430b, 480b) located in the center among three coding units (430a, 430b, 430c, 480a, 480b, 480c) generated by splitting the current coding unit (400 or 450) differently from the decoding process for other coding units (430a, 430c, 480a, 480c). For example, the image decoding device (100) can restrict the encoding unit (430b, 480b) located in the center from being split any further, unlike other encoding units (430a, 430c, 480a, 480c), or can restrict it to be split only a predetermined number of times.

[0134] FIG. 5 illustrates a process in which an image decoding device (100) divides an encoding unit based on at least one of block shape information and division shape mode information according to one embodiment.

[0135] According to one embodiment, the image decoding device (100) may determine whether to split or not to split a first coding unit (500) having a square shape into coding units based on at least one of block shape information and split shape mode information. According to one embodiment, when the split shape mode information indicates splitting the first coding unit (500) in the horizontal direction, the image decoding device (100) may split the first coding unit (500) in the horizontal direction to determine a second coding unit (510). The first coding unit, the second coding unit, and the third coding unit used according to one embodiment are terms used to understand the relationship before and after splitting between coding units. For example, when the first coding unit is split, the second coding unit may be determined, and when the second coding unit is split, the third coding unit may be determined. Hereinafter, the relationship between the first coding unit, the second coding unit, and the third coding unit used may be understood to follow the above-described characteristics.

[0136] According to one embodiment, the image decoding device (100) may determine to split or not split the determined second encoding unit (510) into encoding units based on the split shape mode information. Referring to FIG. 5, the image decoding device (100) may split the first encoding unit (500) based on the split shape mode information to split the determined second encoding unit (510) of a non-square shape into at least one third encoding unit (520a, 520b, 520c, 520d, etc.) or may not split the second encoding unit (510). The image decoding device (100) can obtain split shape mode information, and the image decoding device (100) can split the first encoding unit (500) based on the obtained split shape mode information to split a plurality of second encoding units (e.g., 510) of various shapes, and the second encoding unit (510) can be split according to the way in which the first encoding unit (500) is split based on the split shape mode information. According to one embodiment, when the first encoding unit (500) is split into the second encoding unit (510) based on the split shape mode information for the first encoding unit (500), the second encoding unit (510) can also be split into the third encoding unit (e.g., 520a, 520b, 520c, 520d, etc.) based on the split shape mode information for the second encoding unit (510). That is, the coding unit can be recursively split based on the split shape mode information associated with each coding unit. Accordingly, a square coding unit can be determined from a non-square coding unit, and such a square coding unit can be recursively split to determine a non-square coding unit.

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

[0138] According to one embodiment, the image decoding device (100) may split each of the third encoding units (520a, 520b, 520c, 520d, etc.) into encoding units based on the split shape mode information. In addition, the image decoding device (100) may determine not to split the second encoding unit (510) based on the split shape mode information. According to one embodiment, the image decoding device (100) may split the second encoding unit (510) having a non-square shape into an odd number of third encoding units (520b, 520c, 520d). The image decoding device (100) may place a predetermined restriction on a predetermined third encoding unit among the odd number of third encoding units (520b, 520c, 520d). For example, the image decoding device (100) can limit the encoding unit (520c) located in the middle among an odd number of third encoding units (520b, 520c, 520d) to not be divided any further or to be divided a settable number of times.

[0139] Referring to FIG. 5, the image decoding device (100) may limit the coding unit (520c) located in the middle among the odd number of third coding units (520b, 520c, 520d) included in the second coding unit (510) having a non-square shape to not be split any further, or to be split in a predetermined split form (for example, to be split only into four coding units or to be split in a form corresponding to the split form of the second coding unit (510), or to be split only a predetermined number of times (for example, to be split only n times, where n>0). However, the above limitations on the coding unit (520c) located in the middle are merely simple embodiments and should not be interpreted as being limited to the above-described embodiments, but should be interpreted as including various limitations in which the coding unit (520c) located in the middle can be decoded differently from the other coding units (520b, 520d).

[0140] According to one embodiment, the image decoding device (100) can obtain the segmentation shape mode information used to segment the current encoding unit from a predetermined location within the current encoding unit.

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

[0142] Referring to FIG. 6, the split shape mode information of the current encoding unit (600, 650) can be obtained from a sample at a predetermined position among a plurality of samples included in the current encoding unit (600, 650) (for example, a sample (640, 690) located in the center). However, the predetermined position within the current encoding unit (600) from which at least one of the split shape mode information can be obtained should not be interpreted as being limited to the center position illustrated in FIG. 6, but should be interpreted as including various positions (for example, top, bottom, left, right, upper left, lower left, upper right, or lower right, etc.) that can be included within the current encoding unit (600). The image decoding device (100) can obtain the split shape mode information obtained from the predetermined position and determine whether or not to split the current encoding unit into encoding units of various shapes and sizes.

[0143] According to one embodiment, the image decoding device (100) may select one of the coding units when the current coding unit is divided into a predetermined number of coding units. Various methods may be used to select one of the multiple coding units, and descriptions of such methods will be provided later through various embodiments.

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

[0145] According to one embodiment, the image decoding device (100) may use information indicating the positions of each of the odd-numbered coding units to determine an coding unit located in the middle of the odd-numbered coding units. Referring to FIG. 6, the image decoding device (100) may divide the current coding unit (600) or the current coding unit (650) to determine odd-numbered coding units (620a, 620b, 620c) or odd-numbered coding units (660a, 660b, 660c). The image decoding device (100) may use information about the positions of the odd-numbered coding units (620a, 620b, 620c) or odd-numbered coding units (660a, 660b, 660c) to determine the middle coding unit (620b) or the middle coding unit (660b). For example, the image decoding device (100) can determine the coding unit (620b) located in the center by determining the positions of the coding units (620a, 620b, 620c) based on information indicating the positions of predetermined samples included in the coding units (620a, 620b, 620c). Specifically, the image decoding device (100) can determine the coding unit (620b) located in the center by determining the positions of the coding units (620a, 620b, 620c) based on information indicating the positions of samples (630a, 630b, 630c) at the upper left of the coding units (620a, 620b, 620c).

[0146] According to one embodiment, information indicating the positions of the upper left samples (630a, 630b, 630c) included in each of the coding units (620a, 620b, 620c) may include information on the positions or coordinates of the coding units (620a, 620b, 620c) within the picture. According to one embodiment, information indicating the positions of the upper left samples (630a, 630b, 630c) included in each of the coding units (620a, 620b, 620c) may include information indicating the width or height of the coding units (620a, 620b, 620c) included in the current coding unit (600), and this width or height may correspond to information indicating the difference between the coordinates of the coding units (620a, 620b, 620c) within the picture. That is, the image decoding device (100) can determine the encoding unit (620b) located in the center by directly using information about the positions 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 between the coordinates.

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

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

[0149] According to one embodiment, the image decoding device (100) may determine the width or height of each of the encoding units (620a, 620b, 620c) by using the (xa, ya) coordinate, which is information indicating the position of the sample (630a) at the upper left of the upper encoding unit (620a), the (xb, yb) coordinate, which is information indicating the position of the sample (630b) at the upper left of the middle encoding unit (620b), and the (xc, yc) coordinate, which is information indicating the position of the sample (630c) at the upper left of the lower encoding unit (620c). The image decoding device (100) can determine the size of each of the encoding units (620a, 620b, 620c) using coordinates (xa, ya), (xb, yb), (xc, yc) indicating the positions of the encoding units (620a, 620b, 620c). According to one embodiment, the image decoding device (100) can determine the width of the upper encoding unit (620a) as the width of the current encoding unit (600). The image decoding device (100) can determine the height of the upper encoding unit (620a) as yb-ya. According to one embodiment, the image decoding device (100) can determine the width of the middle encoding unit (620b) as the width of the current encoding unit (600). The image decoding device (100) 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 image decoding device (100) may determine an encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (620a, 620b, 620c).Referring to FIG. 6, the image decoding device (100) can determine the middle encoding unit (620b) having a different size from the sizes of the upper encoding unit (620a) and the lower encoding unit (620c) as the encoding unit of a predetermined position. However, the process by which the image decoding device (100) described above determines the encoding unit having a different size from other encoding units is merely an embodiment of determining the encoding unit of a predetermined position using the size of the encoding unit determined based on sample coordinates, and therefore, various processes of determining the encoding unit of a predetermined position by comparing the sizes of the encoding units determined according to predetermined sample coordinates can be used.

[0150] The image decoding device (100) can determine the width or height of each of the encoding units (660a, 660b, 660c) by using the (xd, yd) coordinate, which is information indicating the position of the sample (670a) at the upper left of the left encoding unit (660a), the (xe, ye) coordinate, which is information indicating the position of the sample (670b) at the upper left of the middle encoding unit (660b), and the (xf, yf) coordinate, which is information indicating the position of the sample (670c) at the upper left of the right encoding unit (660c). The image decoding device (100) can determine the size of each of the encoding units (660a, 660b, 660c) by using the (xd, yd), (xe, ye), (xf, yf), which are coordinates indicating the positions of the encoding units (660a, 660b, 660c).

[0151] 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 widths and heights of the left encoding unit (660a) and the middle encoding unit (660b). The image decoding device (100) can determine an encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (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 sizes of the left encoding unit (660a) and the right encoding unit (660c) as an encoding unit at a predetermined position. However, the process of the image decoding device (100) described above determining an encoding unit having a different size from other encoding units is merely an embodiment of determining an encoding unit at a predetermined position using the size of an encoding unit determined based on sample coordinates, and therefore, various processes of determining an encoding unit at a predetermined position by comparing the sizes of encoding units determined according to predetermined sample coordinates can be used.

[0152] However, the location of the sample considered for determining the location of the encoding unit should not be interpreted as being limited to the upper left corner described above, and it can be interpreted that information on the location of any sample included in the encoding unit can be used.

[0153] According to one embodiment, the image decoding device (100) may select an encoding unit at a predetermined position from among an odd number of encoding units determined by splitting the current encoding unit, taking into consideration the shape of the current encoding unit. For example, if the current encoding unit has a non-square shape in which the width is longer than the height, the image decoding device (100) may determine an encoding unit at a predetermined position in the horizontal direction. That is, the image decoding device (100) may determine one of the encoding units whose positions vary in the horizontal direction and place a restriction on the corresponding encoding unit. If the current encoding unit has a non-square shape in which the height is longer than the width, the image decoding device (100) may determine an encoding unit at a predetermined position in the vertical direction. That is, the image decoding device (100) may determine one of the encoding units whose positions vary in the vertical direction and place a restriction on the corresponding encoding unit.

[0154] According to one embodiment, the image decoding device (100) may use information indicating the positions of each of the even-numbered coding units to determine the coding unit at a predetermined position among the even-numbered coding units. The image decoding device (100) may determine the even-numbered coding units by dividing the current coding unit (binary dividing) and may determine the coding unit at a predetermined position using information about the positions of the even-numbered coding units. A specific process for this may be a process corresponding to the process of determining the coding unit at a predetermined position (e.g., the center position) among the odd-numbered coding units described above in FIG. 6, and thus will be omitted.

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

[0156] Referring to FIG. 6, the image decoding device (100) can split the current encoding unit (600) into a plurality of encoding units (620a, 620b, 620c) based on the split shape 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 position where the split shape mode information is acquired. That is, the split shape mode information of the current encoding unit (600) can be obtained from a sample (640) located in the center of the current encoding unit (600), and when the current encoding unit (600) is split into a plurality of encoding units (620a, 620b, 620c) based on the split shape mode information, the encoding unit (620b) including the sample (640) can be determined as the encoding unit located in the center. However, the information used to determine the encoding unit located in the center should not be interpreted as being limited to the split shape mode information, and various types of information can be used in the process of determining the encoding unit located in the center.

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

[0158] According to one embodiment, the position of a sample from which predetermined information can be obtained may be determined according to the shape of the current encoding unit (600). According to one embodiment, the block shape information may determine whether the shape of the current encoding unit is square or non-square, and may determine the position of a sample from which predetermined information can be obtained according to the shape. For example, the image decoding apparatus (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 as a sample from which predetermined information can be obtained, using at least one of information about the width and information about the height of the current encoding unit. As another example, when the block shape information related to the current encoding unit indicates that the shape is non-square, the image decoding apparatus (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 predetermined information can be obtained.

[0159] According to one embodiment, when the image decoding device (100) divides the current encoding unit into a plurality of encoding units, the image decoding device (100) may use the split shape 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 the split shape 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 splitting the current encoding unit using the split shape mode information obtained from the 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 split shape mode information obtained from the sample at a predetermined position included in each of the encoding units. Since the recursive division process of the encoding unit has been described above with reference to FIG. 5, a detailed description thereof will be omitted.

[0160] According to one embodiment, the image decoding device (100) can divide a current encoding unit to determine at least one 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).

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

[0162] According to one embodiment, the image decoding device (100) may determine second encoding units (710a, 710b) by vertically splitting the first encoding unit (700) according to the splitting shape mode information, determine second encoding units (730a, 730b) by horizontally splitting the first encoding unit (700), or determine second encoding units (750a, 750b, 750c, 750d) by vertically and horizontally splitting the first encoding unit (700).

[0163] Referring to FIG. 7, the image decoding device (100) can determine the order in which the second encoding units (710a, 710b) determined by vertically dividing the first encoding unit (700) are processed in the horizontal direction (710c). The image decoding device (100) can determine the order in which the second encoding units (730a, 730b) determined by horizontally dividing the first encoding unit (700) are processed in the vertical direction (730c). The image decoding device (100) can determine the second encoding units (750a, 750b, 750c, 750d) determined by dividing the first encoding unit (700) in the vertical and horizontal directions according to a predetermined order (e.g., raster scan order (750e) or z scan order (z scan order)) in which encoding units located in one row are processed and then encoding units located in the next row are processed.

[0164] According to one embodiment, the image decoding device (100) can recursively split the encoding units. Referring to FIG. 7, the image decoding device (100) can split the first encoding unit (700) to determine a plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d), and can recursively split each of the determined plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d). A method for splitting a plurality of coding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may be a method corresponding to a method for splitting the first coding unit (700). Accordingly, the plurality of coding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may each be independently split into a plurality of coding units. Referring to FIG. 7, the image decoding device (100) may split the first coding unit (700) in the vertical direction to determine the second coding units (710a, 710b), and further may determine to independently split or not split each of the second coding units (710a, 710b).

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

[0166] According to one embodiment, the processing order of the coding units may be determined based on the splitting process of the coding units. In other words, the processing order of the split coding units may be determined based on the processing order of the coding units immediately before splitting. The image decoding device (100) may determine the processing order of the third coding units (720a, 720b) ​​determined by splitting the second coding unit (710a) on the left, independently from the second coding unit (710b) on the right. Since the second coding unit (710a) on the left is split horizontally and the third coding units (720a, 720b) ​​are determined, the third coding units (720a, 720b) ​​may be processed in the vertical direction (720c). In addition, since the order in which the second encoding unit (710a) on the left and the second encoding unit (710b) on the right are processed corresponds to the horizontal direction (710c), the right encoding unit (710b) can be processed after the third encoding units (720a, 720b) ​​included in the second encoding unit (710a) on the left are processed in the vertical direction (720c). Since the above-described content is intended to explain the process in which the processing order of the encoding units is determined according to the encoding units before splitting, it 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 that are split and determined in various forms can be independently processed according to a predetermined order.

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

[0168] According to one embodiment, the image decoding device (100) may determine that the current encoding unit is split into an odd number of encoding units based on the acquired split shape mode information. Referring to FIG. 8, a first encoding unit (800) having a square shape may be split into second encoding units (810a, 810b) having a non-square shape, and the second encoding units (810a, 810b) may each be independently split 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 horizontally dividing the left encoding unit (810a) among the second encoding units, and can divide the right encoding unit (810b) into an odd number of third encoding units (820c, 820d, 820e).

[0169] According to one embodiment, the image decoding device (100) can determine whether there is an odd number of split 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 splitting the first encoding unit (800). The image 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) is divided into an odd number of encoding units based on at least one of the block shape information and the split shape mode information. For example, the encoding unit located on the right side of the second encoding unit (810a, 810b) can be divided into an odd number of third encoding units (820c, 820d, 820e). The order in which the plurality of encoding units included in the first encoding unit (800) are processed can be a predetermined order (e.g., z-scan order (830)), and the image decoding device (100) can determine whether the third encoding unit (820c, 820d, 820e) determined by dividing the second encoding unit (810b) on the right into odd numbers satisfies the condition that it can be processed according to the predetermined order.

[0170] According to one embodiment, the image decoding device (100) may determine whether the third encoding units (820a, 820b, 820c, 820d, 820e) included in the first encoding unit (800) satisfy a condition that they can be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the second encoding unit (810a, 810b) is split 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 splitting the height of the left second encoding unit (810a) of a non-square shape in half may satisfy the condition. Since the boundaries of the third encoding units (820c, 820d, 820e) 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, it may be determined that the third encoding units (820c, 820d, 820e) do not satisfy the condition. In the case where this condition is not satisfied, the image decoding device (100) may determine that there is a disconnection in the scanning order, and may determine that the right second encoding unit (810b) is divided into an odd number of encoding units based on the determination result. According to an embodiment, the image decoding device (100) may place a predetermined restriction on an encoding unit at a predetermined position among the divided encoding units when the encoding unit is divided into an odd number of encoding units. Since the contents of such restrictions or predetermined positions have been described above through various embodiments, a detailed description thereof will be omitted.

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

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

[0173] According to one embodiment, the image decoding device (100) can determine whether the second encoding units (910a, 910b, 910c, 920a, 920b, 920c) included in the first encoding unit (900) satisfy a condition that allows them to be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the first encoding unit (900) is split in half according to the boundary of the second encoding units (910a, 910b, 910c, 920a, 920b, 920c). Referring to FIG. 9, since the boundaries of the second coding units (910a, 910b, 910c) determined by vertically dividing the first coding unit (900) in a square shape do not divide the width of the first coding unit (900) in half, it may be determined that the first coding unit (900) does not satisfy the condition that it can be processed in a predetermined order. In addition, since the boundaries of the second coding units (920a, 920b, 920c) determined by horizontally dividing the first coding unit (900) in a square shape do not divide the height of the first coding unit (900) in half, it may be determined that the first coding unit (900) does not satisfy the condition that it can be processed in a predetermined order. If such a condition is not satisfied, the image decoding device (100) may determine that the scan order is disconnected, and based on the determination result, may determine that the first encoding unit (900) is divided into an odd number of encoding units. According to one embodiment, the image decoding device (100) may place a predetermined restriction on an encoding unit at a predetermined position among the divided encoding units when the encoding unit is divided into an odd number of encoding units. Since the contents of such restrictions or predetermined positions, etc. have been described above through various embodiments, a detailed description thereof will be omitted.

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

[0175] Referring to FIG. 9, the image decoding device (100) can divide the first encoding unit (900) having a square shape and the first encoding unit (930 or 950) having a non-square shape into encoding units of various shapes.

[0176] FIG. 10 illustrates that, according to one embodiment, a video decoding device (100) limits the shapes into which a second encoding unit can be divided when a non-square shape of a second encoding unit determined by splitting a first encoding unit (1000) satisfies a predetermined condition.

[0177] According to one embodiment, the image decoding device (100) may determine to split a first coding unit (1000) having a square shape into second coding units (1010a, 1010b, 1020a, 1020b) having a non-square shape based on the split shape mode information acquired through the bitstream acquisition unit (110). The second coding units (1010a, 1010b, 1020a, 1020b) may be split independently. Accordingly, the image decoding device (100) may determine to split or not split into a plurality of coding units based on the split shape mode information related to each of the second coding units (1010a, 1010b, 1020a, 1020b). According to one embodiment, the image decoding device (100) may determine third encoding units (1012a, 1012b) by horizontally dividing the left second encoding unit (1010a) having a non-square shape determined by vertically dividing the first encoding unit (1000). 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 from being horizontally divided in the same direction as the direction in which the left second encoding unit (1010a) is divided. If the second encoding unit on the right (1010b) is split in the same direction to determine the third encoding unit (1014a, 1014b), the second encoding unit on the left (1010a) and the second encoding unit on the right (1010b) may be independently split 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) splitting the first encoding unit (1000) into four square-shaped second encoding units (1030a, 1030b, 1030c, 1030d) based on the split shape mode information, which may be inefficient in terms of image decoding.

[0178] According to one embodiment, the image decoding device (100) may determine third coding units (1022a, 1022b, 1024a, 1024b) by vertically dividing a second coding unit (1020a or 1020b) having a non-square shape determined by dividing a first coding unit (1000) in a horizontal direction. However, when the image decoding device (100) vertically divides one of the second coding units (e.g., the upper second coding unit (1020a)), the other second coding units (e.g., the lower coding unit (1020b)) may be restricted from being vertically divided in the same direction as the direction in which the upper second coding unit (1020a) is divided, for the reasons described above.

[0179] FIG. 11 illustrates a process in which an image decoding device (100) divides a square-shaped encoding unit when the split shape mode information cannot indicate that the encoding unit is divided into four square-shaped encoding units according to one embodiment.

[0180] According to one embodiment, the image decoding device (100) may split the first encoding unit (1100) based on the split shape mode information to determine the second encoding units (1110a, 1110b, 1120a, 1120b, etc.). The split shape mode information may include information about various shapes into which the encoding unit may be split, but the information about various shapes may not include information for splitting the encoding unit into four encoding units having a square shape. According to this split shape mode information, the image decoding device (100) cannot split the first encoding unit (1100) having a square shape into four second encoding units having a square shape (1130a, 1130b, 1130c, 1130d). Based on the segmentation shape mode information, the image decoding device (100) can determine a second encoding unit (1110a, 1110b, 1120a, 1120b, etc.) of a non-square shape.

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

[0182] For example, the image decoding device (100) can determine third coding units (1112a, 1112b) having a square shape by splitting the left second coding unit (1110a) in the horizontal direction, and can determine third coding units (1114a, 1114b) having a square shape by splitting the right second coding unit (1110b) in the horizontal direction. Furthermore, the image decoding device (100) can also determine third coding units (1116a, 1116b, 1116c, 1116d) having a square shape by splitting both the left second coding unit (1110a) and the right second coding unit (1110b) in the 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).

[0183] As another example, the image decoding device (100) may determine third coding units (1122a, 1122b) having a square shape by vertically splitting the upper second coding unit (1120a), and may determine third coding units (1124a, 1124b) having a square shape by vertically splitting the lower second coding unit (1120b). Furthermore, the image decoding device (100) may determine third coding units (1126a, 1126b, 1126a, 1126b) having a square shape by vertically splitting both the upper second coding unit (1120a) and the lower second coding unit (1120b). In this case, the encoding unit can be determined in the same form as the first encoding unit (1100) being divided into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d).

[0184] FIG. 12 illustrates that, according to one embodiment, the processing order between multiple encoding units may vary depending on the process of dividing the encoding units.

[0185] According to one embodiment, the image decoding device (100) may split the first encoding unit (1200) based on the split shape mode information. If the block shape is square and the split shape mode information indicates that the first encoding unit (1200) is split in at least one of the horizontal direction and the vertical direction, the image decoding device (100) may split the first encoding unit (1200) to determine second encoding units (e.g., 1210a, 1210b, 1220a, 1220b, etc.). Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) having a non-square shape determined by splitting the first encoding unit 1200 only in the horizontal direction or the vertical direction may be independently split based on the split shape mode information for each. For example, the image decoding device (100) can determine third encoding units (1216a, 1216b, 1216c, 1216d) by horizontally dividing second encoding units (1210a, 1210b) generated by vertically dividing the first encoding unit (1200), and can determine third encoding units (1226a, 1226b, 1226c, 1226d) by vertically dividing second encoding units (1220a, 1220b) generated by horizontally dividing the first encoding unit (1200). Since the process of dividing the second encoding units (1210a, 1210b, 1220a, 1220b) has been described above with reference to FIG. 11, a detailed description thereof will be omitted.

[0186] According to one embodiment, the image decoding device (100) can process encoding units according to a predetermined order. Since the characteristics of processing encoding units according to a predetermined order have been described above with reference to FIG. 7, a detailed description thereof will be omitted. Referring to FIG. 12, the image decoding device (100) can divide a first encoding unit (1200) having a square shape and determine four third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) having a square shape. According to one embodiment, the image decoding device (100) can determine the processing order of the third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) depending on the form in which the first encoding unit (1200) is divided.

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

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

[0189] Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) can be divided into third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) having a square shape. The second encoding units (1210a, 1210b) determined by being split in the vertical direction and the second encoding units (1220a, 1220b) determined by being split in the horizontal direction are split into different shapes, but according to the third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) determined later, the first encoding unit (1200) is ultimately split into encoding units of the same shape. Accordingly, even if the image decoding device (100) determines encoding units of the same shape as a result by recursively splitting the encoding units through different processes based on the split shape mode information, it can process a plurality of encoding units determined in the same shape in different orders.

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

[0191] According to one embodiment, the image decoding device (100) may determine the depth of an encoding unit according to a predetermined criterion. For example, the predetermined criterion may be the length of a long side of the encoding unit. If the length of the long side of the current encoding unit is split to be 2n (n>0) times the length of the long side of the encoding unit before splitting, the image decoding device (100) may determine that the depth of the current encoding unit is increased by n compared to the depth of the encoding unit before splitting. Hereinafter, an encoding unit with an increased depth is expressed as an encoding unit of a lower depth.

[0192] Referring to FIG. 13, according to one embodiment, based on block shape information indicating a square shape (for example, the block shape information may indicate '0: SQUARE'), the image decoding device (100) may divide a first coding unit (1300) having a square shape to determine a second coding unit (1302), a third coding unit (1304), etc. of a lower depth. If the size of the first coding unit (1300) having a square shape is 2Nx2N, the second coding unit (1302) determined by dividing the width and height of the first coding unit (1300) by half may have a size of NxN. Furthermore, the third coding unit (1304) determined by dividing the width and height of the second coding 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 of 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 of 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 of the width and height of the first encoding unit (1300), may be D+2.

[0193] In one embodiment, based on block shape information indicating a non-square shape (for example, the block shape information may indicate '1: NS_VER' indicating a non-square shape in which the height is longer than the width or '2: NS_HOR' indicating a non-square shape in which the width is longer than the height), the image decoding device (100) may split a first coding unit (1310 or 1320) having a non-square shape to determine a second coding unit (1312 or 1322), a third coding unit (1314 or 1324) of a lower depth, etc.

[0194] The image decoding device (100) can determine a second encoding unit (e.g., 1302, 1312, 1322, etc.) by splitting at least one of the width and height of the first encoding unit (1310) having a size of Nx2N. That is, the image decoding device (100) can split the first encoding unit (1310) in the horizontal direction to determine a second encoding unit (1302) having a size of NxN or a second encoding unit (1322) having a size of NxN / 2, and can also split the first encoding unit (1310) in the horizontal direction and the vertical direction to determine a second encoding unit (1312) having a size of N / 2xN.

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

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

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

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

[0199] According to one embodiment, the image decoding device (100) may split a square-shaped encoding unit (e.g., 1300, 1302, 1304) in a horizontal direction or a vertical direction. For example, a first encoding unit (1300) having a size of 2Nx2N may be split in the vertical direction to determine a first encoding unit (1310) having a size of Nx2N, or may be split in the horizontal direction to determine a first encoding unit (1320) having a size of 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 splitting the first encoding unit (1300) having a size of 2Nx2N in the horizontal direction or the vertical direction may be the same as the depth of the first encoding unit (1300).

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

[0201] FIG. 14 illustrates an index (part index, hereinafter referred to as PID) for depth and encoding unit distinction that can be determined according to the shape and size of encoding units according to one embodiment.

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

[0203] According to one embodiment, the depth of the second coding units (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) determined according to the split shape mode information for the first coding unit (1400) having a square shape may be determined based on the length of the long side. For example, since the length of one side of the first coding unit (1400) having a square shape and the length of the long side of the second coding unit (1402a, 1402b, 1404a, 1404b) having a non-square shape are the same, the depth of the first coding unit (1400) and the second coding units (1402a, 1402b, 1404a, 1404b) having a non-square shape may be considered to be the same as D. In contrast, when the image decoding device (100) divides the first encoding unit (1400) into four square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) based on the split shape mode information, 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), so the depth of the second encoding units (1406a, 1406b, 1406c, 1406d) may be a depth of D+1, which is one depth lower than D, the depth of the first encoding unit (1400).

[0204] According to one embodiment, the image decoding device (100) may split a first encoding unit (1410) having a height greater than its width into a plurality of second encoding units (1412a, 1412b, 1414a, 1414b, 1414c) in a horizontal direction according to the splitting shape mode information. According to one embodiment, the image decoding device (100) may split a first encoding unit (1420) having a width greater than its height into a plurality of second encoding units (1422a, 1422b, 1424a, 1424b, 1424c) in a vertical direction according to the splitting shape mode information.

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

[0206] Furthermore, the image decoding device (100) can split a non-square first encoding unit (1410) into an odd number of second encoding units (1414a, 1414b, 1414c) based on the split shape mode information. The odd number of second encoding units (1414a, 1414b, 1414c) can include non-square second encoding units (1414a, 1414c) and square second encoding units (1414b). In this case, since the length of the long side of the second encoding unit (1414a, 1414c) of a non-square shape and the length of one side of the second encoding unit (1414b) of a square shape 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 D, which is the depth of the first encoding unit (1410). The image decoding device (100) may determine the depth of the encoding units associated with the first encoding unit (1420) of a non-square shape, in which the width is longer than the height, in a manner corresponding to the above method of determining the depth of the encoding units associated with the first encoding unit (1410).

[0207] According to one embodiment, when determining an index (PID) for distinguishing divided coding units, the image decoding device (100) may determine the index based on a size ratio between the coding units when the coding units divided into an odd number are not of the same size. Referring to FIG. 14, among the coding units (1414a, 1414b, 1414c) divided into an odd number, the coding unit (1414b) located in the middle may have the same width as the other coding units (1414a, 1414c) but may have a height that is twice the height of the coding units (1414a, 1414c) that are different in height. That is, in this case, the coding unit (1414b) located in the middle may include two of the other coding units (1414a, 1414c). Accordingly, if the index (PID) of the encoding unit (1414b) located in the middle according to the scanning order is 1, the index of the encoding unit (1414c) located in the next order may be 3, which is an increase of 2. In other words, there may be a discontinuity in the index value. 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 the presence or absence of discontinuity in the index for distinguishing between the divided encoding units.

[0208] According to one embodiment, the image decoding device (100) may determine whether the image is divided into a specific split shape based on the value of an index for distinguishing a plurality of coding units that are divided from the current coding unit. Referring to FIG. 14, the image decoding device (100) may divide a first coding unit (1410) having a rectangular shape in which the height is longer than the width, to determine an even number of coding units (1412a, 1412b) or an odd number of coding units (1414a, 1414b, 1414c). The image decoding device (100) may use an index (PID) indicating each coding unit to distinguish each of the plurality of coding units. According to one embodiment, the PID may be obtained from a sample (for example, an upper left sample) at a predetermined position of each coding unit.

[0209] According to one embodiment, the image decoding device (100) may determine an coding unit at a predetermined position among the coding units that are divided and determined using an index for distinguishing the coding units. According to one embodiment, when the split shape mode information for the first coding unit (1410) having a rectangular shape with a height longer than the width indicates that the first coding unit (1410) is divided into three coding units, the image decoding device (100) may divide the first coding unit (1410) into three coding units (1414a, 1414b, 1414c). The image decoding device (100) may assign an index to each of the three coding units (1414a, 1414b, 1414c). The image decoding device (100) may compare the indexes for each coding unit to determine the middle coding unit among the coding units divided into an odd number of coding units. The image decoding device (100) may determine a coding unit (1414b) having an index corresponding to a middle value among the indices of the coding units as a coding unit at a middle position among the coding units determined by splitting the first coding unit (1410). According to an embodiment, when determining an index for distinguishing the split coding units, the image decoding device (100) may determine the index based on a size ratio between the coding units when the coding units do not have the same size. Referring to FIG. 14, the coding unit (1414b) generated by splitting the first coding unit (1410) may have the same width as other coding units (1414a, 1414c) but may be twice the height of the coding units (1414a, 1414c) that are different in height. In this case, if the index (PID) of the encoding unit (1414b) located in the middle is 1, the index of the encoding unit (1414c) located in the next order may be 3, which is an increase of 2.In cases like this where the index increases uniformly and then the increase amount changes, 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. According to one embodiment, when the split shape 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 into a form in which an encoding unit at a predetermined position among the odd number of encoding units (for example, a middle encoding unit) has a different size from the other encoding units. In this case, the image decoding device (100) may determine a middle encoding unit having a different size using an index (PID) for the encoding unit. However, the above-described index, the size or position of the encoding unit at the predetermined position to be determined are specific for explaining one embodiment and should not be interpreted as being limited thereto, and it should be interpreted that various indexes, positions and sizes of encoding units can be used.

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

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

[0212] According to one embodiment, a predetermined data unit may be defined as a data unit from which a coding unit begins to be recursively split using split shape mode information. That is, it may correspond to a coding unit of the highest depth used in the process of determining multiple coding units for splitting the current picture. For convenience of explanation, this predetermined data unit will be referred to as a reference data unit hereinafter.

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

[0214] According to one embodiment, the video decoding device (100) can divide the current picture into a plurality of reference data units. According to one embodiment, the video decoding device (100) can divide the plurality of reference data units into which the current picture is divided using division type mode information for each reference data unit. This division process of the reference data units can correspond to a division process using a quad-tree structure.

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

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

[0217] According to one embodiment, the bitstream acquisition unit (110) of the image decoding device (100) can acquire at least one of information on the shape of the reference coding unit and information on the size of the reference coding unit from the bitstream for each of the various data units. The process of determining at least one coding unit included in the square-shaped reference coding unit (1500) has been described above through the process of splitting the current coding unit (300) of FIG. 3, and the process of determining at least one coding unit included in the non-square-shaped reference coding unit (1502) has been described above through the process of splitting the current coding unit (400 or 450) of FIG. 4, so a detailed description thereof will be omitted.

[0218] According to one embodiment, the image decoding device (100) may use an index for identifying the size and shape of the reference coding unit to determine the size and shape of the reference coding unit according to some 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 the reference coding unit for each slice, slice segment, tile, tile group, maximum coding unit, etc., among the various data units (e.g., sequences, pictures, slices, slice segments, tiles, tile groups, maximum coding units, etc.) that satisfy a predetermined condition (e.g., data units having a size smaller than a slice) from the bitstream. The image decoding device (100) may determine the size and shape of the reference data unit for each data unit that satisfies the predetermined condition by using the index. When information about the shape of the reference coding unit and information about the size of the reference coding unit are obtained from the bitstream for each relatively small-sized data unit and used, the efficiency of the bitstream may not be good. Therefore, instead of directly obtaining information about the shape of the reference coding unit and information about the size of the reference coding unit, only the index may be obtained and used. In this case, at least one of the size and shape of the reference coding unit corresponding to the index indicating the size and shape of the reference coding unit may be determined in advance. That is, the image decoding device (100) can determine at least one of the size and shape of the reference coding unit included in the data unit that serves as the basis for obtaining the index by selecting at least one of the sizes and shapes of the predetermined reference coding units according to the index.

[0219] According to one embodiment, the image decoding device (100) may use at least one reference coding unit included in one maximum coding unit. That is, a maximum coding unit for dividing an image may include at least one reference coding unit, and a coding unit may be determined through a recursive splitting process of each reference coding unit. According to one embodiment, at least one of the width and the height of the maximum coding unit may correspond to an integer multiple of at least one of the width and the height of the reference coding unit. According to one embodiment, the size of the reference coding unit may be a size obtained by splitting the maximum coding unit n times according to a quad tree structure. That is, the image decoding device (100) may split the maximum coding unit n times according to the quad tree structure to determine the reference coding unit, and may split the reference coding unit based on at least one of block shape information and split shape mode information according to various embodiments.

[0220] According to one embodiment, the video decoding device (100) may obtain and use block shape information indicating the shape of the current encoding unit or split shape mode information indicating a method of splitting the current encoding unit from the bitstream. The split shape mode information may be included in a bitstream related to various data units. For example, the video decoding device (100) may use split shape 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 video decoding device (100) may obtain and use a syntax element corresponding to block shape information or split shape mode information from the bitstream for each maximum encoding unit and each reference encoding unit.

[0221] Hereinafter, a method for determining a partitioning rule according to one embodiment of the present disclosure will be described in detail.

[0222] The video decoding device (100) can determine a segmentation rule of the video. The segmentation rule may be predetermined between the video decoding device (100) and the video encoding device (200). The video decoding device (100) can determine the segmentation rule of the video based on information obtained from a bitstream. The video 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 video decoding device (100) can determine the segmentation rule differently according to a frame, a slice, a tile, a temporal layer, a maximum coding unit, or an coding unit.

[0223] The image decoding device (100) can determine a segmentation rule based on the block shape of the encoding unit. The block shape can include the size, shape, width and height ratio, and direction of the encoding unit. The image encoding device (200) and the image decoding device (100) can determine in advance that the segmentation rule will be determined based on the block shape of the encoding unit. However, the present invention is not limited thereto. The image decoding device (100) can determine the segmentation rule based on information obtained from the bitstream received from the image encoding device (200).

[0224] The shape of the encoding unit may include a square and a non-square. If the width and height of the encoding unit are equal, the image decoding device (100) may determine the shape of the encoding unit as a square. In addition, if the width and height of the encoding unit are not equal, the image decoding device (100) may determine the shape of the encoding unit as a non-square.

[0225] The size of the coding unit may include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ..., 256x256. The size of the coding unit may be classified according to the length of the long side, the length of the short side, or the area of ​​the coding unit. The image decoding device (100) may apply the same splitting rule to the coding units classified into the same group. For example, the image decoding device (100) may classify the coding units having the same long side length into the same size. In addition, the image decoding device (100) may apply the same splitting rule to the coding units having the same long side length.

[0226] The ratio of the width to the height of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, or 1:32, etc. In addition, the direction of the coding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate a case where the length of the width of the coding unit is longer than the length of the height. The vertical direction may indicate a case where the length of the width of the coding unit is shorter than the length of the height.

[0227] The image decoding device (100) can adaptively determine a splitting rule based on the size of the encoding unit. The image decoding device (100) can determine a different allowable splitting mode based on the size of the encoding unit. For example, the image decoding device (100) can determine whether splitting is allowed based on the size of the encoding unit. The image decoding device (100) can determine a splitting direction based on the size of the encoding unit. The image decoding device (100) can determine an allowable splitting type based on the size of the encoding unit.

[0228] Determining the splitting rule based on the size of the encoding unit may be a splitting rule predetermined between the image encoding device (200) and the image decoding device (100). In addition, the image decoding device (100) may determine the splitting rule based on information obtained from the bitstream.

[0229] The image decoding device (100) can adaptively determine a segmentation rule based on the position of the encoding unit. The image decoding device (100) can adaptively determine a segmentation rule based on the position that the encoding unit occupies in the image.

[0230] Additionally, the image decoding device (100) can determine a splitting rule so that encoding units generated through different splitting paths do not have the same block shape. However, this is not limited thereto, and encoding units generated through different splitting paths may have the same block shape. Encoding units generated through different splitting paths may have different decoding processing orders. Since the decoding processing order has been described together with FIG. 12, a detailed description thereof will be omitted.

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

[0232] Referring to FIG. 16, the image decoding device (100) can determine a different combination of partitioning shapes into which encoding units can be partitioned for each picture. For example, the image decoding device (100) can decode an image using a picture (1600) that can be partitioned into four encoding units, a picture (1610) that can be partitioned into two or four encoding units, and a picture (1620) that can be partitioned into two, three, or four encoding units, among at least one picture included in the image. The image decoding device (100) can only use partitioning shape information indicating that the picture (1600) is partitioned into four square encoding units to partition the picture (1600) into a plurality of encoding units. The image decoding device (100) can only use partitioning shape information indicating that the picture (1610) is partitioned into two or four encoding units to partition the picture. The video decoding device (100) can only use the segmentation type information indicating that the picture (1620) is segmented into two, three, or four encoding units. The above-described combination of segmentation types is merely an example for explaining the operation of the video decoding device (100), and therefore the above-described combination of segmentation types should not be interpreted as being limited to the above-described example, but should be interpreted as being capable of using various combinations of segmentation types for each predetermined data unit.

[0233] According to one embodiment, the bitstream acquisition unit (110) of the image decoding device (100) can acquire a bitstream including an index indicating a combination of segmentation type information for each predetermined data unit (e.g., sequence, picture, slice, slice segment, tile, tile group, etc.). For example, the bitstream acquisition unit (110) can acquire an index indicating a combination of segmentation type 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) can determine a combination of segmentation types by which an encoding unit can be divided for each predetermined data unit using the acquired index, and thus can use different combinations of segmentation types for each predetermined data unit.

[0234] FIG. 17 illustrates various forms of encoding units that can be determined based on segmentation mode information that can be expressed in binary code according to one embodiment.

[0235] According to one embodiment, the image decoding device (100) can split an encoding unit into various shapes using block shape information and split shape mode information acquired through the bitstream acquisition unit (110). The shapes of the encoding unit that can be split may correspond to various shapes including the shapes described through the above-described embodiments.

[0236] Referring to FIG. 17, the image decoding device (100) can split a square-shaped encoding unit in at least one of the horizontal direction and the vertical direction based on the split shape mode information, and can split a non-square-shaped encoding unit in the horizontal direction or the vertical direction.

[0237] According to one embodiment, when the image decoding device (100) can divide a square-shaped encoding unit into four square encoding units by horizontally and vertically splitting the encoding unit, there may be four types of splitting modes that the splitting mode information for the square encoding unit can indicate. According to one embodiment, the splitting mode information may be expressed as a two-digit binary code, and a binary code may be assigned to each splitting mode. For example, when the encoding unit is not split, the splitting mode information may be expressed as (00)b, when the encoding unit is split in the horizontal direction and the vertical direction, the splitting mode information may be expressed as (01)b, when the encoding unit is split in the horizontal direction, the splitting mode information may be expressed as (10)b, and when the encoding unit is split in the vertical direction, the splitting mode information may be expressed as (11)b.

[0238] According to one embodiment, when the image decoding device (100) splits a non-square coding unit in a horizontal direction or a vertical direction, the type of split shape that the split shape mode information can indicate may be determined depending on the number of coding units into which the coding unit is split. Referring to FIG. 17, the image decoding device (100) may split a non-square coding unit into up to three according to one embodiment. The image decoding device (100) may split the coding unit into two coding units, in which case the split shape mode information may be expressed as (10)b. The image decoding device (100) may split the coding unit into three coding units, in which case the split shape mode information may be expressed as (11)b. The image decoding device (100) may determine not to split the coding unit, in which case the split shape 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 a binary code representing segmentation mode information.

[0239] According to one embodiment, referring to FIG. 17, the binary code of the partition shape mode information indicating that the coding unit is not split may be expressed as (0)b. If the binary code of the partition shape mode information indicating that the coding unit is not split is set to (00)b, all binary codes of the 2-bit partition shape mode information must be used even if there is no partition shape mode information set to (01)b. However, as illustrated in FIG. 17, if three partition shapes for a non-square coding unit are used, the image decoding device (100) can determine that the coding unit is not split even if it uses a 1-bit binary code (0)b as the partition shape mode information, and thus can efficiently use the bitstream. However, the partition shapes of the non-square coding unit indicated by the partition shape mode information should not be interpreted as being limited to only the three shapes illustrated in FIG. 17, but should be interpreted as various shapes including the above-described embodiments.

[0240] FIG. 18 illustrates another form of a coding unit that can be determined based on segmentation mode information that can be expressed in binary code according to one embodiment.

[0241] Referring to FIG. 18, the image decoding device (100) can split a square-shaped encoding unit in the horizontal direction or the vertical direction based on the split shape mode information, and can split a non-square-shaped encoding unit in the horizontal direction or the vertical direction. That is, the split shape mode information can indicate that a square-shaped encoding unit is split in one direction. In this case, the binary code of the split shape mode information indicating that a square-shaped encoding unit is not split can be expressed as (0)b. If the binary code of the split shape mode information indicating that the encoding unit is not split is set to (00)b, all binary codes of the 2-bit split shape mode information must be used even though there is no split shape mode information set to (01)b. However, as illustrated in FIG. 18, if three types of 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 it uses a 1-bit binary code (0)b as the division form mode information, and thus can efficiently use the bitstream. However, the division forms of the square-shaped encoding unit indicated by the division form mode information should not be interpreted as being limited to only the three types illustrated in FIG. 18, but should be interpreted as various types including the embodiments described above.

[0242] In one embodiment, block shape information or segmentation shape mode information may be expressed using binary code, and such information may be directly generated as a bitstream. Furthermore, block shape information or segmentation shape mode information that may be expressed using binary code may not be directly generated as a bitstream, but may instead be used as a binary code input into CABAC (context adaptive binary arithmetic coding).

[0243] According to one embodiment, the image decoding device (100) describes a process of obtaining syntax for block shape information or segmentation shape mode information through CABAC. A bitstream including a binary code for the syntax can be obtained through a bitstream obtaining unit (110). The image decoding device (100) can detect a syntax element indicating block shape information or segmentation shape mode information by de-binarizing a bin string included in the obtained bitstream. According to one embodiment, the image decoding device (100) can obtain a set of binary bin strings corresponding to syntax elements to be decoded, and decode each bin using probability information, and the image decoding device (100) can repeat the process until a bin string composed of the decoded bins becomes equal to one of the previously obtained bin strings. The image decoding device (100) can determine syntax elements by performing inverse binarization of an empty string.

[0244] According to one embodiment, the image decoding device (100) may perform a decoding process of adaptive binary arithmetic coding to determine a syntax for a bin string, and the image decoding device (100) may update a probability model for bins acquired through the bitstream acquisition unit (110). Referring to FIG. 17, the bitstream acquisition unit (110) of the image decoding device (100) may acquire a bitstream representing a binary code representing segmentation mode information according to one embodiment. Using the acquired binary code having a size of 1 or 2 bits, the image decoding device (100) may determine a syntax for the segmentation mode information. In order to determine the syntax for the segmentation mode information, the image decoding device (100) may update a 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 among the 2-bit binary codes is 0 or 1.

[0245] According to one embodiment, the image decoding device (100) may, in the process of determining the syntax, update the probability for the bins used in the process of decoding the bins of the empty string for the syntax, and the image decoding device (100) may determine that certain bits among the empty strings have the same probability without updating the probability.

[0246] Referring to FIG. 17, in the process of determining a syntax using an empty string indicating split shape mode information for a non-square coding unit, the image decoding device (100) may determine the syntax for the split shape mode information using one bin having a value of 0 when the non-square coding unit is not split. That is, when the block shape information indicates that the current coding unit is a non-square shape, the first bin of the empty string for the split shape mode information may be 0 when the non-square coding unit is not split, and may be 1 when it is split into 2 or 3 coding units. Accordingly, the probability that the first bin of the empty string of the split shape mode information for the non-square coding unit is 0 may be 1 / 3, and the probability that it is 1 may be 2 / 3. As described above, the image decoding device (100) can only express a 1-bit empty string having a value of 0 for the partition shape mode information indicating that a non-square-shaped encoding unit is not partitioned, so the image decoding device (100) can determine the syntax for the partition shape mode information by determining whether the second bin is 0 or 1 only when the first bin of the partition shape mode information is 1. According to one embodiment, the image decoding device (100) can decode the bin by considering that the probability that the second bin is 0 or 1 when the first bin for the partition shape mode information is 1 is the same probability.

[0247] According to one embodiment, the image decoding device (100) may use various probabilities for each bin in the process of determining a bin of a bin string for the partition shape mode information. According to one embodiment, the image decoding device (100) may determine the probability of a bin for the partition shape mode information differently depending on the direction of a non-square block. According to one embodiment, the image decoding device (100) may determine the probability of a bin for the partition shape mode information differently depending on the area 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 a bin for the partition shape mode information differently depending on at least one of the shape and the length of the long side of the current encoding unit.

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

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

[0250] Figure 19 is a block diagram of an image encoding and decoding system that performs loop filtering.

[0251] The encoding unit (1910) of the image encoding and decoding system (1900) transmits an encoded bitstream of an image, and the decoding unit (1950) receives the bitstream and decodes it to output a restored image. Here, the encoding unit (1910) may have a configuration similar to that of the image encoding device (200) described below, and the decoding unit (1950) may have a configuration similar to that of the image decoding device (100).

[0252] 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 are 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 of the next input image through the prediction encoding unit (1915).

[0253] The encoded image data among the bitstreams received by the decoding unit (1950) is restored to residual data in the spatial domain through the entropy decoding unit (1955) and the inverse quantization and inverse transformation unit (1960). The prediction data and residual data output from the prediction decoding unit (1975) are combined to form image data in the spatial domain, and the deblocking filtering unit (1965) and the loop filtering unit (1970) can perform filtering on the image data in the spatial domain 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).

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

[0255] The various embodiments described above describe operations related to the image decoding method performed by the image decoding device (100). Hereinafter, the operations of the image encoding device (200), which performs the image encoding method corresponding to the reverse process of the image decoding method, will be described through various embodiments.

[0256] 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 segmentation shape mode information according to one embodiment.

[0257] 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 image and encode the input image. The encoding unit (220) may encode the input image 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 a shape, a direction, a ratio of width and height, or a size of an encoding unit.

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

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

[0260] According to one embodiment, the encoding unit (220) can determine the shape into which the encoding unit is to be split. The encoding unit (220) can determine the shape of at least one encoding unit included in the encoding unit, and the bitstream generation unit (210) can generate a bitstream including split shape mode information including information about the shape of such encoding unit.

[0261] According to one embodiment, the encoder (220) may determine whether the encoding unit is split or not. If the encoder (220) determines that the encoding unit includes only one encoding unit or that the encoding unit is not split, the bitstream generation unit (210) may generate a bitstream including split shape mode information indicating that the encoding unit is not split. In addition, the encoder (220) may split the encoding unit into a plurality of encoding units, and the bitstream generation unit (210) may generate a bitstream including split shape mode information indicating that the encoding unit is split into a plurality of encoding units.

[0262] According to one embodiment, information indicating the number of encoding units to be split into or the direction in which the encoding unit is to be split may be included in the splitting mode information. For example, the splitting mode information may indicate splitting in at least one of the vertical and horizontal directions, or may indicate no splitting.

[0263] The video encoding device (200) determines information about the segmentation shape mode based on the segmentation shape mode of the encoding unit. The video encoding device (200) determines a context model based on at least one of the shape, direction, width, and height ratio or size of the encoding unit. Then, the video encoding device (200) generates information about the segmentation shape mode for segmenting the encoding unit based on the context model as a bitstream.

[0264] In order to determine a context model, the video encoding device (200) may obtain an array for matching at least one of the shape, direction, width and height ratio or size of the encoding unit with an index for the context model. The video encoding device (200) may obtain an index for the context model based on at least one of the shape, direction, width and height ratio or size of the encoding unit in the array. The video encoding device (200) may determine the context model based on the index for the context model.

[0265] The video encoding device (200) may further determine the context model based on block shape information including at least one of the shape, direction, width, and height ratio or size of a neighboring encoding unit adjacent to the encoding unit, in order to determine the context model. In addition, the neighboring encoding unit may include at least one of encoding units located on the lower left, left, upper left, upper right, right, or lower right of the encoding unit.

[0266] In addition, the video encoding device (200) may compare the length of the width of the upper peripheral encoding unit with the length of the width of the encoding unit to determine the context model. In addition, the video encoding device (200) may compare the length of the height of the left and right peripheral encoding units with the length of the height of the encoding unit. In addition, the video encoding device (200) may determine the context model based on the comparison results.

[0267] Since the operation of the video encoding device (200) includes similar contents to the operation of the video decoding device (100) described in FIGS. 3 to 19, a detailed description is omitted.

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

[0269] Referring to FIG. 20, the image decoding device (2000) may include a context modeler (2010), an arithmetic decoding unit (2030), and a restoration unit (2070).

[0270] According to one embodiment, the context modeler (2010), the arithmetic decryption unit (2030), and the restoration unit (2070) may be implemented with at least one processor. In one embodiment, the context modeler (2010), the arithmetic decryption unit (2030), and the restoration unit (2070) may operate according to at least one instruction stored in at least one memory.

[0271] The image decoding device (2000) may include at least one memory for storing input / output data of the context modeler (2010), the arithmetic decoding unit (2030), and the restoration unit (2070). In addition, the image decoding device (2000) may include a memory control unit for controlling data input / output of at least one memory.

[0272] In one embodiment, the context modeler (2010) and the arithmetic decoding unit (2030) may correspond to the entropy decoding unit (1955) illustrated in FIG. 19, and the restoration unit (2070) may correspond to the inverse quantization and inverse transformation unit (1960) and the prediction decoding unit (1975) illustrated in FIG. 19.

[0273] In one embodiment, a device including a context modeler (2010) and an arithmetic decryption unit (2030) may be referred to as an entropy decryption device (2050).

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

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

[0276] In one embodiment, the image 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, and the like.

[0277] In one embodiment, the bits contained in the bitstream may correspond to the result of entropy encoding empty strings corresponding to syntax elements. The syntax elements may be generated through encoding of the image.

[0278] In one embodiment, the context modeler (2010) may determine a probability value of each context of syntax elements to reconstruct bins from bits included in a bitstream. Each syntax element may have one or more contexts. Here, the probability value may mean the probability of occurrence of a specific bin (e.g., 0 or 1). In one embodiment, the probability value may represent the probability value of a least probable symbol (LPS) with a lower probability of occurrence among 0 and 1.

[0279] In one embodiment, the context modeler (2010) may determine an initial probability value of each context of a syntax element if the syntax element currently being restored satisfies a predetermined condition, for example, if the syntax element currently being restored is the first syntax element of an independent slice segment. The process of determining the initial probability value of each context may be referred to as context initialization. The initial probability value of each context may be updated during the restoration process of the bin.

[0280] In one embodiment, the context modeler (2010) may obtain information (e.g., ctxIdx) indicating a specific context by using the type of the syntax element that is currently the target of restoration, the location information of the bin within the bin string, and surrounding block information. Based on the obtained information (e.g., ctxIdx), the context modeler (2010) may determine the probability value of a specific context among the context-specific probability values ​​of the syntax element that is currently the target of restoration.

[0281] In one embodiment, when the probability value of a bin is determined by the context modeler (2010), the arithmetic decoding unit (2030) can obtain an empty string corresponding to a syntax element from the bits included in the bitstream based on the probability value of the bin. In one embodiment, the empty string can be converted into a syntax element through a reverse binarization process.

[0282] Whenever a bin is restored by the arithmetic decoding unit (2030), the context modeler (2010) updates the probability value of the bin, and the arithmetic decoding unit (2030) can restore the bin using the updated probability value of the bin.

[0283] In one embodiment, the arithmetic decryption unit (2030) can restore the empty string by repeating the process of dividing a predetermined integer range according to the probability value of the bin.

[0284] In one embodiment, the restoration unit (2070) can restore the image using syntax elements obtained through a reverse binarization process for the empty string when the empty string is restored by the entropy decoding device (2050).

[0285] Below, the arithmetic encoding process and the arithmetic decoding process are described with reference to FIGS. 21 and 22.

[0286] FIG. 21 is a diagram for explaining an arithmetic encoding process according to one embodiment.

[0287] To arithmetic encode the binary sequence of 01111 (empty string), the initial probability value p(0) of 0 can be set to 0.25, and the initial probability value p(1) of 1 can be set to 0.75.

[0288] In Fig. 21, C(0) is the accumulated value of the number of occurrences of 0, and C(1) is the accumulated value of the number of occurrences of 1. C(0) can be 1, and C(1) can be 3. p(0) can be obtained by dividing C(0) by the sum of C(0) and C(1), and p(1) can be obtained by dividing C(1) by the sum of C(0) and C(1).

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

[0290] Since the initial blank 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 p(0) of 0 can be updated to 0.4, and the probability value p(1) of 1 can be updated to 0.6.

[0291] The range of 0 to 0.25 can be divided into the range of 0 to 0.1 and the range of 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 next blank value to be encoded is 1, the range of 0.1 to 0.25 is selected, and since the value of C(1) has been changed to 4, the probability value p(0) of 0 can be updated to 2 / 6, and the probability value p(1) of 1 can be updated to 4 / 6.

[0292] 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 of 2 / 6 and the probability value of 1 of 4 / 6. Since the next blank value to be encoded is 1, the range of 0.15 to 0.25 is selected, and since the value of C(1) has been changed to 5, the probability value p(0) of 0 can be updated to 2 / 7, and the probability value p(1) of 1 can be updated to 5 / 7.

[0293] 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 of 2 / 7 and the probability value of 1 of 5 / 7. Since the next blank value to be encoded is 1, the range of 0.1786 to 0.25 is selected, and since the value of C(1) has been changed to 6, the probability value p(0) of 0 can be updated to 2 / 8, and the probability value p(1) of 1 can be changed to 6 / 8.

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

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

[0296] Figure 22 is a diagram for explaining an arithmetic decryption process according to one embodiment.

[0297] The arithmetic decoding process illustrated in Fig. 22 may correspond to the reverse process of the arithmetic encoding process described with reference to Fig. 21.

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

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

[0300] Since the values ​​within the range of 0.19645 to 0.25 represented by the bits (001111) of the bitstream are included in the range of 0 to 0.25, the range of 0 to 0.25 is selected, and the bin of 0 can be restored accordingly.

[0301] As 0 is restored, the value of C(0) can be 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.

[0302] The range of 0 to 0.25 can be divided into the range of 0 to 0.1 and the range of 0.1 to 0.25, according to the probability value of 0 being 0.4 and the probability value of 1 being 0.6. Since the values ​​within the range of 0.19645 to 0.25 are included in the range of 0.1 to 0.25, the range of 0.1 to 0.25 is selected, and 1 can be restored accordingly.

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

[0304] 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 being 2 / 6 and the probability value of 1 being 4 / 6. Since the values ​​within the range of 0.19645 to 0.25 are included in the range of 0.15 to 0.25, the range of 0.15 to 0.25 is selected, and 1 can be restored accordingly.

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

[0306] 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 of 2 / 7 and the probability value of 1 of 5 / 7. Since the values ​​within the range of 0.19645 to 0.25 are 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.

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

[0308] The range of 0.1786 to 0.25 can be divided into the range of 0.1786 to 0.19645 and the range of 0.19645 to 0.25, according to the probability value of 0 of 2 / 8 and the probability value of 1 of 6 / 8. Since the value within the range of 0.19645 to 0.25 is included in the range of 0.19645 to 0.25, 1 can be restored accordingly.

[0309] If there are no more empty strings to restore, an empty string of 01111 can be output as the result of arithmetic decryption.

[0310] In general, if the initial probability of a bin is not accurately predicted, the number of bits generated through arithmetic coding increases, which in turn increases the bitrate of the bitstream. Therefore, accurately predicting the probability values ​​of bins used in bin encoding and decoding is crucial from a bitrate perspective. Video standards such as HEVC and VVC also provide tools for accurately predicting bin probability values.

[0311] In one embodiment, the context modeler (2010) may obtain the probability value of the context of the syntax element stored after the entropy decoding of the previous block restored before the current block, for entropy decoding of the current block split from the current upper block. Then, the context modeler (2010) may use the obtained probability value of the context to entropy decode the syntax element for the current block.

[0312] Since the current block and the previous block are spatially adjacent within the current image, similarity in image features may exist. Therefore, by using the probability value of the final updated context, obtained through entropy decoding of the previous block, for the current block, the efficiency of entropy encoding / entropy decoding can be improved.

[0313] In one embodiment, the upper block may include a slice, a tile, or a maximum coding unit split from the image, and the block split from the upper block may include a tile split from the slice, a maximum coding unit split from the slice, a coding unit split from the slice, a maximum coding unit split from the tile, a coding unit split from the tile, or a coding unit split from the maximum coding unit.

[0314] In the following, it is assumed that the upper block is the maximum coding unit and the block split from the upper block is the coding unit.

[0315] In one embodiment, the context modeler (2010) may obtain a probability value of each context of a syntax element stored after entropy decoding for a previous maximum coding unit that was restored before the current maximum coding unit, if the current coding unit corresponds to the first decoding target among at least one coding unit split from the current maximum coding unit. Then, the context modeler (2010) may use the obtained probability value of each context as a probability value of each context of a syntax element for the current coding unit.

[0316] In one embodiment, the context modeler (2010) may obtain a probability value of each context of a syntax element stored after entropy decoding for a previous coding unit restored before the current coding unit among the coding units included in the current maximum coding unit, if the current coding unit does not correspond to the first decoding target among the coding units split from the current maximum coding unit. In addition, the context modeler (2010) may use the obtained probability value of each context as the probability value of each context of the syntax element for the current coding unit.

[0317] Maximum coding units segmented from an image may be reconstructed according to a raster scan order, and at least one coding unit segmented from a maximum coding unit may be reconstructed according to a nested tree order. Accordingly, if a current coding unit corresponds to a first decoding target within a current maximum coding unit, the current coding unit and a previous coding unit may be spatially distant from each other. In other words, since the current coding unit is not adjacent to a previous coding unit, the probability value of a context stored after entropy decoding for the previous coding unit is completed may not be suitable for entropy decoding for the current coding unit.

[0318] The case where the current encoding unit and the previous encoding unit are not adjacent is described with reference to FIGS. 23 and 24.

[0319] FIG. 23 is a diagram for explaining a method for obtaining a probability value of a context used in an entropy decoding process of a previous encoding unit for entropy decoding of a current encoding unit according to one embodiment.

[0320] Referring to FIG. 23, the current image (2300) can be divided into a plurality of maximum coding units including a first maximum coding unit (2310), a second maximum coding unit (2320), a third maximum coding unit (2330), a fourth maximum coding unit (2340), and a current maximum coding unit (2350).

[0321] According to the raster scan order, restoration can proceed in the order of the first maximum coding unit (2310), the second maximum coding unit (2320), the third maximum coding unit (2330), the fourth maximum coding unit (2340), and the current maximum coding unit (2350).

[0322] The fourth maximum coding unit (2340) is divided into multiple coding units, and the multiple coding units can be restored according to a nested tree order. In Fig. 23, the numbers indicated on the coding units within the fourth maximum coding unit (2340) may indicate the restoration order.

[0323] In one embodiment, the context modeler (2010) may store the context-specific probability values ​​of the finally updated syntax elements once entropy decoding for the fifth coding unit within the fourth maximum coding unit (2340) is completed.

[0324] In one embodiment, completion of entropy decoding may mean that restoration of the last syntax element required to restore the encoding unit has been completed.

[0325] In one embodiment, the context modeler (2010) may use the context-specific probability values ​​stored after the entropy decoding for the fifth coding unit within the fourth maximum coding unit (2340) is completed to accurately predict the probability value for the current coding unit. However, as described above, the fifth coding unit within the fourth maximum coding unit (2340) is located at the lower right within the fourth maximum coding unit (2340), and the current coding unit is located at the upper left of the current maximum coding unit (2350). Therefore, the context-specific probability values ​​stored after the entropy decoding for the fifth coding unit within the fourth maximum coding unit (2340) is completed may not be optimized for the current coding unit.

[0326] FIG. 24 is a diagram for explaining a method for obtaining a probability value of a context used in an entropy decoding process of a previous encoding unit for entropy decoding of a current encoding unit according to one embodiment.

[0327] Referring to FIG. 24, the current image (2300) can be divided into a plurality of maximum coding units including a first maximum coding unit (2310), a second maximum coding unit (2320), a third maximum coding unit (2330), and a current maximum coding unit (2350).

[0328] According to the raster scan order, restoration can proceed in the order of the first maximum coding unit (2310), the second maximum coding unit (2320), the third maximum coding unit (2330), and the current maximum coding unit (2350).

[0329] The third maximum coding unit (2330) is included in the same row as the first maximum coding unit (2310) and the second maximum coding unit (2320). Since the third maximum coding unit (2330) is located at the end of the row, the current maximum coding unit (2350), which is the first maximum coding unit of the next row, can be restored after the restoration of the third maximum coding unit (2330).

[0330] In one embodiment, the context modeler (2010) may store the context-specific probability values ​​of the finally updated syntax elements once entropy decoding for the fifth coding unit within the third maximum coding unit (2330) is completed.

[0331] In one embodiment, the context modeler (2010) can use the stored context-specific probability values ​​after entropy decoding for the fifth coding unit within the third maximum coding unit (2330) is completed to restore syntax elements for the current coding unit within the current maximum coding unit (2350).

[0332] As illustrated in FIG. 24, the fifth coding unit within the third maximum coding unit (2330) is located at the lower right of the row containing the third maximum coding unit (2330), and the current coding unit is located at the upper left of the row containing the current maximum coding unit (2350). Therefore, the context-specific probability value for the fifth coding unit within the third maximum coding unit (2330) may not be optimized for the current coding unit.

[0333] In one embodiment, the context modeler (2010) may tune the context-specific probability values ​​stored after entropy decoding for the previous coding unit, based on the context-specific bins of the syntax elements used to restore the previous maximum coding unit or the previous coding unit, to compensate for discontinuity between the current coding unit and the previous coding unit. Then, the context modeler (2010) may use the tuned context-specific probability values ​​for entropy decoding for the current coding unit. This will be described with reference to FIG. 25.

[0334] FIG. 25 is a diagram illustrating a method for updating a probability value of a context based on a bin stored according to the context according to one embodiment.

[0335] As described above, the context modeler (2010) can obtain the probability value of each context of the stored syntax element after entropy decoding for the fifth coding unit within the fourth maximum coding unit (2340) for entropy decoding for the first coding unit corresponding to the current coding unit among the coding units within the current maximum coding unit (2350).

[0336] In one embodiment, the context modeler (2010) may store bins obtained through entropy decoding for at least one coding unit included in at least one of the first maximum coding unit (2310), the second maximum coding unit (2320), and the fourth maximum coding unit (2340) according to the context of the syntax element. The context modeler (2010) may use the bins stored according to the context to tune the probability value of each context of the syntax element obtained from the fifth coding unit within the fourth maximum coding unit (2340).

[0337] In one embodiment, a bin may be stored for a coding unit adjacent to the right boundary or lower boundary among the coding units included in the first maximum coding unit (2310), the second maximum coding unit (2320), or the fourth maximum coding unit (2340).

[0338] For example, the context modeler (2010) may perform entropy decoding on the second coding unit, the third coding unit, the sixth coding unit, and the seventh coding unit of the second maximum coding unit (2320), and when a bin corresponding to a syntax element is obtained, the bin may be stored in memory (or a buffer) according to the context.

[0339] The context modeler (2010) can tune the probability value of each context of the stored syntax element after entropy decoding for the fifth coding unit within the fourth maximum coding unit (2340) according to the bin stored in the memory.

[0340] In one embodiment, tuning the context-specific probability values ​​can be understood as updating the probability values ​​according to the context-specific bins.

[0341] As described above, the probability value of a bin may be updated each time the bin is restored during the entropy decoding process. In one embodiment, the context modeler (2010) may update the context-specific probability value obtained from the previous encoding unit according to the context-specific bin obtained from at least one previous encoding unit adjacent to the current encoding unit, thereby making the probability value for the current encoding unit more optimized for the current encoding unit.

[0342] In one embodiment, the sum of the number of bins stored for each context may be set to be less than or equal to a first threshold value predetermined for the maximum coding unit. This is to prevent excessive load from occurring due to buffering and probability value updates.

[0343] For example, bins generated during the entropy decoding process of the second coding unit, the third coding unit, the sixth coding unit, and the seventh coding unit within the second maximum coding unit (2320) may be stored in memory, and the context modeler (2010) may ensure that the total number of bins stored in the memory is 512 or less. Here, 512 is an example, and various values ​​may be set as the first threshold value.

[0344] Additionally, in one embodiment, the number of bins stored for a given context may be set to be less than or equal to a second threshold. This is to prevent bins for other contexts from being stored in memory due to multiple bins for a specific context being stored in memory. In one embodiment, the second threshold may be, but is not limited to, 32. For example, the second threshold may be 2^n (where n is an integer).

[0345] In summary, in one embodiment, the context modeler (2010) may store bins generated during an entropy decoding process for a previous maximum coding unit restored before the current maximum coding unit (2350) in memory according to context, but may ensure that the number of bins stored for a specific context does not exceed a second threshold value, and that the total number of bins stored for contexts does not exceed a first threshold value.

[0346] In one embodiment, if the current maximum coding unit (2350) is located at the leftmost side of the row containing the current maximum coding unit (2350), the context modeler (2010) can tune the context-specific probability values ​​using the bins generated during the entropy decoding process for the maximum coding unit located above the current maximum coding unit (2350).

[0347] Meanwhile, in one embodiment, the probability value for each context of the syntax element may include a first probability value and a second probability value. The first probability value may be a probability value updated based on a first factor, and the second probability value may be a probability value updated based on a second factor. In one embodiment, the first factor and the second factor may be integer values, and the first factor may be smaller than the second factor.

[0348] The context modeler (2010) can determine a final probability value for each context by weighting the first probability value for each context and the second probability value for each context, and the arithmetic decoding unit (2030) can restore a bin corresponding to a syntax element based on the determined final probability value.

[0349] In one embodiment, the first probability value and the second probability value can be updated according to the following mathematical expressions 1 and 2.

[0350] [Mathematical Formula 1]

[0351] Updated first probability value = first probability value - (first probability value >> shift0) + (a*binVal >> shift0)

[0352] [Equation 2]

[0353] Updated second probability value = second probability value - (second probability value >> shift1) + (b*binVal >> shift1)

[0354] In mathematical expressions 1 and 2, >> is a bit shift operator, shift0 may correspond to the first factor, and shift1 may correspond to the second factor. In addition, binVal in mathematical expressions 1 and 2 may represent the value of a restored bin based on the first probability value and the second probability value. In addition, a and b in mathematical expressions 1 and 2 may be predetermined constants.

[0355] shift0 and shift1 can be determined independently depending on the context of the syntax element.

[0356] For example, shift0 and shift1 for the first context of the first syntax element, and shift0 and shift1 for the second context of the first syntax element, can be determined independently of each other. In one embodiment, shift0 and shift1 for the first context of the first syntax element, and shift0 and shift1 for the second context of the first syntax element can be the same or different.

[0357] For example, shift0 and shift1 for the first context of the first syntax element and shift0 and shift1 for the first context of the second syntax element can be determined independently of each other. In one embodiment, shift0 and shift1 for the first context of the first syntax element and shift0 and shift1 for the first context of the second syntax element can be the same or different.

[0358] In one embodiment, shift0 may be smaller than shift1, which may mean that the range over which the first probability value changes in response to an update of the first probability value is larger than the range over which the second probability value changes in response to an update of the second probability value. In other words, the first probability value may fluctuate more in response to an update, and the second probability value may fluctuate less in response to an update.

[0359] FIG. 26 is a graph showing the tendency of the first probability value and the second probability value updated according to each of the first factor and the second factor according to one embodiment.

[0360] Referring to FIG. 26, it can be seen that the first probability value (p1) is updated according to the first factor, which is smaller than the second factor, and therefore has greater volatility than the second probability value (p2) that is updated according to the second factor.

[0361] By using the weighted sum of the first probability value (p1) with high volatility and the second probability value (p2) with low volatility for entropy coding, the context-specific probability value can be quickly and stably approximated to the actual probability value of the bins.

[0362] In one embodiment, the context modeler (2010) may update both the context-specific first probability value and the context-specific second probability value when updating the context-specific probability value based on the bins stored for the context.

[0363] In one embodiment, when updating context-specific probability values ​​based on bins stored according to context, the context modeler (2010) may update only the context-specific first probability value among the context-specific first probability value and the context-specific second probability value.

[0364] In one embodiment, when the context modeler (2010) updates the context-specific probability value based on the bins stored according to the context, it may update only the context-specific second probability value among the context-specific first probability value and the context-specific second probability value.

[0365] In one embodiment, the context-specific probability value may include only one probability value representing the probability of occurrence of a bin, in which case the context modeler (2010) may update the context-specific probability value based on one factor.

[0366] Hereinafter, the process of determining context-specific probability values ​​for the current encoding unit is described in detail with reference to FIGS. 27 to 29.

[0367] FIG. 27 is a table showing bins obtained through entropy decoding for at least one coding unit within a maximum coding unit according to one embodiment.

[0368] Fig. 27 illustrates bins stored according to the context of syntax elements, and the bins illustrated in Fig. 27 may be, for example, bins restored through entropy decoding for the second coding unit, the third coding unit, the sixth coding unit, and the seventh coding unit within the second maximum coding unit (2320) illustrated in Fig. 25.

[0369] Referring to Fig. 27, it can be seen that ctx0 and ctx1 exist for the syntax element merge_flag, and the bins of 1 and 0 are restored based on ctx0, and the bins of 0 are restored based on ctx1.

[0370] Additionally, we can see that ctx2, ctx3, ctx4 and ctx5 exist for the syntax element abs_mvd_greater0_flag, and ctx6, ctx7, ctx8 and ctx9 exist for the syntax element abs_mvd_greater1_flag.

[0371] In Fig. 27, no bin is stored for ctx5 of the syntax element abs_mvd_greater0_flag, which means that there is no bin restored according to ctx5 in the bin string corresponding to abs_mvd_greater0_flag.

[0372] Figure 27 shows only merge_flag, abs_mvd_greater0_flag and abs_mvd_greater1_flag as syntax elements, but this is an example, and bins can be stored for various types of syntax elements that are not shown.

[0373] FIG. 28 is a table showing the probability values ​​of the context of a stored syntax element after entropy decoding for a previous encoding unit is completed according to one embodiment.

[0374] FIG. 28 illustrates a first probability value and a second probability value for each context of a syntax element. The first probability value and the second probability value for each context illustrated in FIG. 28 may be, for example, the first probability value and the second probability value for each context stored after entropy decoding for the fifth encoding unit in the fourth maximum encoding unit (2340) illustrated in FIG. 25 is completed.

[0375] In one embodiment, the context modeler (2010) updates the context-specific first probability value and / or the context-specific second probability value each time a bin is restored during entropy decoding for the fifth coding unit within the fourth largest coding unit (2340), and when restoration of the last syntax element for the fifth coding unit is completed, the final updated context-specific first probability value and the final updated context-specific second probability value can be used for entropy decoding for the current coding unit.

[0376] For example, in FIG. 28, the first probability value of ctx0 of the syntax element merge_flag is 15, and the second probability value is 23, which may be the updated first probability value and the updated second probability value each time the bins corresponding to the syntax element merge_flag for the coding units in the fourth maximum coding unit (2340) are restored according to ctx0 after the initial probability value of ctx0 of the syntax element merge_flag is determined.

[0377] FIG. 29 is a table showing a process in which the probability value of the context shown in FIG. 28 is updated according to the bin shown in FIG. 27 according to one embodiment.

[0378] In one embodiment, the context modeler (2010) can tune the probability values ​​of each context of syntax elements after the entropy decoding for the previous encoding unit is completed based on bins obtained through the entropy decoding for at least one encoding unit within the previous maximum encoding unit, and use the tuned probability values ​​for the entropy decoding for the current encoding unit.

[0379] As previously illustrated in FIGS. 27 and 28, the first probability value of ctx0 of the syntax element merge_flag may be 15, and the second probability value may be 23. In addition, a bin of 1 and a bin of 0 may be stored for ctx0 of the syntax element merge_flag.

[0380] Referring to FIG. 29, the context modeler (2010) can update the first probability value and the second probability value of ctx0 of the syntax element merge_flag according to the bin of 1 and the bin of 0, respectively. Since two bins are stored for ctx0 of the syntax element merge_flag, the first probability value and the second probability value can be updated twice each.

[0381] In one embodiment, the context modeler (2010) may first consider bins that are stored later when updating the first probability value and the second probability value. For example, if a bin of 1 is stored for ctx0 of the syntax element merge_flag and then a bin of 0 is stored, the context modeler (2010) may first update the first probability value and the second probability value of ctx0 of the syntax element merge_flag according to the bin of 0, and then according to the bin of 1. Updating the probability value by first using the bins that are stored later may mean that the probability value is updated by first using the bins obtained through entropy decoding for the encoding unit with a later decoding order.

[0382] If one bin is stored for ctx1 of the syntax element merge_flag, the first probability value and the second probability value can be updated once, as shown in FIG. 29.

[0383] Additionally, in FIG. 29, the first probability value and the second probability value of ctx5 of the syntax element abs_mvd_greater0_flag are not updated because the bin corresponding to ctx5 of the syntax element abs_mvd_greater0_flag is not stored.

[0384] In one embodiment, the context modeler (2010) can update the first probability value and the second probability value for each context of the syntax elements based on the aforementioned mathematical expressions 1 and 2.

[0385] Although FIG. 29 illustrates that both the first probability value and the second probability value for each context of the syntax elements are updated according to the bin, in one embodiment, only one of the first probability value and the second probability value may be updated according to the bin.

[0386] Meanwhile, as described above, bins obtained in the entropy decoding process for at least one encoding unit within the previous maximum encoding unit are stored in memory according to context. At this time, the number of bins stored for any one context may be limited to a second threshold value or less, and the total number of bins stored for contexts may be limited to a first threshold value or less.

[0387] For example, if the first threshold is 512 and the second threshold is 32, the minimum number of contexts that can be tuned is 16 (512 / 32). This means that the probability values ​​of 16 contexts can be updated according to the bins.

[0388] Since the total number of contexts defined in the VVC standard exceeds 300, it may be difficult to derive a probability value optimized for entropy decoding of the current encoding unit if only 16 contexts are tuned.

[0389] In one embodiment, when storing bins obtained during an entropy decoding process of at least one coding unit within a previous maximum coding unit in memory, the context modeler (2010) may limit the number of bins stored for any one context to a smaller value between a second threshold value and a limit value.

[0390] In one embodiment, the limit value may be a value corresponding to a first factor used to update the first probability value of the context. For example, the limit value may be 2^the first factor (2 제 1 팩터 ) may be a value corresponding to .

[0391] By considering the first factor in limiting the number of bins, the accurate probability value of the current encoding unit can be properly predicted simply by updating the first probability value using the bins.

[0392] Specifically, the first factor is a value used to update the first probability value of the context, and may be smaller than the second factor used to update the second probability value.

[0393] The aforementioned mathematical expression 1 is derived from the assumption that there will be N bins for a specific context, and the 2^1st factor can correspond to N. This is explained with reference to mathematical expressions 3 and 4 below.

[0394] [Equation 3]

[0395]

[0396] In Equation 3, P represents the probability value of a bin of a specific value (e.g., 1), and P' represents the updated probability value. Additionally, N represents the number of bins existing for a specific context, and Y represents the value of the restored bin.

[0397] To eliminate the division operation in Equation 3, approximate N+1, which corresponds to the window size, as N', and assume that N' is 1< <W로 변경하면, 수학식 3은 하기 수학식 4로 변경된다.

[0398] [Equation 4]

[0399]

[0400] Comparing mathematical expressions 1 and 2 with mathematical expression 4, we can see that they are the same except for the constants a and b. That is, W in mathematical expression 4 can correspond to shift0 and shift1 in mathematical expressions 1 and 2.

[0401] W in mathematical expression 4 is a value determined based on the number of bins (N) that exist for a specific context. The larger N is, the larger W is determined, and the smaller N is, the smaller W is determined. In the above, N is 1< <W로 근사화되므로, N은 2^W가 된다.

[0402] The fact that the aforementioned limit value is set to the 2^1st factor may mean that the number of bins to be stored is limited to less than or equal to the number N of bins considered in updating the first probability value.

[0403] By limiting the number of bins stored to update the first probability value to a limit value calculated from the first factor, an accurate probability value can be derived even if the first probability value is updated with only a small number of bins.

[0404] The difference between limiting the number of bins stored for a given context by considering only the second threshold value and limiting the number of bins stored for a given context by considering both the limit value and the second threshold value is explained with reference to FIG. 30.

[0405] FIG. 30 is a table comparing the number of contexts that can be tuned when the number of bins is limited to a second threshold value according to one embodiment and the number of contexts that can be tuned when the number of bins is limited to a smaller value between the second threshold value and the limit value.

[0406] Assume that the total number of bins that can be stored for contexts is limited by a first threshold of 512.

[0407] As illustrated in Figure 30, if the number of bins stored according to context is limited by the second threshold value of 32, bins can be stored only for ctx0 to ctx15. Therefore, probability value tuning can be performed only for 16 contexts from ctx0 to ctx15.

[0408] Additionally, if the number of bins stored according to context is limited by the smaller of the second threshold value of 32 and the limit value corresponding to the first factor of 2, bins can be stored for 32 contexts from ctx0 to ctx31. Therefore, probability value tuning can be performed for 32 contexts.

[0409] As illustrated in Figure 30, since the first factor of most contexts has a value of 5 or less, the number of contexts for which probability value tuning can be performed can be increased by using the 2^1st factor as a limiting value, compared to the case where the number of bins is limited using only the second threshold value of 32.

[0410] In one embodiment, the limit value may be set independently for each context, regardless of the first factor. For example, the limit value may be set to 32 for one context, and 16 for another context.

[0411] In one embodiment, the context modeler (2010) can control the number of beans stored per context using a table representing context-specific limit values.

[0412] In one embodiment, the context modeler (2010) may adjust the number of beans stored per context using only a context-specific limit value. For example, the context modeler (2010) may adjust the number of beans stored per context to be less than or equal to a context-specific limit value.

[0413] Below, with reference to FIGS. 31 and 32, it is explained which bins of which encoding units can be used for tuning probability values ​​for the current encoding unit.

[0414] FIG. 31 is a diagram illustrating a previous encoding unit that can be used to update a probability value of a context according to one embodiment.

[0415] In FIG. 31, if the current encoding unit within the current maximum encoding unit (2350) corresponds to the first encoding unit, the context modeler (2010) can obtain the context-specific probability value after entropy decoding for the fifth encoding unit within the fourth maximum encoding unit (2340). In addition, the context modeler (2010) can tune the context-specific probability value according to the context-specific bin stored in the memory.

[0416] In one embodiment, the context modeler (2010) may store bins obtained through entropy decoding for at least one of the coding units adjacent to the lower boundary among the coding units within the first maximum coding unit (2310), for example, the third coding unit, the fifth coding unit, or the seventh coding unit, according to the context.

[0417] In one embodiment, the context modeler (2010) may store bins obtained through entropy decoding for at least one of the coding units adjacent to the lower boundary among the coding units within the second maximum coding unit (2320), for example, the second coding unit, the third coding unit, the sixth coding unit, or the seventh coding unit, according to the context.

[0418] In one embodiment, the context modeler (2010) may store bins obtained through entropy decoding for at least one of the coding units adjacent to the right boundary among the coding units within the fourth largest coding unit (2340), for example, the second coding unit, the third coding unit, or the fifth coding unit, according to the context.

[0419] Hereinafter, the term "bin of a maximum coding unit" may refer to a bin obtained through entropy decoding for at least one coding unit within the maximum coding unit and stored according to context. Furthermore, the term "bin of a coding unit" may refer to a bin obtained through entropy decoding for a coding unit and stored according to context.

[0420] In one embodiment, the context modeler (2010) can tune the context-specific probability values ​​for the current coding unit by using the bins of a second maximum coding unit (2320) located above the current maximum coding unit (2350) among the maximum coding units adjacent to the current maximum coding unit (2350).

[0421] In one embodiment, the context modeler (2010) can tune the context-specific probability values ​​for the current coding unit by using the bins of the coding units adjacent to the upper portion of the current coding unit among the coding units within the second maximum coding unit (2320), for example, the second coding unit within the second maximum coding unit (2320).

[0422] In one embodiment, the context modeler (2010) can identify which bin of the maximum coding unit adjacent to the current maximum coding unit (2350) is used for probability value tuning for the current coding unit, based on information contained in the bitstream.

[0423] For example, if information included in a bitstream points to a second maximum coding unit (2320) among the first maximum coding unit (2310), the second maximum coding unit (2320), and the fourth maximum coding unit (2340), the context modeler (2010) can perform probability value tuning using the bin of the second maximum coding unit (2320).

[0424] Additionally, for example, if information included in a bitstream points to a fourth maximum coding unit (2340) among the first maximum coding unit (2310), the second maximum coding unit (2320), and the fourth maximum coding unit (2340), the context modeler (2010) can perform probability value tuning using the bin of the fourth maximum coding unit (2340).

[0425] In one embodiment, the context modeler (2010) may determine from information included in the bitstream which of the previous coding units adjacent to the current coding unit can be used for tuning the probability value for the current coding unit. Here, the previous coding units adjacent to the current coding unit may include the second coding unit within the second largest coding unit (2320) and the second coding unit within the fourth largest coding unit (2340). Additionally, for example, the previous coding units adjacent to the current coding unit may include the seventh coding unit within the first largest coding unit (2310), the second coding unit within the second largest coding unit (2320), and the second coding unit within the fourth largest coding unit (2340). In addition, for example, previous coding units adjacent to the current coding unit may include coding units adjacent to the lower boundary among the coding units in the second maximum coding unit (2320) and coding units adjacent to the right boundary among the coding units in the fourth maximum coding unit (2340). In addition, for example, previous coding units adjacent to the current coding unit may include coding units adjacent to the lower boundary among the coding units in the first maximum coding unit (2310), coding units adjacent to the lower boundary among the coding units in the second maximum coding unit (2320), and coding units adjacent to the right boundary among the coding units in the fourth maximum coding unit (2340).

[0426] In one embodiment, the context modeler (2010) can identify which bin of the maximum coding unit adjacent to the current maximum coding unit (2350) is used for probability value tuning for the current coding unit based on the size of the current coding unit. In one embodiment, the size of the current coding unit can correspond to the result of a comparison of the width and height of the current coding unit.

[0427] For example, if the width of the current encoding unit is greater than the height, the context modeler (2010) can tune the probability value by using the bin of the second maximum encoding unit (2320) located above the current maximum encoding unit (2350) or the bin of the second encoding unit within the second maximum encoding unit (2320) located above the current encoding unit.

[0428] Additionally, for example, if the height of the current encoding unit is greater than the width, the context modeler (2010) may tune the probability value by using the bin of the fourth maximum encoding unit (2340) located to the left of the current maximum encoding unit (2350) or the bin of the second encoding unit within the fourth maximum encoding unit (2340) located to the left of the current encoding unit.

[0429] Additionally, for example, the context modeler (2010) can tune the probability value using the maximum coding unit or the bin of the coding unit at a predetermined location (e.g., upper left) if the width and height of the current coding unit are the same.

[0430] In one embodiment, the context modeler (2010) can identify which bin of the largest coding unit adjacent to the current largest coding unit (2350) is used for probability value tuning for the current coding unit based on the size of the boundary of the coding units adjacent to the current coding unit that touches the current coding unit.

[0431] Referring to FIG. 31, the lower boundary of the second coding unit in the second maximum coding unit (2320), the lower boundary of the third coding unit, and the right boundary of the second coding unit in the fourth maximum coding unit (2340) are in contact with the current coding unit. In one embodiment, the context modeler (2010) can identify a maximum coding unit that can be used for probability value tuning based on a comparison result of the length (i.e., width) of the lower boundary of the second coding unit in the second maximum coding unit (2320), the length (i.e., width) of the lower boundary of the third coding unit, and the length (i.e., height) of the right boundary of the second coding unit in the fourth maximum coding unit (2340).

[0432] For example, in FIG. 31, since the height of the second coding unit in the fourth maximum coding unit (2340) is greater than the width of the second coding unit and the width of the third coding unit in the second maximum coding unit (2320), the context modeler (2010) can perform probability value tuning using the bins of the fourth maximum coding unit (2340) or the bins of the second coding unit in the fourth maximum coding unit (2340).

[0433] Additionally, for example, if the width of the second coding unit within the second maximum coding unit (2320) is greater than the width of the third coding unit within the second maximum coding unit (2320) and the height of the second coding unit within the fourth maximum coding unit (2340), the context modeler (2010) may perform probability value tuning using the bins of the second maximum coding unit (2320) or the bins of the second coding unit within the second maximum coding unit (2320).

[0434] Additionally, for example, if the width of the second coding unit within the second maximum coding unit (2320), the width of the third coding unit within the second maximum coding unit (2320), and the height of the second coding unit within the fourth maximum coding unit (2340) are all the same, the context modeler (2010) can tune the probability value using the maximum coding unit or the bin of the coding unit at a predetermined location (e.g., above).

[0435] In one embodiment, the context modeler (2010) can identify which of the bins of the maximum coding units adjacent to the current maximum coding unit (2350) is used for probability value tuning for the current coding unit based on the area of ​​the coding units adjacent to the current coding unit.

[0436] For example, the context modeler (2010) can tune the probability value for the current coding unit using the bin of the largest coding unit containing the coding unit with the largest area among the coding units adjacent to the current coding unit or the bin of the coding unit with the largest area.

[0437] Additionally, for example, the context modeler (2010) can tune the probability value by using the maximum coding unit or the bin of the coding unit at a predetermined location (e.g., above) when the areas of the coding units adjacent to the current coding unit are all the same.

[0438] In FIG. 31, since the area of ​​the second coding unit within the fourth maximum coding unit (2340) among the coding units adjacent to the current coding unit is the largest, the context modeler (2010) can tune the probability value using the bin of the fourth maximum coding unit (2340) or the bin of the second coding unit within the fourth maximum coding unit (2340).

[0439] FIG. 32 is a diagram illustrating a previous encoding unit that can be used to update a probability value of a context according to one embodiment.

[0440] In Fig. 32, the current encoding unit is the fifth encoding unit adjacent to the left boundary of the current maximum encoding unit (2350), and it is assumed that the restoration of the first encoding unit, the second encoding unit, the third encoding unit, and the fourth encoding unit has been completed.

[0441] In one embodiment, since the restoration of the fourth coding unit is completed immediately before the current coding unit, the context modeler (2010) can obtain the context-specific probability values ​​after entropy decoding for the fourth coding unit within the current largest coding unit (2350) for entropy decoding for the current coding unit.

[0442] In one embodiment, the context modeler (2010) can optionally tune the context-specific probability values ​​after entropy decoding for the fourth coding unit within the current maximum coding unit (2350) according to context-specific bins stored in memory.

[0443] For example, the context modeler (2010) can obtain information from the bitstream indicating whether tuning of the probability value is required, and if the obtained information indicates that tuning of the probability value is required, the context modeler (2010) can tune the probability value according to the context-specific bin stored in the memory.

[0444] In one embodiment, the context modeler (2010) may tune the probability value by using a bin of the fourth largest coding unit (2340) closest to the current coding unit or a bin of the third coding unit among the coding units within the fourth largest coding unit (2340) that is adjacent to the current coding unit, since the current coding unit is adjacent to the left boundary of the current largest coding unit (2350) and not adjacent to the upper boundary.

[0445] In one embodiment, when probability value tuning for the current encoding unit is required, the context modeler (2010) may identify the encoding unit used for probability value tuning according to an embodiment described with reference to FIG. 31 described above, for example, an embodiment of identifying which bin of the encoding unit is used for probability value tuning for the current encoding unit.

[0446] In one embodiment, the context modeler (2010) may determine whether to perform probability value tuning on the current encoding unit based on the size of the current encoding unit. In one embodiment, the size of the current encoding unit may correspond to the result of a comparison of the width and height of the current encoding unit.

[0447] For example, if the height of the current encoding unit is greater than the width, the context modeler (2010) can tune the probability value using the bin of the fourth largest encoding unit (2340) or the third encoding unit adjacent to the left of the current encoding unit among the encoding units within the fourth largest encoding unit (2340). Since the height of the current encoding unit is greater than the width, it means that a large area of ​​the current encoding unit is in contact with the fourth largest encoding unit (2340), the probability value is tuned using the bin of the fourth largest encoding unit (2340).

[0448] Additionally, for example, the context modeler (2010) may not perform probability value tuning for the current encoding unit if the width of the current encoding unit is greater than its height. That is, the context-specific probability values ​​stored after entropy decoding for the fourth encoding unit within the current maximum encoding unit (2350) may be used for entropy decoding for the current encoding unit.

[0449] Additionally, for example, if the height and width of the current encoding unit are the same, the context modeler (2010) may determine whether to perform probability value tuning for the current encoding unit based on information contained in the bitstream.

[0450] Figure 33 is a flowchart of an image decoding method according to one embodiment.

[0451] The image decoding method illustrated in FIG. 33 can be performed by the image decoding device (2000) described above.

[0452] In step S3310, the image decoding device (2000) can store a bin obtained through entropy decoding for at least one coding unit within the first maximum coding unit according to the context of the syntax element.

[0453] The first maximum coding unit may be restored before the current maximum coding unit, and the first maximum coding unit may include at least one of a maximum coding unit located to the left of the current maximum coding unit, a maximum coding unit located above the current maximum coding unit, and a maximum coding unit located to the upper left of the current maximum coding unit.

[0454] For example, the first maximum coding unit may include at least one of the first maximum coding unit (2310), the second maximum coding unit (2320), or the fourth maximum coding unit (2340) illustrated in FIG. 31.

[0455] In one embodiment, at least one coding unit within the first maximum coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0456] In one embodiment, the image decoding device (2000) can identify at least one coding unit adjacent to a boundary of a first maximum coding unit, which is adjacent to a current maximum coding unit or a boundary that is adjacent to a current coding unit within the current maximum coding unit, and store a bin obtained through entropy decoding for the identified at least one coding unit according to the context of a syntax element.

[0457] In step S3320, the image decoding device (2000) can obtain a probability value of a context of a syntax element after entropy decoding for at least one encoding unit within a second maximum encoding unit is completed, for entropy decoding for the current encoding unit within the current maximum encoding unit.

[0458] In one embodiment, the second maximum coding unit may be restored before the current maximum coding unit.

[0459] In one embodiment, the second maximum coding unit may be located to the left of the current maximum coding unit. For example, the second maximum coding unit may be the fourth maximum coding unit (2340) illustrated in FIG. 31.

[0460] In one embodiment, the second maximum coding unit may be located at the rightmost position in the upper row of the maximum coding unit row that includes the current maximum coding unit. For example, the second maximum coding unit may be the third maximum coding unit (2330) illustrated in FIG. 31.

[0461] In one embodiment, the image decoding device (2000) can update context-specific probability values ​​while restoring bins of syntax elements for at least one coding unit within a second maximum coding unit, and obtain the final updated context-specific probability values ​​for the current coding unit.

[0462] At step S3330, the image decoding device (2000) can update the probability value of the context based on the bin stored according to the context.

[0463] In one embodiment, the probability value of the context may include a first probability value of the context and a second probability value of the context. The image decoding device (2000) may update the first probability value of the context using a first factor independently set according to the context and a bin stored according to the context, and may update the second probability value of the context using a second factor independently set according to the context and a bin stored according to the context.

[0464] In one embodiment, the image decoding device (2000) may update only one of the first probability value of the context and the second probability value of the context according to the bin.

[0465] At step S3340, the image decoding device (2000) can restore the syntax element for the current encoding unit based on the probability value of the updated context.

[0466] In one embodiment, the image decoding device (2000) can restore bins of syntax elements for the current encoding unit based on the probability value of the updated context, and obtain syntax elements by de-binarizing an empty string including the restored bins.

[0467] In the aforementioned step S3310, when storing bins according to context, the image decoding device (2000) can limit the number of bins to be stored.

[0468] In one embodiment, the image decoding device (2000) may limit the total number of bins stored for any one maximum coding unit to be less than or equal to a first threshold value. For example, when the first threshold value is 512, up to 512 bins may be stored for any one maximum coding unit, and up to 512 bins may be stored for another maximum coding unit.

[0469] In one embodiment, the image decoding device (2000) may limit the number of bins stored for any one context to be less than or equal to the smaller of the limit value and a predetermined second threshold value.

[0470] In one embodiment, the limit value may be a value that is set independently for each context, and the second threshold value may be a value that is set equally for the contexts.

[0471] For example, a second threshold value of 32 may be set for both the first and second contexts, while a limit value of 16 may be set for the first context and a limit value of 32 may be set for the second context. In this case, a maximum of 16 bins may be stored for the first context and a maximum of 32 bins may be stored for the second context.

[0472] In one embodiment, the limit value may be a value corresponding to a first factor set per context to update the first probability value of the context. For example, the limit value may be 2^the first factor.

[0473] In one embodiment, the image decoding device (2000) can restore the current encoding unit using the restored syntax elements when the syntax elements for the current encoding unit are restored.

[0474] The probability value of the context of the syntax element after entropy decoding for the current encoding unit can be used for entropy decoding for the next encoding unit.

[0475] FIG. 34 is a diagram illustrating the configuration of an image encoding device (3400) according to one embodiment.

[0476] Referring to FIG. 34, the image encoding device (3400) may include an encoding unit (3410), a context modeler (3430), and an arithmetic encoding unit (3450).

[0477] According to one embodiment, the encoding unit (3410), the context modeler (3430), and the arithmetic encoding unit (3450) may be implemented with at least one processor. In one embodiment, the encoding unit (3410), the context modeler (3430), and the arithmetic encoding unit (3450) may operate according to at least one instruction stored in at least one memory.

[0478] The image encoding device (3400) may include at least one memory for storing input / output data of the encoding unit (3410), the context modeler (3430), and the arithmetic encoding unit (3450). In addition, the image encoding device (3400) may include a memory control unit for controlling data input / output of at least one memory.

[0479] In one embodiment, the encoder (3410) may correspond to the predictive encoder (1915), the transform and quantization unit (1920), the inverse quantization and inverse transform unit (1930), the deblocking filtering unit (1935), and the loop filtering unit (1940) illustrated in FIG. 19. In one embodiment, the context modeler (3430) and the arithmetic encoder (3450) may correspond to the entropy encoder (1925) illustrated in FIG. 19.

[0480] In one embodiment, a device including a context modeler (3430) and an arithmetic encoder (3450) may be referred to as an entropy encoder (3470).

[0481] The image encoding device (3400) can encode an image to generate a bitstream.

[0482] In one embodiment, the video encoding device (3400) can transmit the bitstream to the video decoding device (2000) over a network. In one embodiment, the video encoding device (3400) can store the 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, and the like.

[0483] In one embodiment, the encoding unit (3410) can encode an image and obtain syntax elements as an encoding result.

[0484] In one embodiment, the encoder (3410) may divide the current image into maximum coding units, and divide the maximum coding units into at least one coding unit. The encoder (3410) may encode each coding unit according to a prediction mode, such as intra mode or inter mode.

[0485] The syntax element obtained by the encoding unit (3410) can be converted into an empty string through binarization, and the empty string can be input to the entropy encoding device (3470).

[0486] In one embodiment, the context modeler (3430) can determine the probability value of each context of syntax elements to entropy encode the bins of the binstring.

[0487] In one embodiment, the context modeler (3430) can determine an initial probability value of each context of syntax elements when the syntax element currently being encoded satisfies a predetermined condition, for example, when the syntax element currently being encoded is the first syntax element of an independent slice segment.

[0488] In one embodiment, the context modeler (3430) may obtain information (e.g., ctxIdx) indicating a specific context by using the type of the syntax element that is currently the target of encoding, the location information of the bin within the bin string, and the surrounding block information. Based on the obtained information (e.g., ctxIdx), the context modeler (3430) may determine the probability value of a specific context among the context-specific probability values ​​of the syntax element that is currently the target of encoding.

[0489] In one embodiment, when the probability value of a bin is determined by the context modeler (3430), the arithmetic encoding unit (3450) can arithmetic encode the bins included in the bin string based on the probability value of the bin, and obtain a bitstream as a result of the arithmetic encoding.

[0490] Whenever a bin is arithmetic-encoded by the arithmetic encoding unit (3450), the context modeler (3430) updates the probability value of the bin, and the arithmetic encoding unit (3450) can arithmetic-encode the bin using the updated probability value of the bin.

[0491] In one embodiment, the arithmetic encoding unit (3450) can arithmetic encode bins within an empty string by repeating the process of dividing a predetermined integer range according to the probability value of the bin.

[0492] In one embodiment, the context modeler (3430) may obtain the probability value of the context of the syntax elements stored after the entropy encoding of the previous block encoded before the current block, for entropy encoding of the current block segmented from the current upper block. Then, the context modeler (3430) may use the probability value of the obtained context to entropy encode the syntax elements for the current block.

[0493] In one embodiment, the upper block may include a slice, a tile, or a maximum coding unit split from the image, and the block split from the upper block may include a tile split from the slice, a maximum coding unit split from the slice, a coding unit split from the slice, a maximum coding unit split from the tile, a coding unit split from the tile, or a coding unit split from the maximum coding unit.

[0494] In the following, it is assumed that the upper block is the maximum coding unit and the block split from the upper block is the coding unit.

[0495] In one embodiment, the context modeler (3430) may obtain a probability value of each context of a syntax element stored after entropy encoding for a previous maximum coding unit encoded before the current maximum coding unit, if the current coding unit corresponds to a first coding target among at least one coding unit split from the current maximum coding unit. Then, the context modeler (3430) may use the obtained probability value of each context as a probability value of each context of a syntax element for the current coding unit.

[0496] In one embodiment, the context modeler (3430) may obtain a probability value of each context of a syntax element stored after entropy encoding for a previous coding unit encoded before the current coding unit among the coding units included in the current maximum coding unit, if the current coding unit does not correspond to the first coding target among the coding units split from the current maximum coding unit. Then, the context modeler (3430) may use the obtained probability value of each context as a probability value of each context of a syntax element for the current coding unit.

[0497] In one embodiment, the context modeler (3430) can tune the context-specific probability values ​​stored after entropy encoding for the previous encoding unit based on the context-specific bins of the syntax elements of the previous maximum encoding unit or the previous encoding unit to compensate for discontinuity between the current encoding unit and the previous encoding unit. Then, the context modeler (3430) can use the tuned context-specific probability values ​​for entropy encoding for the current encoding unit.

[0498] In one embodiment, referring to FIG. 25, the context modeler (3430) can obtain the probability value of each context of the stored syntax element after entropy encoding for the fifth coding unit within the fourth maximum coding unit (2340) for entropy encoding for the current coding unit (the first coding unit) within the current maximum coding unit (2350).

[0499] In one embodiment, the context modeler (3430) can store bins obtained through entropy encoding for at least one coding unit included in at least one of the first maximum coding unit (2310), the second maximum coding unit (2320), or the fourth maximum coding unit (2340) according to the context of the syntax element.

[0500] The context modeler (3430) can tune the probability value of each context of the syntax element obtained from the fifth coding unit within the fourth maximum coding unit (2340) using the bins stored according to the context.

[0501] In one embodiment, a bin may be stored for a coding unit adjacent to the right boundary or lower boundary among the coding units included in the first maximum coding unit (2310), the second maximum coding unit (2320), or the fourth maximum coding unit (2340).

[0502] In one embodiment, the sum of the number of bins stored for each context may be set to be less than or equal to a first threshold value predetermined for the maximum encoding unit.

[0503] In one embodiment, the number of bins stored for any one context may be set to be less than or equal to the lesser of the second threshold value and the limit value.

[0504] In one embodiment, the limit value may be a value that is set independently for each context, and the second threshold value may be a value that is set equally for the contexts.

[0505] In one embodiment, the context modeler (3430) can control the number of beans stored per context using a table representing context-specific limit values.

[0506] In one embodiment, the context-specific probability value of a syntax element may include a first probability value and a second probability value, wherein the first probability value may be updated according to a first factor and the second probability value may be updated according to a second factor. In one embodiment, the first factor may be a smaller value than the second factor.

[0507] In one embodiment, the limit value may be a value corresponding to a first factor used to update the first probability value of the context. For example, the limit value may be 2^the first factor (2 제 1 팩터 ) may be a value corresponding to .

[0508] In one embodiment, the context modeler (3430) can update the context-specific first probability value and the context-specific second probability value based on bins stored according to the context.

[0509] In one embodiment, the context modeler (3430) may update only the context-specific first probability value among the context-specific first probability value and the context-specific second probability value based on the bins stored according to the context.

[0510] In one embodiment, the context modeler (3430) may update only the context-specific second probability value among the context-specific first probability value and the context-specific second probability value based on the bins stored according to the context.

[0511] In one embodiment, the context-specific probability value may include only one probability value representing the probability of occurrence of a bin, in which case the context modeler (3430) may update the context-specific probability value based on one factor.

[0512] In one embodiment, the context modeler (3430) may determine which bins of a coding unit (or which maximum coding unit) can be used for tuning probability values ​​for the current coding unit by considering at least one of information included in the bitstream, the size of the current coding unit, the size of a boundary of coding units adjacent to the current coding unit that is in contact with the current coding unit, or the area of ​​coding units adjacent to the current coding unit.

[0513] In one embodiment, the context modeler (3430) may determine whether probability value tuning should be performed for the current encoding unit by considering at least one of information contained in the bitstream or the size of the current encoding unit.

[0514] The method for determining which bins of which coding unit (or which maximum coding unit) are used for probability value tuning for the current coding unit and whether probability value tuning should be performed for the current coding unit has been described with reference to FIGS. 31 and 32, so a detailed description thereof is omitted here.

[0515] Figure 35 is a flowchart of an image encoding method according to one embodiment.

[0516] The image encoding method illustrated in FIG. 35 can be performed by the image encoding device (3400) described above.

[0517] In step S3510, the video encoding device (3400) can store a bin corresponding to a syntax element of at least one encoding unit within the first maximum encoding unit according to the context of the syntax element.

[0518] The first maximum coding unit may be encoded before the current maximum coding unit, and the first maximum coding unit may include at least one of a maximum coding unit located to the left of the current maximum coding unit, a maximum coding unit located above the current maximum coding unit, or a maximum coding unit located to the upper left of the current maximum coding unit.

[0519] For example, the first maximum coding unit may include at least one of the first maximum coding unit (2310), the second maximum coding unit (2320), or the fourth maximum coding unit (2340) illustrated in FIG. 31.

[0520] In one embodiment, at least one coding unit within the first maximum coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0521] In one embodiment, the video encoding device (3400) can identify at least one coding unit adjacent to a boundary of a first maximum coding unit that is adjacent to a current maximum coding unit or a boundary that is adjacent to a current coding unit within the current maximum coding unit, and store a bin corresponding to a syntax element of the identified at least one coding unit according to the context of the syntax element.

[0522] In step S3520, the image encoding device (3400) can obtain a probability value of a context of a syntax element after entropy encoding for at least one encoding unit within a second maximum encoding unit is completed, for entropy encoding for the current encoding unit within the current maximum encoding unit.

[0523] In one embodiment, the second maximum coding unit may be encoded before the current maximum coding unit. In one embodiment, the encoding order of the second maximum coding unit may be later than that of the first maximum coding unit.

[0524] In one embodiment, the second maximum coding unit may be located to the left of the current maximum coding unit. For example, the second maximum coding unit may be the fourth maximum coding unit (2340) illustrated in FIG. 31.

[0525] In one embodiment, the second maximum coding unit may be located at the rightmost position in the upper row of the maximum coding unit row that includes the current maximum coding unit. For example, the second maximum coding unit may be the third maximum coding unit (2330) illustrated in FIG. 31.

[0526] In one embodiment, the video encoding device (3400) can update context-specific probability values ​​while arithmetic-encoding bins of syntax elements for at least one encoding unit within a second maximum encoding unit, and obtain the final updated context-specific probability values ​​for the current encoding unit.

[0527] In step S3530, the image encoding device (3400) can update the probability value of the context based on the bin stored according to the context.

[0528] In one embodiment, the probability value of the context may include a first probability value of the context and a second probability value of the context. The image encoding device (3400) may update the first probability value of the context using a first factor independently set according to the context and a bin stored according to the context, and may update the second probability value of the context using a second factor independently set according to the context and a bin stored according to the context.

[0529] In one embodiment, the video encoding device (3400) may update only one of the first probability value of the context and the second probability value of the context according to the bin.

[0530] In step S3540, the video encoding device (3400) can arithmetic encode a syntax element for the current encoding unit based on the probability value of the updated context.

[0531] In one embodiment, the image encoding device (3400) can obtain a bitstream by binarizing the syntax elements of the current encoding unit to obtain an empty string and arithmetic encoding the bins in the empty string according to the probability values ​​of the updated context.

[0532] In the aforementioned step S3510, when storing bins according to context, the image encoding device (3400) can limit the number of bins to be stored.

[0533] In one embodiment, the video encoding device (3400) may limit the total number of bins stored for any one maximum coding unit to be less than or equal to a first threshold value. For example, when the first threshold value is 512, up to 512 bins may be stored for any one maximum coding unit, and up to 512 bins may be stored for another maximum coding unit.

[0534] In one embodiment, the video encoding device (3400) may limit the number of bins stored for any one context to be less than or equal to the smaller of the limit value and a predetermined second threshold value.

[0535] In one embodiment, the limit value may be a value that is set independently for each context, and the second threshold value may be a value that is set equally for the contexts.

[0536] For example, a second threshold value of 32 may be set for both the first and second contexts, while a limit value of 16 may be set for the first context and a limit value of 32 may be set for the second context. In this case, a maximum of 16 bins may be stored for the first context and a maximum of 32 bins may be stored for the second context.

[0537] In one embodiment, the limit value may be a value corresponding to a first factor set per context to update the first probability value of the context. For example, the limit value may be 2^the first factor.

[0538] The probability value of the context of the syntax element after entropy encoding for the current encoding unit can be used for entropy encoding for the next encoding unit.

[0539] One embodiment challenges the task of reducing the bitrate of a bitstream through entropy coding using probability value tuning.

[0540] One embodiment aims to maintain a stable load due to buffering and probability value tuning by limiting the number of bins stored in the buffer to a given block standard.

[0541] One embodiment challenges the task of enabling probability values ​​of multiple contexts to be tuned by adjusting the number of bins stored in a buffer based on the context.

[0542] The technical problems to be achieved through the present disclosure are not limited to the technical problems mentioned above, and other technical problems not mentioned will be clearly understood by a person having ordinary skill in the technical field to which the present disclosure pertains from the description below.

[0543] A method for decoding an image according to one embodiment may include a step of storing a bin obtained through entropy decoding for at least one coding unit within a first maximum coding unit according to a context of a syntax element, wherein at least one coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0544] A method for decoding an image according to one embodiment may include a step of obtaining a probability value of a context of a syntax element after entropy decoding for at least one coding unit within a second maximum coding unit is completed, for entropy decoding for a current coding unit within a current maximum coding unit (2350), and the first maximum coding unit and the second maximum coding unit may be restored before the current maximum coding unit (2350).

[0545] A method for decoding an image according to one embodiment may include a step of updating a probability value of a context based on a bin stored according to the context.

[0546] A method of decoding an image according to one embodiment may include a step of restoring a syntax element for a current encoding unit based on a probability value of an updated context.

[0547] In one embodiment, the total number of bins stored according to the context may be less than or equal to a predetermined first threshold value.

[0548] In one embodiment, the number of bins stored for any one context may be less than or equal to a limit value set for any one context, or less than or equal to the lesser of the limit value and a second predetermined threshold value.

[0549] According to an image decoding method according to one embodiment, probability values ​​of multiple contexts can be tuned by adjusting the number of bins stored in a buffer based on the context.

[0550] In one embodiment, the threshold value is set independently for each context, and the second threshold value can be determined to be the same value for all contexts. Accordingly, the probability values ​​of multiple contexts can be tuned.

[0551] In one embodiment, the limit value may be a value corresponding to a first factor that is independently set for each context for updating the probability value.

[0552] In one embodiment, the probability value of a context includes a first probability value updated based on a first factor and a second probability value updated based on a second factor, wherein the size of the first factor may be smaller than the size of the second factor. Accordingly, the probability values ​​of multiple contexts can be tuned, and by setting a limit value based on the first factor, the probability of the context can quickly converge to an accurate probability.

[0553] In one embodiment, the first maximum coding unit may be located above, to the left, or on the upper left side of the current maximum coding unit (2350), and the second maximum coding unit may be located to the left of the current maximum coding unit (2350) or on the rightmost side of the upper row of the maximum coding unit row that includes the current maximum coding unit (2350).

[0554] In one embodiment, the updating step may include: identifying any one of a first maximum coding unit (2340) located to the left of a current maximum coding unit (2350), a first maximum coding unit (2320) located above the current maximum coding unit (2350), and a first maximum coding unit (2310) located to the upper left of the current maximum coding unit (2350) based on information included in the bitstream; and updating a probability value of a context based on a bin obtained through entropy decoding for at least one coding unit within the identified first maximum coding unit. According to one embodiment, appropriate probability value tuning of the context may be performed.

[0555] In one embodiment, the updating step may include: identifying one of a first maximum coding unit (2340) located to the left of a current maximum coding unit (2350) and a first maximum coding unit (2320) located above the current maximum coding unit (2350) based on a comparison result of a width and a height of the current coding unit; and updating a probability value of the context based on a bin obtained through entropy decoding for at least one coding unit within the identified first maximum coding unit. According to one embodiment, appropriate probability value tuning of the context may be performed.

[0556] In one embodiment, the updating step may include: identifying one of a first maximum coding unit (2340) located to the left of a current maximum coding unit (2350) and a first maximum coding unit (2320) located above the current maximum coding unit (2350), based on a comparison result of a height of a coding unit adjacent to the left of the current coding unit among coding units within the first maximum coding unit (2340) located to the left of the current maximum coding unit (2350) and a width of a coding unit adjacent to the top of the current coding unit among coding units within the first maximum coding unit (2320) located above the current maximum coding unit (2350); and updating a probability value of a context based on a bin obtained through entropy decoding for at least one coding unit within the identified first maximum coding unit. According to one embodiment, appropriate probability value tuning of the context may be performed.

[0557] In one embodiment, the updating step includes: identifying one of a first maximum coding unit (2340) located to the left of a current maximum coding unit (2350), a first maximum coding unit (2320) located above the current maximum coding unit (2350), and a first maximum coding unit (2310) located to the upper left of the current maximum coding unit (2350), based on a comparison result of an area of ​​a coding unit in the first maximum coding unit (2340) located to the left of the current maximum coding unit (2350), an area of ​​a coding unit in the first maximum coding unit (2320) located above the current maximum coding unit (2350), and an area of ​​a coding unit in the first maximum coding unit (2310) located to the upper left of the current maximum coding unit (2350); And may include a step of updating the probability value of the context based on the bin obtained through entropy decoding for at least one coding unit within the identified first maximum coding unit. According to one embodiment, appropriate probability value tuning of the context may be performed.

[0558] In one embodiment, the image decoding method further includes a step of obtaining a probability value of a context of a syntax element after entropy decoding is completed for a coding unit that is reconstructed earlier than the current coding unit among coding units included in a current maximum coding unit (2350), and the updating step may include a step of updating the probability value of the context of the syntax element after entropy decoding is completed for a coding unit that is reconstructed earlier than the current coding unit, based on a bin stored according to the context.

[0559] In one embodiment, the current encoding unit is adjacent to the left boundary of the current maximum encoding unit (2350), and the first maximum encoding unit (2340) is located on the left side of the current maximum encoding unit (2350), and the updating step may update, when the height of the current encoding unit is greater than the width, the probability value of the context of the syntax element after the entropy decoding for the encoding unit reconstructed before the current encoding unit is completed, based on a bin obtained through the entropy decoding for at least one encoding unit within the first maximum encoding unit (2340) located on the left side of the current maximum encoding unit (2350). According to one embodiment, an appropriate probability value tuning of the context may be performed.

[0560] A video decoding device according to one embodiment may include a context modeler (2010) that stores a bin obtained through entropy decoding for at least one coding unit within a first maximum coding unit according to a context of a syntax element, obtains a probability value of a context of a syntax element after entropy decoding for at least one coding unit within a second maximum coding unit is completed for entropy decoding for a current coding unit within a current maximum coding unit (2350), and updates the probability value of the context based on the bin stored according to the context.

[0561] An image decoding device according to one embodiment may include an arithmetic decoding unit (2030) that restores a syntax element for a current encoding unit based on a probability value of an updated context.

[0562] In one embodiment, at least one coding unit within the first maximum coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0563] In one embodiment, the first maximum coding unit and the second maximum coding unit may be restored before the current maximum coding unit (2350).

[0564] In one embodiment, the total number of bins stored according to the context may be less than or equal to a predetermined first threshold value.

[0565] In one embodiment, the number of bins stored for any one context may be less than or equal to a limit value set for any one context, or less than or equal to the lesser of the limit value and a second predetermined threshold value.

[0566] According to an image decoding device according to one embodiment, probability values ​​of multiple contexts can be tuned by adjusting the number of bins stored in a buffer based on the context.

[0567] A method of encoding an image according to one embodiment includes a step of storing a bin corresponding to a syntax element of at least one coding unit within a first maximum coding unit according to a context of the syntax element, wherein at least one coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0568] A method for encoding an image according to one embodiment may include a step of obtaining a probability value of a context of a syntax element after entropy encoding for at least one encoding unit within a second maximum encoding unit is completed, for entropy encoding for a current encoding unit within a current maximum encoding unit (2350), and the first maximum encoding unit and the second maximum encoding unit may be encoded before the current maximum encoding unit (2350).

[0569] A method of encoding an image according to one embodiment may include a step of updating a probability value of a context based on a bin stored according to the context.

[0570] A method of encoding an image according to one embodiment may include a step of arithmetic encoding a syntax element for a current encoding unit based on a probability value of an updated context.

[0571] In one embodiment, the total number of bins stored according to the context may be less than or equal to a predetermined first threshold value.

[0572] In one embodiment, the number of bins stored for any one context may be less than or equal to a limit value set for any one context, or less than or equal to the lesser of the limit value and a second predetermined threshold value.

[0573] According to an image encoding method according to one embodiment, the bit rate of a bitstream can be reduced through entropy coding using probability value tuning.

[0574] An image encoding device according to one embodiment may include a context modeler (3430) that stores a bin corresponding to a syntax element of at least one encoding unit within a first maximum encoding unit according to a context of the syntax element, obtains a probability value of a context of a syntax element after entropy encoding for at least one encoding unit within a second maximum encoding unit is completed for entropy encoding for a current encoding unit within a current maximum encoding unit (2350), and updates the probability value of the context based on the bin stored according to the context.

[0575] An image encoding device according to one embodiment may include an arithmetic encoding unit (3450) that arithmetic-encodes a syntax element for a current encoding unit based on a probability value of an updated context.

[0576] In one embodiment, at least one coding unit within the first maximum coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0577] In one embodiment, the first maximum coding unit and the second maximum coding unit may be coded before the current maximum coding unit (2350).

[0578] In one embodiment, the total number of bins stored according to the context may be less than or equal to a predetermined first threshold value.

[0579] In one embodiment, the number of bins stored for any one context may be less than or equal to a limit value set for any one context, or less than or equal to the lesser of the limit value and a second predetermined threshold value.

[0580] According to an image encoding device according to one embodiment, the bit rate of a bitstream can be reduced through entropy coding using probability value tuning.

[0581] In a computer-readable recording medium for recording a bitstream according to one embodiment, the bitstream may correspond to a result of arithmetic encoding of a syntax element for a current encoding unit.

[0582] In one embodiment, the result of arithmetic encoding of a syntax element can be obtained by storing a bin corresponding to a syntax element of at least one coding unit within a first maximum coding unit according to the context of the syntax element.

[0583] In one embodiment, the result of arithmetic encoding of a syntax element can be obtained by obtaining a probability value of a context of a syntax element after entropy encoding for at least one encoding unit within a second maximum encoding unit is completed for entropy encoding for a current encoding unit within a current maximum encoding unit (2350).

[0584] In one embodiment, the result of arithmetic encoding of a syntax element can be obtained by updating the probability value of the context based on a bin stored according to the context.

[0585] In one embodiment, the result of arithmetic encoding of a syntax element can be obtained by arithmetic encoding of a syntax element for a current encoding unit based on a probability value of an updated context.

[0586] In one embodiment, at least one coding unit within the first maximum coding unit may be adjacent to a lower boundary or a right boundary of the first maximum coding unit.

[0587] In one embodiment, the first maximum coding unit and the second maximum coding unit may be coded before the current maximum coding unit (2350).

[0588] In one embodiment, the total number of bins stored according to the context may be less than or equal to a predetermined first threshold value.

[0589] In one embodiment, the number of bins stored for any one context may be less than or equal to a limit value set for any one context, or less than or equal to the lesser of the limit value and a second predetermined threshold value.

[0590] One embodiment can reduce the bitrate of a bitstream through entropy coding using probability value tuning.

[0591] One embodiment can stably maintain the load due to buffering and probability value tuning by limiting the number of bins stored in the buffer to a predetermined block standard.

[0592] One embodiment allows probability values ​​of multiple contexts to be tuned by adjusting the number of bins stored in a buffer based on the context.

[0593] The effects that can be obtained from the present disclosure are not limited to the effects mentioned above, and other effects that are not mentioned can be clearly understood by a person having ordinary skill in the art to which the present disclosure belongs from the description below.

[0594] 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 in a storage medium that can be read by a device.

[0595] A device-readable storage medium may be provided in the form of a non-transitory storage medium. Here, the term "non-transitory storage medium" simply means a tangible device that does not contain signals (e.g., electromagnetic waves). This term does not distinguish between cases where data is permanently stored in the storage medium and cases where data is temporarily stored. For example, a "non-transitory storage medium" may include a buffer in which data is temporarily stored.

[0596] According to one embodiment, the method according to various embodiments disclosed in the present document may be provided as included in a computer program product. The computer program product may be traded as a product between a seller and a buyer. The computer program product may be distributed in the form of a machine-readable storage medium (e.g., compact disc read-only memory (CD-ROM)), or may be distributed online (e.g., downloaded or uploaded) 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., a downloadable app) may be temporarily stored or temporarily generated in a machine-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or an intermediary server.

[0597] Above, the technical idea of ​​the present disclosure has been described in detail with reference to preferred embodiments, but the technical idea of ​​the present disclosure is not limited to the above embodiments, and various modifications and changes are possible by a person having ordinary knowledge in the art within the scope of the technical idea of ​​the present disclosure.

Claims

1. A step of storing a bin obtained through entropy decoding for at least one coding unit within a first maximum coding unit according to the context of a syntax element, wherein the at least one coding unit is adjacent to a lower boundary or a right boundary of the first maximum coding unit; A step of obtaining a probability value of a context of a syntax element after entropy decoding for at least one coding unit in a second maximum coding unit is completed for entropy decoding for a current coding unit within a current maximum coding unit (2350), wherein the first maximum coding unit and the second maximum coding unit are restored before the current maximum coding unit (2350); A step of updating the probability value of the above context based on the bin stored according to the above context; and A step of restoring a syntax element for the current encoding unit based on the probability value of the updated context, The total number of bins stored according to the above context is less than or equal to a predetermined first threshold value, A method for decoding an image, wherein the number of bins stored for a given context is less than or equal to a limit value set for said one context, or less than or equal to a smaller value between said limit value and a predetermined second threshold value.

2. In paragraph 1, The above limits are set independently for each context, A method for decoding an image, wherein the second threshold value is determined to be the same value for contexts.

3. In any one of paragraphs 1 and 2, The above limit values ​​are, A method for decoding an image, wherein the value corresponding to the first factor is set independently for each context for updating the above probability value.

4. In any one of the clauses 1 to 3, The probability value in the above context is, Including a first probability value updated based on the first factor and a second probability value updated based on the second factor, An image decoding method, wherein the size of the first factor is smaller than the size of the second factor.

5. In any one of paragraphs 1 to 4, The above first maximum encoding unit is located above, to the left or upper left of the current maximum encoding unit (2350), A method for decoding an image, wherein the second maximum coding unit is located on the left side of the current maximum coding unit (2350) or on the rightmost side of an upper row of a maximum coding unit row including the current maximum coding unit (2350).

6. In any one of paragraphs 1 to 5, The above updating steps are: A step of identifying one of the first maximum coding unit (2340) located to the left of the current maximum coding unit (2350), the first maximum coding unit (2320) located above the current maximum coding unit (2350), and the first maximum coding unit (2310) located to the upper left of the current maximum coding unit (2350) based on information included in the bitstream; and An image decoding method, comprising the step of updating a probability value of the context based on a bin obtained through entropy decoding for at least one coding unit within the identified first maximum coding unit.

7. In any one of paragraphs 1 to 6, The above updating steps are: A step of identifying one of the first maximum coding unit (2340) located to the left of the current maximum coding unit (2350) and the first maximum coding unit (2320) located above the current maximum coding unit (2350) based on a comparison result of the width and height of the current coding unit; and An image decoding method, comprising the step of updating a probability value of the context based on a bin obtained through entropy decoding for at least one coding unit within the identified first maximum coding unit.

8. In any one of paragraphs 1 to 7, The above updating steps are: A step of identifying one of the first maximum coding unit (2340) located on the left side of the current maximum coding unit (2350) and the first maximum coding unit (2320) located above the current maximum coding unit (2350), based on a comparison result of a height of a coding unit adjacent to the left side of the current coding unit among the coding units in the first maximum coding unit (2340) located on the left side of the current maximum coding unit (2350) and a width of a coding unit adjacent to the upper side of the current coding unit among the coding units in the first maximum coding unit (2320) located above the current maximum coding unit (2350); and An image decoding method, comprising the step of updating a probability value of the context based on a bin obtained through entropy decoding for at least one coding unit within the identified first maximum coding unit.

9. In any one of paragraphs 1 to 8, The above updating steps are: A step of identifying one of a first maximum coding unit (2340) located to the left of the current maximum coding unit (2350), a first maximum coding unit (2320) located above the current maximum coding unit (2350), and a first maximum coding unit (2310) located to the upper left of the current maximum coding unit (2350), based on a comparison result of an area of ​​a coding unit in the first maximum coding unit (2340) located to the left of the current maximum coding unit (2350), an area of ​​a coding unit in the first maximum coding unit (2320) located above the current maximum coding unit (2350), and an area of ​​a coding unit in the first maximum coding unit (2310) located to the upper left of the current maximum coding unit (2350); and An image decoding method, comprising the step of updating a probability value of the context based on a bin obtained through entropy decoding for at least one coding unit within the identified first maximum coding unit.

10. In any one of the clauses 1 to 9, The above video decryption method is, Further comprising a step of obtaining a probability value of a context of a syntax element after the entropy decoding for a coding unit restored before the current coding unit among the coding units included in the current maximum coding unit (2350) is completed, The above updating steps are: An image decoding method, comprising the step of updating a probability value of a context of a syntax element after entropy decoding for a coding unit restored before the current coding unit is completed, based on a bin stored according to the context.

11. In any one of clauses 1 to 10, The above current encoding unit is adjacent to the left boundary of the above current maximum encoding unit (2350), The above first maximum encoding unit (2340) is located to the left of the current maximum encoding unit (2350). The above updating steps are: An image decoding method, comprising: a step of updating a probability value of a context of a syntax element after entropy decoding for an encoding unit restored before the current encoding unit is completed, based on a bin obtained through entropy decoding for at least one encoding unit in a first maximum encoding unit (2340) located to the left of the current maximum encoding unit (2350), when the height of the current encoding unit is greater than the width.

12. A context modeler (2010) that stores a bin obtained through entropy decoding for at least one coding unit in a first maximum coding unit according to the context of a syntax element, obtains a probability value of a context of a syntax element after the entropy decoding for at least one coding unit in a second maximum coding unit is completed for entropy decoding for a current coding unit in a current maximum coding unit (2350), and updates the probability value of the context based on the bin stored according to the context; and An arithmetic decoding unit (2030) for restoring a syntax element for the current encoding unit based on the probability value of the updated context is included. At least one coding unit within the first maximum coding unit is adjacent to the lower boundary or the right boundary of the first maximum coding unit, The first maximum coding unit and the second maximum coding unit are restored before the current maximum coding unit (2350), The total number of bins stored according to the above context is less than or equal to a predetermined first threshold value, An image decoding device, wherein the number of bins stored for a given context is less than or equal to a limit value set for said one context, or less than or equal to a smaller value between said limit value and a predetermined second threshold value.

13. A step of storing a bin corresponding to a syntax element of at least one coding unit within a first maximum coding unit according to a context of the syntax element, wherein the at least one coding unit is adjacent to a lower boundary or a right boundary of the first maximum coding unit; A step of obtaining a probability value of a context of a syntax element after entropy encoding for at least one encoding unit in a second maximum encoding unit is completed for entropy encoding for a current encoding unit within a current maximum encoding unit (2350), wherein the first maximum encoding unit and the second maximum encoding unit are encoded before the current maximum encoding unit (2350); A step of updating the probability value of the above context based on the bin stored according to the above context; and A step of arithmetic encoding a syntax element for the current encoding unit based on a probability value of the updated context, The total number of bins stored according to the above context is less than or equal to a predetermined first threshold value, A method for encoding an image, wherein the number of bins stored for a given context is less than or equal to a limit value set for said one context, or less than or equal to a smaller value between said limit value and a second threshold value determined in advance.

14. A context modeler (3430) that stores a bin corresponding to a syntax element of at least one coding unit in a first maximum coding unit according to the context of the syntax element, obtains a probability value of the context of the syntax element after the entropy coding for at least one coding unit in a second maximum coding unit is completed for entropy coding for the current coding unit in the current maximum coding unit (2350), and updates the probability value of the context based on the bin stored according to the context; and Including an arithmetic encoding unit (3450) that arithmetic-encodes a syntax element for the current encoding unit based on the probability value of the updated context, At least one coding unit within the first maximum coding unit is adjacent to the lower boundary or the right boundary of the first maximum coding unit, The first maximum coding unit and the second maximum coding unit are coded before the current maximum coding unit (2350), The total number of bins stored according to the above context is less than or equal to a predetermined first threshold value, An image encoding device, wherein the number of bins stored for a given context is less than or equal to a limit value set for said one context, or less than or equal to a smaller value between said limit value and a second threshold value determined in advance.

15. In a computer-readable recording medium that records a bitstream, The above bitstream corresponds to the result of arithmetic encoding of the syntax element for the current encoding unit, The result of arithmetic encoding of the above syntax elements is: Store a bin corresponding to a syntax element of at least one coding unit within the first maximum coding unit according to the context of the syntax element, For entropy encoding for the current encoding unit within the current maximum encoding unit (2350), a probability value of the context of a syntax element is obtained after the entropy encoding for at least one encoding unit within the second maximum encoding unit is completed, The probability value of the above context is updated based on the bin stored according to the above context, is obtained by arithmetic encoding the syntax element for the current encoding unit based on the probability value of the updated context, At least one coding unit within the first maximum coding unit is adjacent to the lower boundary or the right boundary of the first maximum coding unit, The first maximum coding unit and the second maximum coding unit are coded before the current maximum coding unit (2350), The total number of bins stored according to the above context is less than or equal to a predetermined first threshold value, A recording medium wherein the number of bins stored for a given context is less than or equal to a limit value set for said one context, or less than or equal to a smaller value between said limit value and a second threshold value determined in advance.

Citation Information

Patent Citations

  • Method for determining context model and scalable video coding apparatus thereof

    KR101867613B1

  • Blind branch outlet socket assembly

    KR102143396B1

  • Low complexity entropy-encoding / decoding method and apparatus

    US20170289579A1

  • KR20210018140A

  • KR20230087621A