Video encoding method, video decoding method, and bitstream transmission method
By dividing the largest encoding and decoding unit in the image decoding method and partitioning binary or quad-tree according to the outer boundary characteristics of the image, the problem of high-resolution image encoding complexity is solved, and a more efficient encoding and decoding process is achieved.
Patent Information
- Application Number
- CN202411278755.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2018-12-21
- Filing Date
- 2019-08-28
- Publication Date
- 2025-07-18
AI Technical Summary
The prior art has problems of high coding complexity and low efficiency when encoding and decoding high-resolution or high-definition images, especially when using flexible tree division methods, it is difficult to optimize the size and shape of data units to improve encoding and decoding efficiency.
By dividing at least one of the height and width of the maximum codec unit, it is determined whether to allow generation of the second codec unit, and binary or quad-tree division is performed according to the non-square characteristics of the outer boundary of the image and the maximum transform size, the generation and decoding process of the codec unit is optimized.
It improves the encoding and decoding efficiency, reduces the encoding complexity, optimizes the division of image data units, and improves the encoding and decoding performance of hardware design.
Smart Images

Figure CN120343245A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of its parent application is: 201980069515.8, the application date is: August 28, 2019, and the invention title is: Video Encoding Method and Encoding Device Considering Hardware Design, as well as Video Decoding Method and Decoding Device. Technical Field
[0002] The method and apparatus according to an embodiment can encode or decode an image by using coding units of various shapes included in the image. Background Art
[0003] With the development and popularization of hardware capable of reproducing and storing high-resolution or high-definition image content, the demand for codecs that can effectively encode or decode high-resolution or high-definition image content has increased. The encoded image content can be decoded and then reproduced. Recently, methods for effectively compressing such high-resolution or high-definition image content have been used. For example, a method for effectively achieving image compression by dividing the processing of an image to be encoded by any method has been implemented.
[0004] Various data units can be used to compress an image, and there may be an inclusion relationship between these data units. To determine the size of the data unit to be used for image compression, the data unit can be divided by using various methods, and the image can be encoded or decoded by determining the data unit optimized based on the characteristics of the image.
[0005] The data unit can be determined by recursively performing flexible tree partitioning. Flexible tree partitioning can include binary split, ternary split, or quadtree partitioning. In addition, by allowing square data units and non-square data units, the data unit optimized for encoding can be determined according to the characteristics of the image. However, since various partitioning shapes and various data unit shapes are used, the encoding complexity may increase. Therefore, there is a need for an image decoding / encoding method and apparatus that can improve the decoding / encoding efficiency and reduce the complexity by using flexible tree partitioning. Summary of the Invention
[0006] Technical Problem
[0007] Provided is an image decoding / encoding method and apparatus that considers the size of a pipeline data unit for hardware design, and the image decoding / encoding method and apparatus improve the decoding / encoding efficiency and reduce the complexity by determining a method for partitioning a block.
[0008] Technical Solution
[0009] To overcome the above technical problems, the video decoding method proposed by the present invention includes: generating a coding and decoding unit by dividing at least one of the height and width of a maximum coding and decoding unit having a first size; determining whether to allow generating two second coding and decoding units by dividing at least one of the height and width of the first coding and decoding unit based on whether the height or width of the non-square first coding and decoding unit including the outer boundary of the image in the coding and decoding unit is greater than the maximum transform size; and decoding the second coding and decoding unit generated from the first coding and decoding unit by performing an inverse transform on the second coding and decoding unit using the maximum transform size.
[0010] Determining whether to allow generating two second coding and decoding units by dividing at least one of the height and width of the first coding and decoding unit may include: when the length of the height of the first coding and decoding unit is greater than the maximum transform size and the length of the width of the first coding and decoding unit is equal to the maximum transform size, allowing generating smaller coding and decoding units by performing a horizontal binary partition on the first coding and decoding unit; and prohibiting generating smaller coding and decoding units by performing a vertical binary partition on the first coding and decoding unit.
[0011] Determining whether to allow generating two second coding and decoding units by dividing at least one of the height and width of the first coding and decoding unit may include: when the length of the height of the first coding and decoding unit is equal to the maximum transform size and the length of the width of the first coding and decoding unit is greater than the maximum transform size, allowing generating smaller coding and decoding units by performing a vertical binary partition on the first coding and decoding unit; and prohibiting generating smaller coding and decoding units by performing a horizontal binary partition on the first coding and decoding unit.
[0012] The video decoding method may further include, when the length of the height of the coding and decoding unit including the outer boundary of the image is greater than the maximum transform size and the length of the width of the coding and decoding unit is greater than the maximum transform size, allowing generating smaller coding and decoding units by performing a quadtree partition on the coding and decoding unit.
[0013] The lengths of the height and width of the coding and decoding unit may be greater than or equal to the maximum transform size.
[0014] Generating a coding and decoding unit by dividing at least one of the height and width of a maximum coding and decoding unit having a first size may include: determining the maximum coding and decoding unit of the first size by dividing the image based on the information about the size of the maximum coding and decoding unit obtained from the bitstream.
[0015] Generating coding units by dividing at least one of the height and width of a maximum coding unit having a first size may include: obtaining information on the minimum size of a luminance coding unit, information on the difference between the maximum size and the minimum size of a luminance coding unit generated by performing binary partitioning on an intra slice, information on the difference between the maximum size and the minimum size of a luminance coding unit generated by performing binary partitioning on an inter slice, information on the difference between the maximum size and the minimum size of a luminance coding unit generated by performing ternary partitioning on an intra slice, and information on the difference between the maximum size and the minimum size of a luminance coding unit generated by performing ternary partitioning on an inter slice from a bitstream; determining the maximum size of a luminance coding unit generated by performing binary partitioning, which can be determined in an intra slice, by using the information on the minimum size of the luminance coding unit and the information on the difference between the maximum size and the minimum size of a luminance coding unit generated by performing binary partitioning on an intra slice; determining the maximum size of a luminance coding unit generated by performing ternary partitioning, which can be determined in an intra slice, by using the information on the minimum size of the luminance coding unit and the information on the difference between the maximum size and the minimum size of a luminance coding unit generated by performing ternary partitioning on an intra slice; determining the maximum size of a luminance coding unit generated by performing binary partitioning, which can be determined in an inter slice, by using the information on the minimum size of the luminance coding unit and the information on the difference between the maximum size and the minimum size of a luminance coding unit generated by performing binary partitioning on an inter slice; and determining the maximum size of a luminance coding unit generated by performing ternary partitioning, which can be determined in an inter slice, by using the information on the minimum size of the luminance coding unit and the information on the difference between the maximum size and the minimum size of a luminance coding unit generated by performing ternary partitioning on an inter slice.
[0016] Generating a coding unit by dividing at least one of the height and width of a maximum coding unit having a first size may include: obtaining information indicating whether a luminance coding unit and a chrominance coding unit are determined separately from a bitstream; when the luminance coding unit and the chrominance coding unit are determined separately according to the obtained information, obtaining information about the difference between the maximum size and the minimum size of a chrominance coding unit generated by performing binary partitioning on an intra-strip and information about the difference between the maximum size and the minimum size of a chrominance coding unit generated by performing ternary partitioning on an intra-strip from the bitstream; determining the maximum size of a chrominance coding unit generated by performing binary partitioning, which can be determined in an intra-strip, by using the information about the minimum size of the chrominance coding unit and the information about the difference between the maximum size and the minimum size of a chrominance coding unit generated by performing binary partitioning on an intra-strip; and determining the maximum size of a chrominance coding unit generated by performing ternary partitioning, which can be determined in an intra-strip, by using the information about the minimum size of the chrominance coding unit and the information about the difference between the maximum size and the minimum size of a chrominance coding unit generated by performing ternary partitioning on an intra-strip.
[0017] The video decoding method may further include: when a first coding unit in the coding unit is not adjacent to the outer boundary of the image, obtaining partition type information of the first coding unit; when the partition type information of the first coding unit indicates binary partitioning, dividing the height or width of the first coding unit in half and determining two second coding units, and the depth of each second coding unit is increased by 1 compared to the depth of the first coding unit; and when the partition type information of the first coding unit indicates ternary partitioning, dividing the height or width of the first coding unit in a ratio of 1:2:1, and determining a third coding unit and two fourth coding units, the depth of the third coding unit is increased by 1 compared to the depth of the first coding unit, and the depth of each fourth coding unit is increased by 2 compared to the depth of the first coding unit.
[0018] To overcome the above technical problems, the video decoding apparatus proposed by the present invention includes: a processor configured to determine a coding unit by dividing at least one of the height and width of a maximum coding unit having a first size; determining whether to allow generating two second coding units by dividing at least one of the height and width of the first coding unit based on whether the height or width of a non-square first coding unit including the outer boundary of the image in the coding unit is greater than the maximum transform size; and decoding the second coding unit generated from the first coding unit by performing inverse transform on the second coding unit using the maximum transform size; and a memory for storing data generated by the processor.
[0019] To overcome the above technical problems, the video encoding method proposed by the present invention includes: determining a codec unit by dividing at least one of the height and width of a maximum codec unit having a first size; determining whether to allow generating two second codec units by dividing at least one of the height and width of the first codec unit based on whether the height or width of a non-square first codec unit including the outer boundary of the image in the codec unit is greater than the maximum transform size; and encoding the second codec units generated from the first codec unit by performing a transform on the second codec units using the maximum transform size.
[0020] Determining whether to allow generating two second codec units by dividing at least one of the height and width of the first codec unit may include: when the length of the height of the first codec unit is greater than the maximum transform size and the length of the width of the first codec unit is equal to the maximum transform size, allowing generating smaller codec units by performing a horizontal binary division on the first codec unit; and prohibiting generating smaller codec units by performing a vertical binary division on the first codec unit.
[0021] Determining whether to allow generating two second codec units by dividing at least one of the height and width of the first codec unit may include: when the length of the height of the first codec unit is equal to the maximum transform size and the length of the width of the first codec unit is greater than the maximum transform size, allowing generating smaller codec units by performing a vertical binary division on the first codec unit; and prohibiting generating smaller codec units by performing a horizontal binary division on the first codec unit.
[0022] The video encoding method may further include: when the length of the height of the codec unit including the outer boundary of the image is greater than the maximum transform size and the length of the width of the codec unit is greater than the maximum transform size, allowing generating smaller codec units by performing a quadtree division on the codec unit.
[0023] Generating a codec unit by dividing at least one of the height and width of a maximum codec unit having a first size may include: determining the maximum codec unit having a first size by dividing the image, and encoding information about the size of the maximum codec unit.
[0024] The video encoding method may further include: determining information about the difference between the maximum size and the minimum size of a luminance codec unit generated by performing binary partitioning, where the binary partitioning can be determined in an intra slice, by using the minimum size and the maximum size of the luminance codec unit generated by performing binary partitioning; determining information about the difference between the maximum size and the minimum size of a luminance codec unit generated by performing ternary partitioning, where the ternary partitioning can be determined in an intra slice, by using the minimum size and the maximum size of the luminance codec unit generated by performing ternary partitioning; determining information about the difference between the maximum size and the minimum size of a luminance codec unit generated by performing binary partitioning, where the binary partitioning can be determined in an inter slice, by using the minimum size and the maximum size of the luminance codec unit generated by performing binary partitioning; and determining information about the difference between the maximum size and the minimum size of a luminance codec unit generated by performing ternary partitioning, where the ternary partitioning can be determined in an inter slice, by using the minimum size and the maximum size of the luminance codec unit generated by performing ternary partitioning.
[0025] The video encoding method may further include: outputting in a bitstream information about the minimum size of a luminance codec unit, information about the difference between the maximum size and the minimum size of a luminance codec unit generated by performing binary partitioning in an intra slice, information about the difference between the maximum size and the minimum size of a luminance codec unit generated by performing binary partitioning in an inter slice, information about the difference between the maximum size and the minimum size of a luminance codec unit generated by performing ternary partitioning in an intra slice, and information about the difference between the maximum size and the minimum size of a luminance codec unit generated by performing ternary partitioning in an inter slice.
[0026] The video encoding method may further include: determining information about the difference between the maximum size and the minimum size of a chrominance codec unit generated by performing binary partitioning, where the binary partitioning can be determined in an intra slice, by using information about the minimum size and the maximum size of the chrominance codec unit generated by performing binary partitioning; and determining information about the difference between the maximum size and the minimum size of a chrominance codec unit generated by performing ternary partitioning, where the ternary partitioning can be determined in an intra slice, by using information about the minimum size and the maximum size of the chrominance codec unit generated by performing ternary partitioning.
[0027] The video encoding method may further include: encoding information indicating whether the luminance codec unit and the chrominance codec unit are separately determined, and outputting the encoded information in a bitstream. The video encoding method may further include: when the luminance codec unit and the chrominance codec unit are separately determined, encoding information about the difference between the maximum size and the minimum size of the chrominance codec unit generated by performing binary partitioning on an intra-strip and information about the difference between the maximum size and the minimum size of the chrominance codec unit generated by performing ternary partitioning on an intra-strip, and outputting the encoded information in a bitstream.
[0028] The video encoding method may further include: when a first codec unit in the codec unit is not adjacent to the outer boundary of the image, encoding the partitioning type information of the first codec unit, and outputting the encoded partitioning type information in a bitstream. The video encoding method may further include: halving the height or width of the first codec unit to determine two second codec units, with the depth of each second codec unit increased by 1 compared to the depth of the first codec unit, and encoding the partitioning type information of the first codec unit indicating binary partitioning; and partitioning the height or width of the first codec unit at a ratio of 1:2:1 to determine a third codec unit and two fourth codec units, with the depth of the third codec unit increased by 1 compared to the depth of the first codec unit, and the depth of each fourth codec unit increased by 2 compared to the depth of the first codec unit, and encoding the partitioning type information of the first codec unit indicating ternary partitioning.
[0029] To overcome the above technical problems, the video encoding apparatus proposed in the present invention includes: a processor configured to determine a codec unit by partitioning at least one of the height and width of a maximum codec unit having a first size; determining whether to allow generating two second codec units by partitioning at least one of the height and width of the first codec unit based on whether the height or width of a non-square first codec unit including the outer boundary of the image in the codec unit is greater than the maximum transform size; and encoding the second codec units generated from the first codec unit by performing a transform on the second codec units using the maximum transform size; and a memory. Description of the Drawings
[0030] Figure 1 A schematic block diagram of an image decoding apparatus according to an embodiment is shown.
[0031] Figure 2 A flowchart of an image decoding method according to an embodiment is shown.
[0032] Figure 3Shows the process of determining at least one coding unit by dividing a current coding unit, which is performed by an image decoding device according to an embodiment.
[0033] Figure 4 Shows the process of determining at least one coding unit by dividing a non-square coding unit, which is performed by an image decoding device according to an embodiment.
[0034] Figure 5 Shows the process of dividing a coding unit based on at least one of block shape information and division shape mode information, which is performed by an image decoding device according to an embodiment.
[0035] Figure 6 Shows a method of determining a preset coding unit from an odd number of coding units, which is performed by an image decoding device according to an embodiment.
[0036] Figure 7 Shows the order of processing multiple coding units when an image decoding device determines multiple coding units by dividing a current coding unit according to an embodiment.
[0037] Figure 8 Shows the process of determining that a current coding unit will be divided into an odd number of coding units, which is performed by an image decoding device when the coding units cannot be processed in a preset order according to an embodiment.
[0038] Figure 9 Shows the process of determining at least one coding unit by dividing a first coding unit, which is performed by an image decoding device according to an embodiment.
[0039] Figure 10 Shows that when a second coding unit with a non-square shape (determined by dividing a first coding unit by an image decoding device) meets a preset condition, the shape into which the second coding unit can be divided is restricted according to an embodiment.
[0040] Figure 11 Shows the process of dividing a square coding unit when division shape mode information indicates that a square coding unit is not divided into four square coding units, which is performed by an image decoding device according to an embodiment.
[0041] Figure 12 Shows that the processing order between multiple coding units can be changed depending on the process of dividing coding units according to an embodiment.
[0042] Figure 13 Shows the process of determining the depth of a coding unit when the shape and size of a coding unit change when a coding unit is recursively divided so that multiple coding units are determined according to an embodiment.
[0043] Figure 14 Shows the depth that can be determined based on the shape and size of the codec unit according to an embodiment, and the partial index (PID) for distinguishing the codec unit.
[0044] Figure 15 Shows determining a plurality of codec units based on a plurality of preset data units included in a picture according to an embodiment.
[0045] Figure 16 Shows a processing block that serves as a criterion for determining the determination order of reference codec units included in a picture according to an embodiment.
[0046] Figure 17 Shows a block diagram of a video encoding device according to an embodiment.
[0047] Figure 18 Shows a flowchart of a video encoding method according to an embodiment.
[0048] Figure 19 Shows a block diagram of a video decoding device according to an embodiment.
[0049] Figure 20 Shows a flowchart of a video decoding method according to an embodiment.
[0050] Figure 21 Shows the relationship between the maximum codec unit, the pipeline data unit, and the block according to an embodiment.
[0051] Figure 22 Shows three shapes of combinations of pipeline data units that can be determined from the maximum codec unit considering the size of the pipeline data unit according to an embodiment.
[0052] Figure 23 Shows five shapes of combinations of pipeline data units that can be determined from the maximum codec unit considering the size of the pipeline data unit according to an embodiment.
[0053] Figure 24 Shows seven shapes of combinations of pipeline data units that can be determined from the maximum codec unit considering the size of the pipeline data unit according to an embodiment.
[0054] Figure 25 Shows nine shapes of combinations of pipeline data units that can be determined from the maximum codec unit considering the size of the pipeline data unit according to another embodiment.
[0055] Figure 26 Shows two shapes of combinations of pipeline data units that can be determined from the maximum codec unit considering the size of the pipeline data unit according to an embodiment.
[0056] Figure 27 Shows two shapes of combinations of pipeline data units that take into account the size of the pipeline data units and are determined only by quadtree partitioning or binary partitioning of the maximum codec unit.
[0057] Figure 28 Shows three shapes of combinations of pipeline data units that take into account the size of the pipeline data units and are determined by quadtree partitioning, ternary partitioning, and binary partitioning of the maximum codec unit.
[0058] Figure 29 Shows a function for determining whether a codec unit is located at the boundary line of a pipeline data unit according to an embodiment.
[0059] Figure 30 Shows the syntax signaled by a sequence parameter set (SPS) according to an embodiment. Detailed Description
[0060] The advantages and features of the present invention and the methods for realizing these advantages and features will be described more comprehensively with reference to the accompanying drawings, in which embodiments of the present invention are shown. However, the present invention can be implemented in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the present invention to those of ordinary skill in the art.
[0061] The terms used herein will be briefly described, and the disclosed embodiments will be described in detail.
[0062] Considering the functions of the terms used in the embodiments, the terms used in the embodiments are selected from the commonly used terms currently widely used. However, depending on the intention of those of ordinary skill in the art, precedent, or the emergence of new technologies, the terms may become different. In addition, in specific cases, the terms are freely selected by the applicant of the present invention, and the meanings of these terms will be described in detail in the corresponding part of the detailed description. Therefore, the terms used in the embodiments are not only designations of the terms, but terms defined based on the meanings of the terms and the content throughout the embodiments.
[0063] It should be understood that unless the context clearly dictates otherwise, the singular forms "a", "an", and "the" include plural referents.
[0064] It should be understood that when a specific part "includes" a specific component, that part does not exclude another component, but may further include another component, unless the context clearly dictates otherwise.
[0065] As used herein, the terms "portion", "module", or "unit" refer to a software or hardware component that performs a predefined function. However, the term "unit" is not limited to software or hardware. A "unit" can be configured in an addressable storage medium or configured to operate on one or more processors. Thus, for example, a "unit" can include components such as software components, object-oriented software components, class components, and task components, processes, functions, attributes, procedures, subroutines, program code segments, drivers, firmware, microcode, circuits, data, databases, data structures, tables, arrays, and variables. The functions provided by components and "units" can be combined into fewer components and "units", or further separated into additional components and "units".
[0066] According to an embodiment of the present invention, a "unit" can include a processor and a memory. The term "processor" should be broadly interpreted to include a general-purpose processor, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a controller, a microcontroller, a state machine, etc. In some embodiments, a "processor" can represent an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a field-programmable gate array (FPGA), etc. The term "processor" can refer to a combination of processing devices, such as a combination of a DSP and a microprocessor, a combination of multiple microprocessors, a combination of one or more microprocessors and a DSP core, or any other such configured combination.
[0067] The term "memory" should be broadly interpreted to include any electronic component capable of storing electronic information. The term "memory" can refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable PROM (EEPROM), flash memory, magnetic or optical data storage devices, registers, etc. When a processor can read information from a memory and / or write information to the memory, the memory is said to be in electronic communication with the processor. Memory integrated in a processor is in electronic communication with the processor.
[0068] Hereinafter, an "image" can indicate a still image of a video, or can indicate a moving image, such as a motion picture, i.e., the video itself.
[0069] Hereinafter, a "sample" represents data assigned to a sample position of an image, i.e., data to be processed. For example, pixel values in a spatial domain image and transform coefficients on a transform region can be samples. A unit including at least one such sample can be defined as a block.
[0070] In addition, in the specification, a "current block" may represent a block of a maximum coding / decoding unit, a coding / decoding unit, a prediction unit, or a transform unit of a current image to be coded or decoded.
[0071] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those of ordinary skill in the art to which the present invention pertains can easily implement these embodiments. In addition, in order to clearly describe the present invention, parts irrelevant to the description of the present invention will be omitted in the drawings.
[0072] Hereinafter, reference will be made to Figures 1 to 16 describe an image coding device, an image decoding device, an image coding method, and an image decoding method according to an embodiment. According to an embodiment, reference will be made to Figures 3 to 16 describe a method for determining a data unit of an image. According to an embodiment, hereinafter, reference will be made to Figures 17 to 20 describe a video coding / decoding method considering hardware design. Hereinafter, reference will be made to Figures 21 to 28 describe various combinations of pipelined data units. Hereinafter, reference will be made to Figure 29 describe a method for determining whether a coding / decoding unit is outside a pipeline boundary line. And according to an embodiment, hereinafter, reference will be made to Figure 30 describe a method by which a video coding device 1700 and a video decoding device 1900 signal information regarding a maximum size and a minimum size of a block allowed based on a partitioning mode.
[0073] Hereinafter, reference will be made to Figure 1 and Figure 2 describe a method and an apparatus for adaptively selecting a context model based on various shapes of coding / decoding units according to an embodiment of the present disclosure.
[0074] Figure 1 A schematic block diagram of an image decoding device according to an embodiment is shown.
[0075] The image decoding device 100 may include a receiver 110 and a decoder 120. The receiver 110 and the decoder 120 may include at least one processor. In addition, the receiver 110 and the decoder 120 may include a memory that stores instructions to be executed by the at least one processor.
[0076] The receiver 110 may receive a bitstream. The bitstream includes information on an image encoded by an image encoding device 2200 described below. In addition, the bitstream may be transmitted from the image encoding device 2200. The image encoding device 2200 and the image decoding device 100 may be connected wired or wirelessly, and the receiver 110 may receive the bitstream wired or wirelessly. The receiver 110 may receive the bitstream from a storage medium such as an optical medium or a hard disk. The decoder 120 may reconstruct an image based on the information obtained from the received bitstream. The decoder 120 may obtain syntax elements for reconstructing the image from the bitstream. The decoder 120 may reconstruct the image based on the syntax elements.
[0077] Reference will be made to Figure 2 describe the operation of the image decoding device 100 in detail.
[0078] Figure 2 A flowchart showing an image decoding method according to an embodiment is shown.
[0079] According to an embodiment of the present invention, the receiver 110 receives a bitstream.
[0080] The image decoding device 100 obtains a bin (binary digit) string corresponding to a partitioning shape pattern of a coding / decoding unit from the bitstream (operation 210). The image decoding device 100 determines a partitioning rule for the coding / decoding unit (operation 220). In addition, the image decoding device 100 partitions the coding / decoding unit into a plurality of coding / decoding units based on at least one of the bin strings corresponding to the partitioning shape pattern and the partitioning rule (operation 230). The image decoding device 100 may determine a first allowable range of the size of the coding / decoding unit according to the aspect ratio of the coding / decoding unit in order to determine the partitioning rule. The image decoding device 100 may determine a second allowable range of the size of the coding / decoding unit according to the partitioning shape pattern of the coding / decoding unit in order to determine the partitioning rule.
[0081] Hereinafter, the partitioning of the coding / decoding unit will be described in detail according to an embodiment of the present invention.
[0082] First, a picture may be partitioned into one or more strips or one or more tiles. A strip or a tile may be a sequence of one or more largest coding / decoding units (coding tree units (CTUs)). Conceptually, there is a largest coding block (coding tree block (CTB)) compared to the largest coding / decoding unit (CTU).
[0083] The largest coding block (CTB) represents an NxN block including NxN samples (where N is an integer). Each color component may be partitioned into one or more largest coding blocks.
[0084] When an image has three sample arrays (sample arrays for Y, Cr, and Cb components), a maximum coding tree unit (CTU) includes a maximum coding block for luminance samples, two corresponding maximum coding blocks for chrominance samples, and a syntax structure for coding the luminance samples and the chrominance samples. When the image is a monochrome image, the maximum coding tree unit includes a maximum coding block for monochrome samples and a syntax structure for coding the monochrome samples. When the image is an image coded in color planes separated according to color components, the maximum coding tree unit includes a syntax structure for coding the image and the samples of the image.
[0085] A maximum coding block (CTB) can be divided into MxN coding blocks, including MxN samples (M and N are integers).
[0086] When an image has sample arrays for Y, Cr, and Cb components, a coding tree unit (CU) includes a coding block for luminance samples, two corresponding coding blocks for chrominance samples, and a syntax structure for coding the luminance samples and the chrominance samples. When the image is a monochrome image, the coding tree unit includes a coding block for monochrome samples and a syntax structure for coding the monochrome samples. When the image is an image coded in color planes separated according to color components, the coding tree unit includes a syntax structure for coding the image and the samples of the image.
[0087] As described above, the maximum coding block and the maximum coding tree unit are conceptually distinguished, and the coding block and the coding tree unit are conceptually distinguished. That is, the (maximum) coding tree unit refers to a data structure that includes the (maximum) coding block (including corresponding samples) and a syntax structure corresponding to the (maximum) coding block. However, as understood by those skilled in the art, the (maximum) coding tree unit or the (maximum) coding block refers to a block of a preset size including a preset number of samples, the maximum coding block, and the maximum coding tree unit, or, unless otherwise specified, the coding block and the coding tree unit are mentioned without distinction in the following description.
[0088] An image can be divided into maximum coding tree units (CTUs). The size of the maximum coding tree unit can be determined based on information obtained from the bitstream. The maximum coding tree unit can be in a square shape with the same size, but is not limited thereto. However, the embodiments are not limited thereto.
[0089] For example, information about the maximum size of the luminance coding block can be obtained from the bitstream. For example, the maximum size of the luminance coding block indicated by the information about the maximum size of the luminance coding block can be one of 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, and 256x256.
[0090] For example, information about the difference in luminance block sizes and the maximum size of luminance coding blocks that can be divided into two can be obtained from a bitstream. The information about the difference in luminance block sizes may refer to the size difference between the largest luminance codec unit and the largest luminance coding block that can be divided into two. Thus, when the information about the maximum size of luminance coding blocks that can be divided into two and the information about the difference in luminance block sizes obtained from the bitstream are combined with each other, the size of the largest luminance codec unit can be determined. The size of the largest chrominance codec unit can be determined by using the size of the largest luminance codec unit. For example, when the Y:Cb:Cr ratio according to the color format is 4:2:0, the size of a chrominance block can be half the size of a luminance block, and the size of the largest chrominance codec unit can be half the size of the largest luminance codec unit.
[0091] According to an embodiment, since information about the maximum size of binarily partitionable luminance coding blocks is obtained from a bitstream, the maximum size of binarily partitionable luminance coding blocks can be variably determined. In contrast, the maximum size of ternarily partitionable luminance coding blocks can be fixed. For example, the maximum size of ternarily partitionable luminance coding blocks in an I picture can be 32x32, while the maximum size of ternarily partitionable luminance coding blocks in a P picture or a B picture can be 64x64.
[0092] In addition, the largest codec unit can be hierarchically divided into codec units based on partition shape mode information obtained from a bitstream. At least one of information indicating whether quad partitioning is performed, information indicating whether multi-partitioning is performed, partition direction information, and partition type information can be obtained from the bitstream as the partition shape mode information.
[0093] For example, the information indicating whether quad partitioning is performed can indicate whether the current codec unit is quad partitioned (QUAD_SPLIT).
[0094] When the current codec unit is not quad partitioned, the information indicating whether multi-partitioning is performed can indicate whether the current codec unit is no longer partitioned (NO_SPLIT) or is binarily / ternarily partitioned.
[0095] When the current codec unit is binarily or ternarily partitioned, the partition direction information indicates that the current codec unit is partitioned in one of the horizontal and vertical directions.
[0096] When the current codec unit is partitioned in the horizontal or vertical direction, the partition type information indicates that the current codec unit is binarily or ternarily partitioned.
[0097] The partitioning mode of the current coding / decoding unit can be determined according to the partitioning direction information and the partitioning type information. When the current coding / decoding unit is binary partitioned in the horizontal direction, the partitioning mode can be determined as the binary horizontal partitioning mode (SPLIT_BT_HOR). When the current coding / decoding unit is ternary partitioned in the horizontal direction, the partitioning mode can be determined as the ternary horizontal partitioning mode (SPLIT_TT_HOR). When the current coding / decoding unit is binary partitioned in the vertical direction, the partitioning mode can be determined as the binary vertical partitioning mode (SPLIT_BT_VER), and when the current coding / decoding unit is ternary partitioned in the vertical direction, the partitioning mode can be determined as the ternary vertical partitioning mode (SPLIT_TT_VER).
[0098] The image decoding apparatus 100 can obtain the partitioning shape mode information from a bin string in the bitstream. The form of the bitstream received by the image decoding apparatus 100 can include fixed-length binary codes, unary codes, truncated unary codes, predetermined binary codes, etc. The bin string is information in the form of binary numbers. The bin string can include at least one bit. The image decoding apparatus 100 can obtain the partitioning shape mode information corresponding to the bin string based on the partitioning rules. The image decoding apparatus 100 can determine whether to quaternary partition the coding / decoding unit, whether to partition the coding / decoding unit, the partitioning direction, and the partitioning type based on a bin string.
[0099] The coding / decoding unit can be less than or equal to the maximum coding / decoding unit. For example, since the maximum coding / decoding unit is the coding / decoding unit with the largest size, the maximum coding / decoding unit is one of the coding / decoding units. When the partitioning shape mode information about the maximum coding / decoding unit indicates that no partitioning is performed, the coding / decoding unit determined in the maximum coding / decoding unit has the same size as the maximum coding / decoding unit. When the partitioning shape mode information about the maximum coding / decoding unit indicates that partitioning is performed, the maximum coding / decoding unit can be partitioned into coding / decoding units. In addition, when the partitioning shape mode information about the coding / decoding unit indicates that partitioning is performed, the coding / decoding unit can be partitioned into smaller coding / decoding units. However, the partitioning of the image is not limited to this, and the maximum coding / decoding unit and the coding / decoding unit may not be distinguished. The partitioning of the coding / decoding unit will be described in detail with reference to Figures 3 to 16 Describe the partitioning of the coding / decoding unit in detail.
[0100] In addition, one or more prediction blocks for prediction can be determined from the coding / decoding unit. The prediction block can be the same as or smaller than the coding / decoding unit. In addition, one or more transform blocks for transformation can be determined from the coding / decoding unit. The transform block can be the same as or smaller than the coding / decoding unit.
[0101] The shapes and sizes of the transform block and the prediction block can be independent of each other.
[0102] In another embodiment, prediction may be performed by using the codec unit as a prediction block. In addition, transformation may be performed by using the codec unit as a transform block.
[0103] Reference will be made Figures 3 to 16 to a detailed description of the division of the codec unit. The current block and adjacent blocks of the present invention may indicate one of a largest codec unit, a codec unit, a prediction block, and a transform block. In addition, the current block or the current codec unit may be a currently decoded or encoded block or a currently divided block. The adjacent block may be a block that has been reconstructed earlier than the current block. The adjacent block may be adjacent to the current block in the spatial domain or the temporal domain. The adjacent block may be located at any one of the lower left side, upper left side, upper side, upper right side, right side, and lower right side of the current block.
[0104] Figure 3 FIG. shows a process of determining at least one codec unit by dividing a current codec unit, which is performed by an image decoding apparatus according to an embodiment.
[0105] The block shape may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N. Here, N may be a positive integer. The block shape information is information indicating at least one of the shape, direction, aspect ratio, or size of the codec unit.
[0106] The shape of the codec unit may include a square and a non-square. When the lengths of the width and height of the codec unit are the same (i.e., when the block shape of the codec unit is 4Nx4N), the image decoding apparatus 100 may determine the block shape information of the codec unit as a square. The image decoding apparatus 100 may determine the shape of the codec unit as a non-square.
[0107] When the lengths of the width and height of the codec unit are different from each other (i.e., when the block shape of the codec unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the image decoding apparatus 100 may determine the block shape information of the codec unit as a non-square. When the shape of the codec unit is non-square, the image decoding apparatus 100 may determine the aspect ratio in the block shape information of the codec unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. In addition, the image decoding apparatus 100 may determine whether the codec unit is in the horizontal direction or the vertical direction based on the length of the width and the length of the height of the codec unit. In addition, the image decoding apparatus 100 may determine the size of the codec unit based on at least one of the length of the width, the length of the height, or the area of the codec unit.
[0108] According to an embodiment, the image decoding apparatus 100 may determine the shape of a coding / decoding unit by using block shape information, and may determine the division shape of the coding / decoding unit by using division shape mode information. That is, the division method of the coding / decoding unit indicated by the division shape mode information may be determined based on the block shape indicated by the block shape information used by the image decoding apparatus 100.
[0109] The image decoding apparatus 100 may obtain the division shape mode information from a bitstream. However, the embodiment is not limited thereto, and the image decoding apparatus 100 and the image encoding apparatus 2200 may determine pre-agreed division shape mode information based on the block shape information. The image decoding apparatus 100 may determine pre-agreed division shape mode information regarding the largest coding / decoding unit or the smallest coding / decoding unit. For example, the image decoding apparatus 100 may determine that the division shape mode information regarding the largest coding / decoding unit is quadtree division. In addition, the image decoding apparatus 100 may determine the division shape mode information regarding the smallest coding / decoding unit as "no division is performed". Specifically, the image decoding apparatus 100 may determine the size of the largest coding / decoding unit as 256x256. The image decoding apparatus 100 may determine the pre-agreed division shape mode information as quadtree division. Quadtree division is a division shape mode in which both the width and height of the coding / decoding unit are bisected. The image decoding apparatus 100 may obtain a coding / decoding unit having a size of 128x128 from the largest coding / decoding unit having a size of 256x256 based on the division shape mode information. In addition, the image decoding apparatus 100 may determine the size of the smallest coding / decoding unit as 4x4. The image decoding apparatus 100 may obtain division shape mode information indicating "no division is performed" regarding the smallest coding / decoding unit.
[0110] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding / decoding unit has a square shape. For example, the image decoding apparatus 100 may determine whether to not divide the square coding / decoding unit, whether to vertically divide the square coding / decoding unit, whether to horizontally divide the square coding / decoding unit, or whether to divide the square coding / decoding unit into four coding / decoding units based on the division shape mode information. Refer to Figure 3 , when the block shape information of the current coding / decoding unit 300 indicates a square, the decoder 120 may determine that the coding / decoding unit 310a having the same size as the current coding / decoding unit 300 is not divided based on the division shape mode information indicating no division is performed, or may determine that the coding / decoding units 310b, 310c, 310d, 310e, or 310f are divided based on the division shape mode information indicating a preset division method.
[0111] Refer to Figure 3, according to an embodiment, the image decoding apparatus 100 may determine two codec units 310b obtained by dividing a current codec unit 300 in a vertical direction based on partition shape mode information indicating partition in the vertical direction. The image decoding apparatus 100 may determine two codec units 310c obtained by dividing the current codec unit 300 in a horizontal direction based on partition shape mode information indicating partition in the horizontal direction. The image decoding apparatus 100 may determine four codec units 310d obtained by dividing the current codec unit 300 in both the vertical and horizontal directions based on partition shape mode information indicating partition in both the vertical and horizontal directions. According to an embodiment, the image decoding apparatus 100 may determine three codec units 310e obtained by dividing the current codec unit 300 in a vertical direction based on partition shape mode information indicating ternary partition in the vertical direction. The image decoding apparatus 100 may determine three codec units 310f obtained by dividing the current codec unit 300 in a horizontal direction based on partition shape mode information indicating ternary partition in the horizontal direction. However, the partition shapes into which a square codec unit can be divided are not limited to the above methods, and the partition shape mode information may indicate various methods. The preset partition shapes into which a square codec unit will be divided will be described in detail below in conjunction with various embodiments.
[0112] Figure 4 FIG. shows a process of determining at least one codec unit by dividing a non-square codec unit performed by an image decoding apparatus according to an embodiment.
[0113] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that a current codec unit has a non-square shape. The image decoding apparatus 100 may determine whether to divide a non-square current codec unit or determine whether to divide a non-square current codec unit by using a preset partitioning method based on the partition shape mode information. Refer to Figure 4 , when the block shape information of the current codec unit 400 or 450 indicates a non-square shape, the image decoding apparatus 100 may determine that the codec units 410 or 460 having the same size as the current codec unit 400 or 450 are not divided based on the partition shape mode information indicating no partition, or may determine that the codec units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c are divided based on the partition shape mode information indicating a preset partitioning method. The preset partitioning method for dividing a non-square codec unit will be described in detail below in conjunction with various embodiments.
[0114] According to an embodiment, the image decoding apparatus 100 may determine a partitioning shape into which a codec unit is to be partitioned by using partitioning shape mode information, and in this case, the partitioning shape mode information may indicate the number of one or more codec units generated by partitioning the codec unit. Refer to Figure 4 , when the partitioning shape mode information indicates that the current codec unit 400 or 450 is to be partitioned into two codec units, the image decoding apparatus 100 may determine two codec units 420a and 420b, or 470a and 470b included in the current codec unit 400 or 450 by partitioning the current codec unit 400 or 450 based on the partitioning shape mode information.
[0115] According to an embodiment, when the image decoding apparatus 100 partitions a non-square current codec unit 400 or 450 based on the partitioning shape mode information, the image decoding apparatus 100 may consider the position of the long side of the non-square current codec unit 400 or 450 to partition the current codec unit. For example, considering the shape of the current codec unit 400 or 450, the image decoding apparatus 100 may determine a plurality of codec units by partitioning the current codec unit 400 or 450 in the direction of the long side of the current codec unit 400 or 450.
[0116] According to an embodiment, when the partitioning shape mode information indicates that the codec unit is partitioned (ternary partitioning) into an odd number of blocks, the image decoding apparatus 100 may determine an odd number of codec units included in the current codec unit 400 or 450. For example, when the partitioning shape mode information indicates that the current codec unit 400 or 450 is to be partitioned into three codec units, the image decoding apparatus 100 may partition the current codec unit 400 or 450 into three codec units 430a, 430b, and 430c, or 480a, 480b, and 480c.
[0117] According to an embodiment, the aspect ratio of the current coding / decoding unit 400 or 450 may be 4:1 or 1:4. When the aspect ratio is 4:1, the block shape information may indicate the horizontal direction because the length of the width is longer than the length of the height. When the aspect ratio is 1:4, the block shape information may indicate the vertical direction because the length of the width is shorter than the length of the height. The image decoding device 100 may determine to divide the current coding / decoding unit into an odd number of blocks based on the partitioning shape mode information. In addition, the image decoding device 100 may determine the partitioning direction of the current coding / decoding unit 400 or 450 based on the block shape information of the current coding / decoding unit 400 or 450. For example, when the current coding / decoding unit 400 is in the vertical direction, the image decoding device 100 may determine the coding / decoding units 430a to 430c by partitioning the current coding / decoding unit 400 in the horizontal direction. In addition, when the current coding / decoding unit 450 is in the horizontal direction, the image decoding device 100 may determine the coding / decoding units 480a to 480c by partitioning the current coding / decoding unit 450 in the vertical direction.
[0118] According to an embodiment, the image decoding device 100 may determine an odd number of coding / decoding units included in the current coding / decoding unit 400 or 450, and not all of the determined coding / decoding units may have the same size. For example, the size of a preset coding / decoding unit 430b or 480b among the determined odd number of coding / decoding units 430a, 430b, and 430c or 480a, 480b, and 480c may be different from the sizes of the other coding / decoding units 430a and 430c or 480a and 480c. That is, the coding / decoding units that can be determined by partitioning the current coding / decoding unit 400 or 450 may have multiple sizes, and in some cases, all of the odd number of coding / decoding units 430a, 430b, and 430c or 480a, 480b, and 480c may have different sizes.
[0119] According to an embodiment, when the partitioning shape mode information indicates that the coding / decoding unit is to be divided into an odd number of blocks, the image decoding device 100 may determine an odd number of coding / decoding units included in the current coding / decoding unit 400 or 450, and may impose a preset restriction on at least one of the odd number of coding / decoding units generated by partitioning the current coding / decoding unit 400 or 450. Refer to Figure 4, the image decoding device 100 may set the decoding process for the codec unit 430b or 480b located in the middle of the three codec units 430a, 430b, and 430c or 480a, 480b, and 480c generated as the current codec unit 400 or 450 is divided to be different from the decoding processes of the other codec units 430a and 430c or 480a and 480c. For example, different from the other codec units 430a and 430c or 480a and 480c, the image decoding device 100 may limit the codec unit 430b or 480b located at the central position from being further divided or only divided a preset number of times.
[0120] Figure 5 Shows the process of dividing a codec unit based on at least one of block shape information and partition shape mode information performed by an image decoding device according to an embodiment.
[0121] According to an embodiment, the image decoding device 100 may determine whether to divide the square first codec unit 500 into codec units based on at least one of block shape information and partition shape mode information. According to an embodiment, when the partition shape mode information indicates dividing the first codec unit 500 in the horizontal direction, the image decoding device 100 may determine the second codec unit 510 by dividing the first codec unit 500 in the horizontal direction. The first codec unit, the second codec unit, and the third codec unit used according to an embodiment are terms for understanding the relationship before and after dividing the codec unit. For example, the second codec unit may be determined by dividing the first codec unit, and the third codec unit may be determined by dividing the second codec unit. It should be understood that the relationship between the first codec unit, the second codec unit, and the third codec unit follows the above description.
[0122] According to an embodiment, the image decoding device 100 may determine whether to divide the determined second codec unit 510 into codec units based on the partition shape mode information. Refer to Figure 5, the image decoding apparatus 100 may divide the non-square second decoding unit 510 determined by dividing the first decoding unit 500 into one or more third decoding units 520a, 520b, 520c, and 520d based on at least one of the partitioning shape mode information and the partitioning shape mode information, or may not divide the non-square second decoding unit 510. The image decoding apparatus 100 may obtain the partitioning shape mode information, and may, based on the obtained partitioning shape mode information, obtain a plurality of second decoding units (e.g., 510) of different shapes by dividing the first decoding unit 500, and may divide the second decoding unit 510 by using the partitioning method of the first decoding unit 500 based on the partitioning shape mode information. According to an embodiment, when the first decoding unit 500 is divided into the second decoding unit 510 based on the partitioning shape mode information of the first decoding unit 500, the second decoding unit 510 may also be divided into third decoding units (e.g., 520a, or 520b, 520c, and 520d). That is, the decoding units may be recursively divided based on the partitioning shape mode information of each decoding unit. Therefore, a square decoding unit may be determined by dividing a non-square decoding unit, and a non-square decoding unit may be determined by recursively dividing a square decoding unit.
[0123] Reference Figure 5 , a preset decoding unit (e.g., a decoding unit located at the center position or a square decoding unit) among the odd-numbered third decoding units 520b, 520c, and 520d determined by dividing the non-square second decoding unit 510 may be recursively divided. According to an embodiment, the square third decoding unit 520c among the odd-numbered third decoding units 520b, 520c, and 520d may be divided into a plurality of fourth decoding units in the horizontal direction. The non-square fourth decoding unit 530b or 530d among the plurality of fourth decoding units 530a, 530b, 530c, and 530d may be re-divided into a plurality of decoding units. For example, the non-square fourth decoding unit 530b or 530d may be re-divided into an odd number of decoding units. A method for recursively dividing decoding units that can be used will be described below in conjunction with various embodiments.
[0124] According to an embodiment, the image decoding apparatus 100 may divide each of the third-stage decoding units 520a or 520b, 520c, and 520d into coding / decoding units based on the partitioning shape mode information. In addition, the image decoding apparatus 100 may determine not to divide the second-stage decoding unit 510 based on the partitioning shape mode information. According to an embodiment, the image decoding apparatus 100 may divide the non-square second-stage decoding unit 510 into an odd number of third-stage decoding units 520b, 520c, and 520d. The image decoding apparatus 100 may impose a preset restriction on a preset third-stage decoding unit among the odd number of third-stage decoding units 520b, 520c, and 520d. For example, the image decoding apparatus 100 may restrict the third-stage decoding unit 520c at the central position among the odd number of third-stage decoding units 520b, 520c, and 520d from being further divided or from being divided a settable number of times.
[0125] Reference Figure 5 , the image decoding apparatus 100 may restrict the third-stage decoding unit 520c at the central position among the odd number of third-stage decoding units 520b, 520c, and 520d included in the non-square second-stage decoding unit 510 from being further divided, from being divided by using a preset partitioning method (e.g., only divided into four coding / decoding units or divided by using the partitioning method of the second-stage decoding unit 510), or from being divided only a preset number of times (e.g., only divided n times (where n > 0)). However, the restriction on the third-stage decoding unit 520c at the central position is not limited to the above examples and may include various restrictions on decoding the third-stage decoding unit 520c at the central position that are different from those of the other third-stage decoding units 520b and 520d.
[0126] According to an embodiment, the image decoding apparatus 100 may obtain partitioning shape mode information for partitioning the current coding / decoding unit from a preset position in the current coding / decoding unit.
[0127] Figure 6 FIG. shows a method for determining a preset coding / decoding unit from an odd number of coding / decoding units performed by an image decoding apparatus according to an embodiment.
[0128] Reference Figure 6 , the partitioning shape mode information of the current coding / decoding unit 600 or 650 may be obtained from a sample at a preset position among a plurality of samples included in the current coding / decoding unit 600 or 650 (e.g., the sample 640 or 690 at the central position). However, the preset positions from which at least one piece of partitioning shape mode information can be obtained from the current coding / decoding unit 600 are not limited to Figure 6at the central position in, and may include various positions included in the current codec unit 600 (e.g., top, bottom, left, right, upper left, lower left, upper right, lower right positions, etc.). The image decoding apparatus 100 may obtain the partition shape mode information from a preset position, and may determine whether to partition the current codec unit into codec units of various shapes and various sizes.
[0129] According to an embodiment, when the current codec unit is partitioned into a preset number of codec units, the image decoding apparatus 100 may select one of the codec units. Various methods may be used to select one of the multiple codec units, as will be described in conjunction with various embodiments below.
[0130] According to an embodiment, the image decoding apparatus 100 may partition the current codec unit into a plurality of codec units, and may determine the codec unit at the preset position.
[0131] According to an embodiment, the image decoding apparatus 100 may use the information indicating the positions of an odd number of codec units to determine the codec unit located at the central position among the odd number of codec units. Referring to Figure 6 , the image decoding apparatus 100 may determine the odd number of codec units 620a, 620b, and 620c or the odd number of codec units 660a, 660b, and 660c by partitioning the current codec unit 600 or the current codec unit 650. The image decoding apparatus 100 may determine the middle codec unit 620b or the middle codec unit 660b by using the information about the positions of the odd number of codec units 620a, 620b, and 620c or the positions of the odd number of codec units 660a, 660b, and 660c. For example, the image decoding apparatus 100 may determine the positions of the codec units 620a, 620b, and 620c based on the information indicating the positions of preset sample points included in the codec units 620a, 620b, and 620c to determine the codec unit 620b at the central position. Specifically, the image decoding apparatus 100 may determine the positions of the codec units 620a, 620b, and 620c based on the information indicating the positions of the upper left sample points 630a, 630b, and 630c of the codec units 620a, 620b, and 620c to determine the codec unit 620b at the central position.
[0132] According to an embodiment, the information indicating the positions of the upper left corner samples 630a, 630b, and 630c included in the encoding / decoding units 620a, 620b, and 620c, respectively, may include information about the positions or coordinates of the encoding / decoding units 620a, 620b, and 620c in the picture. According to an embodiment, the information indicating the positions of the upper left samples 630a, 630b, and 630c included in the encoding / decoding units 620a, 620b, and 620c, respectively, may include information indicating the width or height of the encoding / decoding units 620a, 620b, and 620c included in the current encoding / decoding unit 600, and the width or height may correspond to the information indicating the difference between the coordinates of the encoding / decoding units 620a, 620b, and 620c in the picture. That is, the image decoding apparatus 100 may determine the encoding / decoding unit 620b at the center position by directly using the information about the positions or coordinates of the encoding / decoding units 620a, 620b, and 620c in the picture, or by using the information about the width or height of the encoding / decoding unit corresponding to the difference between the coordinates.
[0133] According to an embodiment, the information indicating the position of the upper left sample 630a of the upper encoding / decoding unit 620a may include coordinates (xa, ya), the information indicating the position of the upper left sample 630b of the middle encoding / decoding unit 620b may include coordinates (xb, yb), and the information indicating the position of the upper left sample 630c of the lower encoding / decoding unit 620c may include coordinates (xc, yc). The image decoding apparatus 100 may determine the middle encoding / decoding unit 620b by using the coordinates of the upper left samples 630a, 630b, and 630c included in the encoding / decoding units 620a, 620b, and 620c, respectively. For example, when the coordinates of the upper left samples 630a, 630b, and 630c are sorted in ascending or descending order, the encoding / decoding unit 620b including the coordinates (xb, yb) of the sample 630b at the center position may be determined as the encoding / decoding unit at the center position among the encoding / decoding units 620a, 620b, and 620c determined by dividing the current encoding / decoding unit 600. However, the coordinates indicating the positions of the upper left samples 630a, 630b, and 630c may include coordinates indicating the absolute position in the picture, or may use the coordinates (dxb, dyb) indicating the relative position of the upper left sample 630b of the middle encoding / decoding unit 620b and the coordinates (dxc, dyc) indicating the relative position of the upper left sample 630c of the lower encoding / decoding unit 620c with respect to the position of the upper left sample 630a of the upper encoding / decoding unit 620a. The method of determining the encoding / decoding unit at a preset position by using the coordinates of the samples included in the encoding / decoding unit as the information indicating the positions of the samples is not limited to the above method, and may include various arithmetic methods capable of using the coordinates of the samples.
[0134] According to an embodiment, the image decoding apparatus 100 may divide the current codec unit 600 into multiple codec units 620a, 620b, and 620c, and may select one of the codec units 620a, 620b, and 620c based on a preset criterion. For example, the image decoding apparatus 100 may select the codec unit 620b whose size is different from that of the other codec units from the codec units 620a, 620b, and 620c.
[0135] According to an embodiment, the image decoding apparatus 100 may determine the width or height of each of the codec units 620a, 620b, and 620c by using the coordinates (xa, ya), the coordinates (xb, yb), and the coordinates (xc, yc). The coordinates (xa, ya) are information indicating the position of the upper left sample 630a of the upper codec unit 620a, the coordinates (xb, yb) are information indicating the position of the upper left sample 630b of the middle codec unit 620b, and the coordinates (xc, yc) are information indicating the position of the upper left sample 630c of the lower codec unit 620c. The image decoding apparatus 100 may determine the corresponding sizes of the codec units 620a, 620b, and 620c by using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the codec units 620a, 620b, and 620c. According to an embodiment, the image decoding apparatus 100 may determine the width of the upper codec unit 620a as the width of the current codec unit 600. The image decoding apparatus 100 may determine the height of the upper codec unit 620a as yb - ya. According to an embodiment, the image decoding apparatus 100 may determine the width of the middle codec unit 620b as the width of the current codec unit 600. The image decoding apparatus 100 may determine the height of the middle codec unit 620b as yc - yb. According to an embodiment, the image decoding apparatus 100 may determine the width or height of the lower codec unit 620c by using the width or height of the current codec unit 600 or the width or height of the upper codec unit 620a and the middle codec unit 620b. The image decoding apparatus 100 may determine a codec unit having a size different from that of the other codec units based on the determined widths and heights of the codec units 620a to 620c. Refer to Figure 6, the image decoding apparatus 100 may determine an intermediate codec unit 620b having a size different from that of the upper codec unit 620a and the lower codec unit 620c as the codec unit at a preset position. However, the above method of determining, by the image decoding apparatus 100, a codec unit having a size different from that of other codec units corresponds only to an example of determining the codec unit at the preset position by using the size of the codec unit determined based on the coordinates of sample points. Thus, various methods of determining the codec unit at the preset position by comparing the sizes of the codec units determined based on the coordinates of preset sample points may be used.
[0136] The image decoding apparatus 100 may determine the width or height of each of the codec units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf). The coordinate (xd, yd) is information indicating the position of the upper-left sample point 670a of the left codec unit 660a, the coordinate (xe, ye) is information indicating the position of the upper-left sample point 670b of the intermediate codec unit 660b, and the coordinate (xf, yf) is information indicating the position of the upper-left sample point 670c of the right codec unit 660c. The image decoding apparatus 100 may determine the respective sizes of the codec units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the codec units 660a, 660b, and 660c.
[0137] According to an embodiment, the image decoding apparatus 100 may determine the width of the left codec unit 660a as xe - xd. The image decoding apparatus 100 may determine the height of the left codec unit 660a as the height of the current codec unit 650. According to an embodiment, the image decoding apparatus 100 may determine the width of the intermediate codec unit 660b as xf - xe. The image decoding apparatus 100 may determine the height of the intermediate codec unit 660b as the height of the current codec unit 650. According to an embodiment, the image decoding apparatus 100 may determine the width or height of the right codec unit 660c by using the width or height of the current codec unit 650 or the widths or heights of the left codec unit 660a and the intermediate codec unit 660b. The image decoding apparatus 100 may determine a codec unit having a size different from that of other codec units based on the determined widths or heights of the codec units 660a to 660c. Refer to Figure 6, the image decoding device 100 may determine the intermediate codec unit 660b having a size different from that of the left codec unit 660a and the right codec unit 660c as the codec unit at the preset position. However, the above method of determining the codec unit having a size different from that of other codec units performed by the image decoding device 100 only corresponds to an example of determining the codec unit at the preset position by using the size of the codec unit determined based on the coordinates of the sample points. Therefore, various methods of determining the codec unit at the preset position by comparing the sizes of the codec units determined based on the coordinates of the preset sample points can be used.
[0138] However, the position of the sample point for determining the position of the codec unit is not limited to the above-mentioned upper left position, and information on any position of the sample points included in the codec unit can be used.
[0139] According to an embodiment, the image decoding device 100 may select the codec unit at the preset position from an odd number of codec units determined by dividing the current codec unit in consideration of the shape of the current codec unit. For example, when the current codec unit has a non-square shape with a width greater than the height, the image decoding device 100 may determine the codec unit at the preset position in the horizontal direction. That is, the image decoding device 100 may determine one of the codec units at different positions in the horizontal direction and impose a restriction on the codec unit. When the current codec unit has a non-square shape with a height greater than the width, the image decoding device 100 may determine the codec unit at the preset position in the vertical direction. That is, the image decoding device 100 may determine one of the codec units at different positions in the vertical direction and may impose a restriction on the codec unit.
[0140] According to an embodiment, the image decoding device 100 may determine the codec unit at the preset position from an even number of codec units by using the information indicating the corresponding positions of the even number of codec units. The image decoding device 100 may determine an even number of codec units by dividing (binary division) the current codec unit, and may determine the codec unit at the preset position by using the information on the positions of the even number of codec units. The operations related thereto may correspond to the operations of determining the codec unit at the preset position (e.g., the center position) among an odd number of codec units, which have been described in detail above with respect to Figure 6 This has been described in detail, so a detailed description thereof is not provided herein.
[0141] According to an embodiment, when a non-square current codec unit is divided into a plurality of codec units, preset information about a codec unit at a preset position can be used in the division operation to determine the codec unit at the preset position among the plurality of codec units. For example, the image decoding apparatus 100 can use at least one of block shape information and division shape mode information stored in samples included in an intermediate codec unit in the division operation to determine the codec unit at the center position among the plurality of codec units determined by dividing the current codec unit.
[0142] Reference Figure 6 , the image decoding apparatus 100 can divide the current codec unit 600 into a plurality of codec units 620a, 620b, and 620c based on the division shape mode information, and can determine the codec unit 620b at the center position among the plurality of codec units 620a, 620b, and 620c. In addition, the image decoding apparatus 100 can determine the codec unit 620b at the center position in consideration of the position from which the division shape mode information is obtained. That is, the division shape mode information of the current codec unit 600 can be obtained from the sample 640 at the center position of the current codec unit 600, and when the current codec unit 600 is divided into a plurality of codec units 620a, 620b, and 620c based on the division shape mode information, the codec unit 620b including the sample 640 can be determined as the codec unit at the center position. However, the information for determining the codec unit at the center position is not limited to the division shape mode information, and various types of information can be used to determine the codec unit at the center position.
[0143] According to an embodiment, preset information for identifying a codec unit at a preset position can be obtained from preset samples included in the codec unit to be determined. Reference Figure 6 , the image decoding apparatus 100 can use the division shape mode information obtained from the sample at the preset position in the current codec unit 600 (e.g., the sample at the center position of the current codec unit 600) to determine the codec unit at the preset position (e.g., the codec unit at the center position among the plurality of divided codec units) among the plurality of codec units 620a, 620b, and 620c determined by dividing the current codec unit 600. That is, the image decoding apparatus 100 can determine the sample at the preset position in consideration of the block shape of the current codec unit 600, determine the codec unit 620b including the sample from which preset information (e.g., division shape mode information) can be obtained among the plurality of codec units 620a, 620b, and 620c determined by dividing the current codec unit 600, and can impose a preset restriction on the codec unit 620b. Reference Figure 6, according to an embodiment, the image decoding apparatus 100 may determine a sample 640 at the center position of the current codec unit 600 as a sample from which preset information can be obtained, and may impose a preset restriction on the codec unit 620b including the sample 640 during the decoding operation. However, the position of the sample from which preset information can be obtained is not limited to the above position, and may include any position of the sample included in the codec unit 620b to be determined for restriction.
[0144] According to an embodiment, the position of the sample from which preset information can be obtained may be determined based on the shape of the current codec unit 600. According to an embodiment, the block shape information may indicate whether the current codec unit is a square shape or a non-square shape, and the position of the sample from which preset information can be obtained may be determined based on the shape. For example, the image decoding apparatus 100 may determine, as a sample from which preset information can be obtained, a sample located on a boundary for dividing by at least half of the width or the height of the current codec unit by using at least one of the information on the width of the current codec unit and the information on the height of the current codec unit. As another example, when the block shape information of the current codec unit indicates a non-square shape, the image decoding apparatus 100 may determine one of the samples including a boundary for dividing by half of the long side of the current codec unit as a sample from which preset information can be obtained.
[0145] According to an embodiment, when the current codec unit is divided into a plurality of codec units, the image decoding apparatus 100 may use the division shape mode information to determine the codec unit at a preset position among the plurality of codec units. According to an embodiment, the image decoding apparatus 100 may obtain the division shape mode information from a sample at a preset position in the codec unit, and divide the plurality of codec units generated by dividing the current codec unit by using the division shape mode information (obtained from the samples at the preset positions in each of the plurality of codec units). That is, the codec unit may be recursively divided based on the division shape mode information obtained from the samples at the preset positions in each codec unit. The operation of recursively dividing the codec unit has been described above with reference to Figure 5 the operation of recursively dividing the codec unit, and thus a detailed description thereof is not provided herein.
[0146] According to an embodiment, the image decoding apparatus 100 may determine one or more codec units by dividing the current codec unit, and may determine the order of decoding the one or more codec units based on a preset block (e.g., the current codec unit).
[0147] Figure 7 FIG. shows the order of processing a plurality of codec units when the image decoding apparatus determines a plurality of codec units by dividing the current codec unit according to an embodiment.
[0148] According to an embodiment, based on the divided shape pattern information, the image decoding apparatus 100 may determine second codec units 710a and 710b by dividing a first codec unit 700 in a vertical direction, may determine second codec units 730a and 730b by dividing the first codec unit 700 in a horizontal direction, or may determine second codec units 750a, 750b, 750c, and 750d by dividing the first codec unit 700 in both the vertical and horizontal directions.
[0149] Reference Figure 7 , the image decoding apparatus 100 may determine to process the second codec units 710a and 710b determined by dividing the first codec unit 700 in the vertical direction in a horizontal direction order 710c. The image decoding apparatus 100 may determine to process the second codec units 730a and 730b determined by dividing the first codec unit 700 in the horizontal direction in a vertical direction order 730c. The image decoding apparatus 100 may determine the second codec units 750a to 750d determined by dividing the first codec unit 700 in both the vertical and horizontal directions according to a preset order of processing codec units in one row and then processing codec units in the next row (e.g., raster scan order or Z scan order 750e).
[0150] According to an embodiment, the image decoding apparatus 100 may recursively divide codec units. Reference Figure 7 , the image decoding apparatus 100 may determine a plurality of codec units 710a and 710b, 730a and 730b, or 750a to 750d by dividing the first codec unit 700, and may recursively divide each of the determined plurality of codec units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. The dividing method of the plurality of codec units 710a and 710b, 730a and 730b, or 750a to 750d may correspond to the dividing method of the first codec unit 700. In this way, each of the plurality of codec units 710a and 710b, 730a and 730b, or 750a to 750d may be independently divided into a plurality of codec units. Reference Figure 7 , the image decoding apparatus 100 may determine the second codec units 710a and 710b by dividing the first codec unit 700 in the vertical direction, and may determine whether to independently divide each of the second codec units 710a and 710b or not.
[0151] According to an embodiment, the image decoding apparatus 100 may determine third decoding units 720a and 720b by dividing a left second decoding unit 710a in a horizontal direction, and may not divide a right second decoding unit 710b.
[0152] According to an embodiment, the processing order of the encoding / decoding units may be determined based on the operation of dividing the encoding / decoding units. In other words, the processing order of the divided encoding / decoding units may be determined based on the processing order of the encoding / decoding unit immediately before being divided. The image decoding apparatus 100 may independently of the right second decoding unit 710b, determine the processing order of the third decoding units 720a and 720b determined by dividing the left second decoding unit 710a. Since the third decoding units 720a and 720b are determined by dividing the left second decoding unit 710a in a horizontal direction, the third decoding units 720a and 720b may be processed in a vertical direction order 720c. Since the left second decoding unit 710a and the right second decoding unit 710b are processed in a horizontal direction order 710c, the right second decoding unit 710b may be processed after the third decoding units 720a and 720b included in the left second decoding unit 710a are processed in the vertical direction order 720c. The operation of determining the processing order of the encoding / decoding units based on the encoding / decoding unit before being divided is not limited to the above example, and various methods may be used to independently process the divided and determined encoding / decoding units in various shapes in a preset order.
[0153] Figure 8 Illustrated is the processing of determining that the current encoding / decoding unit will be divided into an odd number of encoding / decoding units when the encoding / decoding units cannot be processed in a preset order, performed by the image decoding apparatus according to an embodiment.
[0154] According to an embodiment, the image decoding apparatus 100 may determine that the current encoding / decoding unit is divided into an odd number of encoding / decoding units based on the obtained division shape pattern information. Refer to Figure 8 , a square first decoding unit 800 may be divided into non-square second decoding units 810a and 810b, and the second decoding units 810a and 810b may be independently divided into third decoding units 820a and 820b, and 820c, 820d, and 820e. According to an embodiment, the image decoding apparatus 100 may determine a plurality of third decoding units 820a and 820b by dividing a left second decoding unit 810a in a horizontal direction, and may divide the right second decoding unit 810b into an odd number of third decoding units 820c to 820e.
[0155] According to an embodiment, the image decoding apparatus 100 may determine whether any codec units are divided into an odd number of codec units by determining whether the third-stage codec units 820a, 820b, and 820c to 820e can be processed in a preset order. Refer to Figure 8 , the image decoding apparatus 100 may determine the third-stage codec units 820a, 820b, and 820c to 820e by recursively dividing the first-stage codec unit 800. The image decoding apparatus 100 may determine whether any of the first-stage codec unit 800, the second-stage codec units 810a and 810b, or the third-stage codec units 820a and 820b, and 820c to 820e are divided into an odd number of codec units based on at least one of the block shape information and the division shape pattern information. For example, the codec unit located on the right among the second-stage codec units 810a and 810b may be divided into an odd number of third-stage codec units 820c, 820d, and 820e. The processing order of the plurality of codec units included in the first-stage codec unit 800 may be a preset order (e.g., the Z-scan order 830), and the image decoding apparatus 100 may determine whether the third-stage codec units 820c, 820d, and 820e determined by dividing the right second-stage codec unit 810b into an odd number of codec units satisfy the condition of being processed in the preset order.
[0156] According to an embodiment, the image decoding apparatus 100 may determine whether the third-stage codec units 820a, 820b, and 820c to 820e included in the first-stage codec unit 800 satisfy the condition of being processed in a preset order, and the condition relates to whether at least one of the width and height of the second-stage codec units 810a and 810e is halved along the boundaries of the third-stage codec units 820a and 820b, and 820c to 820e. For example, the third-stage codec units 820a and 820b determined when the height of the non-square-shaped left second-stage codec unit 810a is halved may satisfy the condition. It may be determined that the third-stage codec units 820c to 820e do not satisfy the condition because the boundaries of the third-stage codec units 820c to 820e determined when the right second-stage codec unit 810b is divided into three codec units cannot be divided by half of the width or height of the right second-stage codec unit 810b. When the condition is satisfied as described above, the image decoding apparatus 100 may determine the disconnection of the scan order, and may determine to divide the right second-stage codec unit 810b into an odd number of codec units based on the determined result. According to an embodiment, when a codec unit is divided into an odd number of codec units, the image decoding apparatus 100 may impose a preset restriction on the codec unit at a preset position in the divided codec units. The restrictions or preset positions have been described in conjunction with various embodiments above, and thus a detailed description thereof will not be provided herein.
[0157] Figure 9 Shows a process of determining at least one codec unit by dividing a first codec unit, which is performed by an image decoding device according to an embodiment.
[0158] According to an embodiment, the image decoding device 100 may divide the first codec unit 900 based on the division shape mode information obtained through the receiver 110. The square first codec unit 900 may be divided into four square codec units, or may be divided into a plurality of non-square codec units. For example, referring to Figure 9 , when the first codec unit 900 has a square shape and the division shape mode information indicates that the first codec unit 900 is to be divided into non-square codec units, the image decoding device 100 may divide the first codec unit 900 into a plurality of non-square codec units. Specifically, when the division shape mode information indicates that an odd number of codec units are to be determined by dividing the first codec unit 900 in the horizontal or vertical direction, the image decoding device 100 may divide the square first codec unit 900 into an odd number of codec units. For example, the second codec units 910a, 910b, and 910c determined by dividing the square first codec unit 900 in the vertical direction, or the second codec units 920a, 920b, and 920c determined by dividing the square first codec unit 900 in the horizontal direction.
[0159] According to an embodiment, the image decoding device 100 may determine whether the second codec units 910a, 910b, and 910c, and 920a, 920b, and 920c included in the first codec unit 900 satisfy the condition for being processed in a preset order, and the condition relates to whether at least one of the width and height of the first codec unit 900 is halved along the boundaries of the second codec units 910a, 910b, and 910c, and 920a, 920b, and 920c. Referring to Figure 9, since the boundaries of the second codec units 910a, 910b, and 910c determined by dividing the square first codec unit 900 in the vertical direction are not divided by half of the width of the first codec unit 900, it can be determined that the first codec unit 900 does not meet the condition for processing in a preset order. In addition, since the boundaries of the second codec units 920a, 920b, and 920c determined by dividing the square first codec unit 900 in the horizontal direction are not divided by half of the height of the first codec unit 900, it can be determined that the first codec unit 900 does not meet the condition for processing in a preset order. As described above, when the condition is not met, the image decoding apparatus 100 may determine the disconnection of the scanning order, and may determine that the first codec unit 900 is to be divided into an odd number of codec units based on the determined result. According to an embodiment, when the codec unit is divided into an odd number of codec units, the image decoding apparatus 100 may impose a preset restriction on the codec unit at a preset position among the divided codec units. The restriction or the preset position has been described in conjunction with various embodiments above, and thus a detailed description thereof will not be provided herein.
[0160] According to an embodiment, the image decoding apparatus 100 may determine codec units of various shapes by dividing the first codec unit.
[0161] Reference Figure 9 , the image decoding apparatus 100 may divide the square first codec unit 900 or the non-square first codec units 930 or 950 into codec units of various shapes.
[0162] Figure 10 It shows that when a second codec unit having a non-square shape (determined by dividing the first codec unit by the image decoding apparatus) meets a preset condition, the shape into which the second codec unit can be divided is restricted.
[0163] According to an embodiment, the image decoding apparatus 100 may determine to divide the square first codec unit 1000 into non-square second codec units 1010a and 1010b or 1020a and 1020b based on the partition shape pattern information obtained through the receiver 110. The second codec units 1010a and 1010b or 1020a and 1020b may be independently divided. In this way, the image decoding apparatus 100 may determine whether to divide each of the second codec units 1010a and 1010b or 1020a and 1020b into a plurality of codec units based on the partition shape pattern information of each of the second codec units 1010a and 1010b or 1020a and 1020b. According to an embodiment, the image decoding apparatus 100 may determine third codec units 1012a and 1012b by dividing the non-square left second codec unit 1010a determined by dividing the first codec unit 1000 in the vertical direction in the horizontal direction. However, when the left second codec unit 1010a is divided in the horizontal direction, the image decoding apparatus 100 may restrict the right second codec unit 1010b from being divided in the horizontal direction in which the left second codec unit 1010a is divided. When determining the third codec units 1014a and 1014b by dividing the right second codec unit 1010b in the same direction, since the left second codec unit 1010a and the right second codec unit 1010b are independently divided in the horizontal direction, the third codec units 1012a and 1012b or 1014a and 1014b may be determined. However, this case is the same as the case where the image decoding apparatus 100 divides the first codec unit 1000 into four square second codec units 1030a, 1030b, 1030c, and 1030d based on the partition shape pattern information, and may be inefficient in image decoding.
[0164] According to an embodiment, the image decoding apparatus 100 may determine third codec units 1022a and 1022b or 1024a and 1024b by dividing the non-square second codec unit 1020a or 1020b determined by dividing the first codec unit 1000 in the horizontal direction in the vertical direction. However, for the above reasons, when the second codec unit (e.g., the upper second codec unit 1020a) is divided in the vertical direction, the image decoding apparatus 100 may restrict another second codec unit (e.g., the lower second codec unit 1020b) from being divided in the vertical direction in which the upper second codec unit 1020a is divided.
[0165] Figure 11 Illustrated is a process of dividing a square codec unit performed by an image decoding apparatus when partition shape pattern information indicates that a square codec unit is not divided into four square codec units according to an embodiment.
[0166] According to an embodiment, the image decoding apparatus 100 may determine second codec units 1110a and 1110b or 1120a and 1120b, etc., by dividing a first codec unit 1100 based on partition shape mode information. The partition shape mode information may include information on various methods of partitioning codec units. However, the information on various partitioning methods may not include information for partitioning a codec unit into four square codec units. According to such partition shape mode information, the image decoding apparatus 100 may not divide the square first codec unit 1100 into four square second codec units 1130a, 1130b, 1130c, and 1130d. The image decoding apparatus 100 may determine non-square second codec units 1110a and 1110b or 1120a and 1120b, etc., based on the partition shape mode information.
[0167] According to an embodiment, the image decoding apparatus 100 may independently divide non-square second codec units 1110a and 1110b or 1120a and 1120b, etc. Each of the second codec units 1110a and 1110b or 1120a and 1120b, etc., may be recursively divided in a preset order, and the partitioning method may correspond to the method of dividing the first codec unit 1100 based on the partition shape mode information.
[0168] For example, the image decoding apparatus 100 may determine square third codec units 1112a and 1112b by dividing the left second codec unit 1110a in the horizontal direction, and may determine square third codec units 1114a and 1114b by dividing the right second codec unit 1110b in the horizontal direction. In addition, the image decoding apparatus 100 may determine square third codec units 1116a, 1116b, 1116c, and 1116d by dividing both the left second codec unit 1110a and the right second codec unit 1110b in the horizontal direction. In this case, codec units having the same shape as the four square second codec units 1130a, 1130b, 1130c, and 1130d divided from the first codec unit 1100 may be determined.
[0169] As another example, the image decoding apparatus 100 may determine square third-stage decoding units 1122a and 1122b by dividing the upper second-stage decoding unit 1120a in the vertical direction, and may determine square third-stage decoding units 1124a and 1124b by dividing the lower second-stage decoding unit 1120b in the vertical direction. In addition, the image decoding apparatus 100 may determine square third-stage decoding units 1126a, 1126b, 1126c, and 1126d by dividing both the upper second-stage decoding unit 1120a and the lower second-stage decoding unit 1120b in the vertical direction. In this case, decoding units having the same shape as the four square second-stage decoding units 1130a, 1130b, 1130c, and 1130d divided from the first-stage decoding unit 1100 may be determined.
[0170] Figure 12 It shows that according to an embodiment, the processing order between a plurality of encoding / decoding units may be changed depending on the processing of dividing the encoding / decoding units.
[0171] According to an embodiment, the image decoding apparatus 100 may divide the first-stage decoding unit 1200 based on division shape mode information. When the block shape indicates a square shape and the division shape mode information indicates dividing the first-stage decoding unit 1200 in at least one of the horizontal direction and the vertical direction, the image decoding apparatus 100 may determine second-stage decoding units 1210a and 1210b or 1220a and 1220b, etc. by dividing the first-stage decoding unit 1200. Refer to Figure 12 , the non-square second-stage decoding units 1210a and 1210b or 1220a and 1220b determined by dividing the first-stage decoding unit 1200 only in the horizontal direction or the vertical direction may be independently divided based on the division shape mode information of each encoding / decoding unit. For example, the image decoding apparatus 100 may determine third-stage decoding units 1216a, 1216b, 1216c, and 1216d by dividing the second-stage decoding units 1210a and 1210b generated by dividing the first-stage decoding unit 1200 in the vertical direction in the horizontal direction, and may determine third-stage decoding units 1226a, 1226b, 1226c, and 1226d by dividing the second-stage decoding units 1220a and 1220b generated by dividing the first-stage decoding unit 1200 in the horizontal direction in the vertical direction. The operations of dividing the second-stage decoding units 1210a and 1210b or 1220a and 1220b have been described above with reference to Figure 11 and thus a detailed description thereof is not provided herein.
[0172] According to an embodiment, the image decoding apparatus 100 may process the encoding / decoding units in a preset order. It has been described above with reference to Figure 7The operation of processing the codec units in a preset order is described, and thus a detailed description thereof is not provided herein. Refer to Figure 12 , the image decoding apparatus 100 may determine four square third codec units 1216a, 1216b, 1216c, and 1216d and 1226a, 1226b, 1226c, and 1226d by dividing a square first codec unit 1200. According to an embodiment, the image decoding apparatus 100 may determine the processing order of the third codec units 1216a, 1216b, 1216c, and 1216d and of 1226a, 1226b, 1226c, and 1226d based on the division shape into which the first codec unit 1200 is divided.
[0173] According to an embodiment, the image decoding apparatus 100 may determine the third codec units 1216a, 1216b, 1216c, and 1216d by dividing second codec units 1210a and 1210b generated by dividing the first codec unit 1200 in the vertical direction in the horizontal direction, and may process the third codec units 1216a, 1216b, 1216c, and 1216d in the processing order 1217 to first process, in the vertical direction, the third codec units 1216a and 1216c included in the left second codec unit 1210a, and then process, in the vertical direction, the third codec units 1216b and 1216d included in the right second codec unit 1210b.
[0174] According to an embodiment, the image decoding apparatus 100 may determine the third codec units 1226a, 1226b, 1226c, and 1226d by dividing second codec units 1220a and 1220b generated by dividing the first codec unit 1200 in the horizontal direction in the vertical direction, and may process the third codec units 1226a, 1226b, 1226c, and 1226d in the processing order 1227 to first process, in the horizontal direction, the third codec units 1226a and 1226b included in the upper second codec unit 1220a, and then process, in the horizontal direction, the third codec units 1226c and 1226d included in the lower second codec unit 1220b.
[0175] Refer to Figure 12, the square third-stage decoding units 1216a, 1216b, 1216c, and 1216d, as well as 1226a, 1226b, 1226c, and 1226d, can be determined by dividing the second-stage decoding units 1210a and 1210b, and 1220a and 1220b, respectively. Although the second-stage decoding units 1210a and 1210b are determined by dividing the first-stage decoding unit 1200 in the vertical direction, different from the second-stage decoding units 1220a and 1220b determined by dividing the first-stage decoding unit 1200 in the horizontal direction, the third-stage decoding units 1216a, 1216b, 1216c, and 1216d, and 1226a, 1226b, 1226c, and 1226d finally shown are decoding units of the same shape divided from the first-stage decoding unit 1200. In this way, by recursively dividing the decoding units in different ways based on the division shape pattern information, even if the decoding units are finally determined to be of the same shape, the image decoding device 100 can process multiple decoding units in different orders.
[0176] Figure 13 The processing of determining the depth of a decoding unit when the shape and size of the decoding unit change when the decoding unit is recursively divided such that multiple decoding units are determined according to an embodiment is shown.
[0177] According to an embodiment, the image decoding device 100 can determine the depth of a decoding unit based on a preset criterion. For example, the preset criterion can be the length of the long side of the decoding unit. When the length of the long side of the decoding unit before division is 2n times (n > 0) the length of the long side of the currently divided decoding unit, the image decoding device 100 can determine that the depth of the current decoding unit increases by n from the depth of the decoding unit before division. In the following description, the decoding unit with an increased depth is represented as a decoding unit with a deeper depth.
[0178] Refer to Figure 13, according to an embodiment, the image decoding apparatus 100 may determine a second decoding unit 1302 and a third decoding unit 1304 with a deeper depth by dividing a square first decoding unit 1300 based on block shape information indicating a square shape (e.g., the block shape information may be expressed as '0: SQUARE'). Assuming that the size of the square first decoding unit 1300 is 2N×2N, the second decoding unit 1302 determined by dividing the width and height of the first decoding unit 1300 by 1 / 2 may have a size of N×N. In addition, the third decoding unit 1304 determined by dividing the width and height of the second decoding unit 1302 by 1 / 2 may have a size of N / 2×N / 2. In this case, the width and height of the third decoding unit 1304 are 1 / 4 times the width and height of the first decoding unit 1300. When the depth of the first decoding unit 1300 is D, the depth of the second decoding unit 1302 with a width and height that are 1 / 2 times those of the first decoding unit 1300 may be D + 1, and the depth of the third decoding unit 1304 with a width and height that are 1 / 4 times those of the first decoding unit 1300 may be D + 2.
[0179] According to an embodiment, the image decoding apparatus 100 may determine a second decoding unit 1312 or 1322 and a third decoding unit 1314 or 1324 with a deeper depth by dividing a non-square first decoding unit 1310 or 1320 based on block shape information indicating a non-square shape (e.g., the block shape information may be expressed as '1: NS_VER' indicating a non-square shape with a height longer than the width, or the block shape information may be expressed as '2: NS_HOR' indicating a non-square shape with a width longer than the height).
[0180] The image decoding apparatus 100 may determine the second decoding unit 1302, 1312, or 1322 by dividing at least one of the width and height of the first decoding unit 1310 having a size of N×2N. That is, the image decoding apparatus 100 may determine the second decoding unit 1302 having a size of N×N or the second decoding unit 1322 having a size of N×N / 2 by dividing the first decoding unit 1310 in the horizontal direction, or may determine the second decoding unit 1312 having a size of N / 2×N by dividing the first decoding unit 1310 in both the horizontal and vertical directions.
[0181] According to an embodiment, the image decoding apparatus 100 may determine second decoding units 1302, 1312, or 1322 by dividing at least one of the width and height of a first decoding unit 1320 having a size of 2N×N. That is, the image decoding apparatus 100 may determine a second decoding unit 1302 having a size of N×N or a second decoding unit 1312 having a size of N / 2×N by dividing the first decoding unit 1320 in the vertical direction, or may determine a second decoding unit 1322 having a size of N×N / 2 by dividing the first decoding unit 1320 in both the horizontal and vertical directions.
[0182] According to an embodiment, the image decoding apparatus 100 may determine third decoding units 1304, 1314, or 1324 by dividing at least one of the width and height of a second decoding unit 1302 having a size of N×N. That is, the image decoding apparatus 100 may determine a third decoding unit 1304 having a size of N / 2×N / 2, a third decoding unit 1314 having a size of N / 4×N / 2, or a third decoding unit 1324 having a size of N / 2×N / 4 by dividing the second decoding unit 1302 in both the vertical and horizontal directions.
[0183] According to an embodiment, the image decoding apparatus 100 may determine third decoding units 1304, 1314, or 1324 by dividing at least one of the width and height of a second decoding unit 1312 having a size of N / 2×N. That is, the image decoding apparatus 100 may determine a third decoding unit 1304 having a size of N / 2×N / 2 or a third decoding unit 1324 having a size of N / 2×N / 4 by dividing the second decoding unit 1312 in the horizontal direction, or may determine a third decoding unit 1314 having a size of N / 4×N / 2 by dividing the second decoding unit 1312 in both the vertical and horizontal directions.
[0184] According to an embodiment, the image decoding apparatus 100 may determine third decoding units 1304, 1314, or 1324 by dividing at least one of the width and height of a second decoding unit 1322 having a size of N×N / 2. That is, the image decoding apparatus 100 may determine a third decoding unit 1304 having a size of N / 2×N / 2 or a third decoding unit 1314 having a size of N / 4×N / 2 by dividing the second decoding unit 1322 in the vertical direction, or may determine a third decoding unit 1324 having a size of N / 2×N / 4 by dividing the second decoding unit 1322 in both the vertical and horizontal directions.
[0185] According to an embodiment, the image decoding apparatus 100 may divide the square encoding / decoding units 1300, 1302, or 1304 in a horizontal direction or a vertical direction. For example, the image decoding apparatus 100 may determine a first encoding / decoding unit 1310 having a size of N×2N by dividing a first encoding / decoding unit 1300 having a size of 2N×2N in a vertical direction, or may determine a first encoding / decoding unit 1320 having a size of 2N×N by dividing the first encoding / decoding unit 1300 in a horizontal direction. According to an embodiment, when determining the depth based on the length of the longest side of the encoding / decoding unit, the depth of the encoding / decoding unit determined by dividing the first encoding / decoding unit 1300 having a size of 2N×2N in a horizontal direction or a vertical direction may be the same as the depth of the first encoding / decoding unit 1300.
[0186] According to an embodiment, the width and height of the third encoding / decoding units 1314 or 1324 may be 1 / 4 times the width and height of the first encoding / decoding units 1310 or 1320. When the depth of the first encoding / decoding units 1310 or 1320 is D, the depth of the second encoding / decoding units 1312 or 1322 having a width and height that are 1 / 2 times the width and height of the first encoding / decoding units 1310 or 1320 may be D + 1, and the depth of the third encoding / decoding units 1314 or 1324 having a width and height that are 1 / 4 times the width and height of the first encoding / decoding units 1310 or 1320 may be D + 2.
[0187] Figure 14 The depth that can be determined based on the shape and size of the encoding / decoding unit according to an embodiment, and the partial index (PID) for distinguishing the encoding / decoding unit are shown.
[0188] According to an embodiment, the image decoding apparatus 100 may determine second encoding / decoding units having various shapes by dividing a square first encoding / decoding unit 1400. Referring to Figure 14 , the image decoding apparatus 100 may determine second encoding / decoding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d by dividing the first encoding / decoding unit 1400 in at least one of a vertical direction and a horizontal direction based on division shape pattern information. That is, the image decoding apparatus 100 may determine the second encoding / decoding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information of the first encoding / decoding unit 1400.
[0189] According to an embodiment, the depths of the second decoding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d determined based on the division shape pattern information of the square first decoding unit 1400 may be determined based on the length of their long sides. For example, since the side length of the square first decoding unit 1400 is equal to the length of the long sides of the non-square second decoding units 1402a and 1402b and 1404a and 1404b, the first decoding unit 1400 and the non-square second decoding units 1402a and 1402b and 1404a and 1404b may have the same depth, for example, D. However, when the image decoding apparatus 100 divides the first decoding unit 1400 into four square second decoding units 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information, since the side lengths of the square second decoding units 1406a, 1406b, 1406c, and 1406d are 1 / 2 times the side length of the first decoding unit 1400, the depths of the second decoding units 1406a, 1406b, 1406c, and 1406d may be D + 1, which is 1 deeper than the depth D of the first decoding unit 1400.
[0190] According to an embodiment, the image decoding apparatus 100 may determine a plurality of second decoding units 1412a and 1412b and 1414a, 1414b, and 1414c by dividing a first decoding unit 1410 having a height greater than a width in a horizontal direction based on the division shape pattern information. According to an embodiment, the image decoding apparatus 100 may determine a plurality of second decoding units 1422a and 1422b and 1424a, 1424b, and 1424c by dividing a first decoding unit 1420 having a width greater than a height in a vertical direction based on the division shape pattern information.
[0191] According to an embodiment, the depths of the second decoding units 1412a and 1412b and 1414a, 1414b, and 1414c, or 1422a and 1422b and 1424a, 1424b, and 1424c determined based on the division shape pattern information of the non-square first decoding unit 1410 or 1420 may be determined based on the length of their long sides. For example, since the side lengths of the square second decoding units 1412a and 1412b are 1 / 2 times the length of the long side of the non-square first decoding unit 1410 having a height greater than a width, the depths of the square second decoding units 1412a and 1412b are D + 1, which is 1 deeper than the depth D of the non-square first decoding unit 410.
[0192] In addition, the image decoding apparatus 100 may divide the non-square first decoded unit 1410 into an odd number of second decoded units 1414a, 1414b, and 1414c based on the partitioning shape mode information. The odd number of second decoded units 1414a, 1414b, and 1414c may include non-square second decoded units 1414a and 1414c and a square second decoded unit 1414b. In this case, since the length of the long side of the non-square second decoded units 1414a and 1414c and the length of the side of the square second decoded unit 1414b are 1 / 2 times the length of the long side of the non-square first decoded unit 1410, the depth of the second decoded units 1414a, 1414b, and 1414c may be D + 1, which is 1 deeper than the depth D of the non-square first decoded unit 1410. The image decoding apparatus 100 may determine the depth of the decoded units divided from the first decoded unit 1420 having a non-square shape with a width greater than the height by using the method of determining the depth of the decoded units divided from the first decoded unit 1410 described above.
[0193] According to an embodiment, when the sizes of the odd number of divided decoded units are not equal, the image decoding apparatus 100 may determine the PID for identifying the divided decoded units based on the size ratio between the decoded units. Refer to Figure 14 , the decoded unit 1414b at the center position among the odd number of divided decoded units 1414a, 1414b, and 1414c may have the same width as the other decoded units 1414a and 1414c and twice the height of the other decoded units 1414a and 1414c. That is, in this case, the decoded unit 1414b at the center position may include two of the other decoded units 1414a or 1414c. Therefore, when the PID of the decoded unit 1414b at the center position is 1 based on the scanning order, the PID of the decoded unit 1414c adjacent to the decoded unit 1414b may be increased by 2 and thus may be 3. That is, there may be a discontinuity in the PID values. According to an embodiment, the image decoding apparatus 100 may determine whether the odd number of divided decoded units have equal sizes based on whether there is a discontinuity in the PIDs for identifying the divided decoded units.
[0194] According to an embodiment, the image decoding apparatus 100 may determine whether to use a specific partitioning method based on the PID values for identifying the multiple decoded units determined by partitioning the current decoded unit. Refer to Figure 14, the image decoding device 100 may determine an even number of codec units 1412a and 1412b or an odd number of codec units 1414a, 1414b, and 1414c by dividing a first codec unit 1410 having a rectangular shape with a height greater than a width. The image decoding device 100 may use a PID indicating a corresponding codec unit to identify the corresponding codec unit. According to an embodiment, the PID may be obtained from a sample (e.g., an upper left sample) at a preset position of each codec unit.
[0195] According to an embodiment, the image decoding device 100 may determine a codec unit at a preset position in the divided codec units by using a PID for distinguishing codec units. According to an embodiment, when the division shape mode information of the first codec unit 1410 having a rectangle with a height greater than a width indicates that the codec unit is divided into three codec units, the image decoding device 100 may divide the first codec unit 1410 into three codec units 1414a, 1414b, and 1414c. The image decoding device 100 may assign a PID to each of the three codec units 1414a, 1414b, and 1414c. The image decoding device 100 may compare the PIDs of the odd number of divided codec units to determine the codec unit at the center position in the codec units. The image decoding device 100 may determine the codec unit 1414b having a PID corresponding to the middle value among the PIDs of the codec units as the codec unit at the center position in the codec units determined by dividing the first codec unit 1410. According to an embodiment, when the divided codec units do not have equal sizes, the image decoding device 100 may determine a PID for distinguishing the divided codec units based on a size ratio between the codec units. Refer to Figure 14, the codec unit 1414b generated by dividing the first - stage decoding unit 1410 may have the same width as the other codec units 1414a and 1414c and twice the height of the other codec units 1414a and 1414c. In this case, when the PID of the codec unit 1414b at the center position is 1, the PID of the codec unit 1414c adjacent to the codec unit 1414b may be increased by 2 and thus may be 3. As described above, when the PID does not increase uniformly, the image decoding device 100 may determine that the codec unit is divided into a plurality of codec units, and the plurality of codec units include a codec unit having a size different from that of the other codec units. According to an embodiment, when the division shape mode information indicates that the codec unit is divided into an odd number of codec units, the image decoding device 100 may divide the current codec unit in such a way that the codec unit at a preset position (e.g., the codec unit at the center position) among the odd number of codec units has a size different from that of the other codec units. In this case, the image decoding device 100 may determine the codec unit at the center position having a different size by using the PID of the codec unit. However, the PID and the size or position of the codec unit at the preset position are not limited to the above examples, and various PIDs and various positions and sizes of the codec units may be used.
[0196] According to an embodiment, the image decoding device 100 may use a preset data unit at which the codec unit starts to be recursively divided.
[0197] Figure 15 An example is shown of determining a plurality of codec units based on a plurality of preset data units included in a picture according to an embodiment.
[0198] According to an embodiment, the preset data unit may be defined as a data unit that starts to recursively divide the codec unit by using the division shape mode information. That is, the preset data unit may correspond to the codec unit at the highest depth, which is used to determine a plurality of codec units divided from the current picture. In the following description, for ease of explanation, the preset data unit is referred to as a reference data unit.
[0199] According to an embodiment, the reference data unit may have a preset size and a preset shape. According to an embodiment, the reference codec unit may include M×N samples. Here, M and N may be equal to each other and may be integers represented as a power of 2. That is, the reference data unit may have a square or non - square shape and may be divided into an integer number of codec units.
[0200] According to an embodiment, the image decoding apparatus 100 may divide a current picture into a plurality of reference data units. According to an embodiment, the image decoding apparatus 100 may divide the plurality of reference data units divided from the current picture by using the division shape mode information of each reference data unit. The operation of dividing the reference data units may correspond to a division operation using a quadtree structure.
[0201] According to an embodiment, the image decoding apparatus 100 may pre-determine the minimum size allowed for the reference data units included in the current picture. Thus, the image decoding apparatus 100 may determine various reference data units having a size equal to or greater than the minimum size, and may determine one or more coding / decoding units by using the division shape mode information with respect to the determined reference data units.
[0202] Reference Figure 15 , the image decoding apparatus 100 may use a square reference coding / decoding unit 1500 or a non-square reference coding / decoding unit 1502. According to an embodiment, the shape and size of the reference coding / decoding unit may be determined based on various data units capable of including one or more reference coding / decoding units (e.g., sequence, picture, slice, slice segment, tile, tile group, maximum coding / decoding unit, etc.).
[0203] According to an embodiment, the receiver 110 of the image decoding apparatus 100 may obtain at least one of the reference coding / decoding unit shape information and the reference coding / decoding unit size information with respect to each of the various data units from a bitstream. Regarding Figure 3 the operation of dividing the current coding / decoding unit 300, the operation of dividing the square reference coding / decoding unit 1500 into one or more coding / decoding units has been described above, and, regarding Figure 4 the operation of dividing the current coding / decoding unit 400 or 450, the operation of dividing the non-square reference coding / decoding unit 1502 into one or more coding / decoding units has been described above. Thus, a detailed description thereof will not be provided herein.
[0204] According to an embodiment, the image decoding apparatus 100 may use a PID for identifying the size and shape of a reference codec unit to determine the size and shape of the reference codec unit based on some data units predetermined according to preset conditions. That is, the receiver 110 may obtain only the PID from the bitstream for identifying the size and shape of the reference codec unit for each slice, slice segment, tile, tile group, or maximum codec unit among various data units (e.g., sequence, picture, slice, slice segment, tile, tile group, maximum codec unit, etc.) that are data units satisfying the preset conditions (the data unit has a size equal to or smaller than that of a slice). The image decoding apparatus 100 may determine the size and shape of the reference data unit for each data unit satisfying the preset conditions by using the PID. When the reference codec unit shape information and the reference codec unit size information are obtained and used from the bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high. Thus, only the PID may be obtained and used instead of directly obtaining the reference codec unit shape information and the reference codec unit size information. In this case, at least one of the size and shape of the reference codec unit corresponding to the PID for identifying the size and shape of the reference codec unit may be predetermined. That is, the image decoding apparatus 100 may determine at least one of the size and shape of the reference codec unit included in the data unit used as the unit for obtaining the PID by selecting at least one of the predetermined size and shape of the reference codec unit based on the PID.
[0205] According to an embodiment, the image decoding apparatus 100 may use one or more reference codec units included in a maximum codec unit. That is, the maximum codec unit divided from a picture may include one or more reference codec units, and the codec unit may be determined by recursively dividing each reference codec unit. According to an embodiment, at least one of the width and height of the maximum codec unit may be an integer multiple of at least one of the width and height of the reference codec unit. According to an embodiment, the size of the reference codec unit may be obtained by dividing the maximum codec unit n times based on a quadtree structure. That is, according to various embodiments, the image decoding apparatus 100 may determine the reference codec unit by dividing the maximum codec unit n times based on the quadtree structure, and may divide the reference codec unit based on at least one of the block shape information and the division shape pattern information.
[0206] Figure 16 A processing block showing a criterion for determining an order of determination of a reference codec unit included in a picture according to an embodiment is shown.
[0207] According to an embodiment, the image decoding apparatus 100 may determine one or more processing blocks divided from a picture. A processing block is a data unit including one or more reference codec units divided from a picture, and one or more reference codec units included in a processing block may be determined according to a specific order. That is, the determination order of one or more reference codec units determined in each processing block may correspond to one of various types of orders for determining reference codec units, and may vary depending on the processing block. The determination order of reference codec units determined with respect to each processing block may be one of various orders (e.g., raster scan order, Z-scan, N-scan, upper right diagonal scan, horizontal scan, and vertical scan, but not limited to the mentioned scan orders).
[0208] According to an embodiment, the image decoding apparatus 100 may obtain processing block size information and may determine the sizes of one or more processing blocks included in a picture. The image decoding apparatus 100 may obtain the processing block size information from a bitstream and may determine the sizes of one or more processing blocks included in a picture. The size of a processing block may be a preset size of a data unit indicated by the processing block size information.
[0209] According to an embodiment, the receiver 110 of the image decoding apparatus 100 may obtain the processing block size information from the bitstream according to each specific data unit. For example, the processing block size information may be obtained from the bitstream in a data unit (such as an image, a sequence, a picture, a slice, a slice segment, a tile, or a tile group). That is, the receiver 110 may obtain the processing block size information from the bitstream according to each of various data units, and the image decoding apparatus 100 may determine the sizes of one or more processing blocks divided from a picture by using the obtained processing block size information. The size of a processing block may be an integer multiple of a reference codec unit.
[0210] According to an embodiment, the image decoding apparatus 100 may determine the sizes of the processing blocks 1602 and 1612 included in the picture 1600. For example, the image decoding apparatus 100 may determine the size of a processing block based on the processing block size information obtained from the bitstream. Refer to Figure 16 , according to an embodiment, the image decoding apparatus 100 may determine the width of the processing blocks 1602 and 1612 to be four times the width of a reference codec unit and may determine the height of the processing blocks 1602 and 1612 to be four times the height of a reference codec unit. The image decoding apparatus 100 may determine the determination order of one or more reference codec units in one or more processing blocks.
[0211] According to an embodiment, the image decoding apparatus 100 may determine processing blocks 1602 and 1612 included in picture 1600 based on the size of the processing blocks, and may determine the determination order of one or more reference codec units in the processing blocks 1602 and 1612. According to an embodiment, the determination of the reference codec units may include the determination of the size of the reference codec units.
[0212] According to an embodiment, the image decoding apparatus 100 may obtain determination order information of one or more reference codec units included in one or more processing blocks from a bitstream, and may determine the determination order regarding the one or more reference codec units based on the obtained determination order information. The determination order information may be defined as information for determining the order or direction of the reference codec units in the processing blocks. That is, the determination order of the reference codec units may be determined independently for each processing block.
[0213] According to an embodiment, the image decoding apparatus 100 may obtain determination order information of reference codec units according to each specific data unit from a bitstream. For example, the receiver 110 may obtain determination order information of reference codec units from the bitstream according to each data unit (such as an image, a sequence, a picture, a slice, a slice segment, a tile, a tile group, or a processing block). Since the determination order information of the reference codec units indicates the order for determining the reference codec units in the processing blocks, the determination order information may be obtained for each specific data unit including an integer number of processing blocks.
[0214] According to an embodiment, the image decoding apparatus 100 may determine one or more reference codec units based on the determined determination order.
[0215] According to an embodiment, the receiver 110 may obtain determination order information of reference codec units from the bitstream as information related to the processing blocks 1602 and 1612, and the image decoding apparatus 100 may determine the determination order of one or more reference codec units included in the processing blocks 1602 and 1612 and determine one or more reference codec units included in picture 1600 based on the determination order. Refer Figure 16, the image decoding device 100 can respectively determine the determination orders 1604 and 1614 of one or more reference codec units in the processing blocks 1602 and 1612. For example, when obtaining the determination order information of reference codec units for each processing block, different types of determination order information of reference codec units can be obtained for the processing blocks 1602 and 1612. When the determination order 1604 of the reference codec units in the processing block 1602 is the raster scan order, the reference codec units included in the processing block 1602 can be determined according to the raster scan order. On the contrary, when the determination order 1614 of the reference codec units in another processing block 1612 is the backward raster scan order, the reference codec units included in the processing block 1612 can be determined according to the backward raster scan order.
[0216] According to an embodiment, the image decoding device 100 can decode the determined one or more reference codec units. As described above, the image decoding device 100 can decode an image based on the determined reference codec units. The method of decoding the reference codec units can include various image decoding methods.
[0217] According to an embodiment, the image decoding device 100 can obtain block shape information indicating the shape of the current codec unit or partition shape mode information indicating the partitioning method of the current codec unit from the bitstream, and can use the obtained information. The partition shape mode information can be included in the bitstream related to various data units. For example, the image decoding device 100 can use the partition shape mode information included in the sequence parameter set, picture parameter set, video parameter set, slice header, slice segment header, picture header, or picture group header. In addition, the image decoding device 100 can obtain a syntax element corresponding to the block shape information or partition shape mode information from the bitstream according to each maximum codec unit, each reference codec unit, or each processing block, and can use the obtained syntax element.
[0218] Next, a method for determining a partitioning rule according to an embodiment of the present invention will be described in detail.
[0219] The image decoding device 100 can determine the partitioning rule of the image. A partitioning rule can be predetermined between the image decoding device 100 and the image encoding device 2200. The image decoding device 100 can determine the partitioning rule of the image based on the information obtained from the bitstream. The image decoding device 100 can determine the partitioning rule based on the information obtained from at least one of the sequence parameter set, picture parameter set, video parameter set, slice header, slice segment header, picture header, and picture group header. The image decoding device 100 can determine the partitioning rule differently according to the frame, slice, picture, temporal layer, maximum codec unit, or codec unit.
[0220] The image decoding device 100 may determine a partitioning rule based on the block shape of the codec unit. The block shape may include the size, shape, aspect ratio, and orientation of the codec unit. The image encoding device 2200 and the image decoding device 100 may determine a partitioning rule in advance based on the block shape of the codec unit. However, the embodiments are not limited thereto. The image decoding device 100 may determine a partitioning rule based on information obtained from the bitstream received from the image encoding device 2200.
[0221] The shape of the codec unit may include square and non-square. When the lengths of the width and height of the codec unit are the same, the image decoding device 100 may determine the shape of the codec unit as square. In addition, when the lengths of the width and height of the codec unit are different, the image decoding device 100 may determine the shape of the codec unit as non-square.
[0222] The size of the codec unit may include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, and 256x256. The size of the codec unit may be classified based on the length of the long side, the length of the short side, or the area of the codec unit. The image decoding device 100 may apply the same partitioning rule to the codec units classified into the same group. For example, the image decoding device 100 may classify the codec units having the same length of the long side as the codec units having the same size. In addition, the image decoding device 100 may apply the same partitioning rule to the codec units having the same length of the long side.
[0223] The aspect ratio of the codec unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 32:1, 1:32, etc. In addition, the orientation of the codec unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate a case where the length of the width of the codec unit is greater than the length of its height. The vertical direction may indicate a case where the length of the width of the codec unit is less than the length of its height.
[0224] The image decoding device 100 may adaptively determine a partitioning rule based on the size of the codec unit. The image decoding device 100 may determine different allowed partitioning shape patterns based on the size of the codec unit. For example, the image decoding device 100 may determine whether partitioning is allowed based on the size of the codec unit. The image decoding device 100 may determine the partitioning direction according to the size of the codec unit. The image decoding device 100 may determine the allowed partitioning type according to the size of the codec unit.
[0225] The partitioning rule determined based on the size of the coding / decoding unit may be a pre-determined partitioning rule between the image coding device 2200 and the image decoding device 100. In addition, the image decoding device 100 may determine the partitioning rule based on the information obtained from the bitstream.
[0226] The image decoding device 100 may adaptively determine the partitioning rule based on the position of the coding / decoding unit. The image decoding device 100 may adaptively determine the partitioning rule based on the position of the coding / decoding unit in the image.
[0227] In addition, the image decoding device 100 may determine the partitioning rule such that the coding / decoding units generated via different partitioning paths do not have the same block shape. However, the embodiment is not limited thereto, and the coding / decoding units generated via different partitioning paths have the same block shape. The coding / decoding units generated via different partitioning paths may have different decoding processing orders. Since the decoding processing order is described above, its details are not provided again. Figure 12 Since the decoding processing order is described above, its details are not provided again.
[0228] Next, according to an embodiment of the present specification, a method for partitioning a coding / decoding unit for an effective hardware implementation is provided, and a method and apparatus for encoding or decoding video will be described in detail with reference to Figures 17 to 20 A method and apparatus for encoding or decoding video will be described in detail.
[0229] Figure 17 A block diagram of a video coding device according to an embodiment is shown.
[0230] According to an embodiment, the video coding device 1700 may include a memory 1710 and at least one processor 1720 connected to the memory 1710. The operation of the video coding device 1700 according to an embodiment may be executed as a separate processor or may be executed under the control of a central processing unit. In addition, the memory 1710 of the video coding device 1700 may store data received from the outside and data generated by the processor, for example, partitioning information related to the coding / decoding unit, prediction information related to the coding / decoding unit, and residual information related to the coding / decoding unit, information on whether binary partitioning of the coding / decoding unit is allowed, information on whether ternary partitioning of the coding / decoding unit is allowed, and the like.
[0231] In order to effectively encode an image divided into multiple blocks, the video coding device 1700 may perform encoding using a pipelining method that parallelly processes multiple blocks. Hereinafter, a block that is processed during one pipeline cycle to implement pipelined video coding in hardware is referred to as a pipeline data unit. The size of the pipeline data unit may be predetermined.
[0232] Since the processor 1720 can access the data of the current pipeline data unit during the current pipeline cycle, blocks located in the pipeline can be encoded. However, since the processor 1720 may not be able to access the data of the next pipeline data unit or the previous pipeline data unit during the current pipeline cycle, blocks spanning the current pipeline data unit and the next pipeline data unit, or blocks spanning the current pipeline data unit and the previous pipeline data unit may not be encoded.
[0233] In addition, in order to be able to perform encoding on blocks in the pipeline data unit within a pipeline cycle, the size of the codec unit or the transform unit needs to be less than or equal to the size of the pipeline data unit.
[0234] In addition, when the origin of the upper left position of the codec unit includes the contour of the image, depending on the size of the codec unit, the codec unit can be outside the image, so the video encoding device 1700 can determine to arbitrarily divide the codec unit.
[0235] The processor 1720 of the video encoding device 1700 can determine the codec unit by dividing at least one of the height and width of the maximum codec unit having the first size based on whether the height or width of the non-square first codec unit including the outer boundary of the image in the codec unit is greater than the maximum transform size, determine whether to allow generating two second codec units by dividing at least one of the height and width of the first codec unit, and perform encoding by using the maximum transform size to transform the second codec units generated from the first codec unit.
[0236] In this regard, considering the size of the pipeline data unit, the maximum transform size can be determined to be less than or equal to the size of the pipeline data unit. Therefore, encoding of each second codec unit having a size less than or equal to the maximum transform size can be processed during one pipeline cycle, and thus, the video encoding device 1700 can use the pipeline method to process encoding.
[0237] Next, with reference to Figure 18 The detailed operation of the method for the video encoding device 1700 to perform encoding using the codec unit determined from the maximum codec unit will be described in detail.
[0238] Figure 18 A flowchart of a video encoding method according to an embodiment is shown.
[0239] In operation 1810, the video encoding device 1700 can generate codec units by dividing at least one of the height and width of the maximum codec unit having the first size.
[0240] In operation 1820, based on whether the height or width of a non-square first coding / decoding unit including the outer boundary of an image in a coding / decoding unit is greater than a maximum transform size, video coding device 1700 may determine whether to allow generating two second coding / decoding units by dividing at least one of the height and width of the first coding / decoding unit.
[0241] According to an embodiment, video coding device 1700 may set a flag value indicating whether to allow generating a second coding / decoding unit by dividing at least one of the height and width of a non-square first coding / decoding unit including the outer boundary of an image.
[0242] In operation 1820, according to an embodiment, when the length of the width of a non-square first coding / decoding unit including the outer boundary of an image is greater than the maximum transform size and the length of the height of the first coding / decoding unit is equal to the maximum transform size, video coding device 1700 may allow generating smaller coding / decoding units by performing vertical binary partitioning on the first coding / decoding unit, and prohibit generating smaller coding / decoding units by performing horizontal binary partitioning on the first coding / decoding unit. Specifically, video coding device 1700 may set a vertical binary partitioning flag value for allowing generating smaller coding / decoding units by performing vertical binary partitioning on the first coding / decoding unit, and set a horizontal binary partitioning flag value for prohibiting generating smaller coding / decoding units by performing horizontal binary partitioning on the first coding / decoding unit.
[0243] According to an embodiment, when the length of the width of a non-square first coding / decoding unit including the outer boundary of an image is equal to the maximum transform size and the length of the height of the first coding / decoding unit is greater than the maximum transform size, video coding device 1700 may allow generating smaller coding / decoding units by performing horizontal binary partitioning on the first coding / decoding unit, and prohibit generating smaller coding / decoding units by performing vertical binary partitioning on the first coding / decoding unit. Specifically, video coding device 1700 may set a horizontal binary partitioning flag value for allowing generating smaller coding / decoding units by performing horizontal binary partitioning on the first coding / decoding unit, and set a vertical binary partitioning flag value for prohibiting generating smaller coding / decoding units by performing vertical binary partitioning on the first coding / decoding unit.
[0244] According to an embodiment, when the length of the height of a coding / decoding unit including the outer boundary of an image is greater than the maximum transform size and the length of the width of the coding / decoding unit is greater than the maximum transform size, video coding device 1700 may allow generating smaller coding / decoding units by performing quadtree partitioning on the coding / decoding unit.
[0245] According to an embodiment, the dimensions of the height and width of a coding / decoding unit may be greater than or equal to the maximum transform size.
[0246] In addition, in operation 1820, when the first codec unit is adjacent to the contour of the image such that the height or width of the first codec unit is outside the contour of the image, the video encoding device 1700 may prohibit binary partitioning in the direction of dividing the height or width of the first codec unit, which may be outside the contour of the image. As a specific example, when the height of the first codec unit is greater than the maximum transform size and the width of the first codec unit is outside the right contour of the image, the video encoding device 1700 may determine to prohibit vertical binary partitioning for dividing the width of the first codec unit. Similarly, when the width of the first codec unit is greater than the maximum transform size and the height of the first codec unit is outside the lower contour of the image, the video encoding device 1700 may determine to prohibit horizontal binary partitioning for dividing the height of the first codec unit.
[0247] However, when the height of the codec unit including the outer boundary of the image is outside the lower contour of the image or the width of the codec unit is outside the right contour of the image, the video encoding device 1700 may allow quadtree partitioning of the codec unit.
[0248] In operation 1830, the video encoding device 1700 may perform encoding by transforming the second codec unit generated from the first codec unit using the maximum transform size. The video encoding device 1700 may determine a prediction block by performing prediction on the second codec unit, and determine a residual block composed of the difference between the sample values of the original block of the second codec unit and the sample values of the prediction block. The video encoding device 1700 may generate quantized transform coefficients by performing transform and quantization on the residual block, and encode the second codec unit by performing entropy encoding on the quantized transform coefficients.
[0249] According to an embodiment, the video encoding device 1700 may also determine whether to arbitrarily partition the codec unit into codec units of a lower depth in consideration of the size of the pipeline data unit. To complete the transform and quantization of the residual data in the codec unit during one pipeline cycle, it is necessary to determine that the size of the pipeline data unit is equal to the size of the maximum transform unit. In addition, when the pipeline data unit and the maximum transform unit have a square shape, the height and width of the pipeline data unit and the maximum transform unit are equal to each other. Therefore, when the length of the height or width of the codec unit is greater than the length of the height or width of the maximum transform unit, by arbitrarily partitioning the height or width of the codec unit to divide the codec unit into codec units of a lower depth, the encoding process of the corresponding codec unit can be completed within one pipeline cycle.
[0250] Accordingly, embodiments will be described below, in which, in order to complete the transform within a pipeline cycle, the video encoding device 1700 compares the maximum transform size with at least one of the height and width of the codec unit, and sets vertical binary partition flag values, horizontal binary partition flag values, and quadtree partition flag values to indicate whether vertical binary partitioning, horizontal binary partitioning, and quadtree partitioning of the codec unit are allowed, respectively.
[0251] Specifically, in order to complete the transform within a pipeline cycle, when the length of the width of the codec unit is greater than the maximum transform size and the length of the height of the codec unit is equal to the maximum transform size, the video encoding device 1700 may allow smaller codec units to be generated by performing vertical binary partitioning on the codec unit, and prohibit smaller codec units from being generated by performing horizontal binary partitioning on the codec unit.
[0252] Specifically, in order to complete the transform within a pipeline cycle, when the length of the width of the codec unit is equal to the maximum transform size and the length of the height of the codec unit is greater than the maximum transform size, the video encoding device 1700 may allow smaller codec units to be generated by performing horizontal binary partitioning on the codec unit, and prohibit smaller codec units from being generated by performing vertical binary partitioning on the codec unit.
[0253] Specifically, in order to complete the transform within a pipeline cycle, when the length of the width of the codec unit is greater than the maximum transform size and the length of the height of the codec unit is equal to the maximum transform size, the video encoding device 1700 may allow smaller codec units to be generated by performing vertical binary partitioning on the codec unit, and prohibit smaller codec units from being generated by performing horizontal binary partitioning on the codec unit.
[0254] Specifically, in order to complete the transform within a pipeline cycle, when the length of the width of the codec unit is equal to the maximum transform size and the length of the height of the codec unit is greater than the maximum transform size, the video encoding device 1700 may allow smaller codec units to be generated by performing horizontal binary partitioning on the codec unit, and prohibit smaller codec units from being generated by performing vertical binary partitioning on the codec unit.
[0255] Specifically, in order to complete the transform within a pipeline cycle, when each of the height and width dimensions of the codec unit is greater than the maximum transform size, the video encoding device 1700 may allow smaller codec units to be generated by performing quadtree partitioning on the codec unit.
[0256] In addition, according to an embodiment, the video encoding device 1700 may pre-determine maximum and minimum values to limit the size of the maximum codec unit or codec units, and encode information regarding the maximum and minimum values.
[0257] In operation 1810, according to an embodiment, the video encoding device 1700 may divide an image into maximum codec units having a constant size and encode the image. Each maximum codec unit may be divided into codec units having an optimal size from which the highest codec efficiency can be obtained. To this end, the size of the maximum codec unit may be predetermined, and the video encoding device 1700 may encode information about the size of the maximum codec unit and include the encoded information in a sequence parameter set (SPS). According to an embodiment, the size of the maximum codec unit may be 128x128.
[0258] According to an embodiment, the video encoding device 1700 may differently determine the maximum size and the minimum size of codec units based on the type of a slice.
[0259] Specifically, the video encoding device 1700 may set the minimum size and the maximum size of a luminance codec unit generated by performing binary partitioning on an intra slice. In addition, by using the minimum size and the maximum size of the luminance codec unit generated by performing binary partitioning on an intra slice, the video encoding device 1700 may determine information about the difference between the maximum size and the minimum size of the luminance codec unit generated by performing binary partitioning on an intra slice. In addition, the video encoding device 1700 may encode the information about the difference between the maximum size and the minimum size of the luminance codec unit generated by performing binary partitioning on an intra slice and include the encoded information in the SPS.
[0260] Specifically, the video encoding device 1700 may preset the maximum size of a luminance codec unit generated by performing ternary partitioning on an intra slice. In addition, by using the minimum size and the maximum size of the luminance codec unit generated by performing ternary partitioning on an intra slice, the video encoding device 1700 may determine information about the difference between the maximum size and the minimum size of the luminance codec unit generated by performing ternary partitioning on an intra slice. In addition, the video encoding device 1700 may encode the information about the maximum size and the minimum size of the luminance codec unit generated by performing ternary partitioning on an intra slice and include the encoded information in the SPS.
[0261] Specifically, the video encoding apparatus 1700 may preset the maximum size of the luminance codec unit generated by performing binary partitioning on an inter-frame strip. In addition, by using the minimum size of the luminance codec unit generated by performing binary partitioning on an inter-frame strip and the maximum size of the luminance codec unit, the video encoding apparatus 1700 may determine information regarding the difference between the maximum size and the minimum size of the luminance codec unit generated by performing binary partitioning on an inter-frame strip. In addition, the video encoding apparatus 1700 may encode the information regarding the difference between the maximum size and the minimum size of the luminance codec unit generated by performing binary partitioning on an inter-frame strip, and include the encoded information in the SPS.
[0262] Specifically, the video encoding apparatus 1700 may preset the maximum size of the luminance codec unit generated by performing ternary partitioning on an inter-frame strip. In addition, by using the minimum size of the luminance codec unit generated by performing ternary partitioning on an inter-frame strip and the maximum size of the luminance codec unit, the video encoding apparatus 1700 may determine information regarding the difference between the maximum size and the minimum size of the luminance codec unit generated by performing ternary partitioning on an inter-frame strip. In addition, the video encoding apparatus 1700 may encode the information regarding the difference between the maximum size and the minimum size of the luminance codec unit generated by performing ternary partitioning on an inter-frame strip, and include the encoded information in the SPS.
[0263] According to an embodiment, the video encoding apparatus 1700 may determine whether the luminance codec unit and the chrominance codec unit are determined separately. The video encoding apparatus 1700 may encode the information indicating whether the luminance codec unit and the chrominance codec unit are determined separately, and include the encoded information in the SPS.
[0264] According to an embodiment, when the luminance codec unit and the chrominance codec unit are determined separately, the video encoding apparatus 1700 may preset the maximum size of the chrominance codec unit generated by performing binary partitioning on an intra-frame strip. In addition, by using the minimum size of the chrominance codec unit generated by performing binary partitioning on an intra-frame strip and the maximum size of the chrominance codec unit, the video encoding apparatus 1700 may determine information regarding the difference between the maximum size and the minimum size of the chrominance codec unit generated by performing binary partitioning on an intra-frame strip. In addition, the video encoding apparatus 1700 may encode the information regarding the difference between the maximum size and the minimum size of the chrominance codec unit generated by performing binary partitioning on an intra-frame strip, and include the encoded information in the SPS.
[0265] According to an embodiment, when the luminance codec unit and the chrominance codec unit are determined separately, the video encoding apparatus 1700 may preset the maximum size of the chrominance codec unit generated by performing ternary partitioning, which can be determined in an intra slice. By using the minimum size and the maximum size of the chrominance codec unit generated by performing ternary partitioning on an intra slice, the video encoding apparatus 1700 may determine information regarding the difference between the maximum size and the minimum size of the chrominance codec unit generated by performing ternary partitioning on an intra slice. In addition, the video encoding apparatus 1700 may encode the information regarding the difference between the maximum size and the minimum size of the chrominance codec unit generated by performing ternary partitioning on an intra slice, and include the encoded information in the SPS.
[0266] According to an embodiment, when a first codec unit among codec units is not adjacent to an outer boundary of an image, the video encoding apparatus 1700 may encode partitioning type information of the first codec unit, and output the encoded partitioning type information in a bitstream.
[0267] Specifically, when binary partitioning is performed on the first codec unit, the video encoding apparatus 1700 may determine two second codec units, each having a depth increased by 1 from the depth of the first codec unit, and encode the partitioning type information of the first codec unit indicating binary partitioning. For example, when the depth of the first codec unit is N, the depth of each of the two second codec units generated by performing binary partitioning on the first codec unit may be N+1. In this case, the area of each of the second codec units may be 1 / 2 of the area of the first codec unit.
[0268] Specifically, when ternary partitioning is performed on the first codec unit, the video encoding apparatus 1700 may determine a third codec unit having a depth increased by 1 from the depth of the first codec unit and two fourth codec units each having a depth increased by 2 from the depth of the first codec unit, and encode the partitioning type information of the first codec unit indicating ternary partitioning. For example, when the depth of the first codec unit is N, the depth of the third codec unit may be N+1, and the depth of each of the two fourth codec units may be N+2, where the third codec unit and the fourth codec units are generated by performing ternary partitioning on the first codec unit. In this case, the area of the third codec unit may be 1 / 2 of the area of the first codec unit, and the area of each of the fourth codec units may be 1 / 4 of the area of the first codec unit.
[0269] Next, Figure 19 and Figure 20 the video decoding process will be described in detail.
[0270] Figure 19 The block diagram of a video decoding device according to an embodiment is shown.
[0271] According to an embodiment, the video decoding device 1900 may include a memory 1910 and at least one processor 1920 connected to the memory 1910. The operation of the video decoding device 1900 according to an embodiment may be executed as a separate processor or may be executed under the control of a central processing unit. In addition, the memory 1910 of the video decoding device 1900 may store data received from the outside and data generated by the processor, for example, partition information, prediction information, and residual information related to a coding / decoding unit, information on whether binary partitioning of the coding / decoding unit is allowed, information on whether ternary partitioning of the coding / decoding unit is allowed, etc.
[0272] To effectively perform video decoding, similar to the video encoding device 1700, the video decoding device 1900 may perform decoding in a pipeline method of processing multiple blocks in parallel. For this purpose, a pipeline data unit having the same size as determined by the video encoding device 1700 may be used.
[0273] The processor 1920 may access the data of the current pipeline data unit during the current pipeline cycle and thus be able to decode the blocks located in the pipeline. However, the processor 1920 may not be able to decode the blocks that span the current pipeline data unit and the next pipeline data unit or the blocks that span the current pipeline data unit and the previous pipeline data unit.
[0274] In addition, as in the video encoding device 1700, the size of the coding / decoding unit or the transform unit needs to be less than or equal to the size of the pipeline data unit.
[0275] In addition, the video decoding device 1900 may determine a partitioning method for partitioning a coding / decoding unit into coding / decoding units of a lower depth based on the partitioning type information obtained from the bitstream.
[0276] However, when the origin of the upper left position of the coding / decoding unit includes the contour of the image, depending on the size of the coding / decoding unit, the coding / decoding unit may be outside the image, so the video decoding device 1900 may determine to arbitrarily partition the coding / decoding unit into a shape in which the coding / decoding unit does not cross the contour of the image even in the absence of partitioning type information. Even if the partitioning type information of the coding / decoding unit exists, the video decoding device 1900 may ignore the value of the partitioning type information and partition the coding / decoding unit into a partitioning shape in which the coding / decoding unit does not cross the contour of the image. When the video decoding device 1900 determines to arbitrarily partition the coding / decoding unit, it may change the value of the partitioning type information and set it to an arbitrarily determined partitioning shape.
[0277] The processor 1920 of the video decoding apparatus 1900 may determine a codec unit by dividing at least one of the height and width of a maximum codec unit having a first size based on whether the height or width of a non-square first codec unit including the outer boundary of an image in the codec unit is greater than a maximum transform size, determine whether to allow generating two second codec units by dividing at least one of the height and width of the first codec unit, and perform decoding by using the maximum transform size to perform inverse transform on the second codec units generated from the first codec unit.
[0278] In this regard, the size of a pipeline data unit may be considered, and the maximum transform size may be determined to be less than or equal to the size of the pipeline data unit. Accordingly, decoding of each second codec unit having a size less than or equal to the maximum transform size may be processed during one pipeline cycle, and thus, the video decoding apparatus 1900 may use a pipeline method to process decoding.
[0279] Hereinafter, reference will be made to Figure 20 a detailed operation of a method for the video decoding apparatus 1900 to perform decoding by using codec units determined from a maximum codec unit will be described in detail.
[0280] Figure 20 A flowchart of a video decoding method according to an embodiment is shown.
[0281] In operation 2010, the video decoding apparatus 1900 according to an embodiment may generate a codec unit by dividing at least one of the height and width of a maximum codec unit having a first size.
[0282] In operation 2020, based on whether the height or width of a non-square first codec unit including the outer boundary of an image in the codec unit is greater than a maximum transform size, the video decoding apparatus 1900 may determine whether to allow generating two second codec units by dividing at least one of the height and width of the first codec unit.
[0283] According to an embodiment, the video decoding apparatus 1900 may set a flag value indicating whether to allow generating a second codec unit by dividing at least one of the height and width of the first codec unit. Specifically, when the first codec unit includes the outer boundary of an image, depending on the size of the first codec unit, the first codec unit may be outside the outer boundary of the image, and thus, the video decoding apparatus 1900 may determine whether to allow generating a second codec unit by arbitrarily dividing at least one of the height and width of the first codec unit.
[0284] According to an embodiment, when the length of the width of a non-square first codec unit including the outer boundary of an image is greater than the maximum transform size and the length of the height of the first codec unit is equal to the maximum transform size, the video decoding apparatus 1900 may allow generation of smaller codec units by performing vertical binary partitioning on the first codec unit, and may prohibit generation of smaller codec units by performing horizontal binary partitioning on the first codec unit. Specifically, the video decoding apparatus 1900 may set a vertical binary partitioning flag value for allowing generation of smaller codec units by performing vertical binary partitioning on the first codec unit, and may set a horizontal binary partitioning flag value for prohibiting generation of smaller codec units by performing horizontal binary partitioning on the first codec unit.
[0285] According to an embodiment, when the length of the width of a non-square first codec unit including the contour of an image is equal to the maximum transform size and the length of the height of the first codec unit is greater than the maximum transform size, the video decoding apparatus 1900 may allow generation of smaller codec units by performing horizontal binary partitioning on the first codec unit, and may prohibit generation of smaller codec units by performing vertical binary partitioning on the first codec unit. Specifically, the video decoding apparatus 1900 may set a horizontal binary partitioning flag value for allowing generation of smaller codec units by performing horizontal binary partitioning on the first codec unit, and may set a vertical binary partitioning flag value for prohibiting generation of smaller codec units by performing vertical binary partitioning on the first codec unit the first codec unit.
[0286] According to an embodiment, when the length of each of the height and width of a codec unit including the contour of an image is greater than the maximum transform size, the video decoding apparatus 1900 may allow generation of smaller codec units by performing quadtree partitioning on the codec unit. Specifically, a quadtree partitioning flag value for allowing generation of smaller codec units by performing quadtree partitioning on the codec unit may be set.
[0287] According to an embodiment, the lengths of the height and width of a codec unit may be greater than or equal to the maximum transform size.
[0288] In addition, in operation 2020, when the first codec unit is adjacent to the contour of the image such that the height or width of the first codec unit is outside the contour of the image, the video decoding apparatus 1900 may prohibit binary partitioning in the direction of partitioning the height or width of the first codec unit, which may be outside the contour of the image. As a specific example, when the height of the first codec unit is greater than the maximum transform size and the width of the first codec unit is outside the right contour of the image, the video decoding apparatus 1900 may determine to prohibit vertical binary partitioning for partitioning the width of the first codec unit. Similarly, when the width of the first codec unit is greater than the maximum transform size and the height of the first codec unit is outside the lower contour of the image, the video decoding apparatus 1900 may determine to prohibit horizontal binary partitioning for partitioning the height of the first codec unit.
[0289] However, when the height of the codec unit including the outer boundary of the image is outside the lower contour of the image or the width of the codec unit is outside the right contour of the image, the video decoding apparatus 1900 may allow quadtree partitioning of the codec unit.
[0290] In operation 2030, the video decoding apparatus 1900 may perform decoding by performing inverse transformation on the second codec unit generated from the first codec unit using the maximum transform size. The video decoding apparatus 1900 may determine a prediction block by performing prediction on the second codec unit, reconstruct a residual block by performing inverse quantization and inverse transformation on the second codec unit using a transform block, and determine a reconstructed block by synthesizing the prediction block and the residual block.
[0291] According to an embodiment, in response to the video encoding apparatus 1700 in which the size of the pipeline data unit is set to be equal to the maximum transform size to complete encoding within a pipeline cycle, in order for the video decoding apparatus 1900 to complete decoding within one pipeline cycle by performing inverse transformation and generating a reconstructed block, it is also necessary to set the size of the pipeline data unit used by the video decoding apparatus 1900 to be equal to the maximum transform size and arbitrarily partition the codec unit based on the maximum transform size.
[0292] Therefore, embodiments will be described below, in which, considering the pipeline cycle, the video decoding apparatus 1900 compares the maximum transform size with at least one of the height and width of the codec unit and sets vertical binary partitioning flag values, horizontal binary partitioning flag values, and quadtree partitioning flag values, respectively indicating whether vertical binary partitioning, horizontal binary partitioning, and quadtree partitioning of the codec unit are allowed.
[0293] Specifically, to complete the decoding of the codec unit within a pipeline cycle, when the length of the width of the codec unit is greater than the maximum transform size and the length of the height of the codec unit is equal to the maximum transform size, the video decoding device 1900 may allow generating smaller codec units by performing vertical binary partitioning on the codec unit, and prohibit generating smaller codec units by performing horizontal binary partitioning on the codec unit.
[0294] Specifically, to complete the decoding of the codec unit within a pipeline cycle, when the length of the width of the codec unit is equal to the maximum transform size and the length of the height of the codec unit is greater than the maximum transform size, the video decoding device 1900 may allow generating smaller codec units by performing horizontal binary partitioning on the codec unit, and prohibit generating smaller codec units by performing vertical binary partitioning on the codec unit.
[0295] Specifically, to complete the decoding of the codec unit within a pipeline cycle, when the length of the width of the codec unit is greater than the maximum transform size and the length of the height of the codec unit is equal to the maximum transform size, the video decoding device 1900 may allow generating smaller codec units by performing vertical binary partitioning on the codec unit, and prohibit generating smaller codec units by performing horizontal binary partitioning on the codec unit.
[0296] Specifically, to complete the decoding of the codec unit within a pipeline cycle, when the length of the width of the codec unit is equal to the maximum transform size and the length of the height of the codec unit is greater than the maximum transform size, the video decoding device 1900 may allow generating smaller codec units by performing horizontal binary partitioning on the codec unit, and prohibit generating smaller codec units by performing vertical binary partitioning on the codec unit.
[0297] Specifically, to complete the decoding of the codec unit within a pipeline cycle, when each of the height and width dimensions of the codec unit is greater than the maximum transform size, the video decoding device 1900 may allow generating smaller codec units by performing quadtree partitioning on the codec unit.
[0298] In addition, according to an embodiment, the video decoding device 1900 may pre-determine a maximum value and a minimum value based on information obtained from the bitstream to limit the size of the maximum codec unit or the codec unit.
[0299] In operation 2010, according to an embodiment, the video decoding apparatus 1900 may divide an image into maximum codec units having a constant size and decode the image. Since the size of the maximum codec unit has been previously determined by the video encoding apparatus 1700, the video decoding apparatus 1900 may obtain information about the size of the maximum codec unit from the SPS. According to an embodiment, the size of the maximum codec unit may be 128x128.
[0300] According to an embodiment, the video decoding apparatus 1900 may separately obtain information about the maximum size and the minimum size of a codec unit from the bitstream based on the type of a slice.
[0301] Specifically, the video decoding apparatus 1900 may obtain information about the minimum size of a luma codec unit and information about the difference between the maximum size and the minimum size of a luma codec unit generated by performing binary partitioning on an intra slice from the bitstream. By using the information about the minimum size of the luma codec unit and the information about the difference between the maximum size and the minimum size of the luma codec unit generated by performing binary partitioning on the intra slice, the video decoding apparatus 1900 may determine the maximum size of the luma codec unit generated by performing binary partitioning on the intra slice. In addition, the video decoding apparatus 1900 may obtain the encoded information about the minimum size of the luma codec unit and the information about the difference between the maximum size and the minimum size of the luma codec unit generated by performing binary partitioning on the intra slice from the SPS.
[0302] Specifically, the video decoding apparatus 1900 may obtain information about the difference between the maximum size and the minimum size of a luma codec unit generated by performing ternary partitioning on an intra slice from the bitstream. By using the information about the minimum size of the luma codec unit and the information about the difference between the maximum size and the minimum size of the luma codec unit generated by performing ternary partitioning on the intra slice, the video decoding apparatus 1900 may determine the maximum size of the luma codec unit generated by performing ternary partitioning on the intra slice. In addition, the video decoding apparatus 1900 may obtain the information about the difference between the maximum size and the minimum size of the luma codec unit generated by performing ternary partitioning on the intra slice from the SPS.
[0303] Specifically, the video decoding device 1900 may obtain information about the difference between the maximum size and the minimum size of a luma codec unit generated by performing binary partitioning on an inter-frame stripe from a bitstream. By using the information about the minimum size of the luma codec unit and the information about the difference between the maximum size and the minimum size of the luma codec unit generated by performing binary partitioning on an inter-frame stripe, the video decoding device 1900 may determine the maximum size of the luma codec unit generated by performing binary partitioning on an inter-frame stripe. In addition, the video decoding device 1900 may obtain information about the difference between the maximum size and the minimum size of the luma codec unit generated by performing binary partitioning on an inter-frame stripe from the SPS.
[0304] Specifically, the video decoding device 1900 may obtain information about the difference between the maximum size and the minimum size of a luma codec unit generated by performing ternary partitioning on an inter-frame stripe from a bitstream. By using the information about the minimum size of the luma codec unit and the information about the difference between the maximum size and the minimum size of the luma codec unit generated by performing ternary partitioning on an inter-frame stripe, the video decoding device 1900 may determine the maximum size of the luma codec unit generated by performing ternary partitioning on an inter-frame stripe. In addition, the video decoding device 1900 may obtain information about the difference between the maximum size and the minimum size of the luma codec unit generated by performing ternary partitioning on an inter-frame stripe from the SPS.
[0305] According to an embodiment, the video decoding device 1900 may determine whether a luma codec unit and a chroma codec unit are determined separately based on the information obtained from the bitstream. Specifically, the video decoding device 1900 may obtain information indicating whether a luma codec unit and a chroma codec unit are determined separately from the SPS.
[0306] Specifically, when a luma codec unit and a chroma codec unit are determined separately, the video decoding device 1900 may obtain information about the difference between the maximum size and the minimum size of a chroma codec unit generated by performing binary partitioning on an intra-frame stripe from a bitstream. By using the information about the minimum size of the chroma codec unit and the information about the difference between the maximum size and the minimum size of the chroma codec unit generated by performing binary partitioning on an intra-frame stripe, the video decoding device 1900 may determine the maximum size of the chroma codec unit generated by performing binary partitioning on an intra-frame stripe. In addition, the video decoding device 1900 may obtain the encoded information about the difference between the maximum size and the minimum size of the chroma codec unit generated by performing binary partitioning on an intra-frame stripe from the SPS.
[0307] Specifically, when the luminance codec unit and the chrominance codec unit are determined separately, the video decoding apparatus 1900 may obtain, from the bitstream, information on the difference between the maximum size and the minimum size of the chrominance codec units generated by performing ternary partitioning on an intra strip. By using the information on the minimum size of the chrominance codec units and the information on the difference between the maximum size and the minimum size of the chrominance codec units generated by performing ternary partitioning on an intra strip, the video decoding apparatus 1900 may determine the maximum size of the chrominance codec units generated by performing ternary partitioning on an intra strip. In addition, the video decoding apparatus 1900 may obtain, from the SPS, information on the difference between the maximum size and the minimum size of the chrominance codec units generated by performing ternary partitioning on an intra strip.
[0308] According to an embodiment, when the codec unit is not adjacent to the outer boundary of the image, the video decoding apparatus 1900 may obtain, from the bitstream, the encoded partitioning type information of the codec unit.
[0309] Specifically, when the partitioning type information of the obtained first codec unit indicates binary partitioning, the video decoding apparatus 1900 may determine two second codec units whose depths are increased by 1 compared to the depth of the first codec unit. For example, when the depth of the first codec unit is N, the depth of each of the two second codec units generated by performing binary partitioning on the first codec unit may be N + 1. In this case, the area of each of the second codec units may be 1 / 2 of the area of the first codec unit.
[0310] Specifically, when the partitioning type information of the obtained first codec unit indicates ternary partitioning, the video decoding apparatus 1900 may determine a third codec unit whose depth is increased by 1 compared to the depth of the first codec unit and two fourth codec units whose depths are increased by 2 compared to the depth of the first codec unit. For example, when the depth of the first codec unit is N, the depth of the third codec unit may be N + 1, and the depth of each of the two fourth codec units may be N + 2. The third codec unit and the fourth codec units are generated by performing ternary partitioning on the first codec unit. In this case, the area of the third codec unit may be 1 / 2 of the area of the first codec unit, and the area of each of the fourth codec units may be 1 / 4 of the area of the first codec unit.
[0311] Next, with reference to Figure 21 and Figure 28 the combination of pipeline data units that can be used by the video encoding apparatus 1700 and the video decoding apparatus 1900 will be described.
[0312] Figure 21 The relationship between the maximum codec unit, the pipeline data unit, and the block according to an embodiment is shown.
[0313] Hardware designs in video coding methods that consider using quadtree partitioning, binary partitioning, and ternary partitioning to perform partitioning on coding / decoding units can be considered to define partitioning methods. For example, in traditional video codec standards, the size of the largest coding / decoding unit (coding tree unit (CTU)) is 64x64, and thus, the size of the pipelined data unit is also set to 64x64. However, in some codecs that are currently being standardized, the size of the largest coding / decoding unit (CTU) 2100 can be determined to be as large as 128x128. This means that compared to traditional codec standards, the memory size or cache size increases. Therefore, in some codecs that are currently being standardized, the block partitioning rules are restricted to having a pipelined data unit 2110 with a size of 64x64. Specifically, constraints have been set that do not allow ternary partitioning in blocks with a size greater than 64x64 (width > 64 or height > 64), and binary partitioning is only allowed in blocks with a size greater than 64x64 (i.e., only blocks with sizes of 128x128, 128x64, and 64x128) at a ratio of 1:2 or 2:1. Since the current maximum transform size is 64 (i.e., the size of the largest transform unit is 64x64), it is possible to allow the block to be partitioned into blocks larger than the pipelined data unit 2110 with a size of 64x64.
[0314] In addition, in order to complete the encoding or decoding process of the coding / decoding unit during the pipeline cycle of the pipelined data unit 2110, the coding / decoding unit needs to be located within the pipelined data unit 2110 without crossing the boundary line of the pipelined data unit 2110 (hereinafter referred to as the pipeline boundary line). Although the coding / decoding units 2120 and 2130 are located within the pipelined data unit 2110, the coding / decoding units 2140 and 2150 cross the pipeline boundary line, so it is difficult to complete the encoding or decoding process within one pipeline cycle.
[0315] According to an embodiment, in order to complete the transform / inverse transform performed based on the transform unit during the pipeline cycle, it is preferred that the transform unit is located within the pipelined data unit 2110. In particular, it is not allowed for the transform unit to cross the pipeline boundary line. Therefore, according to the embodiment, the video encoding device 1700 and the video decoding device 1900 can prohibit the determination of the transform unit from the coding / decoding unit. To this end, the video encoding device 1700 and the video decoding device 1900 can determine the size of the largest transform unit to be 64x64, which is the size of the pipelined data unit and is less than or equal to the size of the coding / decoding unit.
[0316] According to an embodiment, the video encoding device 1700 and the video decoding device 1900 may determine transform units that do not cross the pipeline boundary line by dividing transform units that cross the pipeline boundary line into smaller sizes. However, there is a problem that the division of the transform units needs to be changed according to the pipeline boundary line, the positions of the encoding / decoding units, and the shapes of the encoding / decoding units.
[0317] According to another embodiment, when an encoding / decoding unit crosses the pipeline boundary line, the video encoding device 1700 may not be able to perform a transform on the corresponding block within a pipeline cycle and may thus be able to encode the block without residual data. That is, since the encoding / decoding unit is an encoding / decoding unit that does not include residual data, there is no need to determine a transform unit.
[0318] According to an embodiment, the video encoding device 1700 may set the encoding mode of an encoding / decoding unit that crosses the pipeline boundary line to a skip mode and encode the encoding / decoding unit without encoding residual data. In response thereto, the video decoding device 1900 may determine the encoding mode of the encoding / decoding unit that crosses the pipeline boundary line to be the skip mode and decode the encoding / decoding unit without decoding residual data. In addition, the encoding mode of the encoding / decoding unit that crosses the pipeline boundary line is limited to the skip mode, and other encoding modes may be prohibited.
[0319] According to another embodiment, even if the encoding mode of an encoding / decoding unit that crosses the pipeline boundary line is a mode other than the skip mode, the video encoding device 1700 may encode the encoding / decoding unit without residual data by setting the coding block flag (cbf) of the encoding / decoding unit or the transform unit to 0. In response thereto, the video decoding device 1900 may determine that the encoding mode of the encoding / decoding unit that crosses the pipeline boundary line has a cbf of 0 regardless of the encoding mode and decode the encoding / decoding unit without decoding residual data.
[0320] Therefore, the video encoding device 1700 may set the encoding mode of a block (encoding / decoding unit or transform unit) that crosses the pipeline boundary line to a mode that can be processed without residual data in order to encode the corresponding block (encoding / decoding unit or transform unit). Similarly, the video decoding device 1900 may determine the encoding mode of a block (encoding / decoding unit or transform unit) that crosses the pipeline boundary line to be a mode that can be processed without residual data in order to decode the corresponding block (encoding / decoding unit or transform unit).
[0321] In addition, in the sub-block based prediction method, the entire block is set as the motion vector estimation range. Therefore, the video encoding device 1700 and the video decoding device 1900 may not be able to apply the sub-block based prediction method to the codec units that cross the pipeline boundary line. Thus, the sub-block based prediction methods (such as the affine skip method) are not applicable to the codec units that cross the pipeline boundary line.
[0322] However, as an exception, the problems caused by the pipeline method do not occur in the largest codec unit that crosses the contour of the image. Therefore, the restriction on the residual data at the pipeline boundary may not be applied to the largest codec unit that crosses the contour of the image.
[0323] In Figure 21 above, only the case where the pipeline data unit size is 64x64 is described. However, there is a drawback that the coding performance is reduced by restricting the pipeline data unit to only square blocks. Therefore, in Figures 22 to 28 below, a method is provided to improve the coding performance by allowing various shapes of pipeline data units (such as square and non-square) while keeping the size (area) of the pipeline data unit as 64×64 = 4096. Since various shapes of pipeline data units require operations for memory addressing, the complexity of the implementation may increase, but the coding performance can increase. Therefore, when selecting the pipeline type, the coding performance and the amount of operations can be considered to select the optimal pipeline data unit. Embodiments of the allowed combinations of pipeline data units will be shown in Figures 22 to 28 below.
[0324] Figure 22 Three shapes considering the size of the pipeline data unit and the combination of pipeline data units that can be determined from the largest codec unit according to an embodiment are shown.
[0325] As Figure 22 shown, the allowed combinations of pipeline data units may include three shapes of pipeline data units. That is, the largest codec unit with a size of 128x128 may include a combination 2210 of four pipeline data units with a size of 64x64, a combination 2220 of four pipeline data units with a size of 32x128, and a combination 2230 of four pipeline data units with a size of 128x32. In this case, for example, the ternary partition may not be allowed in blocks with sizes of 128x128, 128x64, and 64x128.
[0326] When a block of size 128x128 is vertically divided and its first block of size 64x128 is vertically binary divided, its second block of size 64x128 can be unconditionally vertically binary divided (horizontal binary division and non-division may not be allowed in the second block of size 64x128). When the first block of size 64x128 is not divided or is horizontally binary divided, vertical binary division may not be allowed in the second block of size 64x128.
[0327] In addition, when a block of size 128x128 is horizontally divided and its first block of size 128x64 is horizontally binary divided, its second block of size 128x64 can be unconditionally horizontally binary divided (vertical binary division and non-division may not be allowed in the second block of size 128x64). When the first block of size 128x64 is not divided or is vertically binary divided, horizontal binary division may not be allowed in the second block of size 128x64.
[0328] Figure 23 Five shapes of combinations of pipeline data units are shown according to an embodiment, taking into account the size of the pipeline data units and the combinations of pipeline data units that can be determined from the maximum codec unit.
[0329] As Figure 23 shown, the allowed combinations of pipeline data units can include pipeline data units of five shapes. In this case, for example, it is possible to consider changing the Figure 22 constraints in the embodiment such that ternary division is allowed in a block of size 128x128. In this case, when a block of size 128x128 is ternary divided and its central block is binary divided, binary division in the same direction as the ternary division direction may be allowed in the central block. When allowed, combinations 2320 and 2330 of four rectangular pipeline data units of the same size can be determined.
[0330] However, when a block of size 128x128 is ternary divided and the central block is binary divided, binary division in the same direction as the ternary division direction is not allowed in the central block. In this case, the pipeline data units of combination 2340 or 2350 in Figure 23 can be used.
[0331] Figure 24 Seven shapes of combinations of pipeline data units are shown according to an embodiment, taking into account the size of the pipeline data units and the combinations of pipeline data units that can be determined from the maximum codec unit.
[0332] As Figure 24As shown, the allowed combinations of pipelined data units can include pipelined data units of seven shapes. According to an embodiment, when a three-way division is not allowed in blocks of 128x128, 128x64, and 64x128 sizes, the combination of Figure 24 can be determined.
[0333] Figure 25 Shows nine shapes of combinations of pipelined data units considering the size of the pipelined data units and the combinations of pipelined data units that can be determined from the maximum codec unit according to another embodiment.
[0334] As Figure 25 shown, the allowed combinations of pipelined data units can include pipelined data units of nine shapes. According to an embodiment, when a three-way division is allowed in a 128x128-size block and not allowed in 128x64-size and 64x128-size blocks, the combination of Figure 25 can be determined.
[0335] Figure 26 Shows two shapes of combinations of pipelined data units considering the size of the pipelined data units and the combinations of pipelined data units that can be determined from the maximum codec unit according to an embodiment.
[0336] As Figure 26 shown, the allowed combinations of pipelined data units can include pipelined data units of two shapes. According to an embodiment, when a three-way division is not allowed in 128x128, 128x64, and 64x128-size blocks and only a vertical binary division is allowed in the 128x128-size block, the combination of Figure 26 can be determined. When the 128x128-size block is vertically divided and its first 64x128-size block is vertically binary divided, its second 64x128-size block can be unconditionally vertically binary divided. A horizontal binary division and no division are not allowed in the second 64x128-size block.
[0337] Figure 27 Shows two shapes of combinations of pipelined data units considering the size of the pipelined data units and the combinations of pipelined data units that can be determined only by quadtree division or binary division of the maximum codec unit according to an embodiment.
[0338] As Figure 27As shown, the allowable combinations of pipeline data units may include pipeline data units of two shapes. For example, a three-way division may not be allowed in blocks of sizes 128x128, 128x64, and 64x128, and only a horizontal binary division may be allowed in a 128x128-sized block. When a 128x128-sized block is horizontally divided and its first 128x64-sized block is horizontally binary divided, its second 128x64-sized block can be horizontally binary divided unconditionally (a vertical binary division and no division may not be allowed in the second 128x64-sized block).
[0339] Figure 28 Illustrated are three shapes of combinations of pipeline data units according to an embodiment, considering the size of the pipeline data units and the combinations of pipeline data units that can be determined by quadtree division, three-way division, and binary division of the maximum codec unit.
[0340] As Figure 28 shown, the allowable combinations of pipeline data units may include pipeline data units of three shapes. When a three-way division is allowed in a 128x128-sized block, and thus the 128x128-sized block is three-way divided and its central block is binary divided, a binary division in the same direction as the three-way division direction may not be allowed in the central block. In this case, depending on whether a three-way division is allowed and the division direction, the combination of pipeline data units can be selected from three combinations.
[0341] The above references Figures 21 to 28 describe various shapes of pipeline data units. However, in addition to the above embodiments, the pipeline data units can be configured in any combination that is easily modified by those of ordinary skill in the art.
[0342] Although the shapes of the allowable pipeline data units vary according to the above various situations, it remains the same that the residual data of blocks crossing the pipeline boundary line is not processed. Below, a method for determining whether a current block crosses the pipeline boundary line will be described with reference to Figure 29 Illustrated is a function for determining whether a codec unit is located at the boundary line of a pipeline data unit according to an embodiment.
[0343] Figure 29 In the
[0344] function, the size of the pipeline data unit is 64x64, the coordinates of the upper left sample point of the current block are (x, y), and the height and width of the current block are h and w, respectively. Figure 29
[0345] When the right boundary of the current block is outside the right boundary line of the pipeline data unit (if (left_pipeline_boundary + 64 < x + w)), it can be determined that the current block crosses the boundary line of the pipeline data unit (result = true).
[0346] When the lower boundary of the current block is outside the lower boundary line of the pipeline data unit (if (top_pipeline_boundary + 64 < y + h)), it can be determined that the current block crosses the boundary line of the pipeline data unit (result = true).
[0347] When the size of the current block is 128x128 (if (w == 128 && h == 128)), it can be determined that the current block does not cross the boundary line of the pipeline data unit (result = false).
[0348] When the width of the current block is 64 and the height of the current block is 128 (if (w == 64 && h == 128 && (w % 64) == 0)), it can be determined that the current block does not cross the boundary line of the pipeline data unit (result = false).
[0349] When the height of the current block is 64 and the width of the current block is 128 (if (h == 64 && w == 128 && (h % 64) == 0)), it can be determined that the current block does not cross the boundary line of the pipeline data unit (result = false).
[0350] When the right boundary or the lower boundary of the current block is outside the contour of the image (if ((x + 128) > pic_w || (y + 128) > pic_h)), it can be determined that the current block does not cross the boundary line of the pipeline data unit (result = false).
[0351] Next, various embodiments will be described in which the video encoding device 1700 and the video decoding device 1900 signal information regarding the maximum size, minimum size, and the difference between the maximum size and the minimum size of various blocks for video encoding and decoding.
[0352] The size of the maximum coding / decoding unit independent of the partitioning mode and the minimum size of the coding / decoding unit can be defined. Before reaching the minimum size of the coding / decoding unit, partitioning methods of various partitioning types (quad-tree partitioning, binary partitioning, and ternary partitioning types) can be used to recursively partition the coding / decoding unit. That is, when performing recursive partitioning, it can be determined whether the current coding / decoding unit can be further divided into sub-coding / decoding units by comparing the size of the current coding / decoding unit with the minimum size of the coding / decoding unit. For example, when identifying whether to perform quad-tree partitioning, in the case where quad-tree partitioning is performed on the current coding / decoding unit and the size of the sub-coding / decoding unit becomes smaller than the minimum size of the coding / decoding unit, quad-tree partitioning may not be performed. As another example, when identifying whether to perform binary partitioning, in the case where binary partitioning in a specific direction is performed on the current coding / decoding unit and the length of the corresponding side of the sub-coding / decoding unit in the partitioning direction becomes smaller than the minimum size of the coding / decoding unit, binary partitioning in the specific direction may not be performed. As another example, when identifying whether to perform ternary partitioning, in the case where ternary partitioning in a specific direction is performed on the current coding / decoding unit and the length of the corresponding side of the sub-coding / decoding unit in the partitioning direction becomes smaller than the minimum size of the coding / decoding unit, ternary partitioning in the specific direction may not be performed.
[0353] In this regard, information about the minimum size of the coding / decoding unit can be predefined by the video encoding device 1700 and the video decoding device 1900. The video encoding device 1700 can encode the information about the minimum size of the coding / decoding unit and include the encoded information in the sequence header, SPS, picture header, picture parameter set (PPS), or slice header. In response thereto, the video decoding device 1900 can obtain the information about the minimum size of the coding / decoding unit from the sequence header, SPS, picture header, PPS, or slice header.
[0354] As a specific example, the minimum size of the coding / decoding unit may be 4. In addition, the value after log2 of the minimum size of the coding / decoding unit may be encoded. That is, when the minimum size of the coding / decoding unit is 4, the value corresponding to log2 of the coding / decoding unit is 2, and when -2 is applied to it, the resulting value may be 0. By applying -2 to the value after log2 of the minimum size of the coding / decoding unit and then signaling the resulting value, the coding / decoding efficiency of the information about the minimum size of the coding / decoding unit can be improved. In this regard, a fixed length coding (FLC) method or a variable length coding (VLC) method may be used as the coding method for the information about the minimum size of the coding / decoding unit. In this case, when the VLC method is used, the unsigned exponential Golomb code method may be used. As another example, when the minimum size of the coding / decoding unit is 8, the resulting value may be signaled by applying -2 to the value corresponding to log2 (3) and setting the value to 1.
[0355] The partition depth allowed for various partition types (quad-tree partition, binary partition, ternary partition type) (indicating the number of times of recursive partitioning allowed in the corresponding type) may also be set individually for each partition type. When the video coding device 1700 and the video decoding device 1900 support quad-tree partition, binary partition, and ternary partition, for example, the partition depth allowed for quad-tree partition, the partition depth allowed for binary partition, and the partition depth allowed for ternary partition may be set. As another example, the partition depth allowed for quad-tree partition and the partition depth allowed for binary partition and ternary partition may also be defined. In this case, the partition depth allowed for binary partition and ternary partition may be set equally. As another example, the partition depth allowed for quad-tree partition, binary partition, and ternary partition may be set to a single partition depth.
[0356] In the foregoing embodiments with a preset division depth, the concept of depth can be considered as the concept of area. For example, when a block is divided and thus the area of its sub-blocks is 1 / N, the depth of the sub-blocks can be set to increase by 1 compared to the depth of the block. For example, in the case of N = 2, when two M / 2xM blocks are determined by performing binary division on an MxM block (depth = 0), the area of each M / 2xM block is 1 / N (i.e., 1 / 2), such that the depth of each M / 2xM block increases by 1, so the depth can be 1. Further, when four M / 2xM / 2 blocks are determined by performing quadtree division on an MxM block (depth = 0), the area of each M / 2xM / 2 block is 1 / N×1 / N (i.e., 1 / 2×1 / 2 = 1 / 4), such that the depth of each M / 2xM / 2 increases by 2, so the depth can be determined to be 2. Further, when two M / 4xM blocks and one M / 2xM block are determined by performing ternary division on an MxM block (depth = 0), the depth of each M / 4xM block increases by 2, so the depth can be determined to be 2, and the depth of the M / 2xM block increases by 1, so the depth can be determined to be 1. Further, depending on the division method, the depth information can be set separately.
[0357] In addition, there is a module that performs a specific operation by comparing the depth information of adjacent blocks with the depth information of the current block, and the depth configuration method in the corresponding division method can be used. For example, the context of context-based adaptive binary arithmetic coding (CABAC) can be determined by comparing the depth of the current block with the depth of adjacent blocks. The embodiments are not limited to the depth of a specific division pattern, and the depth of the current block and the depth of adjacent blocks are compared based on the actual division area or block size, so that a more accurate context can be determined.
[0358] Assume that the allowed division depths for binary division and ternary division are the same, and the allowed division depth is N. In the case of binary division, when the current depth is D, the depth of each sub-block is D + 1. However, in the case of ternary division, since the areas of the sub-blocks are different from each other, the depths of the first sub-block and the third sub-block are determined to be D + 2, and the depth of the second (middle) sub-block is determined to be D + 1. In this regard, when the allowed division depth (N) is D + 3, an additional division can be performed on the first sub-block and the third sub-block, and two additional divisions can be performed on the second sub-block. As another example, an additional division can be performed on the first sub-block and the third sub-block, but only the division pattern that allows the depth of the sub-block to increase by 1 is allowed. That is, since there is a division pattern that increases the depth of the sub-block by 2 when performing ternary division on the corresponding sub-block, ternary division can be not used, and the division pattern that allows the depth of the sub-block to increase by 1 (such as binary division) can be allowed. That is, the depth of the block as a leaf node can be set to a value not exceeding the division depth.
[0359] According to an embodiment, the video encoding device 1700 and the video decoding device 1900 may only preset the maximum size and the minimum size of the coding / decoding unit, and may not signal the allowed partitioning depth. In this case, the allowed partitioning depth for quadtree partitioning, binary partitioning, and ternary partitioning reaches the minimum size of the coding / decoding unit and does not signal a specifically allowed partitioning depth. However, even in this case, information about the partitioning depth may be stored in the storage device for the execution of other modules.
[0360] In a splitting structure that allows binary partitioning and ternary partitioning, when a constraint is imposed on the maximum size of the coding / decoding unit for each of binary partitioning and ternary partitioning (e.g., when binary partitioning or ternary partitioning is not performed with a size greater than the maximum size of the coding / decoding unit), the value of the maximum size of the coding / decoding unit for ternary partitioning may be set to always be equal to or less than the value of the maximum size of the coding / decoding unit for binary partitioning. As a specific example, when the value of the maximum size of the coding / decoding unit for binary partitioning is 64, the value of the maximum size of the coding / decoding unit for ternary partitioning may be equal to or less than 64, i.e., 32.
[0361] According to an embodiment, the video encoding device 1700 and the video decoding device 1900 may only allow binary partitioning and ternary partitioning in coding / decoding units having a fixed size or smaller by presetting the maximum size of the coding / decoding unit for binary partitioning and ternary partitioning. As a specific example, it may always be only allowed to perform binary partitioning and ternary partitioning on sides with a length of 64 or less.
[0362] According to an embodiment, the video encoding device 1700 and the video decoding device 1900 may use the maximum transform size as a reference when designing the hardware pipeline. In this case, a constraint may be imposed on the partitioning such that the number of blocks with a longer side greater than the maximum transform size relative to a block does not exceed (the maximum size of the codec unit) / (the maximum transform size) within the maximum codec unit. For example, when the maximum size of the codec unit is 128 and the maximum transform size is 64, in a 128x128-sized maximum codec unit, 128 / 64 blocks (i.e., at most two blocks) may be allowed, and each of the two blocks has at least two sides of length 128 that are greater than 64. Here, since a block with a side length of 128 has a maximum transform size of 64, the transform should be performed by dividing one side of the block with a length of 128. That is, since a block with a side length of 128 includes two transform blocks with the maximum transform size, two pipeline data units are required for the pipeline design, and thus at most two blocks may be allowed by default. Specifically, when a ternary partitioning is performed on a 128x128-sized maximum codec unit at a ratio of 1:2:1, three blocks with a side length of 128 are generated, and thus such a ternary partitioning may not be allowed. Alternatively, when a horizontal binary partitioning is performed again on each sub-block (128x64) generated by performing a vertical binary partitioning on a 128x128-sized maximum codec unit at a ratio of 1:1, three or more blocks with a side length of 128 are generated, and thus the binary partitioning of these sub-blocks is not allowed.
[0363] In a block structure where partitioning is performed using quadtree partitioning, binary partitioning, and ternary partitioning, with respect to the maximum transform size, ternary partitioning may not be allowed for blocks with sides greater than the maximum transform size, and ternary partitioning may be allowed only for blocks with an aspect ratio of 1:1, 1:2, and 2:1. As a specific example, when the maximum transform size is 64, for a 128x128-sized block, ternary partitioning is not allowed by default, and ternary partitioning is allowed only for blocks with an aspect ratio of 1:1, 1:2, and 2:1. Therefore, since binary partitioned sub-blocks (blocks with an aspect ratio of 1:2 or 2:1, i.e., blocks of size 128x64 or 64x128) already have an aspect ratio of 1:2 or 2:1, binary partitioning of the longer side may be allowed.
[0364] In a structure that allows splitting blocks generated by quadtree partitioning using binary partitioning and ternary partitioning, the allowed partitioning depths for binary partitioning and ternary partitioning can be defined. In this case, the allowed partitioning depths for binary partitioning and ternary partitioning can be defined depending on the depth of the quadtree partitioning (or the block size of the blocks generated by quadtree partitioning). For example, when the depth of the blocks generated by quadtree partitioning is between 0 and 2, the allowed partitioning depths for binary partitioning and ternary partitioning in the blocks generated by quadtree partitioning can be determined to be 2. When the depth of the blocks generated by quadtree partitioning is between 3 and the last depth or the minimum size allowed for the blocks generated by quadtree partitioning, the allowed partitioning depths for binary partitioning and ternary partitioning can be set to 3.
[0365] As another example, when the depth of the blocks generated by quadtree partitioning is between 0 and 2, the allowed partitioning depths for binary partitioning and ternary partitioning can be set to 3. When the depth of the blocks generated by quadtree partitioning is between 3 and the last depth or the minimum size allowed for the blocks generated by quadtree partitioning, the allowed partitioning depths for binary partitioning and ternary partitioning can be set to 2.
[0366] In a method of independently splitting a luminance block and a chrominance block, the partitioning information about the luminance block and the partitioning information about the chrominance block can be sent separately. In the above method, the video decoding device 1900 can apply the parameters for determining the splitting method of the luminance block to the splitting method of the chrominance block as well. As another example, the parameters for the splitting methods of the luminance block and the chrominance block are signaled separately so that different splitting methods can be performed.
[0367] Below, specific examples regarding the size of a picture sample unit will be given. For the luminance block and the chrominance block, the maximum size of the binary partitionable coding / decoding unit can be determined to be the same. In this regard, the maximum size of the binary partitionable coding / decoding unit can be a value pre-agreed upon by the video encoding device 1700 and the video decoding device 1900, or can be a value signaled through a header. The value determined on a sequence basis can be used together in an intra-slice and an inter-slice, or the value determined on a slice basis by signaling for each slice can be used together.
[0368] As another example, for each luminance block and each chrominance block, the maximum size of the binary partitionable coding / decoding unit can be determined differently. In this regard, the maximum size of the binary partitionable coding / decoding unit can be a value pre-agreed upon by the video encoding device 1700 and the video decoding device 1900, or can be a value signaled through a header. In this case, in terms of picture samples, the maximum size of the binary partitionable chrominance block can be larger than the maximum size of the binary partitionable luminance block.
[0369] As another example, in the method of separately splitting luminance blocks and chrominance blocks, when determining the maximum size of a binary-partitionable coding and decoding unit in units of picture samples signaled, the maximum size can be interpreted based on actual luminance blocks and chrominance blocks. For example, when using the 4:2:0 YUV color format and the maximum size of a binary-partitionable coding and decoding unit is determined to be 32, the maximum size of the binary-partitionable coding and decoding unit can be applied in units of luminance samples in the splitting of luminance blocks, and the maximum size of the binary-partitionable coding and decoding unit can be applied in units of chrominance samples in the splitting of chrominance blocks. In this case, in the splitting of chrominance blocks, parameters corresponding to a size twice the width and height of the luminance block relative to picture samples are applied.
[0370] In the above embodiments, the video encoding device 1700 and the video decoding device 1900 may signal the maximum size of a binary-partitionable coding and decoding unit and the maximum size of a ternary-partitionable coding and decoding unit in an integrated manner.
[0371] The following lists embodiments related to the method of splitting blocks, which can be used by the video encoding device 1700 and the video decoding device 1900.
[0372] - In the method of separately splitting luminance blocks and chrominance blocks, for luminance blocks and chrominance blocks, the parameters of the splitting method of the luminance blocks and chrominance blocks may be signaled in an integrated manner, and the splitting method may also be shared between the luminance blocks and chrominance blocks.
[0373] - The parameters of the splitting method in intra slices and inter slices may be integrated and then signaled, and the splitting method may be shared between intra slices and inter slices. By setting parameters in units of sequences, the corresponding splitting method can be shared in all pictures.
[0374] - When the maximum size of a coding and decoding unit is 128x128, the block with the maximum size (allowing binary partitioning) may be fixedly determined as a 64x64-sized coding and decoding unit in intra slices. In addition, the block with the maximum size allowing ternary partitioning may be determined as a 64x64 coding and decoding unit in the same way as binary partitioning, or may be determined as a 32x32-sized coding and decoding unit (which corresponds to 1 / 4 of 128x128). The block with the maximum size (allowing binary partitioning) may be fixedly determined as a 128x128-sized coding and decoding unit in inter slices. In addition, the block with the maximum size allowing ternary partitioning may be determined as a 128x128 coding and decoding unit in the same way as binary partitioning, or may be determined as a 64x64-sized coding and decoding unit (which corresponds to 1 / 4 of 128x128).
[0375] - The maximum size of a trinary partitionable coding unit can be determined based on the maximum size of a binary partitionable coding unit. For example, a size corresponding to 1 / 4 of the maximum size of a binary partitionable coding unit can be determined as the maximum size of a trinary partitionable coding unit. When the maximum size of a binary partitionable coding unit is MxN, the maximum size of a trinary partitionable coding unit can be M / 2xN / 2. That is, the maximum size of a trinary partitionable coding unit can be determined based on signaling of the maximum size of a binary partitionable coding unit.
[0376] - According to an embodiment, the video encoding device 1700 and the video decoding device 1900 can fixedly set the maximum size of a binary partitionable coding unit and the maximum size of a trinary partitionable coding unit without signaling. When applying a method of independently splitting a luminance block and a chrominance block, the maximum size of a binary partitionable block and the maximum size of a trinary partitionable block can also be fixedly set depending on the slice type. In addition, the maximum size of a trinary partitionable block can be determined to be equal to the maximum transform size. As a specific example, for an intra slice and an inter slice, the maximum size of a binary partitionable block can be set differently, but the maximum size of a binary partitionable block in an intra slice can be set to be smaller than the maximum size of a binary partitionable block in an inter slice.
[0377] In addition, when applying a method of independently splitting a luminance block and a chrominance block, the maximum size of a binary partitionable luminance block can be set to be smaller than the maximum size of a binary partitionable chrominance block in the same slice. Similarly, the maximum size of a trinary partitionable luminance block can be set to be smaller than the maximum size of a trinary partitionable chrominance block in the same slice. As a specific example, the maximum size of a binary partitionable block in an intra slice can be set to 32, and the maximum size of a binary partitionable block in an inter slice can be set to 128.
[0378] When applying a method of independently splitting a luminance block and a chrominance block, the maximum size of a binary partitionable chrominance coding unit in an intra slice can be set to 64. In addition, for a coding unit with a side length of 128, only a ratio of 1:2 or 2:1 is allowed for partitioning.
[0379] - For example, the video decoding device 1900 can obtain the following parameters from a bitstream, and the video encoding device 1700 can encode the following parameters and then send the encoded parameters included in the bitstream.
[0380] * The maximum size of a coding unit
[0381] * Maximum size of a binary partitionable coding / decoding unit (applicable to luminance blocks and chrominance blocks) (When applying a method of independently partitioning luminance blocks and chrominance blocks, information on the maximum size of a binary partitionable coding / decoding unit can be shared and used in both luminance blocks and chrominance blocks.)
[0382] * Maximum size of a ternary partitionable coding / decoding unit (applicable to luminance blocks and chrominance blocks) (When applying a method of independently partitioning luminance blocks and chrominance blocks, information on the maximum size of a ternary partitionable coding / decoding unit can be shared and used in both luminance blocks and chrominance blocks.)
[0383] - As another example, the video decoding device 1900 can obtain the following parameters from the bitstream, and the video decoding device 1900 can encode the following parameters and then transmit the encoded parameters included in the bitstream.
[0384] * Maximum size of a coding / decoding unit
[0385] * Maximum sizes of binary partitionable coding / decoding units and ternary partitionable coding / decoding units (applicable to luminance blocks and chrominance blocks) (When applying a method of independently partitioning luminance blocks and chrominance blocks, information on the maximum size of a binary partitionable coding / decoding unit can be shared and used in both luminance blocks and chrominance blocks).
[0386] - In addition, as another example, the video decoding device 1900 can obtain the following parameters from the bitstream, and the video decoding device 1900 can encode the following parameters and then transmit the encoded parameters included in the bitstream.
[0387] * Maximum size of a coding / decoding unit
[0388] * Maximum size of a binary partitionable coding / decoding unit (applicable to luminance blocks and chrominance blocks) (The maximum size of a ternary partitionable coding / decoding unit can be determined by using the maximum size of a binary partitionable coding / decoding unit.)
[0389] - In addition, as another example, the video decoding device 1900 can obtain the following parameters from the bitstream, and the video decoding device 1900 can encode the following parameters and then transmit the encoded parameters included in the bitstream.
[0390] * Maximum size of a coding / decoding unit
[0391] * Maximum sizes of binary partitionable and ternary partitionable luminance coding / decoding units
[0392] * Maximum sizes of binary partitionable and ternary partitionable chrominance coding / decoding units when applying a method of independently partitioning luminance blocks and chrominance blocks
[0393] *When the method of independently splitting luminance blocks and chrominance blocks is not applied, the maximum size of the binary-tree partitionable and ternary-tree partitionable luminance coding / decoding units can be applied to the splitting of chrominance coding / decoding units.
[0394] - Additionally, as another example, the video decoding device 1900 can obtain the following parameters from the bitstream, and the video decoding device 1900 can encode the following parameters and then send the encoded parameters included in the bitstream.
[0395] *The maximum size of coding / decoding units
[0396] *The maximum size of binary-tree partitionable luminance coding / decoding units
[0397] *When the method of independently splitting luminance blocks and chrominance blocks is applied, the maximum size of binary-tree partitionable chrominance coding / decoding units
[0398] *When the method of independently splitting luminance blocks and chrominance blocks is not applied, the maximum size of binary-tree partitionable luminance coding / decoding units can be applied to the splitting of chrominance coding / decoding units.
[0399] *The maximum size of ternary-tree partitionable luminance coding / decoding units
[0400] *When the method of independently splitting luminance blocks and chrominance blocks is applied, the maximum size of ternary-tree partitionable chrominance coding / decoding units
[0401] *When the method of independently splitting luminance blocks and chrominance blocks is not applied, the maximum size of ternary-tree partitionable luminance coding / decoding units can be applied to the splitting of chrominance coding / decoding units.
[0402] - Additionally, as another example, the video decoding device 1900 can obtain the following parameters from the bitstream, and the video decoding device 1900 can encode the following parameters and then send the encoded parameters included in the bitstream.
[0403] *The maximum size of coding / decoding units
[0404] *The maximum size of binary-tree partitionable luminance coding / decoding units in intra slices
[0405] *When the method of independently splitting luminance blocks and chrominance blocks in intra slices is applied, the maximum size of binary-tree partitionable chrominance coding / decoding units
[0406] *The maximum size of ternary-tree partitionable luminance coding / decoding units in intra slices
[0407] *When the method of independently splitting luminance blocks and chrominance blocks in intra slices is applied, the maximum size of ternary-tree partitionable chrominance coding / decoding units
[0408] *Maximum size of a binary partitionable luma codec unit in an inter slice
[0409] *Maximum size of a binary partitionable chroma codec unit when applying a method of independently splitting luma blocks and chroma blocks in an inter slice
[0410] *Maximum size of a ternary partitionable luma codec unit in an inter slice
[0411] *Maximum size of a ternary partitionable chroma codec unit when applying a method of independently splitting luma blocks and chroma blocks in an inter slice
[0412] -In addition to the above embodiments, signaling of the minimum size of a codec unit may also be performed.
[0413] *When there are various splitting methods, the minimum size of a codec unit is not defined for each partitioning mode, but the minimum size of a codec unit can be defined and signaled, and the minimum size of a codec unit is generally used for various partitioning modes. Specifically, the minimum size of a codec unit can be determined as MxN, such as 4x4, etc. When M and N are the same, only information about M can be signaled, and when M and N are different, the value of M and the difference between M and N (or the value of N and the difference between N and M) can be signaled.
[0414] *In addition, a definition of the minimum size of a codec unit can be set for each inter block and each intra block. For example, the minimum size of a codec unit for an intra block (e.g., min_cu_size_intra), the value obtained by applying log2 to the minimum size of a codec unit (e.g., log2_min_cu_size_intra), or the value obtained by applying -2 to the value after applying log2 (e.g., log2_min_cu_size_intra_minus2) can be signaled. In addition, for an inter block similar to an intra block, the minimum size of a codec unit (e.g., min_cu_size_inter), the value obtained by applying log2 to the minimum size of a codec unit (e.g., log2_min_cu_size_inter), or the value obtained by applying -2 to the value after applying log2 (e.g., log2_min_cu_size_inter_minus2) can be signaled.
[0415] *In addition, for each partitioning mode, information about the minimum size of the coding / decoding unit can be signaled. For example, information about the minimum size of the coding / decoding unit allowed for quadtree partitioning, binary partitioning, and ternary partitioning can be signaled separately, and information about the minimum size of the coding / decoding unit allowed for quadtree partitioning and the minimum size of the coding / decoding unit commonly allowed for binary partitioning and ternary partitioning can be signaled.
[0416] - In addition to the above embodiments, an additional allowed partitioning depth can be defined for each partitioning mode. The partitioning depth allowed for quadtree partitioning (e.g., max_qp_depth), the partitioning depth allowed for ternary partitioning (e.g., max_tt_depth), and the partitioning depth allowed for binary partitioning (e.g., max_bt_depth) can be set, and then these partitioning depths can be signaled. As another example, the partitioning depth commonly allowed for binary partitioning and ternary partitioning (e.g., max_btt_depth) can be set, and then this partitioning depth can be signaled.
[0417] - As a specific embodiment, the size of the coding / decoding unit that can be binary partitioned in an intra-frame stripe can be configured to 64 (shared between the luminance block and the chrominance block), the size of the coding / decoding unit that can be ternary partitioned in an intra-frame stripe can be configured to 32 (shared between the luminance block and the chrominance block), the size of the coding / decoding unit that can be binary partitioned in an inter-frame stripe can be configured to 128, and the size of the coding / decoding unit that can be ternary partitioned in an inter-frame stripe can be configured to 64.
[0418] - As a specific embodiment, the maximum size of the coding / decoding unit that can be binary partitioned and the coding / decoding unit that can be ternary partitioned in an intra-frame stripe can be configured to 32, and the maximum size of the coding / decoding unit that can be binary partitioned and the coding / decoding unit that can be ternary partitioned in an inter-frame stripe can be configured to 64.
[0419] - As a specific embodiment, the maximum size of the coding / decoding unit that can be binary partitioned and the coding / decoding unit that can be ternary partitioned in an intra-frame stripe can be configured to 32, the maximum size of the coding / decoding unit that can be binary partitioned in an inter-frame stripe can be configured to 128, and the maximum size of the coding / decoding unit that can be binary partitioned in an inter-frame stripe can be configured to 64. For coding / decoding units with sizes from 128x128 to 64x64, blocks with an aspect ratio of 1:2 or 2:1 can be configured to be the only ones allowed.
[0420] According to an embodiment, the pseudo-code for implementing the above embodiments in a pipeline structure to be used by the video encoding device 1700 and the video decoding device 1900 is shown below. Hereinafter, in the pseudo-code shown in Table 1, the partitioning modes BT, TT, and QT respectively indicate binary partitioning, ternary partitioning, and quadtree partitioning.
[0421] [Table 1]
[0422] max_tt_size / / Maximum size of the coding / decoding unit that can be trinary partitioned
[0423] max_bt_size / / Maximum size of the coding / decoding unit that can be binary partitioned
[0424] width / / Width of the current coding / decoding unit
[0425] height / / Height of the current coding / decoding unit
[0426] log2_width / / log2(width)
[0427] log2_height / / log2(height)
[0428] / / (1. Test for trinary partition in the horizontal direction)
[0429] if (height (height) > max_tt_size)
[0430] TT in horizontal direction is not allowed (Trinary partition in the horizontal direction is not allowed)
[0431] else
[0432] TT in horizontal direction may be allowed (Trinary partition in the horizontal direction may be allowed) / / There may be additional conditions to determine whether trinary partition in the horizontal direction is allowed.
[0433] / / (2. Test for trinary partition in the vertical direction)
[0434] if (width (width) > max_tt_size)
[0435] TT in vertical direction is not allowed (Trinary partition in the vertical direction is not allowed)
[0436] else
[0437] TT in vertical direction may be allowed (Trinary partition in the vertical direction may be allowed) / / There may be additional conditions to determine whether trinary partition in the vertical direction is allowed.
[0438] / / (3. Test for binary partition in the horizontal direction)
[0439] if (abs (log2_height / 2 - log2_width) > 1 && (height > 64 || width >64))
[0440] BT in horizontal direction is not allowed
[0441] else
[0442] BT in horizontal direction is allowed / / There can be additional conditions to determine whether binary partitioning in the horizontal direction is allowed.
[0443] / / (4. Test for binary partition in the vertical direction)
[0444] if (abs (log2_width / 2 - log2_height) > 1 && (height > 64 || width >64))
[0445] BT in vertical direction is not allowed
[0446] else
[0447] BT in vertical direction is allowed / / There can be additional conditions to determine whether binary partitioning in the vertical direction is allowed.
[0448] / / End of table 1
[0449] As another embodiment, Test 1 and Test 2 may be as shown in Table 2. It may be set so that only trifurcated partitioning is allowed in the case of a size of the codec unit (max_tt_size x max_tt_size) or smaller. As an example, in Test 1, even if the width of the current codec unit is greater than max_tt_size, although the height of the codec unit is equal to or less than max_tt_size, the corresponding partitioning mode may be allowed. However, in the case of Table 2 below, even if another side is greater than max_tt_size, the corresponding partitioning mode may not be allowed.
[0450] [Table 2]
[0451] / / (1. Test for trifurcated division in horizontal direction)
[0452] if (height > max_tt_size || width > max_tt_size)
[0453] TT in horizontal direction is not allowed
[0454] else
[0455] TT in horizontal direction may be allowed / / There may be additional conditions to determine whether trifurcations in the horizontal direction are allowed.
[0456] / / (2. Test for the vertical trisection)
[0457] if (width > max_tt_size || height > max_tt_size)
[0458] TT in vertical direction is not allowed
[0459] else
[0460] TT in vertical direction may be allowed / / There may be additional conditions to determine whether trifurcations in the vertical direction are allowed.
[0461] / / End of table 2
[0462] As another embodiment, Test 1 and Test 2 may be as shown in Table 3. When the maximum size max_tt_size of the trifurcated codec unit is less than N, it may be set so that trifurcated division TT is allowed only when the size of the codec unit is (N×N) or smaller. As a specific example, N may be 64. In addition, in this case, the value of max_tt_size may be set to be less than or equal to N. As another example, in this regard, N may be set to the maximum transform size.
[0463] [Table 3]
[0464] / / (1. Test for trifurcated division in horizontal direction)
[0465] if (height > max_tt_size || width > N)
[0466] TT in the horizontal direction is not allowed(Not allowed TT in the horizontal direction)
[0467] else
[0468] TT in the horizontal direction may be allowed(TT in the horizontal direction can be allowed) / / There can be additional conditions to determine whether a horizontal trinary partition is allowed.
[0469] / / (2. Test for vertical trinary partition)
[0470] if (width > max_tt_size || height > N)
[0471] TT in the vertical direction is not allowed(Not allowed TT in the vertical direction)
[0472] else
[0473] TT in the vertical direction may be allowed(TT in the vertical direction can be allowed) / / There can be additional conditions to determine whether a vertical trinary partition is allowed.
[0474] / / End of Table 3
[0475] As another example, Tests 3 and 4 can be as shown in Table 4.
[0476] [Table 4]
[0477] / / (3. Test for horizontal binary partition)
[0478] if (width > height && width > 64)
[0479] BT in the horizontal direction is not allowed(Not allowed BT in the horizontal direction)
[0480] else
[0481] BT in the horizontal direction may be allowed(BT in the horizontal direction can be allowed) / / There can be additional conditions to determine whether a horizontal binary partition is allowed.
[0482] / / (4. Test for vertical binary partition)
[0483] if (height > width && height > 64)
[0484] BT in vertical direction is not allowed (BT in the vertical direction is not permitted)
[0485] else
[0486] BT in vertical direction may be allowed (BT in the vertical direction may be permitted) / / There may be additional conditions to determine whether BT in the vertical direction is allowed.
[0487] / / End of Table 4
[0488] As another embodiment, Tests 3 and 4 can be as shown in Table 5.
[0489] [Table 5]
[0490] / / (3. Test for binary partitioning in the horizontal direction)
[0491] if (width > 64 && width > height)
[0492] BT in horizontal direction is not allowed (BT in the horizontal direction is not permitted)
[0493] else
[0494] BT in horizontal direction may be allowed (BT in the horizontal direction may be permitted) / / There may be additional conditions to determine whether BT in the horizontal direction is allowed.
[0495] / / (4. Test for binary partitioning in the vertical direction)
[0496] if (height > 64 && height > width)
[0497] BT in vertical direction is not allowed (BT in the vertical direction is not permitted)
[0498] else
[0499] BT in vertical direction may be allowed / / There may be additional conditions to determine whether binary partitioning in the vertical direction is allowed.
[0500] / / End of table 5
[0501] As another example, Tests 3 and 4 may be as shown in Table 6.
[0502] [Table 6]
[0503] / / (3. Test for binary partition in horizontal direction)
[0504] if (width > 64 && log2_width - log2_height == 1)
[0505] BT in horizontal direction is not allowed
[0506] else
[0507] BT in horizontal direction may be allowed / / There may be additional conditions to determine whether binary partitioning in the horizontal direction is allowed.
[0508] / / (4. Test for binary partition in the vertical direction)
[0509] if (height > 64 && log2_height - log2_width == 1)
[0510] BT in vertical direction is not allowed
[0511] else
[0512] BT in vertical direction may be allowed / / There may be additional conditions to determine whether binary partitioning in the vertical direction is allowed.
[0513] / / End of table 6
[0514] As another example, Tests 3 and 4 may be as shown in Table 7.
[0515] [Table 7]
[0516] / / (3. Test for binary partitioning in the horizontal direction)
[0517] if (width > 64 && width != height)
[0518] BT in horizontal direction is not allowed (Horizontal BT is not allowed)
[0519] else
[0520] BT in horizontal direction may be allowed (Horizontal BT may be allowed) / / There may be additional conditions to determine whether horizontal binary partitioning is allowed.
[0521] / / (4. Test for binary partitioning in the vertical direction)
[0522] if (height > 64 && height != width)
[0523] BT in vertical direction is not allowed (Vertical BT is not allowed)
[0524] else
[0525] BT in vertical direction may be allowed (Vertical BT may be allowed) / / There may be additional conditions to determine whether vertical binary partitioning is allowed.
[0526] / / End of Table 7
[0527] As another embodiment, Tests 3 and 4 can be as shown in Table 8.
[0528] [Table 8]
[0529] / / (3. Test for binary partitioning in the horizontal direction)
[0530] if (width > 64 && width - height != 0)
[0531] BT in horizontal direction is not allowed (Horizontal BT is not allowed)
[0532] else
[0533] BT in horizontal direction may be allowed / / There may be additional conditions to determine whether binary partitioning in the horizontal direction is allowed.
[0534] / / (4. Test for binary partition in the vertical direction)
[0535] if (height > 64 && height - width != 0)
[0536] BT in vertical direction is not allowed
[0537] else
[0538] BT in vertical direction may be allowed / / There may be additional conditions to determine whether binary partitioning in the vertical direction is allowed.
[0539] / / End of table 8
[0540] As another embodiment, Test 3 and Test 4 may be as shown in Table 9. In the following embodiments, maximumtransform size indicates the maximum transform size.
[0541] [Table 9]
[0542] / / (3. Test for binary partition in horizontal direction)
[0543] if(height == 64 && width == 128)
[0544] BT in horizontal direction is not allowed
[0545] else
[0546] BT in horizontal direction may be allowed / / There may be additional conditions to determine whether binary partitioning in the horizontal direction is allowed.
[0547] / / (4. Test for binary partition in the vertical direction)
[0548] if (height == 128 && width == 64)
[0549] BT in the vertical direction is not allowed (BT in the vertical direction is not permitted).
[0550] else
[0551] BT in the vertical direction may be allowed (BT in the vertical direction may be permitted) / / Additional conditions can be used to determine whether BT in the vertical direction is allowed.
[0552] / / End of Table 9
[0553] As another example, Tests 3 and 4 can be as shown in Table 10.
[0554] [Table 10]
[0555] / / (3. Test for binary tree partitioning in the horizontal direction)
[0556] if (height == maximum transform size && width == CTU size)
[0557] BT in the horizontal direction is not allowed (BT in the horizontal direction is not permitted).
[0558] else
[0559] BT in the horizontal direction may be allowed (BT in the horizontal direction may be permitted) / / Additional conditions can be used to determine whether BT in the horizontal direction is allowed.
[0560] / / (4. Test for binary tree partitioning in the vertical direction)
[0561] if (height == CTU size && width == maximum transform size)
[0562] BT in the vertical direction is not allowed (BT in the vertical direction is not permitted).
[0563] else
[0564] BT in the vertical direction may be allowed (BT in the vertical direction may be permitted) / / Additional conditions can be used to determine whether BT in the vertical direction is allowed.
[0565] / / End of Table 10
[0566] As another example, Tests 3 and 4 can be as shown in Table 11.
[0567] [Table 11]
[0568] / / (3. Test for binary partitioning in the horizontal direction)
[0569] if (height == maximum transform size && width > maximum transform size)
[0570] BT in horizontal direction is not allowed (Horizontal BT is not allowed)
[0571] else
[0572] BT in horizontal direction may be allowed (Horizontal BT may be allowed) / / There may be additional conditions to determine whether to allow binary partitioning in the horizontal direction.
[0573] / / (4. Test for binary partitioning in the vertical direction)
[0574] if (height > maximum transform size && width == maximum transform size)
[0575] BT in vertical direction is not allowed (Vertical BT is not allowed)
[0576] else
[0577] BT in vertical direction may be allowed (Vertical BT may be allowed) / / There may be additional conditions to determine whether to allow binary partitioning in the vertical direction.
[0578] / / End of Table 11
[0579] As another example, Tests 3 and 4 can be as shown in Table 12.
[0580] [Table 12]
[0581] / / (3. Test for horizontal binary partitioning)
[0582] if (height == 64 && width > 64)
[0583] BT in horizontal direction is not allowed (BT in the horizontal direction is not permitted)
[0584] else
[0585] BT in horizontal direction may be allowed (BT in the horizontal direction may be permitted) / / There may be additional conditions to determine whether BT in the horizontal direction is allowed.
[0586] / / (4. Test for binary tree partitioning in the vertical direction)
[0587] if (height > 64 && width == 64)
[0588] BT in vertical direction is not allowed (BT in the vertical direction is not permitted)
[0589] else
[0590] BT in vertical direction may be allowed (BT in the vertical direction may be permitted) / / There may be additional conditions to determine whether BT in the vertical direction is allowed.
[0591] / / End of Table 12
[0592] In the above embodiments (Tables 1 to 12), it can be considered that various expression methods for designing a pipeline structure in units of a maximum transformation size of 64x64 have been provided.
[0593] Similar to the above embodiments, a method for partitioning a codec unit at the contour of an image can be determined in combination with the design of the pipeline structure. When a codec unit crosses the contour of an image, the codec unit can be arbitrarily partitioned by using binary tree partitioning, and as shown in the foregoing embodiments, binary tree partitioning can be allowed or prohibited under preset conditions. As another example, when both quadtree partitioning and binary tree partitioning are allowed at the contour of an image but the preset conditions are not met, it can be set to use quadtree partitioning. As a specific example, for a codec unit that crosses the contour of an image, Conditions 3 and 4 can be changed as shown in Table 13.
[0594] [Table 13]
[0595] / / (3. Test for binary tree partitioning in the horizontal direction)
[0596] if (height == 64 && width > 64)
[0597] QT is used (use QT)
[0598] else
[0599] BT in horizontal direction may be used / / There may be additional conditions to determine whether binary partitioning in the horizontal direction is allowed.
[0600] / / (4. Test for binary partition in the vertical direction)
[0601] if(height > 64 && width == 64)
[0602] QT is used (use QT)
[0603] else
[0604] BT in vertical direction may be used / / There may be additional conditions to determine whether binary partitioning in the vertical direction is allowed.
[0605] / / End of table 13
[0606] For reference, the division of the codec unit that crosses the outline of the image and the division of the codec unit that does not cross the outline of the image are as follows. For the codec unit that crosses the outline of the image, it can be considered whether to use the division mode, and for the codec unit that does not cross the outline of the image, it can be considered whether to allow the division mode. In another embodiment, when the current codec unit is determined by performing binary division on the codec unit of higher depth, after the binary division, the quadtree division of the current codec unit may not be allowed, and the binary division of the current codec unit in the same direction may also be limited. As an exception, the quadtree division of non-square codec units may be allowed. In addition, when the codec unit has been binary divided in another direction, because the binary division in a specific direction is difficult to perform, the division can be performed in a direction different from the division direction of the previously performed binary division. That is, when the binary division in the vertical direction has been performed because it is impossible to perform binary division in the horizontal direction, the binary division in the horizontal direction can be allowed subsequently. This can be represented by pseudo code, as shown in Table 14.
[0607] [Table 14]
[0608] / / (3. Test for binary partitioning in the horizontal direction)
[0609] if (height == 64 && width > 64)
[0610] BT in vertical direction is used (Use BT in the vertical direction)
[0611] else
[0612] BT in horizontal direction may be used (BT in the horizontal direction can be used) / / There can be additional conditions to determine whether binary partitioning in the horizontal direction is allowed.
[0613] / / (4. Test for binary partitioning in the vertical direction)
[0614] if (height > 64 && width == 64)
[0615] BT in horizontal direction is used (Use BT in the horizontal direction)
[0616] else
[0617] BT in vertical direction may be used (BT in the vertical direction can be used) / / There can be additional conditions to determine whether binary partitioning in the vertical direction is allowed.
[0618] / / End of Table 14
[0619] In another embodiment, Conditions 3 and 4 can be modified as shown in Table 15.
[0620] [Table 15]
[0621] / / (3. Test for binary partitioning in the horizontal direction)
[0622] if (width != height && width > 64)
[0623] QT is used (Use QT)
[0624] else
[0625] BT in horizontal direction may be used (BT in the horizontal direction can be used) / / There can be additional conditions to determine whether binary partitioning in the horizontal direction is allowed.
[0626] / / (4. Test for binary partitioning in the vertical direction)
[0627] if (width != height && width == 64)
[0628] QT is used (Use QT)
[0629] else
[0630] BT in vertical direction may be used (Use BT in the vertical direction) / / There can be additional conditions to determine whether binary partitioning in the vertical direction is allowed.
[0631] / / End of Table 15
[0632] In another embodiment, for non-square coding / decoding units, binary partitioning may be allowed, as shown in Table 16.
[0633] [Table 16]
[0634] / / (3. Test for binary partitioning in the horizontal direction)
[0635] if (width != height && width > 64)
[0636] BT in vertical is used (Use BT in the vertical direction)
[0637] else
[0638] BT in horizontal direction may be used (BT in the horizontal direction may be used) / / There can be additional conditions to determine whether binary partitioning in the horizontal direction is allowed.
[0639] / / (4. Test for binary partitioning in the vertical direction)
[0640] if (width != height && width == 64)
[0641] BT in horizontal is used (Use BT in the horizontal direction)
[0642] else
[0643] BT in vertical direction may be used (Use BT in the vertical direction) / / There can be additional conditions to determine whether binary partitioning in the vertical direction is allowed / /
[0644] / / End of table 16
[0645] The above-mentioned specific conditions for various division methods can be used together with various conditions for determining the division mode. In addition, when the maximum codec unit includes the outline of the image, the maximum codec unit is arbitrarily divided once using quadtree division, and the division method according to the division information can be applied to the codec unit generated by the quadtree division. As an example, when the size of the maximum codec unit is 128x128 and the maximum transform size is 64, the maximum codec unit is arbitrarily divided into four codec units of 64x64 size, and then the division method can be performed on the codec unit of 64x64 size according to the division information based on the division mode.
[0646] [Table 17]
[0647] if(width > 64 && height > 64)
[0648] QT split is used
[0649] / / End of table 17
[0650] As another example, when the maximum codec unit includes the right contour of the image, the maximum codec unit is vertically binary divided once, and when the codec unit generated by the vertical binary division requires additional division, only horizontal binary division may be allowed. Similarly, when the maximum codec unit includes the lower contour of the image, the maximum codec unit is horizontally binary divided once, and when the codec unit generated by the horizontal binary division requires additional division, only vertical binary division may be allowed.
[0651] According to an embodiment, when half or more of the codec unit located at the outline of the image is included in the image, additional division may be allowed in consideration of the number of pipeline modules allowed by the pipeline structure. For example, under the assumption that the number of pipeline modules in the codec unit of size 128x128 is 4, a case where the maximum transform size is 64 may be assumed. When the area of the codec unit of size 64x128 is located within the outline of the image, binary division in the vertical direction may be allowed so as to allow the generation of two codec units of size 32x128. In this regard, additional binary division of the generated codec unit in the vertical direction may not be allowed.
[0652] Hereinafter, the SPS is modified based on the working draft 2.0 of the Versatile Video Coding (VVC) standard so that information on the size of a block limited in various partition modes can be signaled.
[0653] Figure 30Shows the syntax signaled through SPS according to an embodiment. According to an embodiment, the video encoding device 1700 may encode information n about the size of blocks restricted in various partitioning modes, and include the encoded information in the Figure 30 SPS. According to an embodiment, the video decoding device 1900 may obtain information about the size of blocks restricted in various partitioning modes from the Figure 30 SPS.
[0654] Through the SPS (seq_parameter_set_rbsp()), information about the maximum size of the coding / decoding unit that can be binary partitioned (log2_diff_ctu_max_bt_size_intra, log2_diff_ctu_max_bt_size_inter) and information about the difference between the maximum size and the minimum size of the coding / decoding unit that can be binary partitioned (log2_diff_ctu_max_bt_size_intra, log2_diff_ctu_max_bt_size_inter) may be signaled through the intra type and the inter type. In addition, information about the maximum size of the coding / decoding unit that can be ternary partitioned (log2_diff_ctu_max_tt_size_intra, log2_diff_ctu_max_tt_size_inter) and information about the difference between the maximum size and the minimum size of the coding / decoding unit that can be ternary partitioned (log2_diff_ctu_max_tt_size_intra, log2_diff_ctu_max_tt_size_inter) may be signaled through the intra stripe and the inter stripe and through the SPS.
[0655] In addition, information indicating whether to determine the partitioning mode separately for the luminance block and the chrominance block (qtbtt_dual_tree_inter_flag) can be signaled through the SPS. When qtbtt_dual_tree_inter_fla indicates to determine the partitioning mode separately for the luminance block and the chrominance block, information on the difference between the maximum size and the minimum size of the binary-partitionable chrominance coding unit (log2_diff_ctu_max_bt_size_chroma_intra, log2_diff_ctu_max_bt_size_chroma_inter) can be signaled through the intra slice and the inter slice, and through the SPS. In addition, information on the difference between the maximum size and the minimum size of the ternary-partitionable chrominance coding unit (log2_diff_ctu_max_tt_size_chroma_intra, log2_diff_ctu_max_tt_size_chroma_inter) can be signaled through the intra slice and the inter slice, and through the SPS.
[0656] Instead Figure 30 in the embodiment provided in Figure 30 wherein information on the maximum size of the binary-partitionable coding unit or the ternary-partitionable coding unit is signaled, information on the minimum size of the binary-partitionable coding unit and information on the minimum size of the ternary-partitionable coding unit can be signaled.
[0657] In another embodiment, signaling of information on the size of the binary-partitionable / ternary-partitionable coding unit may not be performed through binary partitioning and ternary partitioning, but may be performed using common parameters.
[0658] In addition, values set additionally for each slice can be updated and signaled at the slice header level.
[0659] The present invention has been specifically shown and described with reference to embodiments of the present invention. In this regard, those of ordinary skill in the art will understand that various changes can be made to the forms and details thereof without departing from the scope of the present disclosure. Therefore, the embodiments should be considered in a descriptive sense only and not for the purpose of limitation. The scope of the present invention is defined not by the detailed description of the present invention but by the appended claims, and all differences within the scope will be construed as being included in the present disclosure.
[0660] Meanwhile, the above embodiments of the present invention can be written as a computer-executable program and can be implemented in a general-purpose digital computer that executes the program by using a computer-readable recording medium. Examples of the computer-readable storage medium include magnetic storage media (such as ROM, floppy disks, hard disks, etc.), optical storage media (such as CD-ROM or DVD), and the like.
Claims
1. A video decoding method, comprising: identifying that the boundary of a first coded decoding unit includes the right boundary of an image; when the width of the first coded decoding unit is greater than the maximum transform size and the height of the first coded decoding unit is equal to the maximum transform size, determining that horizontal binary partitioning of the first coded decoding unit is not allowed and vertical binary partitioning of the first coded decoding unit is allowed; when horizontal binary partitioning of the first coded decoding unit is not allowed and vertical binary partitioning of the first coded decoding unit is allowed, determining a second coded decoding unit by dividing the width of the first coded decoding unit into two halves in the vertical direction, and decoding the second coded decoding unit; when the height of the first coded decoding unit is greater than the maximum transform size and the width of the first coded decoding unit is equal to the maximum transform size, determining that vertical binary partitioning of the first coded decoding unit is not allowed and horizontal binary partitioning of the first coded decoding unit is allowed; when vertical binary partitioning of the first coded decoding unit is not allowed and horizontal binary partitioning of the first coded decoding unit is allowed, determining a third coded decoding unit by dividing the height of the first coded decoding unit into two halves in the horizontal direction, and decoding the third coded decoding unit; and when the height of the first coded decoding unit is greater than the maximum size of a coded decoding unit that can be ternary-partitioned, determining that ternary partitioning of the first coded decoding unit in the horizontal direction is not allowed, and when the width of the first coded decoding unit is greater than the maximum size of a coded decoding unit that can be ternary-partitioned, determining that ternary partitioning of the first coded decoding unit in the vertical direction is not allowed.
2. A video encoding method, comprising: identifying that the boundary of a first coded decoding unit includes the right boundary of an image; when the width of the first coded decoding unit is greater than the maximum transform size and the height of the first coded decoding unit is equal to the maximum transform size, determining that horizontal binary partitioning of the first coded decoding unit is not allowed and vertical binary partitioning of the first coded decoding unit is allowed; when horizontal binary partitioning of the first coded decoding unit is not allowed and vertical binary partitioning of the first coded decoding unit is allowed, determining a second coded decoding unit by dividing the width of the first coded decoding unit into two halves in the vertical direction, and encoding the second coded decoding unit; when the height of the first coded decoding unit is greater than the maximum transform size and the width of the first coded decoding unit is equal to the maximum transform size, determining that vertical binary partitioning of the first coded decoding unit is not allowed and horizontal binary partitioning of the first coded decoding unit is allowed; when vertical binary partitioning of the first coded decoding unit is not allowed and horizontal binary partitioning of the first coded decoding unit is allowed, determining a third coded decoding unit by dividing the height of the first coded decoding unit into two halves in the horizontal direction, and encoding the third coded decoding unit; when the height of the first coded decoding unit is greater than the maximum size of a coded decoding unit that can be ternary-partitioned, determining that ternary partitioning of the first coded decoding unit in the horizontal direction is not allowed, and when the width of the first coded decoding unit is greater than the maximum size of a coded decoding unit that can be ternary-partitioned, determining that ternary partitioning of the first coded decoding unit in the vertical direction is not allowed; and generating a bitstream including the encoded data of the second coded decoding unit or the encoded data of the third coded decoding unit.
3. A method for transmitting a bitstream generated by the video encoding method of claim 2.