Methods and tools for encoding video entropy and methods and tools for decoding video entropy.
Patent Information
- Application Number
- TH2401002910
- Authority / Receiving Office
- TH · TH
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2013-07-02
- Publication Date
- 2026-10-05
AI Technical Summary
Existing video compression methods, such as MPEG-1, MPEG-2, MPEG-4, H.264/MPEG-4 AVC, face challenges in efficiently entropy-encoding and decoding syntax elements related to transformation units, particularly in selecting appropriate context models based on the hierarchical split relationships between coding and transformation units.
The method involves determining a context model for arithmetic decoding of transform unit significant coefficients based on the transformation depth, which indicates the number of splits from a coding unit to a transformation unit, thereby simplifying the selection criteria and calculation processes for entropy encoding and decoding.
This approach simplifies the context model selection process and improves the efficiency of entropy encoding and decoding by accurately determining context models based on transformation depth, enhancing the overall video compression process.
Smart Images

Figure 00000001_0000
Abstract
Description
The present invention relates to video encoding and decoding, and more particularly, to a method and apparatus for entropy encoding and decoding information related to a transform unit. In video compression methods such as MPEG-1, MPEG-2, MPEG-4 H.264 / MPEG-4 AVC (Advanced Video coding), the image is divided into blocks of a predetermined size, and then residual data of the block is obtained using inter prediction or intra prediction. The residual data is compressed through transformation, quantization, scanning, run length coding, and entropy coding. In entropy coding, syntax elements, such as transformation coefficients or prediction modes, are entropy encoded and a bitstream is output. The decoder parses and extracts syntax elements from the bitstream, and restores the image based on the extracted syntax elements. The technical problem to be solved by the present invention is to provide an entropy encoding method and device, and an entropy decoding method and device, which select a context model used for entropy encoding and decoding syntax elements related to a conversion unit based on a conversion depth representing a hierarchical division relationship between an encoding unit and a conversion unit, which is a data unit used in a conversion processing process of the encoding unit. A context model for arithmetic decoding of a transform unit validity flag is determined based on a transform depth indicating the number of times an coding unit is split to determine a transform unit included in the coding unit, and the transform unit validity flag is arithmetic decoded based on the determined context model. According to embodiments of the present invention, by selecting a context model based on a transformation depth, the selection criteria used in the context model selection process can be simplified and the computational process required for the entropy encoding and decoding process can be simplified. FIG. 1 illustrates a block diagram of a video encoding device according to one embodiment of the present invention. FIG. 2 illustrates a block diagram of a video decoding device according to one embodiment of the present invention. Figure 3 illustrates the concept of a coding unit according to one embodiment of the present invention. FIG. 4 illustrates a specific block diagram of a video encoding device based on encoding units of a hierarchical structure according to one embodiment of the present invention. FIG. 5 illustrates a specific block diagram of a video decoding device based on a hierarchical structure of encoding units according to one embodiment of the present invention. FIG. 6 illustrates depth-based encoding units and partitions according to one embodiment of the present invention. FIG. 7 illustrates the relationship between encoding units and transformation units according to one embodiment of the present invention. FIG. 8 illustrates depth-specific encoding information according to one embodiment of the present invention. FIG. 9 illustrates a depth-based encoding unit according to one embodiment of the present invention. Figures 10, 11 and 12 illustrate the relationship between encoding units, prediction units and frequency transform units according to one embodiment of the present invention. Figure 13 illustrates the relationship between encoding units, prediction units, and transformation units according to the encoding mode information of Table 1. FIG. 14 is a block diagram showing the configuration of an entropy encoding device according to one embodiment of the present invention. FIG. 15 is a flow chart illustrating a process of entropy encoding and decoding a syntax element for a transformation unit according to one embodiment of the present invention. FIG. 16 is a diagram showing an example of an encoding unit and a transformation unit included in the encoding unit according to one embodiment. FIG. 17 is a diagram showing a context increase parameter (ctxInc) used to determine the context model of the conversion unit validity coefficient flag cbf of the conversion unit of FIG. 16 based on the conversion depth. FIG. 18 is a diagram illustrating another example of an encoding unit and a transformation unit included in the encoding unit according to one embodiment. FIG. 19 is a diagram showing an example of a split transform flag (split_transform_flag) for determining the structure of a transform unit included in an encoding unit of FIG. 16 according to one embodiment. Figure 20 illustrates a transform unit that is entropy encoded according to one embodiment. Figure 21 is a diagram showing a validity map corresponding to the conversion unit (2010) of Figure 20. Figure 22 is a diagram showing coeff_abs_level_greater1_flag corresponding to the 4x4 transformation unit (2010) of Figure 20. Figure 23 is a diagram showing coeff_abs_level_greater2_flag corresponding to the 4x4 transformation unit (2010) of Figure 20. Figure 24 is a diagram showing coeff_abs_level_remaining corresponding to the 4x4 transformation unit (2010) of Figure 20. Fig. 25 is a flow chart illustrating a method for entropy encoding a video according to one embodiment. Figure 26 is a block diagram showing the configuration of an entropy decryption device according to one embodiment of the present invention. FIG. 27 is a flow chart illustrating a method for decoding entropy of a video according to one embodiment of the present invention. A method for decoding entropy of a video according to one embodiment of the present invention is characterized by including the steps of: determining a transformation unit included in an encoding unit and used for inverse transform processing of the encoding unit; obtaining a transformation unit validity flag indicating whether a non-zero transformation coefficient exists in the transformation unit from a bitstream; determining a context model for arithmetic decoding of the transformation unit validity flag based on a transformation depth of the transformation unit, when the number of times the encoding unit is split to determine the transformation unit is referred to as a transformation depth of the transformation unit; and a step of arithmetic decoding the transformation unit validity flag based on the determined context model. In one embodiment, a video entropy decoding device comprises: a parsing unit that obtains, from a bitstream, a transformation unit validity flag indicating whether a transformation unit included in an encoding unit and used for inverse transformation processing of the encoding unit has a non-zero transformation coefficient; a context modeler that determines a context model for arithmetic decoding of the transformation unit validity flag based on a transformation depth of the transformation unit, when the number of times the encoding unit is split to determine the transformation unit is referred to as a transformation depth of the transformation unit; and an arithmetic decoding unit that arithmetic decodes the transformation unit validity flag based on the determined context model. A method for entropy encoding a video according to one embodiment is characterized by including: a step of obtaining data of a transformed coding unit based on a transformation unit; a step of determining a context model for arithmetic encoding of a transformation unit significance flag indicating whether a non-zero transform coefficient exists in the transformation unit based on a transformation depth of the transformation unit, where the number of times the coding unit is split to determine a transformation unit included in the coding unit is referred to as a transformation depth of the transformation unit; and a step of arithmetic encoding the transformation unit significance flag based on the determined context model. In one embodiment, a video entropy encoding device comprises: a context modeler for determining a context model for arithmetic encoding of a transform unit significance flag indicating whether a non-zero transform coefficient exists in the transform unit based on a transform depth of the transform unit, wherein the number of times the coding unit is split to obtain data of a transformed coding unit based on a transform unit and determine a transformation unit included in the coding unit is a transform depth of the transform unit; and an arithmetic encoding unit for arithmetic encoding the transform unit significance flag based on the determined context model. Hereinafter, embodiments of the present invention will be described in detail with reference to the attached drawings. First, with reference to FIGS. 1 to 13, a method and device for encoding and decoding a video based on encoding units according to a hierarchical tree structure according to an embodiment of the present invention are disclosed. In addition, with reference to FIGS. 14 to 27, an entropy encoding and decoding process for syntax elements obtained in the encoding and decoding method of the video described in FIGS. 1 to 13 is specifically described. FIG. 1 illustrates a block diagram of a video encoding device according to one embodiment of the present invention. A video encoding device (100) according to one embodiment includes a hierarchical encoding unit (110) and an entropy encoding unit (120). The hierarchical encoding unit (110) divides the current picture to be encoded into data units of a predetermined size and performs encoding for each data unit. Specifically, the hierarchical encoding unit (110) can divide the current picture based on the maximum encoding unit, which is the encoding unit with the largest size. The maximum encoding unit according to one embodiment is a data unit having a size of 32x32, 64x64, 128x128, 256x256, etc., and can be a square data unit having a horizontal and vertical size greater than 8 and a length of each side being a power of 2. A coding unit according to one embodiment may be characterized by a maximum size and a depth. The depth represents the number of times an coding unit is spatially divided from a maximum coding unit, and as the depth becomes deeper, the coding unit for each depth may be divided from the maximum coding unit to the minimum coding unit. The depth of the maximum coding unit may be defined as the highest depth, and the minimum coding unit may be defined as the lowest coding unit. Since the size of the coding unit for each depth decreases as the depth becomes deeper, an coding unit for a higher depth may include coding units for multiple lower depths. As described above, image data of a current picture is divided into maximum coding units according to the maximum size of the coding unit, and each maximum coding unit may include coding units divided by depth. Since the maximum coding unit according to one embodiment is divided by depth, image data of a spatial domain included in the maximum coding unit can be hierarchically classified by depth. There may be preset maximum depth and maximum size of coding units, which limit the total number of times the height and width of a maximum coding unit can be hierarchically divided. The hierarchical encoding unit (110) encodes at least one divided region in which the region of the maximum encoding unit is divided for each depth, and determines the depth at which the final encoding result is to be output for each of the at least one divided region. That is, the hierarchical encoding unit (110) encodes image data as a depth-specific encoding unit for each maximum encoding unit of the current picture, and selects a depth at which the smallest encoding error occurs, and determines it as the encoding depth. The determined encoding depth and image data for each maximum encoding unit are output to the entropy encoding unit (120). Image data within a maximum coding unit is encoded based on depth-specific coding units according to at least one depth lower than a maximum depth, and encoding results based on each depth-specific coding unit are compared. As a result of comparing encoding errors of depth-specific coding units, a depth with a smallest encoding error can be selected. At least one coding depth can be determined for each maximum coding unit. The size of the maximum coding unit increases as the depth increases, and the number of coding units increases as the coding units are hierarchically divided. In addition, even for coding units of the same depth included in one maximum coding unit, the coding error for each data is measured and whether to be divided into a lower depth is determined. Accordingly, even for data included in one maximum coding unit, the coding depth may be determined differently depending on the position because the coding error by depth is different depending on the position. Accordingly, one or more coding depths may be set for one maximum coding unit, and the data of the maximum coding unit may be partitioned according to coding units of one or more coding depths. Accordingly, the hierarchical encoding unit (110) according to one embodiment can determine encoding units according to the tree structure included in the current maximum encoding unit. The 'encoding units according to the tree structure' according to one embodiment include encoding units of a depth determined by an encoding depth among all depth-based encoding units included in the current maximum encoding unit. The encoding unit of the encoding depth can be hierarchically determined according to the depth in the same region within the maximum encoding unit, and can be independently determined for other regions. Similarly, the encoding depth for the current region can be determined independently from the encoding depth for other regions. The maximum depth according to one embodiment is an indicator related to the number of splits from the maximum coding unit to the minimum coding unit. The first maximum depth according to one embodiment may represent the total number of splits from the maximum coding unit to the minimum coding unit. The second maximum depth according to one embodiment may represent the total number of depth levels from the maximum coding unit to the minimum coding unit. For example, when the depth of the maximum coding unit is 0, the depth of the coding unit into which the maximum coding unit is split once may be set to 1, and the depth of the coding unit into which the maximum coding unit is split twice may be set to 2. In this case, if the coding unit split from the maximum coding unit four times is the minimum coding unit, there are depth levels of depths 0, 1, 2, 3, and 4, so the first maximum depth may be set to 4, and the second maximum depth may be set to 5. Predictive encoding and frequency transformation of the maximum coding unit can be performed. Predictive encoding and frequency transformation are also performed based on depth-specific coding units for each maximum coding unit and for each depth below the maximum depth. As the number of depth-specific coding units increases as the maximum coding unit is split by depth, encoding including prediction coding and frequency transformation must be performed on all depth-specific coding units generated as the depth deepens. For convenience of explanation below, prediction coding and frequency transformation are explained based on the coding unit of the current depth among at least one maximum coding unit. A video encoding device (100) according to one embodiment can select various sizes or shapes of data units for encoding image data. In order to encode image data, steps such as prediction encoding, frequency transformation, and entropy encoding are performed, and the same data unit may be used throughout all steps, or the data unit may be changed for each step. For example, the video encoding device (100) may select a data unit other than the encoding unit to perform predictive encoding of the image data of the encoding unit, as well as an encoding unit for encoding the image data. In order to perform prediction encoding of the maximum coding unit, prediction encoding may be performed based on an coding unit of an coding depth according to an embodiment, that is, a more unusual indivisible coding unit. Hereinafter, the more unusual indivisible coding unit that is the basis of prediction encoding is referred to as a 'prediction unit'. A partition into which a prediction unit is divided may include a prediction unit and a data unit into which at least one of the height and width of the prediction unit is divided. For example, when an encoding unit of size 2Nx2N (where N is a positive integer) is no longer split, it becomes a prediction unit of size 2Nx2N, and the sizes of the partitions can be 2Nx2N, 2NxN, Nx2N, NxN, etc. The partition type according to one embodiment may optionally include not only symmetric partitions in which the height or width of the prediction unit is split in a symmetrical ratio, but also partitions in which the height or width is split in an asymmetrical ratio such as 1:n or n:1, partitions in which the height or width is split in a geometric shape, partitions in an arbitrary shape, etc. The prediction mode of the prediction unit can be at least one of intra mode, inter mode, and skip mode. For example, the intra mode and inter mode can be performed on partitions of sizes 2Nx2N, 2NxN, Nx2N, and NxN. In addition, the skip mode can be performed only on partitions of sizes 2Nx2N. Encoding can be performed independently for each prediction unit within an encoding unit, so that a prediction mode with the smallest encoding error can be selected. In addition, the video encoding device (100) according to one embodiment can perform frequency conversion of image data of an encoding unit based on not only an encoding unit for encoding image data, but also a data unit other than the encoding unit. For frequency transformation of a coding unit, frequency transformation may be performed based on a data unit of a size smaller than or equal to the coding unit. For example, the data unit for frequency transformation may include a data unit for intra mode and a data unit for inter mode. Hereinafter, the data unit that is the basis of the frequency transformation may be referred to as a 'transformation unit'. In a similar manner to the encoding unit, the transformation unit within the encoding unit may also be recursively divided into transformation units of smaller size, and the residual data of the encoding unit may be divided into transformation units according to the tree structure according to the transformation depth. For a transformation unit according to one embodiment, a transformation depth may be set, which indicates the number of times the height and width of an encoding unit are divided to reach a transformation unit. For example, if the size of a transformation unit of a current encoding unit with a size of 2Nx2N is 2Nx2N, the transformation depth may be set to 0, if the size of the transformation unit is NxN, the transformation depth may be set to 1, and if the size of the transformation unit is N / 2xN / 2, the transformation depth may be set to 2. In other words, a transformation unit according to a tree structure may be set according to the transformation depth for a transformation unit. Encoding information by encoding depth requires not only the encoding depth but also prediction-related information and frequency transformation-related information. Accordingly, the hierarchical encoding unit (110) can determine not only the encoding depth that causes the minimum encoding error, but also the partition type that divides the prediction unit into partitions, the prediction mode for each prediction unit, the size of the transformation unit for frequency transformation, etc. The method for determining encoding units and partitions according to the tree structure of the maximum encoding unit according to one embodiment will be described in detail later with reference to FIGS. 3 to 12. The hierarchical encoding unit (110) can measure the encoding error of each depth-based encoding unit using a rate-distortion optimization technique based on a Lagrangian multiplier. The entropy encoding unit (120) outputs image data of the maximum encoding unit encoded based on at least one encoding depth determined by the hierarchical encoding unit (110) and information about the encoding mode for each depth in the form of a bitstream. The encoded image data includes information about transform coefficients as an encoding result of residual data of the image. The information about the encoding mode for each depth may include encoding depth information, partition type information of the prediction unit, prediction mode information, size information of the transformation unit, etc. In particular, as described below, the entropy encoding unit (120) according to one embodiment may entropy-encode a transformation unit validity flag (cbf) indicating whether a non-zero transform coefficient is included in the transformation unit by using a context model determined based on the transformation depth of the transformation unit. The process of entropy-encoding syntax elements related to the transformation unit in the entropy encoding unit (120) will be described below. The encoding depth information can be defined using depth-specific split information indicating whether to encode not at the current depth but as a coding unit of a lower depth. If the current depth of the current coding unit is the coding depth, the current coding unit is encoded as a coding unit of the current depth, and therefore the split information of the current depth can be defined such that it is no longer split into lower depths. Conversely, if the current depth of the current coding unit is not the coding depth, encoding using a coding unit of a lower depth should be attempted, and therefore the split information of the current depth can be defined such that it is split into coding units of a lower depth. If the current depth is not an encoding depth, encoding is performed on encoding units divided into encoding units of lower depths. Since there is at least one encoding unit of a lower depth within the encoding unit of the current depth, encoding is performed repeatedly for each encoding unit of a lower depth, so that recursive encoding can be performed for each encoding unit of the same depth. Since tree-structured coding units are determined within one maximum coding unit and information about at least one coding mode must be determined for each coding unit of the coding depth, information about at least one coding mode can be determined for one maximum coding unit. In addition, since data of the maximum coding unit is hierarchically divided according to depth and the coding depth can be different for each position, information about the coding depth and coding mode can be set for the data. Accordingly, the entropy encoding unit (120) according to one embodiment can allocate encoding information for a corresponding encoding depth and encoding mode to at least one of an encoding unit, a prediction unit, and a minimum unit included in a maximum encoding unit. According to one embodiment, the minimum unit is a square data unit having a size in which the minimum coding unit, which is the lowest coding depth, is divided into four parts, and may be a square data unit of the maximum size that can be included in all coding units, prediction units, and transformation units included in the maximum coding unit. For example, encoding information output through the entropy encoding unit (120) can be classified into encoding information per encoding unit by depth and encoding information per prediction unit. The encoding information per encoding unit by depth can include prediction mode information and partition size information. The encoding information transmitted per prediction unit can include information about an estimation direction of an inter mode, information about a reference image index of an inter mode, information about a motion vector, information about a chroma component of an intra mode, information about an interpolation method of an intra mode, and the like. In addition, information about a maximum size of an encoding unit defined for each picture, slice, or GOP and information about a maximum depth can be inserted into a header of a bitstream. According to the simplest embodiment of the video encoding device (100), the depth-specific encoding unit is an encoding unit having a size that is half the height and width of the encoding unit of the upper depth of one layer. That is, if the size of the encoding unit of the current depth is 2Nx2N, the size of the encoding unit of the lower depth is NxN. In addition, the current encoding unit of the size of 2Nx2N can include up to four lower depth encoding units of the size of NxN. Therefore, the video encoding device (100) according to one embodiment can determine an encoding unit of an optimal shape and size for each maximum encoding unit based on the size and maximum depth of the maximum encoding unit determined in consideration of the characteristics of the current picture, thereby configuring encoding units according to a tree structure. In addition, since each maximum encoding unit can be encoded in various prediction modes, frequency transform methods, etc., an optimal encoding mode can be determined in consideration of the image characteristics of encoding units of various image sizes. Therefore, if an image having a very high resolution or a very large amount of data is encoded in the existing macroblock unit, the number of macroblocks per picture becomes excessively large. Accordingly, the compression information generated for each macroblock also increases, so the transmission burden of the compression information increases and the data compression efficiency tends to decrease. Therefore, the video encoding device (100) according to one embodiment can increase the maximum size of the encoding unit by considering the size of the image, and adjust the encoding unit by considering the image characteristics, so that the image compression efficiency can be increased. FIG. 2 illustrates a block diagram of a video decoding device according to one embodiment of the present invention. A video decoding device (200) according to one embodiment includes a parsing unit (210), an entropy decoding unit (220), and a hierarchical decoding unit (230). Definitions of various terms, such as information about encoding units, depths, prediction units, transformation units, and various encoding modes for various processing of the video decoding device (200) according to one embodiment, are the same as those described above with reference to FIG. 1 and the video encoding device (100). The parsing unit (210) receives a bitstream for an encoded video and parses syntax elements. The entropy decoding unit (220) performs entropy decoding on the parsed syntax elements, thereby arithmetic decoding the syntax elements representing encoded video data based on encoding units according to a tree structure, and outputs the arithmetic decoded syntax elements to the hierarchical decoding unit (230). That is, the entropy decoding unit (220) performs entropy decoding on syntax elements received in the form of a bit string of 0s and 1s to restore the syntax elements. The entropy decoding unit (220) extracts additional information such as coding depth, coding mode, color component information, and prediction mode information for coding units according to the tree structure for each maximum coding unit. The extracted information about coding depth and coding mode is output to the hierarchical decoding unit (230). Since the image data of the bit string is divided into maximum coding units and encoded, the hierarchical decoding unit (230) can decode the image data for each maximum coding unit. Information about the encoding depth and encoding mode for each maximum encoding unit can be set for one or more pieces of encoding depth information, and information about the encoding mode for each encoding depth can include partition type information of the corresponding encoding unit, prediction mode information, size information of the transformation unit, transformation coefficient information, etc. In addition, depth-specific partition information can also be extracted as the encoding depth information. The information about the encoding depth and encoding mode for each maximum encoding unit extracted by the entropy decoding unit (220) is information about the encoding depth and encoding mode determined by repeatedly performing encoding for each encoding unit for each maximum encoding unit and depth in an encoding unit, such as the video encoding device (100) according to one embodiment, to generate a minimum encoding error. Accordingly, the video decoding device (200) can decode data according to an encoding method that generates a minimum encoding error to restore an image. Encoding information about an encoding depth and an encoding mode according to one embodiment may be allocated to a predetermined data unit among the corresponding encoding unit, prediction unit, and minimum unit, so that the entropy decoding unit (220) may extract information about an encoding depth and an encoding mode for each predetermined data unit. If information about an encoding depth and an encoding mode of a corresponding maximum encoding unit is recorded for each predetermined data unit, predetermined data units having information about the same encoding depth and encoding mode may be inferred as data units included in the same maximum encoding unit. As described below, the entropy decoding unit (220) according to one embodiment can entropy decode a transformation unit validity coefficient flag (cbf) using a context model determined based on the transformation depth of the transformation unit. The process of entropy decoding syntax elements related to the transformation unit in the entropy decoding unit (220) will be described below. The hierarchical decoding unit (230) decodes image data of each maximum coding unit based on information about the coding depth and coding mode of each maximum coding unit to restore the current picture. That is, the image data decoding unit (230) can decode encoded image data based on the read partition type, prediction mode, and transformation unit for each coding unit among coding units according to the tree structure included in the maximum coding unit. The decoding process can include a prediction process including intra prediction and motion compensation, and a frequency inverse transform process. The hierarchical decoding unit (230) can perform intra prediction or motion compensation for each partition and prediction mode of each encoding unit based on the partition type information and prediction mode information of the prediction unit of each encoding unit for each encoding depth. In addition, the hierarchical decoding unit (230) can perform frequency inverse transformation for each transformation unit for each coding unit based on the size information of the transformation unit of the coding unit for each coding depth, for maximum coding unit-by-unit frequency inverse transformation. The hierarchical decoding unit (230) can determine the encoding depth of the current maximum encoding unit using the depth-based segmentation information. If the segmentation information indicates that the current depth is no longer divided, the current depth is the encoding depth. Accordingly, the hierarchical decoding unit (230) can decode the encoding unit of the current depth for the image data of the current maximum encoding unit using the partition type, prediction mode, and transformation unit size information of the prediction unit. That is, by observing the encoding information set for a given data unit among the encoding unit, prediction unit, and minimum unit, data units having encoding information including the same division information can be gathered and regarded as one data unit to be decoded in the same encoding mode by the hierarchical decoding unit (230). A video decoding device (200) according to one embodiment can obtain information about a coding unit that causes a minimum coding error by recursively performing coding for each maximum coding unit during an coding process, and use the information to decode a current picture. That is, decoding of coded image data of coding units according to a tree structure determined as an optimal coding unit for each maximum coding unit becomes possible. Therefore, even for high-resolution images or images with an excessive amount of data, the image data can be efficiently decoded and restored according to the size of the encoding unit and the encoding mode adaptively determined according to the characteristics of the image by using information about the optimal encoding mode transmitted from the encoding unit. Referring to FIGS. 3 to 13 below, a method of determining encoding units, prediction units, and transformation units according to a tree structure according to an embodiment of the present invention is described in detail. Figure 3 illustrates the concept of a hierarchical encoding unit. Examples of coding units include: a coding unit whose size is expressed as width x height, and can include coding units of sizes 64x64, 32x32, 16x16, and 8x8. A coding unit of size 64x64 can be divided into partitions of sizes 64x64, 64x32, 32x64, and 32x32, a coding unit of size 32x32 can be divided into partitions of sizes 32x32, 32x16, 16x32, and 16x16, a coding unit of size 16x16 can be divided into partitions of sizes 16x16, 16x8, 8x16, and 8x8, and a coding unit of size 8x8 can be divided into partitions of sizes 8x8, 8x4, 4x8, and 4x4. For video data (310), the resolution is set to 1920x1080, the maximum size of the encoding unit is set to 64, and the maximum depth is set to 2. For video data (320), the resolution is set to 1920x1080, the maximum size of the encoding unit is set to 64, and the maximum depth is set to 3. For video data (330), the resolution is set to 352x288, the maximum size of the encoding unit is set to 16, and the maximum depth is set to 1. The maximum depth illustrated in FIG. 3 represents the total number of divisions from the maximum encoding unit to the minimum encoding unit. In case of high resolution or large data volume, it is desirable that the maximum size of the encoding size is relatively large in order to improve encoding efficiency and accurately reflect the image characteristics. Therefore, compared to video data (330), the maximum size of the encoding size of high resolution video data (310, 320) may be selected as 64. Since the maximum depth of the video data (310) is 2, the encoding unit (315) of the video data (310) can include encoding units having a major axis size of 32 and 16 by splitting the maximum encoding unit having a major axis size of 64 twice and increasing the depth by two layers. On the other hand, since the maximum depth of the video data (330) is 1, the encoding unit (335) of the video data (330) can include encoding units having a major axis size of 16 by splitting the maximum encoding unit having a major axis size of 64 once and increasing the depth by one layer. Since the maximum depth of the video data (320) is 3, the encoding unit (325) of the video data (320) can be divided three times from the maximum encoding unit having a major axis size of 64, and the depth can be deepened by three layers to include encoding units having major axis sizes of 32, 16, and 8. As the depth increases, the ability to express detailed information can be improved. FIG. 4 illustrates a specific block diagram of a video encoding device based on encoding units of a hierarchical structure according to one embodiment of the present invention. The intra prediction unit (410) performs intra prediction on the encoding unit of the intra mode among the current frame (405), and the motion estimation unit (420) and the motion compensation unit (425) perform inter estimation and motion compensation using the current frame (405) and reference frame (495) of the inter mode. Data output from the intra prediction unit (410), motion estimation unit (420), and motion compensation unit (425) are output as quantized transform coefficients through the frequency transform unit (430) and the quantization unit (440). The quantized transform coefficients are restored as spatial domain data through the inverse quantization unit (460) and the frequency inverse transform unit (470), and the restored spatial domain data are post-processed through the deblocking unit (480) and the loop filtering unit (490) and output as a reference frame (495). The quantized transform coefficients can be output as a bitstream (455) through the entropy encoding unit (450). An entropy encoder (450) according to one embodiment performs arithmetic encoding on syntax elements related to a transform unit, for example, a transform unit valid transform coefficient flag (cbf) indicating whether a non-zero transform coefficient is included in the transform unit, a significance map indicating the position of a non-zero transform coefficient, a first threshold flag (coeff_abs_level_greater1_flag) indicating whether a transform coefficient has a value greater than 1, a second threshold flag (coeff_abs_level_greather2_flag) indicating whether a transform coefficient has a value greater than 2, and information on the size of a transform coefficient (coeff_abs_level_remaining) corresponding to a difference between a base level (baseLevel) determined based on the first threshold flag and the second threshold flag and an actual transform coefficient (abscoeff), and outputs a bit string. In order to be applied to a video encoding device (100) according to one embodiment, all of the components of the image encoding unit (400), including the intra prediction unit (410), the motion estimation unit (420), the motion compensation unit (425), the frequency transformation unit (430), the quantization unit (440), the entropy encoding unit (450), the inverse quantization unit (460), the inverse frequency transformation unit (470), the deblocking unit (480), and the loop filtering unit (490), must perform a task based on each coding unit among the coding units according to the tree structure while considering the maximum depth for each maximum coding unit. The intra prediction unit (410), the motion estimation unit (420), and the motion compensation unit (425) determine the partition and prediction mode of each coding unit among the coding units according to the tree structure by considering the maximum size and maximum depth of the current maximum coding unit, and the frequency transformation unit (430) determines the size of the transformation unit within each coding unit among the coding units according to the tree structure. FIG. 5 illustrates a specific block diagram of a video decoding device based on a hierarchical structure of encoding units according to one embodiment of the present invention. The bitstream (505) passes through the parsing unit (510) and the encoded image data to be decoded and the syntax elements, which are information on encoding required for decoding, are parsed. The encoded image data passes through the entropy decoding unit (520) and the inverse quantization unit (530) and is output as inverse quantized data. An entropy decoding unit (520) according to one embodiment obtains syntax elements related to a transform unit from a bitstream, that is, a transform unit valid transform coefficient flag (cbf) indicating whether a non-zero transform coefficient is included in the transform unit, a significance map, a first threshold flag (coeff_abs_level_greater1_flag) indicating whether a transform coefficient has a value greater than 1, a second threshold flag (coeff_abs_level_greather2_flag) indicating whether the transform coefficient has a value greater than 2, and size information (coeff_abs_level_remaining) of a transform coefficient corresponding to a difference between a base level (baseLevel) determined based on the first threshold flag and the second threshold flag and an actual transform coefficient (abscoeff), and performs arithmetic decoding on the obtained syntax elements to restore the syntax elements. The frequency inverse transform unit (540) restores the inverse quantized data into image data in the spatial domain. For the image data in the spatial domain, the intra prediction unit (550) performs intra prediction on the encoding unit of the intra mode, and the motion compensation unit (560) performs motion compensation on the encoding unit of the inter mode using the reference frame (585). Data in the spatial domain that has passed through the intra prediction unit (550) and the motion compensation unit (560) may be post-processed through the deblocking unit (570) and the loop filtering unit (580) and output as a restored frame (595). In addition, data that has been post-processed through the deblocking unit (570) and the loop filtering unit (580) may be output as a reference frame (585). In order to be applied to a video decoding device (200) according to one embodiment, all of the components of the image decoding unit (500), including the parsing unit (510), the entropy decoding unit (520), the inverse quantization unit (530), the inverse frequency transform unit (540), the intra prediction unit (550), the motion compensation unit (560), the deblocking unit (570), and the loop filtering unit (580), must perform operations based on the coding units according to the tree structure for each maximum coding unit. The intra prediction unit (550) and the motion compensation unit (560) determine the partition and prediction mode for each encoding unit according to the tree structure, and the frequency inverse transform unit (540) must determine the size of the transformation unit for each encoding unit. FIG. 6 illustrates depth-based encoding units and partitions according to one embodiment of the present invention. A video encoding device (100) according to one embodiment and a video decoding device (200) according to one embodiment use hierarchical encoding units to consider image characteristics. The maximum height and width and maximum depth of the encoding unit may be adaptively determined according to the characteristics of the image, and may be variously set according to the user's request. The size of the encoding unit for each depth may be determined according to the maximum size of the preset encoding unit. The hierarchical structure (600) of the encoding unit according to one embodiment illustrates a case where the maximum height and width of the encoding unit are 64 and the maximum depth is 4. As the depth increases along the vertical axis of the hierarchical structure (600) of the encoding unit according to one embodiment, the height and width of the encoding unit for each depth are divided, respectively. In addition, along the horizontal axis of the hierarchical structure (600) of the encoding unit, the prediction unit and partition that serve as the basis for the prediction encoding of each depth-specific encoding unit are illustrated. That is, the encoding unit (610) is the maximum encoding unit in the hierarchy (600) of encoding units, has a depth of 0, and the size of the encoding unit, i.e., the height and width, is 64x64. The depth increases along the vertical axis, and there is an encoding unit (620) of depth 1 with a size of 32x32, an encoding unit (630) of depth 2 with a size of 16x16, an encoding unit (640) of depth 3 with a size of 8x8, and an encoding unit (650) of depth 4 with a size of 4x4. The encoding unit (650) of depth 4 with a size of 4x4 is the minimum encoding unit. For each depth, prediction units and partitions of the encoding unit are arranged along the horizontal axis. That is, if a 64x64 coding unit (610) of depth 0 is a prediction unit, the prediction unit can be divided into a 64x64 partition (610), a 64x32 partition (612), a 32x64 partition (614), and a 32x32 partition (616) included in the 64x64 coding unit (610). Similarly, a prediction unit of a coding unit (620) of size 32x32 at depth 1 can be split into a partition (620) of size 32x32, partitions (622) of size 32x16, partitions (624) of size 16x32, and partitions (626) of size 16x16 contained in the coding unit (620) of size 32x32. Similarly, a prediction unit of a coding unit (630) of size 16x16 with depth 2 can be divided into a partition (630) of size 16x16, partitions (632) of size 16x8, partitions (634) of size 8x16, and partitions (636) of size 8x8 contained in the coding unit (630) of size 16x16. Similarly, a prediction unit of a coding unit (640) of size 8x8 with depth 3 can be divided into a partition (640) of size 8x8, partitions (642) of size 8x4, partitions (644) of size 4x8, and partitions (646) of size 4x4 contained in the coding unit (640) of size 8x8. Finally, a coding unit (650) of size 4x4 at depth 4 is the minimum coding unit and the coding unit of the lowest depth, and the corresponding prediction unit can also be set only to a partition (650) of size 4x4. The encoding unit determination unit (120) of the video encoding device (100) according to one embodiment must perform encoding for each encoding unit of each depth included in the maximum encoding unit (610) in order to determine the encoding depth of the maximum encoding unit (610). The number of depth-specific coding units for including data of the same range and size increases as the depth increases. For example, for data included in one coding unit of depth 1, four coding units of depth 2 are required. Therefore, in order to compare the encoding results of the same data by depth, each data must be encoded using one coding unit of depth 1 and four coding units of depth 2. For encoding at each depth, encoding may be performed on each prediction unit of the encoding unit at each depth along the horizontal axis of the hierarchical structure (600) of the encoding unit, and a representative encoding error, which is the smallest encoding error at the corresponding depth, may be selected. In addition, as the depth deepens along the vertical axis of the hierarchical structure (600) of the encoding unit, encoding may be performed at each depth, and the minimum encoding error may be searched for by comparing the representative encoding errors at each depth. The depth and partition at which the minimum encoding error occurs among the largest encoding units (610) may be selected as the encoding depth and partition type of the largest encoding unit (610). FIG. 7 illustrates the relationship between encoding units and transformation units according to one embodiment of the present invention. A video encoding device (100) according to one embodiment or a video decoding device (200) according to one embodiment encodes or decodes an image in encoding units of a size smaller than or equal to a maximum encoding unit for each maximum encoding unit. The size of a conversion unit for frequency conversion during an encoding process may be selected based on a data unit that is not larger than each encoding unit. For example, in a video encoding device (100) according to one embodiment or a video decoding device (200) according to one embodiment, when a current encoding unit (710) has a size of 64x64, frequency conversion can be performed using a conversion unit (720) having a size of 32x32. In addition, after performing frequency transformation on data of a 64x64 sized encoding unit (710) into conversion units of sizes 32x32, 16x16, 8x8, and 4x4 smaller than 64x64, and encoding the data, a conversion unit with the smallest error from the original can be selected. FIG. 8 illustrates depth-specific encoding information according to one embodiment of the present invention. An output unit (130) of a video encoding device (100) according to one embodiment may encode and transmit, as information about an encoding mode, information about a partition type (800), information about a prediction mode (810), and information about a transformation unit size (820) for each encoding unit of each encoding depth. Information on the partition type (800) represents information on the form of a partition into which the prediction unit of the current encoding unit is divided, as a data unit for predictive encoding of the current encoding unit. For example, the current encoding unit CU_0 having a size of 2Nx2N may be divided and used as one of a partition (802) having a size of 2Nx2N, a partition (804) having a size of 2NxN, a partition (806) having a size of Nx2N, and a partition (808) having a size of NxN. In this case, the information on the partition type of the current encoding unit (800) is set to represent one of a partition (802) having a size of 2Nx2N, a partition (804) having a size of 2NxN, a partition (806) having a size of Nx2N, and a partition (808) having a size of NxN. Information about the prediction mode (810) indicates the prediction mode of each partition. For example, through the information about the prediction mode (810), it can be set whether the partition indicated by the information about the partition type (800) performs prediction encoding in one of the intra mode (812), inter mode (814), and skip mode (816). Additionally, information about the transformation unit size (820) indicates whether the current encoding unit is to perform frequency transformation based on a transformation unit. For example, the transformation unit may be one of the first intra transformation unit size (822), the second intra transformation unit size (824), the first inter transformation unit size (826), and the second intra transformation unit size (828). The image data and encoding information extraction unit (210) of the video decoding device (200) according to one embodiment can extract information about the partition type (800), information about the prediction mode (810), and information about the transformation unit size (820) for each encoding unit according to depth and use them for decoding. FIG. 9 illustrates a depth-based encoding unit according to one embodiment of the present invention. Split information can be used to indicate changes in depth. Split information indicates whether a coding unit of the current depth is split into a coding unit of a lower depth. A prediction unit (910) for predictive encoding of a coding unit (900) of depth 0 and size 2N_0x2N_0 may include a partition type (912) of size 2N_0x2N_0, a partition type (914) of size 2N_0xN_0, a partition type (916) of size N_0x2N_0, and a partition type (918) of size N_0xN_0. Although only partitions (912, 914, 916, 918) in which the prediction unit is divided in a symmetrical ratio are exemplified, as described above, the partition types are not limited thereto and may include asymmetric partitions, partitions of arbitrary shapes, partitions of geometric shapes, etc. For each partition type, prediction encoding should be performed repeatedly for one partition of size 2N_0x2N_0, two partitions of size 2N_0xN_0, two partitions of size N_0x2N_0, and four partitions of size N_0xN_0. For partitions of size 2N_0x2N_0, size N_0x2N_0, and size 2N_0xN_0, prediction encoding can be performed in intra mode and inter mode. Skip mode can be performed only for prediction encoding for partitions of size 2N_0x2N_0. If the encoding error is the smallest by one of the partition types (912, 914, 916) of sizes 2N_0x2N_0, 2N_0xN_0, and N_0x2N_0, then there is no need to further split into lower depths. If the encoding error by the partition type (918) of size N_0xN_0 is the smallest, the depth 0 is changed to 1 and split (920), and encoding is repeatedly performed on the encoding units (930) of the partition type of depth 2 and size N_0xN_0 to search for the minimum encoding error. A prediction unit (940) for predictive encoding of a coding unit (930) of depth 1 and size 2N_1x2N_1 (=N_0xN_0) may include a partition type (942) of size 2N_1x2N_1, a partition type (944) of size 2N_1xN_1, a partition type (946) of size N_1x2N_1, and a partition type (948) of size N_1xN_1. In addition, if the encoding error by the partition type (948) of size N_1xN_1 is the smallest, the depth 1 is changed to depth 2 and split (950), and encoding is repeatedly performed on the encoding units (960) of depth 2 and size N_2xN_2 to search for the minimum encoding error. When the maximum depth is d, the depth-specific segmentation information is set up to depth d-1, and the segmentation information can be set up to depth d-2. That is, when segmentation (970) is performed from depth d-2 and encoding is performed up to depth d-1, a prediction unit (990) for prediction encoding of an encoding unit (980) of depth d-1 and size 2N_(d-1)x2N_(d-1) may include a partition type (992) of size 2N_(d-1)x2N_(d-1), a partition type (994) of size 2N_(d-1)xN_(d-1), a partition type (996) of size N_(d-1)x2N_(d-1), and a partition type (998) of size N_(d-1)xN_(d-1). Among the partition types, encoding through predictive encoding is repeatedly performed for one partition of size 2N_(d-1)x2N_(d-1), two partitions of size 2N_(d-1)xN_(d-1), two partitions of size N_(d-1)x2N_(d-1), and four partitions of size N_(d-1)xN_(d-1), so that the partition type that causes the minimum encoding error can be searched for. Even if the encoding error by the partition type (998) of size N_(d-1)xN_(d-1) is the smallest, since the maximum depth is d, the encoding unit CU_(d-1) of depth d-1 no longer undergoes the division process into lower depths, and the encoding depth for the current maximum encoding unit (900) is determined as depth d-1, and the partition type can be determined as N_(d-1)xN_(d-1). In addition, since the maximum depth is d, the division information is not set for the encoding unit (952) of depth d-1. The data unit (999) may be referred to as a 'minimum unit' for the current maximum encoding unit. The minimum unit according to one embodiment may be a square data unit having a size in which the minimum encoding unit, which is the lowest encoding depth, is divided into four. Through this repetitive encoding process, the video encoding device (100) according to one embodiment compares encoding errors by depth of the encoding unit (900) to select a depth in which the smallest encoding error occurs, thereby determining the encoding depth, and the corresponding partition type and prediction mode may be set to the encoding mode of the encoding depth. In this way, by comparing the minimum encoding errors for all depths of depths 0, 1, ..., d-1, d, the depth with the smallest error can be selected and determined as the encoding depth. The encoding depth, and the partition type and prediction mode of the prediction unit can be encoded and transmitted as information about the encoding mode. In addition, since the encoding unit must be divided from depth 0 to the encoding depth, only the division information of the encoding depth must be set to '0', and the division information for each depth except for the encoding depth must be set to '1'. The video data and encoding information extraction unit (220) of the video decoding device (200) according to one embodiment can extract information about an encoding depth and a prediction unit for an encoding unit (900) and use them to decode the encoding unit (912). The video decoding device (200) according to one embodiment can use the depth-specific segmentation information to identify a depth where the segmentation information is '0' as an encoding depth, and can use information about an encoding mode for the corresponding depth for decoding. Figures 10, 11 and 12 illustrate the relationship between encoding units, prediction units and frequency transform units according to one embodiment of the present invention. The coding unit (1010) is a coding unit for each coding depth determined by the video coding device (100) according to one embodiment for the maximum coding unit. The prediction unit (1060) is a partition of the prediction units of each coding unit for each coding depth among the coding units (1010), and the transformation unit (1070) is a transformation unit of each coding unit for each coding depth. If the depth of the maximum coding unit of the depth-based coding units (1010) is 0, the coding units (1012, 1054) have a depth of 1, the coding units (1014, 1016, 1018, 1028, 1050, 1052) have a depth of 2, the coding units (1020, 1022, 1024, 1026, 1030, 1032, 1048) have a depth of 3, and the coding units (1040, 1042, 1044, 1046) have a depth of 4. Some partitions (1014, 1016, 1022, 1032, 1048, 1050, 1052, 1054) among the prediction units (1060) are in the form of split coding units. That is, the partitions (1014, 1022, 1050, 1054) are of a 2NxN partition type, the partitions (1016, 1048, 1052) are of an Nx2N partition type, and the partition (1032) is of an NxN partition type. The prediction units and partitions of the depth-based coding units (1010) are smaller than or equal to each coding unit. For image data of some (1052) of the transformation units (1070), frequency transformation or frequency inverse transformation is performed on data units of a smaller size than the encoding unit. In addition, the transformation units (1014, 1016, 1022, 1032, 1048, 1050, 1052, 1054) are data units of different sizes or shapes compared to the corresponding prediction units and partitions among the prediction units (1060). That is, the video encoding device (100) according to one embodiment and the video decoding device (200) according to another embodiment may perform intra prediction / motion estimation / motion compensation tasks and frequency transformation / inverse transformation tasks on the same encoding unit based on separate data units, respectively. Accordingly, for each maximum coding unit, encoding is performed recursively for each coding unit of a hierarchical structure for each region, and an optimal coding unit is determined, so that coding units according to a tree structure can be configured. The encoding information can include segmentation information, partition type information, prediction mode information, and transformation unit size information for the coding unit. Table 1 below shows an example that can be set in a video encoding device (100) according to an embodiment and a video decoding device (200) according to an embodiment. Table 1 An entropy encoding unit (120) of a video encoding device (100) according to one embodiment outputs encoding information for encoding units according to a tree structure, and an entropy decoding unit (210) of a video decoding device (200) according to one embodiment can parse a received bitstream to extract encoding information for encoding units according to a tree structure. The partition information indicates whether the current coding unit is split into coding units of lower depths. If the partition information of the current depth d is 0, the coding depth is the depth at which the current coding unit is no longer split into lower coding units, so partition type information, prediction mode, and transformation unit size information can be defined for the coding depth. If the coding unit needs to be split one more step according to the partition information, encoding must be performed independently for each of the four coding units of the split lower depths. The prediction mode can be represented as one of intra mode, inter mode, and skip mode. Intra mode and inter mode can be defined in all partition types, and skip mode can be defined only in partition type 2Nx2N. Partition type information can represent symmetric partition types 2Nx2N, 2NxN, Nx2N, and NxN in which the height or width of a prediction unit is divided in a symmetrical ratio, and asymmetric partition types 2NxnU, 2NxnD, nLx2N, and nRx2N in which the height is divided in an asymmetrical ratio. The asymmetric partition types 2NxnU and 2NxnD represent forms in which the height is divided in a 1:n (n is an integer greater than 1) and n:1, respectively, and the asymmetric partition types nLx2N and nRx2N represent forms in which the width is divided in a 1:n and n:1, respectively. The size of the transformation unit can be set to two kinds of sizes in the intra mode and two kinds of sizes in the inter mode. That is, if the transformation unit partition information is 0, the size of the transformation unit is set to the size of the current encoding unit 2Nx2N. If the transformation unit partition information is 1, the transformation unit of the size into which the current encoding unit is partitioned can be set. In addition, if the partition type for the current encoding unit with the size 2Nx2N is a symmetric partition type, the size of the transformation unit can be set to NxN, and if it is an asymmetric partition type, the size of the transformation unit can be set to N / 2xN / 2. Encoding information of encoding units according to a tree structure according to one embodiment may be allocated to at least one of an encoding unit, a prediction unit, and a minimum unit of an encoding depth. An encoding unit of an encoding depth may include one or more prediction units and minimum units having the same encoding information. Therefore, by checking the encoding information each of adjacent data units has, it can be checked whether they are included in an encoding unit of the same encoding depth. In addition, since the encoding unit of the corresponding encoding depth can be checked by using the encoding information possessed by the data unit, the distribution of encoding depths within the maximum encoding unit can be inferred. Therefore, in this case, when the current encoding unit is predicted by referring to the surrounding data units, the encoding information of the data unit within the depth-specific encoding unit adjacent to the current encoding unit can be directly referenced and used. In another embodiment, when predictive encoding is performed on a current encoding unit with reference to a neighboring encoding unit, encoding information of an adjacent depth-specific encoding unit may be used to search for data adjacent to the current encoding unit within the depth-specific encoding unit, thereby referencing the neighboring encoding unit. Figure 13 illustrates the relationship between encoding units, prediction units, and transformation units according to the encoding mode information of Table 1. The maximum coding unit (1300) includes coding units (1302, 1304, 1306, 1312, 1314, 1316, 1318) of coding depths. Since one of the coding units (1318) is a coding unit of coding depth, partition information may be set to 0. Partition type information of the coding unit (1318) having a size of 2Nx2N may be set to one of partition types 2Nx2N(1322), 2NxN(1324), Nx2N(1326), NxN(1328), 2NxnU(1332), 2NxnD(1334), nLx2N(1336), and nRx2N(1338). If the partition type information is set to one of the symmetric partition types 2Nx2N(1322), 2NxN(1324), Nx2N(1326), and NxN(1328), if the conversion unit division information (TU size flag) is 0, a conversion unit (1342) of size 2Nx2N can be set, and if the conversion unit division information is 1, a conversion unit (1344) of size NxN can be set. When the partition type information is set to one of the asymmetric partition types 2NxnU (1332), 2NxnD (1334), nLx2N (1336), and nRx2N (1338), if the transformation unit division information (TU size flag) is 0, a transformation unit (1352) of size 2Nx2N may be set, and if the transformation unit division information is 1, a transformation unit (1354) of size N / 2xN / 2 may be set. Transformation unit partition information (TU size flag) is a type of transformation index, and the size of the transformation unit corresponding to the transformation index can be changed depending on the prediction unit type or partition type of the encoding unit. For example, if the partition type information is set to one of the symmetric partition types 2Nx2N (1322), 2NxN (1324), Nx2N (1326), and NxN (1328), then if the conversion unit partition information is 0, a conversion unit (1342) of size 2Nx2N can be set, and if the conversion unit partition information is 1, a conversion unit (1344) of size NxN can be set. When the partition type information is set to one of the asymmetric partition types 2NxnU (1332), 2NxnD (1334), nLx2N (1336), and nRx2N (1338), if the transformation unit division information (TU size flag) is 0, a transformation unit (1352) of size 2Nx2N may be set, and if the transformation unit division information is 1, a transformation unit (1354) of size N / 2xN / 2 may be set. With reference to FIG. 9, the conversion unit division information (TU size flag) described above is a flag having a value of 0 or 1, but the conversion unit division information according to one embodiment is not limited to a 1-bit flag and may increase to 0, 1, 2, 3, etc. depending on the setting, and the conversion unit may be divided hierarchically. The conversion unit division information may be used as an example of a conversion index. In this case, if the transformation unit division information according to one embodiment is used together with the maximum size of the transformation unit and the minimum size of the transformation unit, the size of the transformation unit actually used can be expressed. The video encoding device (100) according to one embodiment can encode the maximum transformation unit size information, the minimum transformation unit size information, and the maximum transformation unit division information. The encoded maximum transformation unit size information, the minimum transformation unit size information, and the maximum transformation unit division information can be inserted into the SPS. The video decoding device (200) according to one embodiment can use the maximum transformation unit size information, the minimum transformation unit size information, and the maximum transformation unit division information for video decoding. For example, if (a) the current encoding unit has a size of 64x64 and the maximum transformation unit size is 32x32, (a-1) when the transformation unit split information is 0, the size of the transformation unit can be set to 32x32, (a-2) when the transformation unit split information is 1, the size of the transformation unit can be set to 16x16, and (a-3) when the transformation unit split information is 2, the size of the transformation unit can be set to 8x8. As another example, (b) if the current encoding unit has a size of 32x32 and the minimum transformation unit size is 32x32, then (b-1) the transformation unit size can be set to 32x32 when the transformation unit split information is 0, and since the transformation unit size cannot be smaller than 32x32, no more transformation unit split information can be set. As another example, (c) if the current encoding unit has a size of 64x64 and the maximum transformation unit split information is 1, the transformation unit split information can be 0 or 1, and no other transformation unit split information can be set. Therefore, when the maximum transformation unit division information is defined as 'MaxTransformSizeIndex', the minimum transformation unit size is defined as 'MinTransformSize', and the size of the transformation unit when the transformation unit division information is 0, i.e. the basic transformation unit RootTu, is defined as 'RootTuSize', the minimum transformation unit size 'CurrMinTuSize' possible in the current encoding unit can be defined as in the following relational expression (1). CurrMinTuSize = max (MinTransformSize, RootTuSize / (2^MaxTransformSizeIndex)) ... (1) Compared to the minimum transformation unit size 'CurrMinTuSize' possible in the current encoding unit, the basic transformation unit size 'RootTuSize' can represent the maximum transformation unit size adoptable in the system. That is, according to the relation (1), 'RootTuSize / (2^MaxTransformSizeIndex)' is the transformation unit size obtained by dividing the basic transformation unit size 'RootTuSize' by the number of times corresponding to the maximum transformation unit division information, and 'MinTransformSize' is the minimum transformation unit size, so the smaller value among them can be the minimum transformation unit size 'CurrMinTuSize' possible in the current encoding unit. The root transform unit size RootTuSize according to one embodiment may vary depending on the prediction mode. For example, if the current prediction mode is inter mode, RootTuSize can be determined according to the following relation (2). In relation (2), 'MaxTransformSize' represents the maximum transformation unit size, and 'PUSize' represents the current prediction unit size. RootTuSize = min(MaxTransformSize, PUSize) ......... (2) That is, if the current prediction mode is inter mode, the basic transformation unit size, 'RootTuSize', which is the transformation unit when the transformation unit split information is 0, can be set to a smaller value between the maximum transformation unit size and the current prediction unit size. If the prediction mode of the current partition unit is intra mode, 'RootTuSize' can be determined according to the following relation (3). 'PartitionSize' represents the size of the current partition unit. RootTuSize = min(MaxTransformSize, PartitionSize) ..........(3) That is, if the current prediction mode is intra mode, the basic transformation unit size, 'RootTuSize', can be set to the smaller value between the maximum transformation unit size and the current partition unit size. However, it should be noted that the basic transformation unit size 'RootTuSize', which is the current maximum transformation unit size according to one embodiment that varies depending on the prediction mode of the partition unit, is only an embodiment, and the factors determining the current maximum transformation unit size are not limited thereto. Hereinafter, the entropy encoding process of syntax elements performed in the entropy encoding unit (120) of the video encoding device (100) of Fig. 1 and the entropy decoding process of syntax elements performed in the entropy decoding unit (220) of the video decoding device (200) of Fig. 2 will be described in detail. As described above, the video encoding device (100) and the video decoding device (200) according to an embodiment of the present invention perform encoding and decoding by dividing the maximum encoding unit into encoding units smaller than or equal to the maximum encoding unit. The prediction unit and the transformation unit used in the prediction process and the transformation process can be determined independently of other data units based on the cost. In this way, encoding is performed recursively for each encoding unit of the hierarchical structure included in the maximum encoding unit, and an optimal encoding unit is determined, whereby data units according to the tree structure can be configured. That is, encoding units of the tree structure, prediction units of the tree structure, and transformation units can be determined for each maximum encoding unit. In order to decode, hierarchical information, which is information representing the structure information of the data units of the hierarchical structure, and extra-hierarchical information for decoding in addition to the hierarchical information need to be transmitted. Information related to the hierarchical structure is information required to determine the coding unit of the tree structure, the prediction unit of the tree structure, and the transformation unit of the tree structure described in the above-mentioned FIGS. 10 to 12, and includes the size of the maximum coding unit, the coding depth, the partition information of the prediction unit, the split flag indicating whether the coding unit is split, the size information of the transformation unit, the split transformation flag (split_transform_flag) indicating whether the coding unit is split into smaller transformation units for transformation processing, and the like. Encoding information other than the hierarchical structure information includes the prediction mode information of the intra / inter prediction applied to each prediction unit, the motion vector information, the prediction direction information, the color component information applied to the corresponding data unit when multiple color components are used, the level information of the transformation coefficient, and the like. In the description below, the hierarchical information and the extra-hierarchical information may be referred to as syntax elements that are targets of entropy encoding and decoding. In particular, embodiments of the present invention relate to a method of selecting a context model when entropy encoding and decoding syntax elements related to a transformation unit among syntax elements. Hereinafter, the entropy encoding and decoding process for syntax elements related to a transformation unit will be specifically described. Fig. 14 is a block diagram showing the configuration of an entropy encoding device according to one embodiment of the present invention. The entropy encoding device (1400) of Fig. 14 corresponds to the entropy encoding unit (120) of the video encoding device (100) of Fig. 1. Referring to FIG. 14, an entropy encoding device (1400) according to one embodiment includes a binarizer (1410), a context modeler (1420), and a binary arithmetic coder (1430). In addition, the binary arithmetic coder (1430) includes a regular coding engine (1432) and a bypass coding engine (1434). If the syntax elements input to the entropy encoding device (1400) are not binary values, the binarization unit (1410) binarizes the syntax elements and outputs a bin string composed of binary values of 0 or 1. A bin represents each bit of a stream composed of 0 or 1, and each bin is encoded through CABAC (Context Adaptive Binary Arithmetic Coding). If the syntax elements are data with the same frequency of 0 and 1, they are output to a bypass coding unit (1434) that does not use probability values and encoded. The binarization unit (1410) can apply various binarization methods depending on the type of syntax element. As the binarization methods, unary, truncated unary, truncated rice code, Golomb code, fixed length code, etc. can be used. The transform unit significant coefficient flag coded_block_flag (or "cbf"), which indicates whether a non-zero transform coefficient (hereinafter referred to as a "significant coefficient") exists in the transform unit, is binarized using a fixed-length code method. That is, if a non-zero transform coefficient exists in the transform unit, the transform unit significant coefficient flag cbf is set to have a value of 1, and if the transform unit does not have a non-zero transform coefficient, the transform unit significant coefficient flag cbf is set to have a value of 0. When an image includes multiple color components, the transform unit significant coefficient flag can be set for each transform unit of each color component. For example, when an image is composed of luminance (Y) and chrominance (Cb, Cr) components, the transform unit significant coefficient flag cbf_luma for the transform unit of the luminance component, and the transform unit significant coefficient flags cbf_cb and cbf_cr for the transform units of the chrominance components can be set. The context modeler (1420) provides a context model for encoding a bit string corresponding to a syntax element to the regular coding unit (1432). Specifically, the context modeler (1420) outputs the occurrence probability of a binary value for encoding each binary value of the bit string of the current syntax element to the binary arithmetic encoding unit (1430). The context model is a probability model for bins, and includes information about which value between 0 and 1 corresponds to the Most Probable Symbol (MPS) and Least Probable Symbol (LPS), as well as the probability of occurrence of at least one of the MPS or LPS. The context modeler (1420) according to one embodiment can select a context model for entropy encoding of the transformation unit validity flag cbf based on the transformation depth of the transformation unit. The context modeler (1420) can determine a first context model preset as a context model for entropy encoding of the transformation unit validity flag when the size of the transformation unit is equal to the size of the coding unit, i.e., when the transformation depth of the transformation unit is 0. In addition, the context modeler (1420) can determine a second context model preset as a context model for entropy encoding of the transformation unit validity flag when the size of the transformation unit is smaller than the size of the coding unit, i.e., when the transformation depth of the transformation unit is not 0. Here, the preset first context model and the second context model are based on different probability distribution models. That is, the first context model and the second context model are different context models. In this way, the context modeler (1420) according to one embodiment applies different context models by distinguishing between cases where the transformation unit is the same as the encoding unit and cases where it is not when entropy encoding the transformation unit validity flag cbf. When an index indicating one of a plurality of preset context models for entropy encoding the transformation unit validity flag is referred to as a context index ctxIdx, the context index ctxIdx can have a value that is the sum of a context increase parameter (ctxInc) for determining a context model and a preset context index offset (ctxIdxOffset). That is, ctxIdx=ctxInc+ctxIdxOffset. The context modeler (1420) can change the context index ctxIdx for determining the context model for entropy encoding of the transformation unit validity flag by changing the context augmentation parameter (ctxInc) for determining the context model based on the transformation depth of the transformation unit by distinguishing between two cases: a case where the transformation depth of the transformation unit is 0 and a case where the transformation depth of the transformation unit is not 0. Specifically, when the transformation depth is called trafodepth, the context modeler (1420) can determine the context augmentation parameter (ctxInc) based on the following algorithm. ctxInc=(trafodepth==0)? 1: 0 The above algorithm can be expressed in pseudo code as follows. { If (trafodepth==0) ctxInc=1; else ctxInc=0; } The transform unit significant coefficient flag can be set separately according to the luminance component and the chrominance component. The context model for entropy encoding of the transform unit significant coefficient flag (cbf_luma) for the transform unit of the luminance component can be determined using the context augmentation parameter (ctxInc) that changes depending on whether the transform depth of the transform unit of the transform unit is 0 as described above. The context model for entropy encoding of the transform unit significant coefficient flag (cbf_cb or cbf_cr) for the transform unit of the chrominance component can be determined using the value of the transform depth (trafodepth) as the context augmentation parameter (ctxInc). The regular coding unit (1432) performs binary arithmetic encoding on a bit string corresponding to a syntax element based on information about the Most Probable Symbol (MPS), the Least Probable Symbol (LPS) included in the context model provided from the context modeler (1420), and probability information of the MPS or LPS. FIG. 15 is a flow chart illustrating a process of entropy encoding and decoding a syntax element for a transformation unit according to one embodiment of the present invention. Referring to FIG. 15, in step 1510, a transform unit valid coefficient flag coded_block_flag (cbf) indicating whether there is a non-zero transform coefficient among the transform coefficients included in the current transform unit is first entropy encoded and decoded. As described above, a context model for entropy encoding of cbf is determined based on the transform depth of the transform unit, and binary arithmetic encoding for cbf can be performed based on the determined context model. If cbf is 0, only 0 transform coefficients exist in the current transform unit, so only the values of 0 as cbf are entropy encoded and decoded, and the transform coefficient level information is not entropy encoded or decoded. In step 1520, if a valid transform coefficient exists in the current transform unit, a significance map (SigMap: significance map) indicating the location of the valid transform coefficient is entropy encoded and decoded. The validity map may be composed of a significant bit and some information indicating the position of the last significant transform coefficient. The significant bit indicates whether the transform coefficient according to each scan index is a significant transform coefficient or 0, and may be expressed using significant_coeff_flag[i]. The validity map may be set in units of a predetermined size of subsets into which the transform unit is divided. Accordingly, significant_coeff_flag[i] may indicate whether the transform coefficient of the i-th scan index among the transform coefficients included in one subset included in the transform unit is 0. In the conventional H.264, etc., a flag (End-Of-Block) indicating whether each valid transform coefficient is the last valid transform coefficient is separately entropy encoded and decoded. However, according to one embodiment of the present invention, the position information of the last valid transform coefficient is entropy encoded and decoded as it is. For example, if the position of the last valid transform coefficient is (x,y) (x,y are integers), syntax elements last_significant_coeff_x and last_significant_coeff_y indicating the (x,y) coordinate values can be entropy encoded and decoded. In step 1530, transform coefficient level information indicating the size of the transform coefficient is entropy encoded and decoded. In the conventional H.264 / AVC, the level information of the transform coefficient is expressed by one syntax element, coeff_abs_level_minus1. According to embodiments of the present invention, the level information of the transform coefficient is encoded by coeff_abs_level_greater1_flag, a syntax element indicating whether the absolute value of the transform coefficient is greater than 1, coeff_abs_level_greater2_flag, a syntax element indicating whether the absolute value is greater than 2, and coeff_abs_level_remaining, a syntax element indicating the size information of the remaining transform coefficients. The syntax element coeff_abs_level_remaining, which represents the size information of the remaining transform coefficients, has the difference between the size of the transform coefficients (absCoeff) and the base level value baseLevel determined using coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag. The base level value baseLevel is determined by the following mathematical formula: baseLevel=1+coeff_abs_level_greather1_flag + coeff_abs_level_greather2_flag, and coeff_abs_level_remaining is determined by the following mathematical formula: coeff_abs_level_remaining=absCoeff-baseLevel. Since coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag have values of 0 or 1, the base level value baseLevel can have values from 1 to 3. Therefore, coeff_abs_level_remaining can vary from (absCoeff-1) to (absCoeff-3). The reason for transmitting the difference between the size of the original transform coefficient absCoeff and the base level value baseLevel (absCoeff-baseLevel) as the transform coefficient size information instead of transmitting the value of the original transform coefficient is to reduce the size of the transmitted data. Below, the process of determining a context model for entropy encoding of a transform unit validity coefficient flag according to one embodiment is described. Fig. 16 is a diagram showing an example of an encoding unit and a transformation unit included in the encoding unit according to one embodiment. In Fig. 16, data units indicated by dotted lines represent encoding units, and data units indicated by solid lines represent transformation units. As described above, the video encoding device (100) and the video decoding device (200) according to an embodiment of the present invention perform encoding and decoding by dividing the maximum encoding unit into encoding units that are smaller than or equal to the maximum encoding unit. The prediction unit and the transformation unit used in the prediction process and the transformation process can be determined independently of other data units based on the cost. If the size of the encoding unit is larger than the size of the maximum transformation unit available in the video encoding device (100) and the video decoding device (200), the encoding unit is divided into transformation units smaller than or equal to the size of the maximum transformation unit, and the transformation process can be performed based on the divided transformation units. For example, if the size of the encoding unit is 64x64 and the size of the available maximum transformation unit is 32x32, in order to perform a transformation (or inverse transformation) process for the encoding unit, the encoding unit is divided into transformation units of a size of 32x32 or smaller. A trafodepth may be determined, which indicates the number of times a coding unit is divided in the horizontal and vertical directions to reach a transformation unit. For example, if the size of the transformation unit of the current coding unit with a size of 2Nx2N is 2Nx2N, the trafodepth may be determined as 0, if the size of the transformation unit is NxN, the trafodepth may be determined as 1, and if the size of the transformation unit is N / 2xN / 2, the trafodepth may be determined as 2. Referring to FIG. 16, transformation units (1611, 1616, 1617) are transformation units of level 1 that are created by dividing the encoding unit of the top root once and have a transformation depth value of 1. In addition, transformation units (1612, 1614, 1614, 1615) are transformation units of level 2 that are created by dividing the transformation unit of level 1 into four again and have a transformation depth value of 2. FIG. 17 is a diagram showing a context increase parameter (ctxInc) used to determine a context model of a conversion unit validity coefficient flag cbf of a conversion unit of FIG. 16 based on a conversion depth. In the tree structure of FIG. 17, leaf nodes (1711 to 1717) correspond to the conversion units (1611 to 1617) of FIG. 16, respectively, and the values of 0 or 1 indicated in the leaf nodes (1711 to 1717) represent the cbf of the conversion units (1611 to 1617) of FIG. 16, respectively. In addition, in FIG. 17, leaves of the same conversion depth are shown in the order of the conversion units located at the upper left, upper right, lower left, and lower right. For example, in Fig. 17, leaves (1712, 1713, 1714, 1715) correspond to transformation units (1612, 1613, 1614, 1615) of Fig. 16, respectively. In addition, referring to Figs. 16 and 17, it is assumed that only the cbf of the transformation units (1612, 1614) is 1, and the cbf of the other transformation units is 0. Referring to FIG. 17, since all of the transform units (1611 to 1617) of FIG. 16 divide the encoding unit of the top root and have a non-zero value of the division depth (trafodepth), the context increase parameter (ctxInc) used to determine the context model of the effective coefficient flag cbf of each of the transform units (1611 to 1617) is set to have a value of 0. Fig. 18 is a diagram showing another example of an encoding unit and a transformation unit included in the encoding unit according to one embodiment. In Fig. 18, a data unit indicated by a dotted line indicates an encoding unit (1811), and a data unit indicated by a solid line indicates a transformation unit (1812). Referring to FIG. 18, when the sizes of the encoding unit (1811) and the transformation unit (1812) used for transformation processing of the encoding unit (1811) are the same, the transformation depth (trafodepth) of the transformation unit (1812) has a value of 0. In this way, when the transformation depth of the transformation unit (1812) is 0, the context increase parameter (ctxInc) used for determining the context model of the effective coefficient flag cbf of the transformation unit (1812) is set to have a value of 1. According to one embodiment, the context modeler (1420) may compare the size of an encoding unit with the size of a transformation unit based on the transformation depth of the transformation unit, and may change the context index ctxIdx for determining a context model for entropy encoding of a transformation unit valid coefficient flag by distinguishing between the case where the transformation depth of the transformation unit is 0 and the case where the transformation depth of the transformation unit is not 0. By changing the context increase parameter (ctxInc) for determining the context model, the context model for entropy encoding of the transformation unit valid coefficient flag (cbf) may be changed in the case where the transformation depth of the transformation unit is 0 and the case where the transformation depth of the transformation unit is not 0. FIG. 19 is a diagram showing an example of a split transform flag (split_transform_flag) for determining the structure of a transform unit included in an encoding unit of FIG. 16 according to one embodiment. The video encoding device (100) can signal information about the structure of the transformation unit used in the transformation process of each coding unit to the video decoding device (200). The information about the structure of the transformation unit can be signaled through a split transformation flag (split_transform_flag) that indicates whether each coding unit is divided into four horizontally and vertically into transformation units. Referring to FIGS. 16 and 19, since the encoding unit of the top root is split into four, the split transform flag (split_transform_flag) (1910) of the encoding unit of the top root is set to 1. If the encoding unit of the top root is larger than the size of the maximum available transformation unit, the split transform flag (split_transform_flag) (1910) of the encoding unit of the top root may always be set to 1 and may not be signaled separately. This is because if the encoding unit is larger than the size of the maximum available transformation unit, the encoding unit needs to be split into a size at least equal to or smaller than the maximum transformation unit. For each of the transformation units of transformation depth 1 that are divided into four parts from the encoding unit of the top root, a split transformation flag is set to indicate whether or not to be split again into transformation units of transformation depth 2. In Fig. 19, the split transformation flags are displayed in the order of the transformation units located at the upper left, upper right, lower left, and lower right for the transformation units of the same transformation depth. Reference numeral 1911 denotes a split transformation flag of the transformation unit (1611) of Fig. 16. Since the transformation unit (1611) is not split into transformation units of lower depths, the split transformation flag (1911) of the transformation unit (1611) has a value of 0. Similarly, since the transformation units (1616, 1617) of Fig. 16 are also not split into transformation units of lower depths, the split transformation flags (1913, 1914) of the transformation units (1616, 1617) both have a value of 0. In FIG. 16, the transformation unit of transformation depth 1 located on the upper right is divided again into transformation units of transformation depth 2 (1612, 1613, 1614, 1615), so the split transformation flag (1912) for the transformation unit of transformation depth 1 located on the upper right has a value of 1. Since the transformation units (1612, 1613, 1614, 1615) of transformation depth 2 are no longer divided into transformation units of lower depths, the split transformation flags (1915, 1916, 1917, 1918) of the transformation units (1612, 1613, 1614, 1615) of transformation depth 2 all have a value of 0. As described above, a context model for entropy encoding of cbf is selected based on the transform depth of the transform unit, and binary arithmetic encoding for cbf can be performed based on the selected context model. If cbf is 0, only transform coefficients that are 0 exist in the current transform unit, so only values of 0 as cbf are entropy encoded and decoded, and transform coefficient level information is not entropy encoded and decoded. Below, we describe the process of entropy encoding syntax elements associated with transform coefficients contained in a transform unit whose cbf has a value of 1, i.e., a transform unit with non-zero transform coefficients. Fig. 20 illustrates a transformation unit that is entropy encoded according to one embodiment. In Fig. 20, the size of the transformation unit (2000) is illustrated as 16x16, but the size of the transformation unit (2000) is not limited to the illustrated 16x16 and may have various sizes such as 4x4 to 32x32. Referring to FIG. 20, in order to entropy encode and decode transform coefficients included in a transform unit (2000), the transform unit (1500) may be split into transform units of smaller sizes. Hereinafter, a process of entropy encoding a syntax element related to a 4x4 transform unit (2010) included in the transform unit (2000) will be described. The process of entropy encoding a syntax element related to a transform unit described below may also be applied to transform units having different sizes. Each transform coefficient included in the 4x4 transform unit (2010) has a transform coefficient value (absCoeff) as illustrated. The transform coefficients included in the 4x4 transform unit (2010) can be serialized and processed sequentially according to a predetermined scan order as illustrated. The scan order is not limited to what is illustrated and can be changed. Syntax elements related to transform coefficients included in a 4x4 transform unit (2010) include significant_coeff_flag, a syntax element indicating whether each transform coefficient included in the transform unit is a significant transform coefficient with a non-zero value; coeff_abs_level_greater1_flag, a syntax element indicating whether the absolute value of the transform coefficient is greater than 1; coeff_abs_level_greater2_flag, a syntax element indicating whether the absolute value is greater than 2; and coeff_abs_level_remaining, a syntax element indicating the size information of the remaining transform coefficients. Figure 21 is a diagram showing a validity map corresponding to the conversion unit (2010) of Figure 20. Referring to FIGS. 20 and 21, a validity map (SigMap) (2100) having a value of 1 is set for valid transform coefficients having non-zero values among the transform coefficients included in the 4x4 transform unit (2010) of FIG. 20. This validity map (SigMap) (2100) is entropy encoded and decoded using a preset context model. Figure 22 is a diagram showing coeff_abs_level_greater1_flag corresponding to the 4x4 transformation unit (2010) of Figure 20. Referring to FIGS. 20 to 22, for a valid transformation coefficient having a value of 1 in a validity map (SigMap) (2100), a flag coeff_abs_level_greater1_flag (2200) may be set to indicate whether the valid transformation coefficient has a value greater than 1. If coeff_abs_level_greater1_flag (2200) is 1, it indicates that the corresponding transformation coefficient is a transformation coefficient having a value greater than 1, and if coeff_abs_level_greater1_flag (2200) is 0, it indicates that the corresponding transformation coefficient is a transformation coefficient having a value of 1. In FIG. 22, coeff_abs_level_greater1_flag (2210) at a transformation coefficient position having a value of 1 has a value of 0. Figure 23 is a diagram showing coeff_abs_level_greater2_flag corresponding to the 4x4 transformation unit (2010) of Figure 20. Referring to FIGS. 20 to 23, for a transformation coefficient in which coeff_abs_level_greater1_flag (2200) is set to 1, coeff_abs_level_greater2_flag (2300) is set to indicate whether the corresponding transformation coefficient has a value greater than 2. If coeff_abs_level_greater2_flag (2300) is 1, it indicates that the corresponding transformation coefficient is a transformation coefficient having a value greater than 2, and if coeff_abs_level_greater2_flag (2300) is 0, it indicates that the corresponding transformation coefficient is a transformation coefficient having a value of 2. In FIG. 23, coeff_abs_level_greater2_flag (2310) at the position of the transformation coefficient having a value of 2 has a value of 0. Figure 24 is a diagram showing coeff_abs_level_remaining corresponding to the 4x4 transformation unit (2010) of Figure 20. Referring to FIGS. 20 to 24, the syntax element coeff_abs_level_remaining (2400) indicating size information of the remaining transform coefficients can be obtained by calculating the value of (absCoeff-baseLevel) for each transform coefficient. The syntax element coeff_abs_level_remaining indicating size information of the remaining transform coefficients has a difference value between the size (absCoeff) of the transform coefficients and a base level value baseLevel determined using coeff_abs_level_greater1_flag and coeff_abs_level_greater2_flag. The base level value baseLevel is determined according to the following mathematical expression; baseLevel=1+coeff_abs_level_greather1_flag + coeff_abs_level_greather2_flag, and coeff_abs_level_remaining is determined according to the following mathematical expression; coeff_abs_level_remaining=absCoeff-baseLevel. coeff_abs_level_remaining(2400) can be read out and entropy encoded according to the illustrated scan order. Fig. 25 is a flow chart illustrating a method for entropy encoding a video according to one embodiment. Referring to FIGS. 14 and 25, in step 2510, the context modeler (1420) obtains data of a transformed encoding unit based on a transformation unit, and in step 2520, the context modeler (1420) determines a context model for arithmetic encoding of a transformation unit significant coefficient flag indicating whether a non-zero transform coefficient exists in the transformation unit based on a transformation depth of the transformation unit. The context modeler (1420) can determine different context models when the size of the transformation unit is the same as the size of the coding unit, that is, when the transformation depth of the transformation unit is 0, and when the size of the transformation unit is smaller than the size of the coding unit, that is, when the transformation depth of the transformation unit is not 0. Specifically, the context modeler (1420) can change the context index ctxIdx for determining the context model for entropy encoding of the transformation unit validity flag by distinguishing between the two cases where the transformation depth of the transformation unit is 0 and the transformation depth of the transformation unit is not 0, by changing the context increase parameter (ctxInc) for determining the context model based on the transformation depth of the transformation unit. The transform unit significant coefficient flag can be set separately according to the luminance component and the chrominance component. The context model for entropy encoding of the transform unit significant coefficient flag (cbf_luma) for the transform unit of the luminance component can be determined using a context augmentation parameter (ctxInc) that changes depending on whether the transform depth of the transform unit of the transform unit is 0. The context model for entropy encoding of the transform unit significant coefficient flag (cbf_cb, cbf_cr) for the transform unit of the chrominance component can be determined using the value of the transform depth (trafodepth) as the context augmentation parameter (ctxInc). In step 2530, the regular coding unit (1432) arithmetically encodes the transform unit validity flag based on the determined context model. Fig. 26 is a block diagram showing the configuration of an entropy decoding device according to one embodiment of the present invention. The entropy decoding device (2600) of Fig. 26 corresponds to the entropy decoding unit (220) of the video decoding device (200) of Fig. 2. The entropy decoding device (2600) performs the reverse process of the entropy encoding process performed in the entropy encoding device (1400) described above. Referring to FIG. 26, the entropy decoding device (2600) includes a context modeler (2610), a regular decoding unit (2620), a bypass decoding unit (2630), and a debinarization unit (2640). A syntax element encoded by bypass coding is output to a bypass decoding unit (2630) and subjected to arithmetic decoding, and a syntax element encoded by regular coding is output to arithmetic decoding unit (2620). The regular decoding unit (2620) outputs a bit string by arithmetic decoding the binary value of the current syntax element based on a context model provided by a context modeler (2610). The context modeler (2610) according to one embodiment can select a context model for entropy encoding of the transform unit valid coefficient flag cbf based on the transform depth of the transform unit, similarly to the context modeler (1420) of FIG. 14 described above. That is, the context modeler (2610) can determine different context models when the size of the transform unit is the same as the size of the coding unit, that is, when the transform depth of the transform unit is 0, and when the size of the transform unit is smaller than the size of the coding unit, that is, when the transform depth of the transform unit is not 0. Specifically, the context modeler (2610) can change the context index ctxIdx for determining the context model for entropy encoding of the transform unit valid coefficient flag by changing the context increase parameter (ctxInc) for determining the context model based on the transform depth of the transform unit, thereby distinguishing between the two cases where the transform depth of the transform unit is 0 and the transform depth of the transform unit is not 0. When the structure of a transformation unit included in an encoding unit is determined based on a split transformation flag (split_transform_flag) indicating whether an encoding unit obtained from a bitstream is split into transformation units, the transformation depth of the transformation unit can be determined based on the number of times the encoding unit is split to reach the transformation unit. The transform unit significant coefficient flag can be set separately according to the luminance component and the chrominance component. The context model for entropy encoding of the transform unit significant coefficient flag (cbf_luma) for the transform unit of the luminance component can be determined using a context augmentation parameter (ctxInc) that changes depending on whether the transform depth of the transform unit of the transform unit is 0. The context model for entropy encoding of the transform unit significant coefficient flag (cbf_cb, cbf_cr) for the transform unit of the chrominance component can be determined using the value of the transform depth (trafodepth) as the context augmentation parameter (ctxInc). The reverse binarization unit (2640) restores the bit strings arithmetic-decoded in the regular decoding unit (2620) or the bypass decoding unit (2630) back into syntax elements. The entropy decoding device (2600) arithmetic decodes and outputs syntax elements related to the transformation unit, such as coeff_abs_level_remaing, SigMap, coeff_abs_level_greater1_flag, and coeff_abs_level_greater2_flag, in addition to the aforementioned transformation unit significant coefficient flag (cbf). When the syntax elements related to the transformation unit are restored, decoding of data included in the transformation unit can be performed through inverse quantization, inverse transformation, and predictive decoding processes based on the restored syntax elements. FIG. 27 is a flow chart illustrating a method for decoding entropy of a video according to one embodiment of the present invention. Referring to FIG. 27, in step 2710, a transformation unit included in an encoding unit and used for inverse transformation processing of the encoding unit is determined. As described above, the structure of the transformation unit included in the encoding unit can be determined based on a split transformation flag (split_transform_flag) indicating whether an encoding unit obtained from a bitstream is split into transformation units. In addition, the transformation depth of the transformation unit can be determined based on the number of splits by which the encoding unit is split to reach the transformation unit. At step 2720, the context modeler (2610) obtains a transform unit valid coefficient flag from the bitstream, which indicates whether a non-zero transform coefficient exists in the transform unit. In step 2730, the context modeler (2620) determines a context model for arithmetic decoding of the transform unit significant coefficient flag based on the transform depth of the transform unit. As described above, the context modeler (2610) can determine different context models when the size of the transform unit is the same as the size of the coding unit, that is, the transform depth of the transform unit is 0, and when the size of the transform unit is smaller than the size of the coding unit, that is, the transform depth of the transform unit is not 0. Specifically, the context modeler (2610) can change the context index ctxIdx for determining the context model for entropy coding of the transform unit significant coefficient flag by changing the context increase parameter (ctxInc) for determining the context model based on the transform depth of the transform unit, thereby distinguishing between the two cases where the transform depth of the transform unit is 0 and the transform depth of the transform unit is not 0. In step 2740, the regular decoding unit (2620) arithmetically decodes the transform unit validity flag based on the context model provided by the context modeler (2610). The present invention can also be implemented as a computer-readable code on a computer-readable recording medium. The computer-readable recording medium includes all kinds of recording devices that store data that can be read by a computer system. Examples of the computer-readable recording medium include ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc. In addition, the computer-readable recording medium can be distributed to computer systems connected to a network, and can be stored and executed as a computer-readable code in a distributed manner. The present invention has been described so far, focusing on preferred embodiments thereof. Those skilled in the art will understand that the present invention can be implemented in modified forms without departing from the essential characteristics of the present invention. The scope of the present invention is indicated in the claims, not in the above description, and all differences within the equivalent scope should be interpreted as being included in the present invention.
Claims
DEPCT671. The video decoder suite comprises: a parser which takes the split transformation indicator for the current depth from the bitstream and, when the split transformation indicator indicates non-split for the current depth, determines that the transformation depth is equal to the current depth; a context modeler which determines the context increment parameters to determine the context index based on whether the transformation depth is equal to a predetermined value without regard to the transformation unit size, and takes the context model to perform arithmetic decoding of the significant coefficient indicator of the transformation unit using the context index obtained by incrementing the context increment and context offset parameters;And the arithmetic decoder, which decodes the arithmetic to the significant coefficient indicators of the conversion unit based on the context model and determines whether at least one non-zero conversion coefficient is present in the conversion unit with a conversion depth based on the significant coefficient indicators of the conversion unit, where conversion depth indicates the number of times the height and width of the code writing unit are split to receive the conversion unit, where the predefined value is zero, and where, when the split conversion indicator indicates that it is split for the current depth, the conversion unit with the current depth is then split into a conversion unit of the next depth level or more, and the split conversion indicator for the next depth level is derived from the bitstream;