Video decoding method and apparatus, and video encoding method and apparatus

By using a historical affine parameter group candidate list and motion vector candidate list reset mechanism during video encoding and decoding, the problems of excessive buffers and low parallel processing efficiency are solved, achieving more efficient video processing.

CN118632014APending Publication Date: 2024-09-10SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410851630.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-09-20
Filing Date
2019-09-19
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing video encoding and decoding technologies suffer from problems such as excessive buffer size and low parallel processing efficiency when processing high-resolution or high-definition images, especially when applying affine modes.

Method used

By receiving information about whether an affine mode is applied to the current block, the affine parameter set is determined using a candidate list of affine parameter sets based on history. When determining whether the current block is the first block to be reconstructed or encoded in a pre-defined region, the motion vector candidate list is reset, and predictions are made based on the motion information of neighboring blocks.

Benefits of technology

This reduces the number of buffers and improves the efficiency of parallel processing in video encoding and decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118632014A
    Figure CN118632014A
Patent Text Reader

Abstract

Provided are a method and apparatus for decoding a video, the method and apparatus: receiving information on whether an affine mode is applied to a current block during a video encoding and decoding process; when the information on whether the affine mode is applied indicates that the affine mode is applied, determining an affine parameter group according to a history-based affine parameter group candidate list in which the affine parameter group of one or more blocks reconstructed in the affine mode prior to the current block is stored; and predicting the current block based on the affine parameter set.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with the application date of September 19, 2019, the Chinese application number 201980074840.3, and the invention name “Video decoding method and device and video encoding method and device”. Technical Field

[0002] The present disclosure relates to a video decoding method and a video decoding device, and more specifically to a video encoding method and a device and a video decoding method and a device, wherein, when an affine mode is to be applied to a current block, an affine parameter group is determined according to a history-based affine parameter group candidate list, in which affine parameter groups of one or more blocks reconstructed in the affine mode before the current block are stored, and prediction is performed on the current block based on the determined affine parameter group.

[0003] In addition, the present disclosure relates to a video encoding method and apparatus and a video decoding method and apparatus, wherein: it is determined whether a current block is a block to be reconstructed first in a predetermined area including the current block; when the current block is a block to be reconstructed first, a history-based motion vector candidate list is reset and prediction is performed on the current block based on motion information of neighboring blocks of the current block, in which motion vectors of blocks reconstructed before the current block are stored; when the current block is not a block to be reconstructed first, prediction is performed on the current block based on motion information of neighboring blocks of the current block and the history-based motion vector candidate list. Background Art

[0004] Image data is encoded by a codec according to a preset data compression standard (eg, the Moving Picture Experts Group (MPEG) standard), and then stored in a recording medium or transmitted through a communication channel in the form of a bit stream.

[0005] With the development and spread of hardware capable of reproducing and storing high-resolution or high-definition image content, there is an increasing demand for codecs for efficiently encoding or decoding high-resolution or high-definition image content. The encoded image content can be reproduced by decoding it. Recently, methods for efficiently compressing such high-resolution or high-definition image content have been implemented. For example, it has been proposed that image compression techniques can be effectively implemented by segmenting the image or rendering data to be encoded by an arbitrary method.

[0006] As one of the techniques for rendering data, a method of performing prediction on a current block by using surrounding information of the current block is generally used. Summary of the invention

[0007] Technical issues

[0008] A method and apparatus are provided, wherein, during video encoding and decoding, when an affine mode is to be applied to a current block, an affine parameter group is determined based on a history-based affine parameter group candidate list, in which affine parameter groups of one or more blocks reconstructed in an affine mode before the current block are stored, and prediction is performed on the current block based on the determined affine parameter group.

[0009] A method and apparatus are also provided, wherein: during video encoding and decoding, it is determined whether a current block is a block to be reconstructed first in a predetermined area including the current block; when the current block is a block to be reconstructed first, a history-based motion vector candidate list is reset and prediction is performed on the current block based on motion information of neighboring blocks of the current block, wherein the motion vectors of blocks reconstructed before the current block are stored in the history-based motion vector candidate list; and when the current block is not a block to be reconstructed first, prediction is performed on the current block based on the motion information of neighboring blocks of the current block and the history-based motion vector candidate list.

[0010] A method and apparatus are also provided, wherein: when a current block is a block to be decoded first in a predetermined area including the current block, a motion vector predictor of the current block is determined based on motion information of neighboring blocks of the current block except for motion information stored in a history-based motion vector candidate list; and when the current block is not a block to be decoded first in a predetermined area including the current block, a motion vector predictor of the current block is determined based on motion information of neighboring blocks of the current block and at least one of motion information stored in the history-based motion vector candidate list, and wherein the predetermined area is a row including a maximum coding unit, wherein the motion vector predictor of the current block is stored in the history-based motion vector candidate list.

[0011] A method and apparatus are also provided, wherein: when a current block is a block to be encoded first in a predetermined area including the current block, a motion vector predictor of the current block is determined based on motion information of neighboring blocks of the current block except for motion information stored in a history-based motion vector candidate list; and when the current block is not a block to be encoded first in a predetermined area including the current block, a motion vector predictor of the current block is determined based on motion information of neighboring blocks of the current block and at least one of motion information stored in the history-based motion vector candidate list, and wherein the predetermined area is a row including a maximum coding unit, wherein the motion vector predictor of the current block is stored in the history-based motion vector candidate list.

[0012] Solution to the problem

[0013] In order to overcome the above-mentioned technical problems, the video decoding method proposed in the present disclosure includes: receiving information about whether to apply an affine mode to a current block; when the information about whether to apply the affine mode indicates that the affine mode is to be applied, determining an affine parameter group according to a history-based affine parameter group candidate list, in which affine parameter groups of one or more blocks reconstructed in the affine mode before the current block are stored; and performing prediction on the current block based on the affine parameter group.

[0014] In order to overcome the above-mentioned technical problems, the video decoding device proposed in the present disclosure includes: a memory; and at least one processor connected to the memory, and the at least one processor is configured to: receive information about whether to apply an affine mode to a current block; when the information about whether to apply the affine mode indicates that the affine mode is to be applied, determine an affine parameter group according to a history-based affine parameter group candidate list, in which affine parameter groups of one or more blocks reconstructed in the affine mode before the current block are stored; and perform prediction on the current block based on the affine parameter group.

[0015] In order to overcome the above-mentioned technical problems, the video encoding method proposed in the present disclosure includes: determining whether to apply an affine mode to a current block; when it is determined that the affine mode is to be applied to the current block, determining an affine parameter group according to a history-based affine parameter group candidate list, in which the affine parameter groups of one or more blocks encoded in the affine mode before the current block are stored; performing prediction on the current block based on the affine parameter group; and encoding information about whether the affine mode is applied to the current block.

[0016] In order to overcome the above-mentioned technical problems, the video encoding device proposed in the present disclosure includes: a memory, and at least one processor connected to the memory, and the at least one processor is configured to: determine whether to apply an affine mode to a current block; when it is determined that the affine mode is to be applied to the current block, determine an affine parameter group according to a history-based affine parameter group candidate list, in which affine parameter groups of one or more blocks encoded in the affine mode before the current block are stored; perform prediction on the current block based on the affine parameter group; and encode information about whether the affine mode is applied to the current block.

[0017] In order to overcome the above technical problems, the video decoding method proposed in the present disclosure includes: determining whether a current block is a block to be reconstructed first in a predetermined area including the current block; when the current block is a block to be reconstructed first, resetting a history-based motion vector candidate list and performing prediction on the current block based on motion information of neighboring blocks of the current block, in which motion vectors of blocks reconstructed before the current block are stored; and when the current block is not a block to be reconstructed first, performing prediction on the current block based on motion information of neighboring blocks of the current block and the history-based motion vector candidate list.

[0018] In order to overcome the above technical problems, the video decoding device proposed in the present disclosure includes: a memory; and at least one processor connected to the memory, and the at least one processor is configured to: determine whether a current block is a block to be reconstructed first in a predetermined area including the current block; when the current block is a block to be reconstructed first, reset a history-based motion vector candidate list and perform prediction on the current block based on motion information of neighboring blocks of the current block, in which motion vectors of blocks reconstructed before the current block are stored; and when the current block is not a block to be reconstructed first, perform prediction on the current block based on the motion information of neighboring blocks of the current block and the history-based motion vector candidate list.

[0019] In order to overcome the above technical problems, the video encoding method proposed in the present disclosure includes: determining whether a current block is a block to be encoded first in a predetermined area including the current block; when the current block is the block to be encoded first, resetting a history-based motion vector candidate list and performing prediction on the current block based on motion information of neighboring blocks of the current block, wherein the motion vectors of blocks encoded before the current block are stored in the history-based motion vector candidate list; and when the current block is not the block to be encoded first, performing prediction on the current block based on the motion information of the neighboring blocks of the current block and the history-based motion vector candidate list.

[0020] In order to overcome the above technical problems, the video encoding device proposed in the present disclosure includes: a memory; and at least one processor connected to the memory, and the at least one processor is configured to: determine whether a current block is a block to be encoded first in a predetermined area including the current block; when the current block is the block to be encoded first, reset a history-based motion vector candidate list and perform prediction on the current block based on motion information of neighboring blocks of the current block, wherein the motion vectors of blocks encoded before the current block are stored in the history-based motion vector candidate list; and when the current block is not the block to be encoded first, perform prediction on the current block based on the motion information of the neighboring blocks of the current block and the history-based motion vector candidate list.

[0021] Disclosure of beneficial effects

[0022] During the video encoding and decoding process, when an affine mode is to be applied to a current block, an affine parameter group is determined based on a history-based affine parameter group candidate list, in which affine parameter groups of one or more blocks reconstructed in the affine mode before the current block are stored, and prediction is performed on the current block based on the determined affine parameter group, thereby reducing the number of buffers.

[0023] In addition, when the current block is a block to be reconstructed first in a predetermined area including the current block, the history-based motion vector candidate list (in which motion vectors of blocks reconstructed before the current block are stored) is reset and the history-based motion vector candidate list is used for each predetermined area, and thus the number of buffers can be reduced and efficient parallel processing can be performed. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 A schematic block diagram of an image decoding device according to an embodiment is shown.

[0025] Figure 2 A flowchart of an image decoding method according to an embodiment is shown.

[0026] Figure 3 A process of determining at least one coding unit by splitting a current coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0027] Figure 4 A process of determining at least one coding unit by dividing a non-square coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0028] Figure 5 A process of splitting a coding unit based on at least one of block shape information and division shape pattern information, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0029] Figure 6 A method of determining a preset coding unit from among an odd number of coding units, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0030] Figure 7 An order in which a plurality of coding units are processed when an image decoding apparatus determines a plurality of coding units by splitting a current coding unit according to an embodiment is illustrated.

[0031] Figure 8 A process of determining that a current coding unit is to be split into an odd number of coding units, performed by an image decoding apparatus when coding units are not processable in a preset order, according to an embodiment is illustrated.

[0032] Fig. 9 A process of determining at least one coding unit by splitting a first coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0033] Fig.10 It is shown that shapes into which the second coding unit can be divided are restricted when a second coding unit having a non-square shape, which is determined when the image decoding apparatus divides the first coding unit, satisfies a preset condition according to an embodiment.

[0034] Fig.11 A process of splitting a square coding unit when division shape pattern information indicates that the square coding unit is not split into four square coding units, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0035] Fig.12 It is shown that a processing order among a plurality of coding units according to an embodiment may be changed depending on a process of splitting the coding units.

[0036] Fig.13 A process of determining a depth of a coding unit as a shape and a size of a coding unit change when a coding unit is recursively split so that a plurality of coding units are determined according to an embodiment is illustrated.

[0037] Fig.14 Depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.

[0038] Fig.15 It is shown that a plurality of coding units are determined based on a plurality of preset data units included in a picture according to an embodiment.

[0039] Fig.16 A processing block as a unit for determining a determination order of reference coding units included in a picture according to an embodiment is shown.

[0040] Fig.17 A block diagram of a video encoding device according to an embodiment is shown.

[0041] Fig.18 is a flowchart illustrating a video encoding method according to an embodiment.

[0042] Fig.19 A block diagram of a video decoding device according to an embodiment is shown.

[0043] Fig. 20 A flowchart of a video decoding method according to an embodiment is shown.

[0044] Fig.21A A schematic diagram of history-based motion vector prediction (HMVP) is shown.

[0045] Fig. 21B The process of processing a list for HMVP is shown.

[0046] Fig.22A A method for deriving a motion vector applied to a sample point of a current block in an affine mode is shown in detail. Fig. 22B A method for deriving an affine parameter set from surrounding information in an affine mode is shown.

[0047] Fig.23 A method of determining an affine parameter group candidate for a current block based on a history-based affine parameter group candidate list is shown.

[0048] Fig.24 A flowchart of a video encoding method according to another embodiment is shown.

[0049] Fig.25 A flowchart of a video decoding method according to another embodiment is shown.

[0050] Fig.26 The line buffer required to access motion information at the boundary of a maximum coding unit is shown.

[0051] Fig.27A An example of identifying each region in a frame having a history-based motion vector candidate list is shown.

[0052] Fig.27B Another example of identifying each region in a frame having a history-based motion vector candidate list is shown.

[0053] Fig.28 A method for determining a motion vector of a current block in an affine mode is shown. DETAILED DESCRIPTION

[0054] Best Mode

[0055] A video decoding method according to an embodiment proposed in the present disclosure includes: receiving information about whether an affine mode is applied to a current block; when the information about whether the affine mode is applied indicates that the affine mode is to be applied, determining an affine parameter group according to a history-based affine parameter group candidate list, in which affine parameter groups of one or more blocks reconstructed in the affine mode before the current block are stored; and performing prediction on the current block based on the affine parameter group.

[0056] According to an embodiment, when there is a neighboring block reconstructed in an affine mode from among neighboring blocks of a current block, an affine parameter group may be determined based on affine parameter information of the neighboring block reconstructed in an affine mode and a history-based affine parameter group candidate list.

[0057] According to an embodiment, the video decoding method may further include adding the affine parameter group of the current block to the history-based affine parameter group candidate list.

[0058] According to an embodiment, the video decoding method may further include: when the affine parameter group of the current block is added to the history-based affine parameter group candidate list, when the number of candidates included in the history-based affine parameter group candidate list is a predetermined maximum value, removing the earliest stored affine parameter candidate from the history-based affine parameter group candidate list.

[0059] According to an embodiment, when the affine parameter group of the current block is added to the history-based affine parameter group candidate list, the history-based affine parameter group candidate list is maintained if the affine parameter group of the current block is the same as the affine parameter group existing in the history-based affine parameter group candidate list.

[0060] According to an embodiment, the affine mode may indicate an affine merge mode or an affine advanced motion vector prediction (AMVP) mode.

[0061] A video encoding method according to an embodiment proposed in the present disclosure includes: determining whether an affine mode is applied to a current block; when it is determined that the affine mode is to be applied to the current block, determining an affine parameter group according to a history-based affine parameter group candidate list, in which affine parameter groups of one or more blocks encoded in the affine mode before the current block are stored; performing prediction on the current block based on an affine array; and encoding information about whether the affine mode is applied to the current block.

[0062] According to an embodiment, when there is a neighboring block encoded in the affine mode from among neighboring blocks of the current block, an affine parameter group may be determined based on affine parameter information of the neighboring block encoded in the affine mode and a history-based affine parameter group candidate list.

[0063] A video decoding method according to another embodiment proposed in the present disclosure includes: determining whether a current block is a block to be reconstructed first in a predetermined area including the current block; when the current block is a block to be reconstructed first, resetting a history-based motion vector candidate list and performing prediction on the current block based on motion information of neighboring blocks of the current block, wherein motion vectors of blocks reconstructed before the current block are stored in the history-based motion vector candidate list; and when the current block is not a block to be reconstructed first, performing prediction on the current block based on motion information of neighboring blocks of the current block and the history-based motion vector candidate list.

[0064] According to an embodiment, the video decoding method may further include storing the motion vector of the current block in a history-based motion vector candidate list.

[0065] According to an embodiment, the video decoding method may further include: when the motion vector of the current block is stored in a history-based motion vector candidate list, when the number of motion vector candidates stored in the history-based motion vector candidate list is a predetermined maximum value, removing the motion vector of the earliest stored block from the history-based motion vector candidate list.

[0066] According to an embodiment, the video decoding method may further include: when the motion vector of the current block is stored in the history-based motion vector candidate list, maintaining the history-based motion vector candidate list when the motion vector of the current block is the same as the motion vector existing in the history-based motion vector candidate list.

[0067] Public Mode

[0068] The advantages and features of the present disclosure and methods of achieving the same will be described more fully with reference to the accompanying drawings, in which embodiments of the present disclosure are shown. However, the present disclosure may be implemented in many different forms and should not be construed as limited to the embodiments set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be thorough and complete and will fully convey the concept of the present disclosure to those of ordinary skill in the art.

[0069] The terms used herein will be briefly described, and the disclosed embodiments will be described in detail.

[0070] The terms used herein are those common terms currently widely used in the art in view of the functions in the present disclosure, but these terms may vary according to the intentions of those skilled in the art, precedents, or new technologies in the art. In addition, some of the terms used herein may be arbitrarily selected by the applicant, and in this case, these terms are defined in detail below. Therefore, the specific terms used herein should be defined based on their unique meanings and the entire context of the present disclosure.

[0071] It is to be understood that the singular forms "a," "an," and "the" include plural referents unless the context clearly dictates otherwise.

[0072] It should be understood that when a part “includes” a certain component, the part does not exclude another component but may further include another component unless the context clearly states otherwise.

[0073] In addition, the term "unit" used in this article refers to a software component or hardware component that performs a specific task. However, the term "unit" is not limited to software or hardware. A "unit" can be configured to be located in an addressable storage medium, or configured to operate one or more processors. Therefore, for example, a "unit" can include components, processes, functions, properties, processes, subroutines, program code segments, drivers, firmware, microcodes, circuits, data, databases, data structures, tables, arrays, and variables such as software components, object-oriented software components, class components, and task components. The functions provided by components and "units" can be combined into fewer components and "units", or further separated into additional components and "units".

[0074] According to an embodiment of the present disclosure, a "unit" may 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 cases, a "processor" may refer to an application-specific semiconductor (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), etc. The term "processor" may 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 a combination of any other such configurations.

[0075] The term "memory" should be interpreted broadly to include any electronic component capable of storing electronic information. The term "memory" may refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), nonvolatile 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 the processor can read information from and / or write information to the memory, the memory is said to be in electronic communication with the processor. Memory integrated into a processor is in electronic communication with the processor.

[0076] Hereinafter, “image” may indicate a still image of a video, or may indicate a dynamic image such as a moving image, that is, a video itself.

[0077] Hereinafter, "sample" means data assigned to a sampling position of an image, that is, data to be processed. For example, pixel values ​​of an image in a spatial domain and transform coefficients on a transform area may be samples. A unit including at least one such sample may be defined as a block.

[0078] Also, in the present specification, a 'current block' may mean a block of a maximum coding unit, a coding unit, a prediction unit, or a transformation unit of a current image to be encoded or decoded.

[0079] The present disclosure will now be described more fully with reference to the accompanying drawings so that those skilled in the art can carry out the present disclosure without difficulty. In addition, in order to clearly describe the present disclosure, parts irrelevant to the description of the present disclosure will be omitted in the accompanying drawings.

[0080] In the following, reference will be made to Figures 1 to 16 An image encoding device, an image decoding device, an image encoding method, and an image decoding method according to an embodiment are described. Figures 3 to 16 A method for determining a data unit of an image according to an embodiment is described. Figures 17 to 23 and Fig.28 A video encoding / decoding method according to an embodiment is described, which receives information about whether to apply an affine mode to a current block, when the information about whether to apply the affine mode indicates that the affine mode is to be applied, determines an affine parameter group based on a history-based affine parameter group candidate list in which affine parameter groups of one or more blocks reconstructed in the affine mode before the current block are stored, and performs prediction on the current block based on the affine parameter group. Reference will be made to Figure 24 to Figure 2 7 describes a video encoding / decoding method, which determines whether a current block is a block to be reconstructed first in a predetermined area including the current block, when the current block is the block to be reconstructed first, resets a history-based motion vector candidate list in which motion vectors of blocks reconstructed before the current block are stored, and performs prediction on the current block based on motion information of neighboring blocks of the current block, and when the current block is not the block to be reconstructed first, performs prediction on the current block based on motion information of neighboring blocks of the current block and the history-based motion vector candidate list.

[0081] In the following, reference will be made to Figure 1 and Figure 2 A method and apparatus for adaptively selecting a context model based on coding units of various shapes according to an embodiment of the present disclosure are described.

[0082] Figure 1 A schematic block diagram of an image decoding device according to an embodiment is shown.

[0083] The image decoding apparatus 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 storing instructions executed by the at least one processor.

[0084] The receiver 110 may receive a bitstream. The bitstream includes information of an image encoded by the image encoding device 2200 described below. In addition, the bitstream may be sent from the image encoding device 2200. The image encoding device 2200 and the image decoding device 100 may be connected via wired or wireless connection, and the receiver 110 may receive the bitstream via wired or wireless connection. 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 the image based on 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.

[0085] Will refer to Figure 2 The operation of the image decoding apparatus 100 is described in detail.

[0086] Figure 2 A flowchart of an image decoding method according to an embodiment is shown.

[0087] According to an embodiment of the present disclosure, the receiver 110 receives a bit stream.

[0088] The image decoding device 100 obtains a binary string corresponding to a division shape pattern of a coding unit from a bitstream (operation 210). The image decoding device 100 determines a division rule of the coding unit (operation 220). In addition, the image decoding device 100 divides the coding unit into a plurality of coding units based on at least one of the binary string corresponding to the division shape pattern and the division rule (operation 230). The image decoding device 100 may determine an allowable first range of the size of the coding unit according to a ratio of a width to a height of the coding unit in order to determine the division rule. The image decoding device 100 may determine an allowable second range of the size of the coding unit according to the division shape pattern of the coding unit in order to determine the division rule.

[0089] Hereinafter, the division of coding units will be described in detail according to an embodiment of the present disclosure.

[0090] First, a picture may be divided into one or more slices or one or more slices. A slice or a slice may be a sequence of one or more maximum coding units (coding tree units (CTUs)). Compared to the maximum coding unit (CTU), there is a maximum coding block (coding tree block (CTB)) in concept.

[0091] A maximum coding block (CTB) represents an N×N block including N×N samples (where N is an integer). Each color component can be divided into one or more maximum coding blocks.

[0092] When a picture has three sample arrays (sample arrays of Y, Cr, and Cb components), the maximum coding unit (CTU) includes a maximum coding block of luma samples, two corresponding maximum coding blocks of chroma samples, and a syntax structure for encoding luma samples and chroma samples. When the picture is a monochrome picture, the maximum coding unit includes a maximum coding block of monochrome samples and a syntax structure for encoding monochrome samples. When the picture is a picture encoded in a color plane separated according to color components, the maximum coding unit includes a syntax structure for encoding the picture and the samples of the picture.

[0093] One maximum coding block (CTB) may be divided into M×N coding blocks (M and N are integers) including M×N samples.

[0094] When a picture has sample arrays of Y, Cr, and Cb components, a coding unit (CU) includes a coding block of luma samples, two corresponding coding blocks of chroma samples, and a syntax structure for encoding luma samples and chroma samples. When a picture is a monochrome picture, a coding unit includes a coding block of monochrome samples and a syntax structure for encoding monochrome samples. When a picture is encoded in a color plane separated according to color components, a coding unit includes a syntax structure for encoding the picture and the samples of the picture.

[0095] As described above, the maximum coding block and the maximum coding unit are conceptually distinguished from each other, and the coding block and the coding unit are conceptually distinguished from each other. That is, the (maximum) coding unit refers to a data structure including a (maximum) coding block, which includes corresponding samples and a syntax structure corresponding to the (maximum) coding block. However, because a person of ordinary skill in the art understands that a (maximum) coding unit or a (maximum) coding block refers to a block of a preset size including a preset number of samples, unless otherwise specified, the maximum coding block and the maximum coding unit, or the coding block and the coding unit, are not mentioned in the following specification without distinction.

[0096] The image may be divided into maximum coding units (CTUs). The size of each maximum coding unit may be determined based on information obtained from the bitstream. The shape of each maximum coding unit may be a square shape of the same size. However, the embodiment is not limited thereto.

[0097] For example, information about the maximum size of the luma coding block may be obtained from the bitstream. For example, the maximum size of the luma coding block indicated by the information about the maximum size of the luma coding block may be one of 4×4, 8×8, 16×16, 32×32, 64×64, 128×128, and 256×256.

[0098] For example, information about the brightness block size difference and the maximum size of a brightness coding block that can be divided into two can be obtained from the bitstream. The information about the brightness block size difference may refer to the size difference between the brightness maximum coding unit and the maximum brightness coding block that can be divided into two. Therefore, when the information about the maximum size of the brightness coding block that can be divided into two obtained from the bitstream and the information about the brightness block size difference are combined with each other, the size of the brightness maximum coding unit can be determined. The size of the chroma maximum coding unit can be determined by using the size of the brightness maximum coding unit. For example, when the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chroma block may be half the size of the brightness block, and the size of the chroma maximum coding unit may be half the size of the brightness maximum coding unit.

[0099] According to an embodiment, since information about the maximum size of a binary divisible luminance coding block is obtained from a bitstream, the maximum size of a binary divisible luminance coding block may be variably determined. In contrast, the maximum size of a trifurcated luminance coding block may be fixed. For example, the maximum size of a trifurcated luminance coding block in an I picture may be 32×32, and the maximum size of a trifurcated luminance coding block in a P picture or a B picture may be 64×64.

[0100] In addition, the maximum coding unit can be hierarchically divided into coding units based on the division shape pattern information obtained from the bitstream. At least one of information indicating whether to perform quad division, information indicating whether to perform multiple divisions, division direction information, and division type information can be obtained from the bitstream as the division shape pattern information.

[0101] For example, the information indicating whether to perform quad splitting may indicate whether the current coding unit is quad split (QUAD_SPLIT).

[0102] When the current coding unit is not quad-split, the information indicating whether to perform multi-split may indicate whether the current coding unit is no longer split (NO_SPLIT) or binary / tripartite.

[0103] When the current coding unit is binary-split or tri-split, the split direction information indicates that the current coding unit is split in one of a horizontal direction and a vertical direction.

[0104] When the current coding unit is split in the horizontal direction or the vertical direction, the split type information indicates whether the current coding unit is binary-split or ternary-split.

[0105] The split mode of the current coding unit may be determined according to the split direction information and the split type information. The split mode when the current coding unit is binary split in the horizontal direction may be determined as a binary horizontal split mode (SPLIT_BT_HOR), the split mode when the current coding unit is trifurcated in the horizontal direction may be determined as a trifurcated horizontal split mode (SPLIT_TT_HOR), the split mode when the current coding unit is binary split in the vertical direction may be determined as a binary vertical split mode (SPLIT_BT_VER), and the split mode when the current coding unit is trifurcated in the vertical direction may be determined as a trifurcated vertical split mode (SPLIT_TT_VER).

[0106] The image decoding device 100 can obtain the division shape pattern information from a binary string from the bit stream. The form of the bit stream received by the image decoding device 100 may include a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The binary string is information in a binary number. The binary string may include at least one bit. The image decoding device 100 can obtain the division shape pattern information corresponding to the binary string based on the division rule. The image decoding device 100 can determine whether to quad-divide the coding unit, whether to not divide the coding unit, the division direction, and the division type based on a binary string.

[0107] The coding unit may be smaller than the maximum coding unit or the same as the maximum coding unit. For example, since the maximum coding unit is a coding unit having the maximum size, the maximum coding unit is one of the coding units. When the division shape pattern information about the maximum coding unit indicates that division is not performed, the coding unit determined in the maximum coding unit has the same size as the maximum coding unit. When the division shape pattern information about the maximum coding unit indicates that division is performed, the maximum coding unit may be divided into coding units. In addition, when the division shape pattern information about the coding unit indicates that division is performed, the coding unit may be divided into smaller coding units. However, the division of the image is not limited thereto, and the maximum coding unit and the coding unit may not be distinguished. Reference will be made to Figures 3 to 16 The division of coding units is described in detail.

[0108] In addition, one or more prediction blocks for prediction may be determined from the coding unit. The prediction block may be the same as or smaller than the coding unit. In addition, one or more transform blocks for transformation may be determined from the coding unit. The transform block may be the same as or smaller than the coding unit.

[0109] The shapes and sizes of the transform block and the prediction block may be unrelated to each other.

[0110] In another embodiment, prediction may be performed by using a coding unit as a prediction unit. In addition, transformation may be performed by using a coding unit as a transformation block.

[0111] The division of coding units will refer to Figures 3 to 16 Detailed description. The current block and the adjacent block of the present disclosure may indicate one of a maximum coding unit, a coding unit, a prediction block, and a transform block. In addition, the current block of the current coding unit is a block currently being decoded or encoded or a block currently being divided. The adjacent block may be a block reconstructed before the current block. The adjacent block may be adjacent to the current block in space or time. The adjacent block may be located at one of the lower left, left side, upper left, top, upper right, right side, and lower right of the current block.

[0112] Figure 3 A process of determining at least one coding unit by splitting a current coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0113] The block shape may include 4N×4N, 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N. Here, N may be a positive integer. The block shape information is information indicating at least one of the shape, direction, ratio, or size of the width and height of the coding unit.

[0114] The shape of the coding unit may include a square and a non-square. When the lengths of the width and height of the coding unit are the same (ie, when the block shape of the coding unit is 4N×4N), the image decoding apparatus 100 may determine the block shape information on the coding unit as a square. The image decoding apparatus 100 may determine the shape of the coding unit as a non-square.

[0115] When the width and height of the coding unit are different from each other (that is, when the block shape of the coding unit is 4N×2N, 2N×4N, 4N×N, N×4N, 32N×N, N×32N, 16N×N, N×16N, 8N×N, or N×8N), the image decoding apparatus 100 may determine the block shape information on the coding unit as a non-square shape. When the shape of the coding unit is non-square, the image decoding apparatus 100 may determine the ratio of the width and height in the block shape information on the coding 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 coding 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 coding unit. In addition, the image decoding apparatus 100 may determine the size of the coding unit based on at least one of the length of the width, the length of the height, or the area of ​​the coding unit.

[0116] According to an embodiment, the image decoding apparatus 100 may determine the shape of the coding unit by using block shape information, and may determine the division method of the coding unit by using division shape pattern information. That is, the coding unit division method indicated by the division shape pattern information may be determined based on the block shape indicated by the block shape information used by the image decoding apparatus 100.

[0117] The image decoding device 100 may obtain the division shape pattern information from the bitstream. However, the embodiment is not limited thereto, and the image decoding device 100 and the image encoding device 2200 may determine the pre-agreed division shape pattern information based on the block shape information. The image decoding device 100 may determine the pre-agreed division shape pattern information about the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine the division shape pattern information about the maximum coding unit as a quadrilateral division. In addition, the image decoding device 100 may determine the division shape pattern information about the minimum coding unit as "no division is performed". Specifically, the image decoding device 100 may determine the size of the maximum coding unit to be 256×256. The image decoding device 100 may determine the pre-agreed division shape pattern information as a quadrilateral division. The quadrilateral division is a division shape pattern that bisects both the width and height of the coding unit. The image decoding device 100 may obtain a coding unit of 128×128 size from a maximum coding unit of 256×256 size based on the division shape pattern information. Also, the image decoding apparatus 100 may determine the size of the minimum coding unit to be 4 × 4. The image decoding apparatus 100 may obtain division shape pattern information indicating “no division is performed” with respect to the minimum coding unit.

[0118] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a square shape. For example, the image decoding apparatus 100 may determine whether to divide a square coding unit, whether to divide a square coding unit vertically, whether to divide a square coding unit horizontally, or whether to divide a square coding unit into four coding units based on the division shape mode information. Figure 3 , when the block shape information on the current coding unit 300 indicates a square shape, the decoder 120 can determine that the coding unit 310a having the same size as the current coding unit 300 is not divided based on the division shape pattern information indicating that division is not performed, or can determine that the coding unit 310b, 310c, 310d, 310e or 310f is divided based on the division shape pattern information indicating a preset division method.

[0119] refer to Figure 3According to an embodiment, the image decoding apparatus 100 may determine two coding units 310b obtained by dividing the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that division is performed in the vertical direction. The image decoding apparatus 100 may determine two coding units 310c obtained by dividing the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that division is performed in the horizontal direction. The image decoding apparatus 100 may determine four coding units 310d obtained by dividing the current coding unit 300 in the vertical and horizontal directions based on the division shape pattern information indicating that division is performed in the vertical and horizontal directions. According to an embodiment, the image decoding apparatus 100 may determine three coding units 310e obtained by dividing the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that trifurcated division is performed in the vertical direction. The image decoding apparatus 100 may determine three coding units 310f obtained by dividing the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that trifurcated division is performed in the horizontal direction. However, the division method of the square coding unit is not limited to the above method, and the division shape pattern information may indicate various methods. The preset division method for dividing the square coding units will be described in detail below in conjunction with various embodiments.

[0120] Figure 4 A process of determining at least one coding unit by dividing a non-square coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0121] According to an embodiment, the image decoding apparatus 100 may use block shape information indicating that the current coding unit has a non-square shape. The image decoding apparatus 100 may determine whether to not split the non-square current coding unit or whether to split the non-square current coding unit by using a preset splitting method based on the splitting shape mode information. Figure 4 , when the block shape information on the current coding unit 400 or 450 indicates a non-square shape, the image decoding apparatus 100 may determine a coding unit 410 or 460 having the same size as the current coding unit 400 or 450 based on the division shape pattern information indicating that division is not performed, or determine that the coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c are divided based on the division shape pattern information indicating a preset division method. The preset division method for dividing a non-square coding unit will be described in detail below in conjunction with various embodiments.

[0122] According to an embodiment, the image decoding apparatus 100 may determine a division method of a coding unit by using division shape pattern information, and in this case, the division shape pattern information may indicate the number of one or more coding units generated by dividing the coding unit. Figure 4 When the division shape pattern information indicates that the current coding unit 400 or 450 is divided into two coding units, the image decoding device 100 can determine the two coding units 420a and 420b or 470a and 470b included in the current coding unit 400 or 450 by dividing the current coding unit 400 or 450 based on the division shape pattern information.

[0123] According to an embodiment, when the image decoding apparatus 100 divides the non-square current coding unit 400 or 450 based on the division shape pattern information, the image decoding apparatus 100 may divide the current coding unit in consideration of the position of the long side of the non-square current coding unit 400 or 450. For example, considering the shape of the current coding unit 400 or 450, the image decoding apparatus 100 may determine a plurality of coding units by dividing the current coding unit 400 or 450 in a direction in which the long side of the current coding unit 400 or 450 is divided.

[0124] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided (tripartitioned) into an odd number of blocks, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450. For example, when the division shape pattern information indicates that the current coding unit 400 or 450 is divided into three coding units, the image decoding apparatus 100 may divide the current coding unit 400 or 450 into three coding units 430a, 430b, and 430c or 480a, 480b, and 480c.

[0125] According to an embodiment, the ratio of the width and height of the current coding unit 400 or 450 may be 4:1 or 1:4. When the ratio of the width and the height 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 ratio of the width and the height 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 the current coding unit to be divided into an odd number of blocks based on the division shape mode information. In addition, the image decoding device 100 may determine the division direction of the current coding unit 400 or 450 based on the block shape information of the current coding unit 400 or 450. For example, when the current coding unit 400 is in the vertical direction, the image decoding device 100 may determine the coding units 430a to 430c by dividing the current coding unit 400 in the horizontal direction. In addition, when the current coding unit 450 is in the horizontal direction, the image decoding device 100 may determine the coding units 480a to 480c by dividing the current coding unit 450 in the vertical direction.

[0126] According to an embodiment, the image decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and not all of the determined coding units may have the same size. For example, the size of a preset coding unit 430b or 480b from among the determined odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may be different from the size of other coding units 430a and 430c or 480a and 480c. That is, the coding unit determined by dividing the current coding unit 400 or 450 may have a plurality of sizes, and in some cases, all of the odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have different sizes.

[0127] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of blocks, the image decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and further, may apply a preset restriction to at least one coding unit from among the odd number of coding units generated by dividing the current coding unit 400 or 450. Figure 4, the image decoding apparatus 100 may set the decoding process of the coding unit 430b or 480b located at the center to be different from the decoding process of the other coding units 430a and 430c or 480a and 480c among the three coding units 430a, 430b, and 430c or 480a, 480b, and 480c generated when the current coding unit 400 or 450 is divided. For example, unlike the other coding units 430a and 430c or 480a and 480c, the image decoding apparatus 100 may limit the coding unit 430b or 480b at the center to not be divided any more or to be divided only a preset number of times.

[0128] Figure 5 A process of splitting a coding unit based on at least one of block shape information and division shape pattern information, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0129] According to an embodiment, the image decoding device 100 may determine whether to divide the square first coding unit 500 into coding units based on at least one of the block shape information and the division shape mode information. According to an embodiment, when the division shape mode information indicates that the first coding unit 500 is divided in the horizontal direction, the image decoding device 100 may determine the second coding unit 510 by dividing the first coding unit 500 in the horizontal direction. The first coding unit, the second coding unit, and the third coding unit used according to the embodiment are terms for understanding the relationship before and after dividing the coding unit. For example, the second coding unit may be determined by dividing the first coding unit, and the third coding unit may be determined by dividing the second coding unit. It should be understood that the relationship between the first coding unit, the second coding unit, and the third coding unit follows the above description.

[0130] According to an embodiment, the image decoding apparatus 100 may determine whether to split the determined second coding unit 510 into coding units based on the division shape pattern information. Figure 5, the image decoding apparatus 100 may divide the non-square second coding unit 510 determined by dividing the first coding unit 500 into one or more third coding units 520a, 520b, 520c, and 520d based on the division shape pattern information and at least one of the division shape pattern information, or may not divide the non-square second coding unit 510. The image decoding apparatus 100 may obtain the division shape pattern information, and may obtain a plurality of second coding units (e.g., 510) of various shapes by dividing the first coding unit 500 based on the obtained division shape pattern information, and the second coding unit 510 may be divided by using the division method of the first coding unit 500 based on the division shape pattern information. According to an embodiment, when the first coding unit 500 is divided into the second coding unit 510 based on the division shape pattern information on the first coding unit 500, the second coding unit 510 may also be divided into the third coding units (e.g., 520a or 520b, 520c, and 520d) based on the division shape pattern information on the second coding unit 510. That is, the coding unit may be recursively split based on the split shape pattern information on each coding unit. Thus, a square coding unit may be determined by splitting a non-square coding unit, and a non-square coding unit may be determined by recursively splitting a square coding unit.

[0131] refer to Figure 5 , a preset coding unit (e.g., a coding unit located at a central position, or a square coding unit) from among the odd number of third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510 can be recursively divided. According to an embodiment, a square third coding unit 520c from among the odd number of third coding units 520b, 520c, and 520d can be divided into a plurality of fourth coding units in the horizontal direction. A non-square fourth coding unit 530b or 530d from among a plurality of fourth coding units 530a, 530b, 530c, and 530d can be re-divided into a plurality of coding units. For example, a non-square fourth coding unit 530b or 530d can be re-divided into an odd number of coding units. A method for recursively dividing coding units will be described below in conjunction with various embodiments.

[0132] According to an embodiment, the image decoding device 100 may divide each of the third coding unit 520a or 520b, 520c, and 520d into coding units based on the division shape pattern information. In addition, the image decoding device 100 may determine not to divide the second coding unit 510 based on the division shape pattern information. According to an embodiment, the image decoding device 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The image decoding device 100 may impose a preset restriction on a preset third coding unit from among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding device 100 may limit the third coding unit 520c at the central position from among the odd number of third coding units 520b, 520c, and 520d to no longer be divided or to be divided a settable number of times.

[0133] refer to Figure 5 , the image decoding device 100 may limit the third coding unit 520c at the center position from among the odd-numbered third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to no longer be divided, to be divided by using a preset division method (for example, to be divided into only four coding units or to be divided by using the division method of the second coding unit 510), or to be divided only a preset number of times (for example, to be divided only n times (where n>0)). However, the limitation on the third coding unit 520c at the center position is not limited to the above example, and may include various limitations for decoding the third coding unit 520c at the center position differently from the other third coding units 520b and 520d.

[0134] According to an embodiment, the image decoding apparatus 100 may obtain split shape pattern information for splitting the current coding unit from a preset position in the current coding unit.

[0135] Figure 6 A method of determining a preset coding unit from among odd-numbered coding units, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0136] refer to Figure 6 , the division shape pattern information on the current coding unit 600 or 650 can be obtained from a sample point at a preset position (e.g., a sample point 640 or 690 at a central position) among a plurality of samples included in the current coding unit 600 or 650. However, the preset position from which at least one piece of division shape pattern information can be obtained in the current coding unit 600 is not limited to Figure 6The image decoding apparatus 100 may obtain the division shape pattern information from a preset position, and may determine whether to divide the current coding unit into coding units of various shapes and sizes.

[0137] According to an embodiment, when the current coding unit is divided into a preset number of coding units, the image decoding apparatus 100 may select one of the coding units. Various methods may be used to select one of the plurality of coding units, which will be described below in conjunction with various embodiments.

[0138] According to an embodiment, the image decoding apparatus 100 may split a current coding unit into a plurality of coding units, and may determine a coding unit at a preset position.

[0139] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a center position from among the odd-numbered coding units using information indicating the positions of the odd-numbered coding units. Figure 6 , the image decoding apparatus 100 may determine the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c by dividing the current coding unit 600 or the current coding unit 650. The image decoding apparatus 100 may determine the intermediate coding unit 620b or the intermediate coding unit 660b by using information about the positions of the odd number of coding units 620a, 620b, and 620c or the odd number of coding units 660a, 660b, and 660c. For example, the image decoding apparatus 100 may determine the coding unit 620b at the central position by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of preset samples included in the coding units 620a, 620b, and 620c. Specifically, the image decoding apparatus 100 may determine the coding unit 620b at the central position by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of the upper left samples 630a, 630b, and 630c of the coding units 620a, 620b, and 620c.

[0140] According to an embodiment, the information indicating the positions of the upper left samples 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c may include information about the positions or coordinates of the coding 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 respectively included in the coding units 620a, 620b, and 620c may include information indicating the width or height of the coding units 620a, 620b, and 620c included in the current coding unit 600, and the width or height may correspond to information indicating the difference between the coordinates of the coding units 620a, 620b, and 620c in the picture. That is, the image decoding apparatus 100 may determine the coding unit 620b at the central position by directly using the information about the positions or coordinates of the coding units 620a, 620b, and 620c in the picture, or by using the information about the width or height of the coding unit corresponding to the difference between the coordinates.

[0141] According to an embodiment, information indicating the position of the upper left sample 630a of the upper coding unit 620a may include coordinates (xa, ya), information indicating the position of the upper left sample 630b of the middle coding unit 620b may include coordinates (xb, yb), and information indicating the position of the upper left sample 630c of the lower coding unit 620c may include coordinates (xc, yc). The image decoding apparatus 100 may determine the middle coding unit 620b by using the coordinates of the upper left samples 630a, 630b, and 630c respectively included in the coding units 620a, 620b, and 620c. For example, when the coordinates of the upper left samples 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b including the coordinates (xb, yb) of the sample 630b at the center position may be determined as a coding unit at the center position from among the coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. However, the coordinates indicating the positions of the upper left sample points 630a, 630b, and 630c may include coordinates indicating absolute positions in the picture, or coordinates (dxb, dyb) indicating the relative position of the upper left sample point 630b of the intermediate coding unit 620b and coordinates (dxc, dyc) indicating the relative position of the upper left sample point 630c of the lower coding unit 620c relative to the position of the upper left sample point 630a of the upper coding unit 620a may be used. The method of determining the coding unit at a preset position by using the coordinates of the sample points included in the coding unit as information indicating the positions of the sample points is not limited to the above method, and may include various arithmetic methods capable of using the coordinates of the sample points.

[0142] According to an embodiment, the image decoding apparatus 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c, and may select one of the coding units 620a, 620b, and 620c based on a preset criterion. For example, the image decoding apparatus 100 may select a coding unit 620b from among the coding units 620a, 620b, and 620c, the size of which is different from that of the other coding units.

[0143] According to an embodiment, the image decoding apparatus 100 may determine the width or height of each of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya) as information indicating the position of the upper left sample 630a of the upper coding unit 620a, the coordinates (xb, yb) as information indicating the position of the upper left sample 630b of the middle coding unit 620b, and the coordinates (xc, yc) as information indicating the position of the upper left sample 630c of the lower coding unit 620c. The image decoding apparatus 100 may determine the corresponding sizes of the coding units 620a, 620b, and 620c by using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 620a, 620b, and 620c. According to an embodiment, the image decoding apparatus 100 may determine the width of the upper coding unit 620a as the width of the current coding unit 600. The image decoding apparatus 100 may determine the height of the upper coding unit 620a as yb-ya. According to an embodiment, the image decoding device 100 may determine the width of the intermediate coding unit 620b as the width of the current coding unit 600. The image decoding device 100 may determine the height of the intermediate coding unit 620b as yc-yb. According to an embodiment, the image decoding device 100 may determine the width or height of the lower coding unit 620c by using the width or height of the current coding unit 600 or the width or height of the upper coding unit 620a and the intermediate coding unit 620b. The image decoding device 100 may determine a coding unit whose size is different from that of other coding units based on the determined width and height of the coding units 620a to 620c. Reference Figure 6 , the image decoding apparatus 100 may determine the middle coding unit 620b having a size different from the sizes of the upper coding unit 620a and the lower coding unit 620c as the coding unit at the preset position. However, the above-mentioned method of determining the coding unit having a size different from the sizes of other coding units performed by the image decoding apparatus 100 only corresponds to an example of determining the coding unit at the preset position by using the size of the coding unit determined based on the coordinates of the sample points, and thus various methods of determining the coding unit at the preset position by comparing the size of the coding unit determined based on the coordinates of the preset sample points may be used.

[0144] The image decoding apparatus 100 may determine the width or height of each of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd) as information indicating the position of the upper left sample 670a of the left coding unit 660a, the coordinates (xe, ye) as information indicating the position of the upper left sample 670b of the middle coding unit 660b, and the coordinates (xf, yf) as information indicating the position of the upper left sample 670c of the right coding unit 660c. The image decoding apparatus 100 may determine the respective sizes of the coding units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.

[0145] According to an embodiment, the image decoding device 100 may determine the width of the left coding unit 660a as xe-xd. The image decoding device 100 may determine the height of the left coding unit 660a as the height of the current coding unit 650. According to an embodiment, the image decoding device 100 may determine the width of the intermediate coding unit 660b as xf-xe. The image decoding device 100 may determine the height of the intermediate coding unit 660b as the height of the current coding unit 650. According to an embodiment, the image decoding device 100 may determine the width or height of the right coding unit 660c by using the width or height of the current coding unit 650 or the width or height of the left coding unit 660a and the intermediate coding unit 660b. The image decoding device 100 may determine a coding unit having a size different from that of other coding units based on the determined width and height of the coding units 660a to 660c. Reference Figure 6 , the image decoding apparatus 100 may determine the middle coding unit 660b having a size different from the sizes of the left coding unit 660a and the right coding unit 660c as the coding unit at the preset position. However, the above-mentioned method of determining the coding unit having a size different from the sizes of other coding units performed by the image decoding apparatus 100 only corresponds to an example of determining the coding unit at the preset position by using the size of the coding unit determined based on the coordinates of the sample points, and thus various methods of determining the coding unit at the preset position by comparing the size of the coding unit determined based on the coordinates of the preset sample points may be used.

[0146] However, the position of the sample considered to determine the position of the coding unit is not limited to the above-mentioned upper left position, and information on arbitrary positions of samples included in the coding unit may be used.

[0147] According to an embodiment, the image decoding device 100 may select a coding unit at a preset position from among an odd number of coding units determined by dividing the current coding unit, taking into account the shape of the current coding unit. For example, when the current coding unit has a non-square shape in which the width is longer than the height, the image decoding device 100 may determine the coding unit at the preset position in the horizontal direction. That is, the image decoding device 100 may determine one of the coding units at different positions in the horizontal direction and impose restrictions on the coding unit. When the current coding unit has a non-square shape in which the height is longer than the width, the image decoding device 100 may determine the coding unit at the preset position in the vertical direction. That is, the image decoding device 100 may determine one of the coding units at different positions in the vertical direction and may impose restrictions on the coding unit.

[0148] According to an embodiment, the image decoding device 100 may determine the coding unit at a preset position from among the even-numbered coding units using information indicating the corresponding positions of the even-numbered coding units. The image decoding device 100 may determine the even-numbered coding units by dividing (binary division) the current coding unit, and may determine the coding unit at the preset position by using information about the positions of the even-numbered coding units. The operation related thereto may correspond to the operation of determining the coding unit at a preset position (e.g., a central position) from among the odd-numbered coding units, which has been described above in conjunction with Figure 6 Detailed description has been given, so a detailed description thereof is not provided here.

[0149] According to an embodiment, when a non-square current coding unit is divided into a plurality of coding units, preset information about a coding unit at a preset position may be used in a division operation to determine a coding unit at a preset position from among a plurality of coding units. For example, the image decoding apparatus 100 may use at least one of block shape information and division shape pattern information stored in a sample included in an intermediate coding unit in a division operation to determine a coding unit at a central position from among a plurality of coding units determined by dividing the current coding unit.

[0150] refer to Figure 6, the image decoding device 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on the division shape pattern information, and may determine the coding unit 620b at the central position from among the plurality of coding units 620a, 620b, and 620c. In addition, the image decoding device 100 may determine the coding unit 620b at the central position, taking into account the position from which the division shape pattern information is obtained. That is, the division shape pattern information of the current coding unit 600 may be obtained from the sample 640 at the central position of the current coding unit 600, and when the current coding unit 600 is divided into a plurality of coding units 620a, 620b, and 620c based on the division shape pattern information, the coding unit 620b including the sample 640 may be determined as the coding unit at the central position. However, information for determining the coding unit at the central position is not limited to the division shape pattern information, and various types of information may be used to determine the coding unit at the central position.

[0151] According to an embodiment, preset information for identifying a coding unit at a preset position may be obtained from preset samples included in a coding unit to be determined. Figure 6 , the image decoding apparatus 100 may use the division shape pattern information obtained from the sample at the preset position in the current coding unit 600 (for example, the sample at the central position of the current coding unit 600) to determine the coding unit at the preset position (for example, the coding unit at the central position from among the plurality of divided coding units) from among the plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. That is, the image decoding apparatus 100 may determine the sample at the preset position by considering the block shape of the current coding unit 600, determine the coding unit 620b including the sample from which the preset information (for example, the division shape pattern information) can be obtained from among the plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may impose a preset restriction on the coding unit 620b. Reference Figure 6 According to an embodiment, in a decoding operation, the image decoding apparatus 100 may determine a sample 640 at a central position of a current coding unit 600 as a sample from which preset information may be obtained, and may impose a preset restriction on a coding unit 620b including the sample 640. However, the position of the sample from which the preset information may be obtained is not limited to the above-mentioned position, and may be included in any position of the sample included in the coding unit 620b to be determined for restriction.

[0152] According to an embodiment, the position of the sample from which the preset information can be obtained may be determined based on the shape of the current coding unit 600. According to an embodiment, the block shape information may indicate whether the current coding unit has a square shape or a non-square shape, and the position of the sample from which the preset information can be obtained may be determined based on the shape. For example, the image decoding device 100 may determine, by using at least one of the information about the width of the current coding unit and the information about the height of the current coding unit, a sample located on a boundary for dividing at least one of the width and the height of the current coding unit into two halves, as a sample from which the preset information can be obtained. As another example, when the block shape information of the current coding unit indicates a non-square shape, the image decoding device 100 may determine one of the samples adjacent to the boundary for dividing the long side of the current coding unit into two halves, as a sample from which the preset information can be obtained.

[0153] According to an embodiment, when the current coding unit is divided into a plurality of coding units, the image decoding device 100 may use the division shape pattern information to determine the coding unit at a preset position from among the plurality of coding units. According to an embodiment, the image decoding device 100 may obtain the division shape pattern information from the sample at the preset position in the coding unit, and divide the plurality of coding units generated by dividing the current coding unit by using the division shape pattern information obtained from the sample at the preset position in each of the plurality of coding units. That is, the coding unit may be recursively divided based on the division shape pattern information obtained from the sample at the preset position in each coding unit. The above has been combined with Figure 5 An operation of recursively splitting the coding unit is described, and thus a detailed description thereof will not be provided here.

[0154] According to an embodiment, the image decoding apparatus 100 may determine one or more coding units by splitting a current coding unit, and may determine an order of decoding the one or more coding units based on a preset block (eg, the current coding unit).

[0155] Figure 7 An order in which a plurality of coding units are processed when an image decoding apparatus determines a plurality of coding units by splitting a current coding unit according to an embodiment is illustrated.

[0156] According to an embodiment, the image decoding device 100 can determine the second coding units 710a and 710b by dividing the first coding unit 700 in the vertical direction, determine the second coding units 730a and 730b by dividing the first coding unit 700 in the horizontal direction, or determine the second coding units 750a, 750b, 750c and 750d by dividing the first coding unit 700 in the vertical and horizontal directions based on the division shape pattern information.

[0157] refer to Figure 7 , the image decoding apparatus 100 may determine to process the second coding units 710a and 710b determined by dividing the first coding unit 700 in the vertical direction in a horizontal direction order 710c. The image decoding apparatus 100 may determine to process the second coding units 730a and 730b determined by dividing the first coding unit 700 in the horizontal direction in a vertical direction order 730c. The image decoding apparatus 100 may determine the second coding units 750a, 750b, 750c, and 750d determined by dividing the first coding unit 700 in the vertical and horizontal directions according to a preset order (e.g., a raster scan order or a Z scan order 750e), process the coding units in one row by the preset order, and then process the coding units in the next row.

[0158] According to an embodiment, the image decoding apparatus 100 may recursively divide the coding unit. Figure 7 , the image decoding apparatus 100 may determine a plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d by dividing the first coding unit 700, and recursively divide each of the determined plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. The division method of the plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d may correspond to the division method of the first coding unit 700. In this way, each of the plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d may be independently divided into a plurality of coding units. Reference Figure 7 , the image decoding apparatus 100 may determine the second coding units 710a and 710b by dividing the first coding unit 700 in a vertical direction, and may determine whether to independently divide or not divide each of the second coding units 710a and 710b.

[0159] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 720a and 720b by splitting the left second coding unit 710a in a horizontal direction, and may not split the right second coding unit 710b.

[0160] According to an embodiment, the processing order of the coding units may be determined based on the operation of dividing the coding units. In other words, the processing order of the divided coding units may be determined based on the processing order of the coding units immediately before being divided. The image decoding device 100 may determine the processing order of the third coding units 720a and 720b determined by dividing the left second coding unit 710a independently of the right second coding unit 710b. Since the third coding units 720a and 720b are determined by dividing the left second coding unit 710a in the horizontal direction, the third coding units 720a and 720b may be processed in a vertical direction order 720c. Since the left second coding unit 710a and the right second coding unit 710b are processed in a horizontal direction order 710c, the right second coding unit 710b may be processed after the third coding units 720a and 720b included in the left second coding unit 710a are processed in a vertical direction order 720c. The operation of determining the processing order of coding units based on the coding units before being split is not limited to the above example, and various methods may be used to independently process coding units that are split and determined to be various shapes in a preset order.

[0161] Figure 8 A process of determining that a current coding unit is to be split into an odd number of coding units, performed by an image decoding apparatus when coding units cannot be processed in a preset order, according to an embodiment is illustrated.

[0162] According to an embodiment, the image decoding apparatus 100 may determine that the current coding unit is split into an odd number of coding units based on the obtained division shape pattern information. Figure 8 , the square first coding unit 800 may be divided into non-square second coding units 810a and 810b, and the second coding units 810a and 810b may be independently divided into third coding units 820a and 820b and 820c to 820e. According to an embodiment, the image decoding device 100 may determine a plurality of third coding units 820a and 820b by dividing the left second coding unit 810a in the horizontal direction, and may divide the right second coding unit 810b into an odd number of third coding units 820c to 820e.

[0163] According to an embodiment, the video decoding apparatus 100 may determine whether any coding unit is split into an odd number of coding units by determining whether the third coding units 820a and 820b and 820c to 820e can be processed in a preset order. Figure 8, the image decoding device 100 can determine the third coding units 820a and 820b and 820c to 820e by recursively dividing the first coding unit 800. The image decoding device 100 can determine whether any one of the first coding unit 800, the second coding units 810a and 810b, or the third coding units 820a and 820b and 820c to 820e is divided into an odd number of coding units based on at least one of the block shape information and the division shape mode information. For example, the coding unit located on the right side from the second coding units 810a and 810b can be divided into an odd number of third coding units 820c, 820d, and 820e. The processing order of the multiple coding units included in the first coding unit 800 can be a preset order (for example, a Z scan order 830), and the image decoding device 100 can determine whether the third coding units 820c, 820d and 820e determined by dividing the right second coding unit 810b into an odd number of coding units meet the conditions for processing in a preset order.

[0164] According to an embodiment, the image decoding device 100 may determine whether the third coding units 820a and 820b and 820c to 820e included in the first coding unit 800 satisfy a condition for processing in a preset order, and the condition relates to whether at least one of the width and height of the second coding units 810a and 810b will be divided into two halves along the boundary of the third coding units 820a and 820b and 820c to 820e. For example, the third coding units 820a and 820b determined when the height of the left second coding unit 810a of a non-square shape is divided into two halves may satisfy the condition. It may be determined that the third coding units 820c to 820e do not satisfy the condition because the boundary of the third coding units 820c to 820e determined when the right second coding unit 810b is divided into three coding units cannot divide the width or height of the right second coding unit 810b into two halves. When the condition is not satisfied as described above, the image decoding device 100 may determine to disconnect the scanning order, and may determine that the right second coding unit 810b is divided into an odd number of coding units based on the result of the determination. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding device 100 may impose a preset restriction on the coding unit at a preset position from among the divided coding units. The restriction or preset position has been described above in conjunction with various embodiments, so a detailed description thereof will not be provided here.

[0165] Fig. 9 A process of determining at least one coding unit by splitting a first coding unit, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0166] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 900 based on the division shape pattern information obtained by the receiver 110. The square first coding unit 900 may be divided into four square coding units, or may be divided into a plurality of non-square coding units. Fig. 9 , when the first coding unit 900 has a square shape and the division shape pattern information indicates that the first coding unit 900 is divided into non-square coding units, the image decoding apparatus 100 may divide the first coding unit 900 into a plurality of non-square coding units. Specifically, when the division shape pattern information indicates that an odd number of coding units is determined by dividing the first coding unit 900 in a horizontal direction or a vertical direction, the image decoding apparatus 100 may divide the square first coding unit 900 into an odd number of coding units, for example, second coding units 910a, 910b, and 910c determined by dividing the square first coding unit 900 in a vertical direction, or second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in a horizontal direction.

[0167] According to an embodiment, the image decoding apparatus 100 may determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition for processing in a preset order, and the condition relates to whether at least one of the width and height of the first coding unit 900 is to be divided into two halves along a boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Fig. 9 , because the boundaries of the second coding units 910a, 910b, and 910c determined by dividing the first coding unit 900 in the vertical direction do not divide the height of the first coding unit 900 into two halves, it can be determined that the first coding unit 900 does not meet the condition for processing in a preset order. In addition, because the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the first coding unit 900 in the horizontal direction do not divide the width of the first coding unit 900 into two halves, it can be determined that the first coding unit 900 does not meet the condition for processing in a preset order. When the condition is not met as described above, the image decoding device 100 may decide to disconnect the disconnection of the scanning order, and may determine that the first coding unit 900 is divided into an odd number of coding units based on the result of the decision. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding device 100 may impose a preset restriction on the coding unit at a preset position from among the divided coding units. The restriction or preset position has been described above in conjunction with various embodiments, so a detailed description thereof will not be provided here.

[0168] According to an embodiment, the image decoding apparatus 100 may determine coding units of various shapes by splitting the first coding unit.

[0169] refer to Fig. 9 , the image decoding apparatus 100 may divide the square first coding unit 900 or the non-square first coding unit 930 or 950 into coding units of various shapes.

[0170] Fig.10 It is shown that shapes into which the second coding unit can be divided are restricted when a second coding unit having a non-square shape, which is determined when the image decoding apparatus divides the first coding unit, satisfies a preset condition according to an embodiment.

[0171] According to an embodiment, the image decoding device 100 may determine to divide the square first coding unit 1000 into non-square second coding units 1010a and 1010b or 1020a and 1020b based on the division shape pattern information obtained by the receiver 110. The second coding units 1010a and 1010b or 1020a and 1020b may be divided independently. In this way, the image decoding device 100 may determine whether to divide each of the second coding units 1010a and 1010b or 1020a and 1020b into a plurality of coding units based on the division shape pattern information on each of the second coding units 1010a and 1010b or 1020a and 1020b. According to an embodiment, the image decoding device 100 may determine the third coding units 1012a and 1012b by dividing the non-square left second coding unit 1010a in the horizontal direction, and the left second coding unit 1010a is determined by dividing the first coding unit 1000 in the vertical direction. However, when the left second coding unit 1010a is divided in the horizontal direction, the image decoding device 100 may restrict the right second coding unit 1010b from being divided in the horizontal direction in which the left second coding unit 1010a is divided. When the third coding units 1014a and 1014b are determined by dividing the right second coding unit 1010b in the same direction, since the left second coding unit 1010a and the right second coding unit 1010b are independently divided in the horizontal direction, the third coding units 1012a and 1012b or 1014a and 1014b may be determined. However, this case is equivalent to the case in which the image decoding device 100 divides the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the division shape pattern information, and may be inefficient in image decoding.

[0172] According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1022a and 1022b or 1024a and 1024b by vertically splitting the non-square second coding unit 1020a or 1020b determined by horizontally splitting the first coding unit 1000. However, when the second coding unit (e.g., the upper second coding unit 1020a) is split in the vertical direction, due to the above reasons, the image decoding apparatus 100 may restrict another second coding unit (e.g., the lower second coding unit 1020b) from being split in the vertical direction in which the upper second coding unit 1020a is split.

[0173] Fig.11 A process of splitting a square coding unit when division shape pattern information indicates that the square coding unit is not to be split into four square coding units, performed by an image decoding apparatus according to an embodiment, is illustrated.

[0174] According to an embodiment, the image decoding device 100 may determine the second coding units 1110a and 1110b or 1120a and 1120b, etc. by dividing the first coding unit 1100 based on the division shape pattern information. The division shape pattern information may include information about various methods of dividing the coding unit, but the information about the various division methods may not include information for dividing the coding unit into four square coding units. According to such division shape pattern information, the image decoding device 100 may not divide the square first coding unit 1100 into four square second coding units 1130a, 1130b, 1130c, and 1130d. The image decoding device 100 may determine the non-square second coding units 1110a and 1110b or 1120a and 1120b, etc. based on the division shape pattern information.

[0175] According to an embodiment, the image decoding apparatus 100 may independently divide the non-square second coding units 1110a and 1110b or 1120a and 1120b, etc. Each of the second coding units 1110a and 1110b or 1120a and 1120b, etc. may be recursively divided in a preset order, and the division method may correspond to the method of dividing the first coding unit 1100 based on the division shape pattern information.

[0176] For example, the image decoding device 100 can determine the square third coding units 1112a and 1112b by dividing the left second coding unit 1110a in the horizontal direction, and can determine the square third coding units 1114a and 1114b by dividing the right second coding unit 1110b in the horizontal direction. In addition, the image decoding device 100 can determine the square third coding units 1116a, 1116b, 1116c, and 1116d by dividing both the left second coding unit 1110a and the right second coding unit 1110b in the horizontal direction. In this case, the coding unit having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 can be determined.

[0177] As another example, the image decoding device 100 may determine the third coding units 1122a and 1122b of the square by dividing the upper second coding unit 1120a in the vertical direction, and may determine the third coding units 1124a and 1124b of the square by dividing the lower second coding unit 1120b in the vertical direction. In addition, the image decoding device 100 may determine the third coding units 1126a, 1126b, 1126c, and 1126d of the square by dividing both the upper second coding unit 1120a and the lower second coding unit 1120b in the vertical direction. In this case, a coding unit having the same shape as the four square second coding units 1130a, 1130b, 1130c, and 1130d divided from the first coding unit 1100 may be determined.

[0178] Fig.12 It is shown that a processing order among a plurality of coding units according to an embodiment may be changed depending on a process of splitting the coding units.

[0179] According to an embodiment, the image decoding apparatus 100 may divide the first coding unit 1200 based on the division shape pattern information. When the block shape indicates a square shape and the division shape pattern information indicates that the first coding unit 1200 is divided in at least one of the horizontal and vertical directions, the image decoding apparatus 100 may determine the second coding units 1210a and 1210b or 1220a and 1220b, etc. by dividing the first coding unit 1200. Fig.12, the non-square second coding units 1210a and 1210b or 1220a and 1220b determined by dividing the first coding unit 1200 only in the horizontal direction or the vertical direction can be independently divided based on the division shape pattern information on each coding unit. For example, the image decoding device 100 can determine the third coding units 1216a, 1216b, 1216c, and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in the vertical direction in the horizontal direction, and can determine the third coding units 1226a, 1226b, 1226c, and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 in the horizontal direction in the vertical direction. The above has been combined with Fig.11 An operation of dividing the second coding units 1210a and 1210b or 1220a and 1220b is described, and thus a detailed description thereof will not be provided here.

[0180] According to an embodiment, the image decoding apparatus 100 may process the coding units in a preset order. Figure 7 The operation of processing the encoding units in a preset order is described, and thus a detailed description thereof will not be provided here. Fig.12 , the image decoding apparatus 100 may determine four square third coding units 1216a, 1216b, 1216c, and 1216d, and 1226a, 1226b, 1226c, and 1226d by dividing the square first coding unit 1200. According to an embodiment, the image decoding apparatus 100 may determine a processing order of the third coding units 1216a, 1216b, 1216c, and 1216d or 1226a, 1226b, 1226c, and 1226d based on a division shape by which the first coding unit 1200 is divided.

[0181] According to an embodiment, the image decoding device 100 can determine the third coding units 1216a, 1216b, 1216c and 1216d by dividing the second coding units 1210a and 1210b generated by dividing the first coding unit 1200 in the vertical direction, and can be used to process the third coding units 1216a, 1216b, 1216c and 1216d in a processing order 1217 of initially processing the third coding units 1216a and 1216c included in the left second coding unit 1210a in the vertical direction and then processing the third coding units 1216b and 1216d included in the right second coding unit 1210b in the vertical direction.

[0182] According to an embodiment, the image decoding device 100 can determine the third coding units 1226a, 1226b, 1226c and 1226d by dividing the second coding units 1220a and 1220b generated by dividing the first coding unit 1200 in the horizontal direction, and can be used to initially process the third coding units 1226a and 1226b included in the upper second coding unit 1220a in the horizontal direction, and then process the third coding units 1226c and 1226d included in the lower second coding unit 1220b in the horizontal direction in a processing order 1227 to process the third coding units 1226a, 1226b, 1226c and 1226d.

[0183] refer to Fig.12 , the third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d of square shape can be determined by dividing the second coding units 1210a and 1210b and 1220a and 1220b, respectively. Although the second coding units 1210a and 1210b are determined by dividing the first coding unit 1200 in the vertical direction, which is different from the second coding units 1220a and 1220b determined by dividing the first coding unit 1200 in the horizontal direction, the third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d divided therefrom ultimately show the same shape of coding units divided from the first coding unit 1200. In this way, by recursively splitting the coding units in different manners based on the division shape pattern information, even when the coding units are finally determined to be the same shape, the image decoding apparatus 100 can process a plurality of coding units in different orders.

[0184] Fig.13 A process of determining a depth of a coding unit as a shape and a size of a coding unit change when a coding unit is recursively split so that a plurality of coding units are determined according to an embodiment is illustrated.

[0185] According to an embodiment, the image decoding device 100 may determine the depth of the coding unit based on a preset criterion. For example, the preset criterion may be the length of the long side of the coding unit. When the length of the long side of the coding unit before being divided is 2n times (n>0) the length of the long side of the current coding unit being divided, the image decoding device 100 may determine that the depth of the current coding unit is increased by n from the depth of the coding unit before being divided. In the following description, a coding unit with an increased depth is represented as a coding unit of a deeper depth.

[0186] refer to Fig.13According to an embodiment, the image decoding apparatus 100 may determine the second coding unit 1302 and the third coding unit 1304 of a deeper depth by dividing the square first coding unit 1300 based on block shape information indicating a square shape (for example, the block shape information may be represented as '0:SQUARE'). Assuming that the size of the square first coding unit 1300 is 2N×2N, the second coding unit 1302 determined by dividing the width and height of the first coding unit 1300 into 1 / 2 may have a size of N×N. In addition, the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 into 1 / 2 may have a size of N / 2×N / 2. In this case, the width and height of the third coding unit 1304 are 1 / 4 times that of the first coding unit 1300. When the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302 having a width and height 1 / 2 times the width and height of the first coding unit 1300 may be D+1, and the depth of the third coding unit 1304 having a width and height 1 / 4 times the width and height of the first coding unit 1300 may be D+2.

[0187] According to an embodiment, the image decoding device 100 can determine the second coding unit 1312 or 1322 and the third coding unit 1314 or 1324 of a deeper depth by dividing the non-square first coding unit 1310 or 1320 based on block shape information indicating a non-square shape (for example, the block shape information can be represented as '1:NS_VER' indicating a non-square shape in which the height is longer than the width, or '2:NS_HOR' indicating a non-square shape in which the width is longer than the height).

[0188] The image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by dividing at least one of the width and the height of the first coding unit 1310 having a size of N×2N. That is, the image decoding apparatus 100 may determine the second coding unit 1302 having a size of N×N or the second coding unit 1322 having a size of N×N / 2 by dividing the first coding unit 1310 in a horizontal direction, or may determine the second coding unit 1312 having a size of N / 2×N by dividing the first coding unit 1310 in horizontal and vertical directions.

[0189] According to an embodiment, the image decoding apparatus 100 may determine the second coding unit 1302, 1312, or 1322 by dividing at least one of the width and the height of the first coding unit 1320 having a size of 2N×N. That is, the image decoding apparatus 100 may determine the second coding unit 1302 having a size of N×N or the second coding unit 1312 having a size of N / 2×N by dividing the first coding unit 1320 in a vertical direction, or may determine the second coding unit 1322 having a size of N×N / 2 by dividing the first coding unit 1320 in horizontal and vertical directions.

[0190] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1302 having a size of N×N. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2, the third coding unit 1314 having a size of N / 4×N / 2, or the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1302 in vertical and horizontal directions.

[0191] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1312 having a size of N / 2×N. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1312 in a horizontal direction, or may determine the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1312 in vertical and horizontal directions.

[0192] According to an embodiment, the image decoding apparatus 100 may determine the third coding unit 1304, 1314, or 1324 by dividing at least one of the width and the height of the second coding unit 1322 having a size of N×N / 2. That is, the image decoding apparatus 100 may determine the third coding unit 1304 having a size of N / 2×N / 2 or the third coding unit 1314 having a size of N / 4×N / 2 by dividing the second coding unit 1322 in a vertical direction, or may determine the third coding unit 1324 having a size of N / 2×N / 4 by dividing the second coding unit 1322 in vertical and horizontal directions.

[0193] According to an embodiment, the image decoding apparatus 100 may split the square coding unit 1300, 1302, or 1304 in a horizontal or vertical direction. For example, the image decoding apparatus 100 may determine the first coding unit 1310 having a size of N×2N by splitting the first coding unit 1300 having a size of 2N×2N in a vertical direction, or may determine the first coding unit 1320 having a size of 2N×N by splitting the first coding unit 1300 in a horizontal direction. According to an embodiment, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by splitting the first coding unit 1300 having a size of 2N×2N in a horizontal or vertical direction may be the same as the depth of the first coding unit 1300.

[0194] According to an embodiment, the width and height of the third coding unit 1314 or 1324 may be 1 / 4 times the width and height of the first coding unit 1310 or 1320. When the depth of the first coding unit 1310 or 1320 is D, the depth of the second coding unit 1312 or 1322 having a width and height 1 / 2 times the width and height of the first coding unit 1310 or 1320 may be D+1, and the depth of the third coding unit 1314 or 1324 having a width and height 1 / 4 times the width and height of the first coding unit 1310 or 1320 may be D+2.

[0195] Fig.14 Depth that may be determined based on a shape and a size of a coding unit and a partial index (PID) for distinguishing coding units according to an embodiment are illustrated.

[0196] According to an embodiment, the image decoding apparatus 100 may determine second coding units of various shapes by dividing the square first coding unit 1400. Fig.14 , the image decoding apparatus 100 may determine the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d by dividing the first coding unit 1400 in at least one of the vertical and horizontal directions based on the division shape pattern information. That is, the image decoding apparatus 100 may determine the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d based on the division shape pattern information of the first coding unit 1400.

[0197] According to an embodiment, the depth of the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d determined based on the division shape pattern information on the square first coding unit 1400 can be determined based on the length of its long side. For example, because the length of the side of the square first coding unit 1400 is equal to the length of the long side of the non-square second coding units 1402a and 1402b and 1404a and 1404b, the first coding unit 1400 and the non-square second coding units 1402a and 1402b and 1404a and 1404b may have the same depth, for example, D. However, when the image decoding device 100 divides the first coding unit 1400 into four square second coding units 1406a, 1406b, 1406c and 1406d based on the division shape pattern information, because the length of the side of the square second coding units 1406a, 1406b, 1406c and 1406d is 1 / 2 times the length of the side of the first coding unit 1400, the depth of the second coding units 1406a, 1406b, 1406c and 1406d can be D+1, which is 1 deeper than the depth D of the first coding unit 1400.

[0198] According to an embodiment, the image decoding apparatus 100 may determine a plurality of second coding units 1412a and 1412b and 1414a, 1414b, and 1414c by dividing the first coding unit 1410 having a height longer 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 coding units 1422a and 1422b and 1424a, 1424b, and 1424c by dividing the first coding unit 1420 having a width longer than a height in a vertical direction based on the division shape pattern information.

[0199] According to an embodiment, the depth of the second coding 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 on the non-square first coding unit 1410 or 1420 may be determined based on the length of its long side. For example, since the length of the side of the square second coding units 1412a and 1412b is 1 / 2 times the length of the long side of the first coding unit 1410 having a non-square shape having a height longer than a width, the depth of the square second coding units 1412a and 1412b is D+1, which is deeper than the depth D of the non-square first coding unit 1410 by 1.

[0200] In addition, the image decoding device 100 may divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the division shape pattern information. The odd number of second coding units 1414a, 1414b, and 1414c may include the non-square second coding units 1414a and 1414c and the square second coding unit 1414b. In this case, since the length of the long side of the non-square second coding units 1414a and 1414c and the length of the side of the square second coding unit 1414b are 1 / 2 times the length of the long side of the first coding unit 1410, the depth of the second coding units 1414a, 1414b, and 1414c may be D+1, which is deeper than the depth D of the non-square first coding unit 1410 by 1. The image decoding apparatus 100 may determine the depth of the coding unit split from the first coding unit 1420 having a non-square shape having a width longer than a height by using the above-described method of determining the depth of the coding unit split from the first coding unit 1410 .

[0201] According to an embodiment, the image decoding apparatus 100 may determine a PID for identifying a split coding unit based on a size ratio between coding units when the odd-numbered split coding units do not have equal sizes. Fig.14 , the coding unit 1414b at the central position among the odd-numbered divided coding units 1414a, 1414b, and 1414c may have a width equal to that of the other coding units 1414a and 1414c and a height twice the height of the other coding units 1414a and 1414c. That is, in this case, the coding unit 1414b at the central position may include two other coding units 1414a or 1414c. Therefore, when the PID of the coding unit 1414b at the central position is 1 based on the scanning order, the PID of the coding unit 1414c located next to the coding unit 1414b may be increased by 2, and thus may be 3. That is, there may be discontinuity in the PID value. According to an embodiment, the image decoding device 100 may determine whether the odd-numbered divided coding units do not have equal sizes based on whether there is discontinuity in the PID used to identify the divided coding units.

[0202] According to an embodiment, the image decoding apparatus 100 may determine whether to use a specific splitting method based on a PID value for identifying a plurality of coding units determined by splitting the current coding unit. Fig.14, the image decoding apparatus 100 may determine even-numbered coding units 1412a and 1412b or odd-numbered coding units 1414a, 1414b, and 1414c by dividing the first coding unit 1410 having a rectangular shape whose height is longer than its width. The image decoding apparatus 100 may use a PID indicating a corresponding coding unit in order to identify the corresponding coding unit. According to an embodiment, the PID may be obtained from a sample at a preset position of each coding unit (e.g., an upper left sample).

[0203] According to an embodiment, the image decoding device 100 may determine a coding unit at a preset position from among the divided coding units by using a PID for distinguishing coding units. According to an embodiment, when the division shape pattern information of the first coding unit 1410 having a rectangular shape having a height longer than a width indicates that the coding unit is divided into three coding units, the image decoding device 100 may divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The image decoding device 100 may assign a PID to each of the three coding units 1414a, 1414b, and 1414c. The image decoding device 100 may compare the PIDs of the odd-numbered divided coding units to determine a coding unit at a central position from among the coding units. The image decoding device 100 may determine a coding unit 1414b having a PID corresponding to an intermediate value among the PIDs of the coding units as a coding unit at a central position from among the coding units determined by dividing the first coding unit 1410. According to an embodiment, when the divided coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for distinguishing the divided coding units based on a size ratio between the coding units. Fig.14, the coding unit 1414b generated by dividing the first coding unit 1410 may have a width equal to that of the other coding units 1414a and 1414c and a height twice the height of the other coding units 1414a and 1414c. In this case, when the PID of the coding unit 1414b at the central position is 1, the PID of the coding unit 1414c located next to the coding unit 1414b may increase by 2 and thus may be 3. When the PID does not increase uniformly as described above, the image decoding device 100 may determine that the coding unit is divided into a plurality of coding units, including coding units whose sizes are different from those of other coding units. According to an embodiment, when the division shape pattern information indicates that the coding unit is divided into an odd number of coding units, the image decoding device 100 may divide the current coding unit so that the size of the coding unit at a preset position (e.g., the coding unit at the central position) among the odd number of coding units is different from that of the other coding units. In this case, the image decoding device 100 may determine the coding unit at the central position having a different size by using the PID of the coding unit. However, the PID of the encoding unit at the preset position and the size or position are not limited to the above-mentioned examples, and various PIDs and various positions and sizes of the encoding unit may be used.

[0204] According to an embodiment, the image decoding apparatus 100 may use a preset data unit in which a coding unit starts to be recursively split.

[0205] Fig.15 It is shown that a plurality of coding units are determined based on a plurality of preset data units included in a picture according to an embodiment.

[0206] According to an embodiment, a preset data unit may be defined as a data unit in which a coding unit begins to be recursively divided by using division shape pattern information. That is, the preset data unit may correspond to a coding unit of the uppermost depth, which is used to determine a plurality of coding units divided from a current picture. In the following description, for ease of explanation, a preset data unit is referred to as a reference data unit.

[0207] According to an embodiment, the reference data unit may have a preset size and a preset shape. According to an embodiment, the reference coding unit may include M×N samples. Here, M and N may be equal to each other and may be an integer expressed 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 coding units.

[0208] According to an embodiment, the image decoding apparatus 100 may divide the 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 pattern information on each reference data unit. The operation of dividing the reference data unit may correspond to a division operation using a quadtree structure.

[0209] According to an embodiment, the image decoding apparatus 100 may predetermine the minimum size allowed for the reference data unit included in the current picture. Therefore, the image decoding apparatus 100 may determine various reference data units whose sizes are equal to or larger than the minimum size, and may determine one or more coding units using the division shape pattern information by referring to the determined reference data unit.

[0210] refer to Fig.15 , the image decoding apparatus 100 may use a square reference coding unit 1500 or a non-square reference coding unit 1502. According to an embodiment, the shape and size of the reference coding unit may be determined based on various data units (e.g., a sequence, a picture, a slice, a slice segment, a slice, a slice group, a maximum coding unit, etc.) that can include one or more reference coding units.

[0211] According to an embodiment, the receiver 110 of the image decoding apparatus 100 may obtain at least one of reference coding unit shape information and reference coding unit size information about each of various data units from a bitstream. The operation of dividing the square reference coding unit 1500 into one or more coding units has been described above in conjunction with Figure 3 The operation of dividing the current coding unit 300 is described, and the operation of dividing the non-square reference coding unit 1502 into one or more coding units has been described above in conjunction with Figure 4 The operation of splitting the current coding unit 400 or 450 has been described. Therefore, a detailed description thereof will not be provided here.

[0212] According to an embodiment, the image decoding apparatus 100 may use a PID for identifying the size and shape of a reference coding unit to determine the size and shape of the reference coding unit according to some data units predetermined based on a preset condition. That is, the receiver 110 may obtain only a PID for identifying the size and shape of a reference coding unit for each slice, slice segment, slice, slice group, or maximum coding unit from a bitstream, each slice, slice segment, slice, slice group, or maximum coding unit being a data unit (e.g., a data unit having a size equal to or smaller than a slice) among various data units (e.g., a sequence, a picture, a slice, a slice segment, a slice, a slice group, a maximum coding unit, etc.) that satisfies a preset condition. The image decoding apparatus 100 may determine the size and shape of a reference data unit for each data unit that satisfies the preset condition by using a PID. When the reference coding unit shape information and the reference coding unit size information are obtained and used from a bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high, and therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the size and shape of the reference coding unit corresponding to the PID for identifying the size and shape of the reference coding unit may be predetermined. That is, the image decoding apparatus 100 may determine at least one of the size and shape of the reference coding unit included in the data unit as a unit for obtaining the PID by selecting at least one of the size and shape of the reference coding unit determined in advance based on the PID.

[0213] According to an embodiment, the image decoding device 100 may use one or more reference coding units included in the maximum coding unit. That is, the maximum coding unit divided from the picture may include one or more reference coding units, and the coding unit may be determined by recursively dividing each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit may be an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be obtained by dividing the maximum coding unit n times based on a quadtree structure. That is, according to various embodiments, the image decoding device 100 may determine the reference coding unit by dividing the maximum coding unit n times based on a quadtree structure, and may divide the reference coding unit based on at least one of the block shape information and the division shape pattern information.

[0214] Fig.16 A processing block as a unit for determining a determination order of reference coding units included in a picture according to an embodiment is shown.

[0215] According to an embodiment, the image decoding device 100 may determine one or more processing blocks divided from a picture. A processing block is a data unit including one or more reference coding units divided from a picture, and one or more reference coding units included in the processing block may be determined according to a specific order. That is, the determination order of one or more reference coding units determined in each processing block may correspond to one of various types of orders for determining reference coding units, and may vary depending on the processing block. The determination order of the reference coding units determined for each processing block may be one of various orders, for example, a raster scan order, a Z scan, an N scan, an upper right diagonal scan, a horizontal scan, and a vertical scan, but is not limited to the above-mentioned scan order.

[0216] According to an embodiment, the image decoding apparatus 100 may obtain processing block size information and may determine the size of one or more processing blocks included in a picture. The image decoding apparatus 100 may obtain processing block size information from a bitstream and may determine the size of one or more processing blocks included in a picture. The size of the processing block may be a preset size of a data unit indicated by the processing block size information.

[0217] According to an embodiment, the receiver 110 of the image decoding device 100 may obtain processing block size information from a bitstream according to each specific data unit. For example, the processing block size information may be obtained from a bitstream in a data unit such as an image, a sequence, a picture, a slice, a slice segment, a slice, or a slice group. That is, the receiver 110 may obtain processing block size information from a bitstream according to each of the various data units, and the image decoding device 100 may determine the size of one or more processing blocks divided from the picture by using the obtained processing block size information. The size of the processing block may be an integer multiple of the reference coding unit.

[0218] According to an embodiment, the image decoding apparatus 100 may determine the size of the processing blocks 1602 and 1612 included in the picture 1600. For example, the image decoding apparatus 100 may determine the size of the processing block based on the processing block size information obtained from the bitstream. Fig.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 the reference coding unit, and may determine the height of the processing blocks 1602 and 1612 to be four times the height of the reference coding unit. The image decoding apparatus 100 may determine the determination order of one or more reference coding units in one or more processing blocks.

[0219] According to an embodiment, the image decoding apparatus 100 may determine the processing blocks 1602 and 1612 included in the picture 1600 based on the size of the processing blocks, and may determine the determination order of one or more reference coding units in the processing blocks 1602 and 1612. According to an embodiment, the determination of the reference coding unit may include determination of the size of the reference coding unit.

[0220] According to an embodiment, the image decoding device 100 may obtain determination order information on one or more reference coding units included in one or more processing blocks from a bitstream, and may determine a determination order about one or more reference coding units based on the obtained determination order information. The determination order information may be defined as an order or direction for determining the reference coding units in the processing block. That is, the determination order of the reference coding units may be determined independently for each processing block.

[0221] According to an embodiment, the image decoding apparatus 100 may obtain the determination order information of the reference coding unit from the bitstream according to each specific data unit. For example, the receiver 110 may obtain the determination order information on the reference coding unit from the bitstream according to each data unit (such as an image, a sequence, a picture, a slice, a slice segment, a slice, a slice group, or a processing block). Because the determination order information of the reference coding unit indicates the order of the reference coding unit in the processing block, the determination order information may be obtained for each specific data unit including an integer number of processing blocks.

[0222] According to an embodiment, the image decoding apparatus 100 may determine one or more reference coding units based on the determined determination order.

[0223] According to an embodiment, the receiver 110 may obtain the determination order information on the reference coding unit from the bitstream as information related to the processing blocks 1602 and 1612, and the image decoding device 100 may determine the determination order of one or more reference coding units included in the processing blocks 1602 and 1612, and determine the one or more reference coding units included in the picture 1600 based on the determination order. Fig.16, the image decoding device 100 may determine determination orders 1604 and 1614 of one or more reference coding units in the processing blocks 1602 and 1612, respectively. For example, when determination order information on reference coding units is obtained with respect to each processing block, determination order information on different types of reference coding units may be obtained for the processing blocks 1602 and 1612. When the determination order 1604 of the reference coding units in the processing block 1602 is a raster scan order, the reference coding units included in the processing block 1602 may be determined according to the raster scan order. On the contrary, when the determination order 1614 of the reference coding units in another processing block 1612 is a reverse raster scan order, the reference coding units included in the processing block 1612 may be determined according to the reverse raster scan order.

[0224] According to an embodiment, the image decoding apparatus 100 may decode the determined one or more reference coding units. The image decoding apparatus 100 may decode an image based on the reference coding units determined as described above. The method of decoding the reference coding units may include various image decoding methods.

[0225] According to an embodiment, the image decoding device 100 may obtain block shape information indicating the shape of the current coding unit or division shape pattern information indicating the division method of the current coding unit from the bitstream, and may use the obtained information. The division shape pattern information may be included in a bitstream associated with various data units. For example, the image decoding device 100 may use the division shape pattern information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a slice header, or a slice group header. In addition, the image decoding device 100 may obtain a syntax element corresponding to the block shape information or the division shape pattern information from the bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and may use the obtained syntax element.

[0226] Hereinafter, a method for determining a division rule according to an embodiment of the present disclosure will be described in detail.

[0227] The image decoding device 100 may determine a division rule of the image. The division rule may be predetermined between the image decoding device 100 and the image encoding device 2200. The image decoding device 100 may determine the division rule of the image based on information obtained from the bitstream. The image decoding device 100 may determine the division rule based on information obtained from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a slice header, and a slice group header. The image decoding device 100 may determine the division rule differently according to a frame, a slice, a slice, a temporal layer, a maximum coding unit, or a coding unit.

[0228] The image decoding device 100 may determine the division rule based on the block shape of the coding unit. The block shape may include the size, shape, ratio of width and height, and direction of the coding unit. The image encoding device 2200 and the image decoding device 100 may predetermine the division rule based on the block shape of the coding unit. However, the embodiment is not limited thereto. The image decoding device 100 may determine the division rule based on information obtained from receiving a bit stream from the image encoding device 2200.

[0229] The shape of the coding unit may include a square and a non-square. When the lengths of the width and height of the coding unit are the same, the image decoding device 100 may determine the shape of the coding unit as a square. In addition, when the lengths of the width and height of the coding unit are different, the image decoding device 100 may determine the shape of the coding unit as a non-square.

[0230] The size of the coding unit may include various sizes such as 4×4, 8×4, 4×8, 8×8, 16×4, 16×8, and up to 256×256. The size of the coding unit may be classified based on the length of the long side, the length of the short side, or the area of ​​the coding unit. The image decoding device 100 may apply the same division rule to the coding units classified into the same group. For example, the image decoding device 100 may classify the coding units having the same long side length as having the same size. In addition, the image decoding device 100 may apply the same division rule to the coding units having the same long side length.

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

[0232] The image decoding device 100 may adaptively determine the division rule based on the size of the coding unit. The image decoding device 100 may determine the allowed division shape mode differently based on the size of the coding unit. For example, the image decoding device 100 may determine whether to allow division based on the size of the coding unit. The image decoding device 100 may determine the division direction according to the size of the coding unit. The image decoding device 100 may determine the allowable division type according to the size of the coding unit.

[0233] The division rule determined based on the size of the coding unit may be a division rule determined in advance between the image encoding apparatus 2200 and the image decoding apparatus 100. In addition, the image decoding apparatus 100 may determine the division rule based on information obtained from a bitstream.

[0234] The image decoding apparatus 100 may adaptively determine a split rule based on a location of a coding unit. The image decoding apparatus 100 may adaptively determine a split rule based on a location of a coding unit in an image.

[0235] In addition, the image decoding apparatus 100 may determine a division rule so that the coding units generated via different division paths do not have the same block shape. However, the embodiment is not limited thereto, and the coding units generated via different division paths have the same block shape. The coding units generated via different division paths may have different decoding processing orders. Because the decoding processing order has been referred to above Fig.12 has been described, so the details are not provided again.

[0236] In the following, reference will be made to Figures 17 to 20 A video encoding or decoding method according to an embodiment of the present disclosure is described in detail, wherein information about whether to apply an affine mode to a current block is received, and when the information about whether to apply the affine mode indicates that the affine mode is to be applied, an affine parameter group is determined according to a history-based affine parameter group candidate list, in which affine parameter groups of one or more blocks reconstructed in the affine mode before the current block are stored, and prediction is performed on the current block based on the affine parameter group.

[0237] Fig.17 is a block diagram of a video encoding apparatus according to an embodiment.

[0238] The video encoding device 1700 according to the embodiment may include a memory 1710 and at least one processor 1720 connected to the memory 1710. The operation of the video encoding device 1700 according to the embodiment may be performed by a separate processor or by control of a central processor. In addition, the memory 1710 of the video encoding device 1700 may store data received from an external device and data generated by the processor, for example, information on whether an affine mode is applied to a current block, a history-based affine parameter group candidate list, etc., in which the affine parameter groups of one or more blocks reconstructed in the affine mode before the current block are stored.

[0239] The processor 1720 of the video encoding device 1700 can determine whether to apply the affine mode to the current block. When it is determined that the affine mode is to be applied to the current block, the affine parameter group is determined according to a history-based affine parameter group candidate list, in which the affine parameter groups of one or more blocks encoded in the affine mode before the current block are stored, prediction is performed on the current block based on the affine parameter group, and information about whether the affine mode is applied to the current block is encoded.

[0240] In the following, reference will be made to Fig.18 The specific operation of the video encoding method is described in detail, wherein the video encoding device 1700 according to the embodiment determines whether to apply the affine mode to the current block. When it is determined that the affine mode is to be applied to the current block, the affine parameter group is determined according to a history-based affine parameter group candidate list, in which the affine parameter groups of one or more blocks encoded in the affine mode before the current block are stored, prediction is performed on the current block based on the affine parameter group, and information about whether the affine mode is applied to the current block is encoded.

[0241] The term "affine parameter set" used here refers to the set of affine parameters required to apply the affine mode and will be used in the following. Fig.22A The affine parameters are described in .

[0242] Fig.18 is a flowchart illustrating a video encoding method according to an embodiment.

[0243] refer to Fig.18 , in operation S1810, the video encoding apparatus 1700 may determine whether an affine mode is applied to a current block.

[0244] According to an embodiment, the affine mode may indicate an affine merge mode or an affine advanced motion vector prediction (AMVP) mode.

[0245] In operation S1820, when it is determined that an affine mode is to be applied to the current block, the video encoding device 1700 can determine the affine parameter group according to a history-based affine parameter group candidate list, in which the affine parameter groups of one or more blocks encoded in the affine mode before the current block are stored.

[0246] According to an embodiment, when there is a neighboring block encoded in affine mode among neighboring blocks of the current block, the affine parameter group can be determined based on the affine parameter information of the neighboring block encoded in affine mode and the history-based affine parameter group candidate list. The affine parameter information of the neighboring block encoded in affine mode can be information of an affine merge mode candidate or an affine AMVP mode candidate of the current block.

[0247] In operation S1850, the video encoding apparatus 1700 may perform prediction on the current block based on the affine parameter group.

[0248] According to an embodiment, the video encoding apparatus 1700 may add the affine parameter group of the current block to the history-based affine parameter group candidate list.

[0249] According to an embodiment, when the affine parameter group of the current block is added to the history-based affine parameter group candidate list, when the number of candidates included in the history-based affine parameter group candidate list is a predetermined maximum value, the video encoding device 1700 may remove the earliest stored affine parameter candidate from the history-based affine parameter group candidate list.

[0250] According to an embodiment, when the affine parameter group of the current block is added to the history-based affine parameter group candidate list, the video encoding device 1700 may maintain the history-based affine parameter group candidate list if the affine parameter group of the current block is the same as the affine parameter group existing in the history-based affine parameter group candidate list.

[0251] According to an embodiment, in the case where the current block is a block to be encoded first in a predetermined area including the current block, the video encoding device 1700 may reset the history-based affine parameter group candidate list, determine the affine parameter group based on the affine parameter information of the neighboring blocks encoded in the affine mode located around the current block, and perform prediction on the current block based on the determined affine parameter group. The predetermined area may be a maximum coding unit, a row of the maximum coding unit, or a slice. In addition, the video encoding device 1700 may add the affine parameter group of the current block to the history-based affine parameter group candidate list.

[0252] According to an embodiment, in the case where the current block is not a block to be encoded first in a predetermined area including the current block, the video encoding apparatus 1700 may determine an affine parameter group based on affine parameter information of neighboring blocks encoded in an affine mode located around the current block and a history-based affine parameter group candidate list, and perform prediction on the current block based on the determined affine parameter group. In addition, the video encoding apparatus 1700 may add the affine parameter group of the current block to the history-based affine parameter group candidate list.

[0253] In operation S1870, the video encoding apparatus 1700 may encode information about whether an affine mode is applied to the current block.

[0254] According to an embodiment, whether the affine mode is applied to the current block may be determined by calculating the sum of transformed differences (SATD) or the ratio of distortion optimization (RDO), and information on whether the affine mode is applied to the current block may be encoded and signaled.

[0255] Fig.19 and Fig. 20 A block diagram of a video decoding device according to an embodiment and a flow chart of a video decoding method according to an embodiment are respectively shown, which correspond to the above-mentioned video encoding device and video encoding method, respectively.

[0256] Fig.19A block diagram of a video decoding device according to an embodiment is shown.

[0257] The video decoding device 1900 according to an embodiment 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 performed by a separate processor or by control of a central processor. In addition, the memory 1910 of the video decoding device 1900 may store data received from an external device and data generated by the processor, for example, information on whether an affine mode is applied to a current block, a history-based affine parameter group candidate list in which an affine parameter group of one or more blocks reconstructed in an affine mode before the current block is stored, and the like.

[0258] The processor 1920 of the video decoding device 1900 can: receive information about whether to apply an affine mode to a current block; when the information about whether to apply the affine mode indicates that the affine mode is to be applied, determine an affine parameter group based on a history-based affine parameter group candidate list, in which affine parameter groups of one or more blocks reconstructed in the affine mode before the current block are stored; and perform prediction on the current block based on the affine parameter group.

[0259] In the following, reference will be made to Fig. 20 The specific operations of the video decoding method are described in detail, wherein the video decoding device 1900 according to the embodiment: receives information about whether to apply the affine mode to the current block; when the information about whether to apply the affine mode indicates that the affine mode will be applied, determines the affine parameter group according to a history-based affine parameter group candidate list, in which the affine parameter groups of one or more blocks reconstructed in the affine mode before the current block are stored; and performs prediction on the current block based on the affine parameter group.

[0260] Fig. 20 A flowchart of a video decoding method according to an embodiment is shown.

[0261] refer to Fig. 20 , in operation S2010, the video decoding apparatus 1900 may receive information about whether an affine mode is applied to a current block.

[0262] According to an embodiment, information on whether the affine mode is applied to the current block may have been determined and signaled during the encoding process.

[0263] According to an embodiment, the affine mode may indicate an affine merge mode or an affine AMVP mode.

[0264] In operation S2030, the video decoding apparatus 1900 may determine an affine parameter group according to a history-based affine parameter group candidate list in which affine parameter groups of one or more blocks reconstructed in an affine mode before a current block are stored.

[0265] According to an embodiment, when there is a neighboring block reconstructed in an affine mode among neighboring blocks of the current block, the affine parameter group can be determined according to the affine parameter information of the neighboring block reconstructed in the affine mode and the history-based affine parameter group candidate list. The affine parameter information of the neighboring block reconstructed in the affine mode can be information of an affine merge mode candidate or an affine AMVP mode candidate of the current block.

[0266] According to an embodiment, the video decoding apparatus 1900 may add the affine parameter group of the current block to the history-based affine parameter group candidate list.

[0267] According to an embodiment, when the affine parameter group of the current block is added to the history-based affine parameter group candidate list, when the number of candidates included in the history-based affine parameter group candidate list is a predetermined maximum value, the video decoding device 1900 may remove the earliest stored affine parameter candidate from the history-based affine parameter group candidate list.

[0268] According to an embodiment, when the affine parameter group of the current block is added to the history-based affine parameter group candidate list, the video decoding device 1900 may maintain the history-based affine parameter group candidate list if the affine parameter group of the current block is the same as the affine parameter group existing in the history-based affine parameter group candidate list.

[0269] In operation S2050, the video decoding apparatus 1900 may perform prediction on the current block based on the affine parameter group.

[0270] According to an embodiment, in the case where the current block is a block to be reconstructed first in a predetermined area including the current block, the video decoding device 1900 may reset the history-based affine parameter group candidate list, determine the affine parameter group based on the affine parameter information of the neighboring blocks reconstructed in the affine mode located around the current block, and perform prediction on the current block based on the determined affine parameter group. The predetermined area may be a maximum coding unit, a row of the maximum coding unit, or a slice. In addition, the video decoding device 1900 may add the affine parameter group of the current block to the history-based affine parameter group candidate list.

[0271] According to an embodiment, in the case where the current block is not a block to be reconstructed first in a predetermined area including the current block, the video decoding apparatus 1900 may determine an affine parameter group based on affine parameter information of neighboring blocks reconstructed in an affine mode located around the current block and a history-based affine parameter group candidate list, and perform prediction on the current block based on the determined affine parameter group. In addition, the video decoding apparatus 1900 may add the affine parameter group of the current block to the history-based affine parameter group candidate list.

[0272] Fig.21A A schematic diagram of history-based motion vector prediction (HMVP) is shown, and Fig. 21B The process of processing a list for HMVP is shown.

[0273] refer to Fig.21A , an HMVP candidate in which a plurality of pieces of motion information of a previously encoded block or a previously reconstructed block are stored is used for the HMVP. In detail, the HMVP list is maintained by a process of loading a table (i.e., an HMVP list) in which HMVP candidates are stored, decoding a block based on the HMVP candidate, and updating the motion information of the decoded block in the HMVP candidate table.

[0274] refer to Fig. 21B , the HMVP list refers to a list of the N most recently decoded motion vectors. When the number of motion vectors that can be stored in the HMVP list is L, before the HMVP list is updated, HMVP candidates from HMVP0 to HMVPL-1 and from index 0 to L-1 can be stored in the HMVP list. Thereafter, when the HMVP list is updated and a new HMVP candidate is then added, the motion information of the earliest stored HMVP0 among the candidates stored in the HMVP list can be removed. That is, the HMVP list is updated according to a first-in, first-out (FIFO) logic. In addition, before a new HMVP candidate is added to the HMVP list, it can be checked whether there is a candidate identical to the new HMVP candidate among the existing HMVP candidates. As a result of the check, when the same candidate exists, the new HMVP candidate may not be added.

[0275] Fig.22A A method of deriving a motion vector applied to a sample point of the current block 2200 in an affine mode is shown in detail.

[0276] In the affine mode, at least three affine parameters are required to derive the motion vector of the sample point of the current block 2200. In detail, the affine mode may include a 6-parameter affine mode, a 4-parameter affine mode, and a 3-parameter affine mode. Hereinafter, a method of deriving the motion vector of the sample point of the current block 2200 according to each affine mode will be described.

[0277] In the 6-parameter affine mode, the processor 1720 may obtain three motion vectors 2202, 2204, and 2206 from neighboring samples 2201, 2203, and 2205 of the current block 2200. The first motion vector 2202 may be obtained from neighboring samples of the upper left coordinate 2201 of the current block 2200. In addition, the second motion vector 2204 may be obtained from neighboring samples of the upper right coordinate 2203 of the current block 2200. The third motion vector 2206 may be obtained from neighboring samples of the lower left coordinate 2205 of the current block 2200. In FIG. 22 , the third motion vector 2206 is obtained based on the lower left coordinate 2205 of the current block 2200, but may also be obtained based on the lower right coordinate 2207 of the current block 2200 according to an embodiment. Also, the processor 1720 may determine the x component and the y component of the first motion vector 2202 , the x component and the y component of the second motion vector 2204 , and the x component and the y component of the third motion vector 2206 as affine parameters.

[0278] According to an embodiment, the first motion vector 2202 may be determined as an average of motion vectors of a plurality of neighboring blocks adjacent to the upper left coordinate 2201 of the current block 2200. Similarly, the second motion vector 2204 may be determined as an average of motion vectors of a plurality of neighboring blocks adjacent to the upper right coordinate 2203 of the current block 2200. In addition, the third motion vector 2206 may be determined as an average of motion vectors of a plurality of neighboring blocks adjacent to the lower left coordinate 2205 or the lower right coordinate 2207 of the current block 2200.

[0279] The motion vector 2210 of the sample 2208 of the current block 2200 may be determined based on the first motion vector 2202 , the second motion vector 2204 , and the third motion vector 2206 according to Equations 1 to 3.

[0280] In Equations 1 to 3, x represents a horizontal distance difference between an upper left coordinate 2201 of a current block 2200 and a sample 2208 of the current block 2200, and y represents a vertical distance difference between an upper left coordinate 2201 of the current block 2200 and a sample 2208 of the current block 2200. MV0 represents a first motion vector 2202, MV1 represents a second motion vector 2204, and MV2 represents a third motion vector 2206. MV represents a motion vector 2210 of the sample 2208 of the current block 2200. w represents a width of the current block 2200, and h represents a height of the current block 2200. dMVx represents a horizontal change rate of the motion vector 2210, and dMVy represents a vertical change rate of the motion vector 2210.

[0281] [Equation 1]

[0282] dMVx=(MV1-MV0) / w

[0283] [Equation 2]

[0284] dMVy=(MV2-MV0) / h

[0285] [Equation 3]

[0286] MV=MV0+x·dMVx+y·dMVy

[0287] Equation 1 indicates a method of obtaining a horizontal change rate (dMVx) of the motion vector 2210. According to Equation 1, a value obtained by subtracting the first motion vector 2202 from the second motion vector 2204 and dividing the resultant value by the width of the current block 2200 is determined as the horizontal change rate of the motion vector 2210.

[0288] Equation 2 indicates a method of obtaining the vertical change rate (dMVy) of the motion vector 2210. According to Equation 2, a value obtained by subtracting the first motion vector 2202 from the third motion vector 2206 and dividing the resultant value by the height of the current block 2200 is determined as the vertical change rate of the motion vector 2210.

[0289] Equation 3 indicates a method of obtaining the motion vector 2210. According to Equation 3, the motion vector 2210 is determined as a value obtained by adding the first motion vector (MV0) 2202 to the inner product of the coordinates (x, y) of the sample point 2208 of the current block 2200 relative to the upper left coordinates 2201 of the current block 2200 and the vertical change rate and the horizontal change rate (dMVx, dMVy).

[0290] The motion vectors of all samples or sub-blocks included in the current block 2200 may be determined according to Equations 1 to 3. According to Equations 1 to 3, it may be determined that the motion vectors of the samples are different according to the positions of the samples. Equations 1 and 2 may be applied to the case where the vertical components of the coordinates from which the first motion vector 2202 and the second motion vector 2204 are extracted are the same, and the horizontal components of the coordinates from which the first motion vector 2202 and the third motion vector 2206 are extracted are the same. Therefore, the following will refer to Fig.28 The general equation for determining the motion vector of the current block 2200 is described.

[0291] In the 6-parameter affine mode, the motion vector 2210 is determined by three motion vectors, so the reference block of the current block 2200 can be scaled, rotated, and sheared from the current block 2200.

[0292] In the 4-parameter affine mode, the processor 1720 may obtain two motion vectors 2202 and 2204 from neighboring samples of the current block 2200. As in the 6-parameter affine mode, the first motion vector 2202 may be obtained from neighboring samples of the upper left coordinate of the current block 2200. Similarly, the second motion vector 2204 may be obtained from neighboring samples of the upper right coordinate of the current block 2200. Furthermore, the processor 1720 may determine the x-component and y-component of the first motion vector 2202 and the x-component and y-component of the second motion vector 2204 as affine parameters.

[0293] In the 4-parameter affine mode, the third motion vector 2206 is not determined from the lower left coordinate or the lower right coordinate of the current block 2200 , but is determined by combining the first motion vector 2202 and the second motion vector 2204 .

[0294] Equation 4 and Equation 5 indicate a method of determining the third motion vector 2206 by combining the first motion vector 2202 and the second motion vector 2204. In Equation 4 and Equation 5, x represents the horizontal component of the motion vector and y represents the vertical component of the motion vector. MV0 represents the first motion vector 2202, MV1 represents the second motion vector 2204, and MV2 represents the third motion vector 2206. w represents the width of the current block 2200, and h represents the height of the current block 2200.

[0295] [Equation 4]

[0296] MV2[x]=(MV1[y]-MV0[y])*w / h+MV0[x]

[0297] [Equation 5]

[0298] MV2[y]=(MV0[x]-MV1[x])*w / h+MV0[y]

[0299] According to Equation 4, the horizontal coordinate value (MV2[x]) of the third motion vector 2206 is determined as the value ((MV1[y]-MV0[y])*w / h+MV0[x]), which is obtained by adding the horizontal coordinate value (MV0[x]) of the first motion vector 2202 to the value obtained by subtracting the vertical coordinate value of the first motion vector 2202 from the vertical coordinate value of the second motion vector 2204 (MV1[y]-MV0[y]) and the product of the value (w / h) obtained by dividing the width of the current block by the height of the current block.

[0300] According to Equation 5, the vertical coordinate value (MV2[y]) of the third motion vector 2206 is determined as the value ((MV0[x]-MV1[x])*w / h+MV0[y]), which is obtained by adding the vertical coordinate value (MV0[y]) of the first motion vector 2202 to the value obtained by subtracting the horizontal coordinate value of the second motion vector 2204 from the horizontal coordinate value of the first motion vector 2202 (MV0[x]-MV1[x]) and the product of the value (w / h) obtained by dividing the width of the current block by the height of the current block.

[0301] In the 4-parameter affine mode, the x-component and the y-component of the third motion vector 2206 are derived from the first motion vector 2202 and the second motion vector 2204. Therefore, unlike the 6-parameter affine mode, in the 4-parameter affine mode, only the reference block of the current block 2200 can be scaled and rotated from the current block 2200 based on the first motion vector 2202 and the second motion vector 2204. That is, in the 4-parameter affine mode, the current block 2200 is not sheared.

[0302] In the 3-parameter affine mode, the processor 1720 may obtain two motion vectors 2202 and 2204 from neighboring samples of the current block 2200. The first motion vector 2202 may be obtained from neighboring samples of the upper left coordinates of the current block 2200. Similarly, the second motion vector 2204 may be obtained from neighboring samples of the upper right coordinates of the current block 2200. However, unlike the 4-parameter affine mode, in the 3-parameter affine mode, only the x component or the y component is obtained from the second motion vector 2204. Therefore, the processor 1720 may determine the x component or the y component of the second motion vector 2204 and the x component and the y component of the first motion vector 2202 as affine parameters.

[0303] When the x component of the second motion vector 2204 is available, the y component of the second motion vector 2204 is obtained from the y component of the first motion vector 2202. Conversely, when the y component of the second motion vector 2204 is available, the x component of the second motion vector 2204 is obtained from the x component and the y component of the first motion vector 2202 and the y component of the second motion vector 2204. Equations 6 and 7 below indicate methods of determining the y component and the x component of the second motion vector 2204, respectively.

[0304] In Equation 6 and Equation 7, x represents the horizontal component of the motion vector and y represents the vertical component of the motion vector. MV0 represents the first motion vector 2202, MV1 represents the second motion vector 2204, and MV2 represents the third motion vector. w represents the width of the current block 2200, and h represents the height of the current block 2200.

[0305] [Equation 6]

[0306] MV1[y]=MV0[y]

[0307] [Equation 7]

[0308] MV1[x]=sqrt(w2-(MV1[y]-MV0[y])2)+MV0[x]–w

[0309] According to Equation 6, when only the x component of the second motion vector 2204 is available, the processor 1720 determines that the y component of the second motion vector 2204 is the same as the y component of the first motion vector 2202 .

[0310] According to Equation 7, when only the y component of the second motion vector 2204 is available, the processor 1720 determines the x component of the second motion vector 2204 based on the x component and y component of the first motion vector 2202 (MV0[x], MV0[y]) and the y component of the second motion vector 2204 (MV1[y]).

[0311] In addition, as in the 4-parameter affine mode, the x-component and the y-component of the third motion vector 2206 are determined according to Equations 4 and 5. In the 3-parameter affine mode, together with the third motion vector 2206, the unavailable components among the x-component and the y-component of the second motion vector 2204 are derived from the available components among the x-component and the y-component of the first motion vector 2202 and the second motion vector 2204. Therefore, in the 3-parameter affine mode, only the reference block of the current block 2200 may be scaled or rotated from the current block 2200 based on the first motion vector 2202 and the second motion vector 2204. When the x-component of the second motion vector 2204 is available, only the reference block of the current block 2200 may be scaled from the current block 2200. On the contrary, the y-component of the second motion vector 2204 is available, only the reference block of the current block 2200 may be rotated from the current block 2200.

[0312] Fig. 22B A method for deriving an affine parameter set from surrounding information in an affine mode is shown.

[0313] Affine mode refers to an inter-frame prediction method that obtains the motion vector of the sample included in the current block by performing affine transformation on the motion vector obtained from the adjacent sample of the current block. Affine mode may include affine merge mode, affine AMVP mode (or affine inter-frame mode), etc.

[0314] Will refer to Fig. 22B A method of deriving affine parameter group candidates from affine mode applied blocks around a current block is described in detail.

[0315] In the affine merge mode or the affine AMVP mode, an affine parameter group for applying the affine mode to the current block can be obtained from the affine merge candidate list or the affine AMVP candidate list. However, when a suitable affine parameter group is not available from the affine merge candidate list or the affine AMVP candidate list, the affine parameter group of the current block can be derived from the information of the neighboring blocks.

[0316] exist Fig. 22B When the upper left coordinate of the current picture is (0, 0), by using the upper left (x E0 ,y E0 )'s motion vector Top right (x E1 ,y E1 )'s motion vector and the lower left (x E2 ,y E2 )'s motion vector Can be with Fig. 22B The upper left corner (x 0 ,y 0 )'s motion vector and upper right (x 1 ,y 1 )'s motion vector exist Fig. 22B In the equation, v E0x 、v E1x and v E2x Respectively and The x-component vector, and v E0y 、v E1y and v E2y Respectively and The y-component vector of .

[0317] When the affine parameter group is derived in the above method, there is a problem that the upper boundary line of the current prediction unit coincides with the upper boundary line of the maximum coding unit. In detail, because the motion vector line buffer is used to store motion information of blocks that are in contact with the upper side of the maximum coding unit, when the upper side of the current prediction unit is the upper boundary line of the maximum coding unit, there is a problem that an additional line buffer is required instead of a general line buffer in order to derive Fig. 22B The upper left corner of the current prediction unit (x 0 ,y 0 )'s motion vector v 0 and upper right (x 1 ,y 1 )'s motion vector v 1This is because in the general line buffer, only the motion vector v E2 is accessible, and the motion vector v E0 and v E1 is not accessible.

[0318] To solve this problem, a history-based candidate list of affine parameter groups can be used. The history-based candidate list of affine parameter groups will be Fig.23 Described in detail in.

[0319] Fig.23 A method of determining an affine parameter group candidate for a current block based on a history-based affine parameter group candidate list is shown.

[0320] refer to Fig.23 , when the current frame 2300 is divided into a plurality of blocks 2301 to 2323 and an affine mode 2317 is to be applied to the current block, there are blocks 2301, 2303, 2305, 2307, 2311, 2314, and 2316 reconstructed in the affine mode before the current block from among the blocks. Information of the blocks 2301, 2303, 2305, 2307, 2311, 2314, and 2316 reconstructed in the affine mode before the current block is respectively stored in the history-based affine parameter group candidate list.

[0321] First, an affine parameter group required for the current block to which the affine mode is to be applied may be obtained from an affine merge candidate list or an affine AMVP candidate list of the current block according to the affine merge mode or the affine AMVP mode. However, when the affine parameter group of the current block is not available from the affine merge candidate list or the affine AMVP candidate list of the current block, the affine parameter group of the current block may be determined by obtaining affine information from a history-based affine parameter group candidate list in which affine parameter groups of blocks reconstructed in the affine mode before the current block are stored.

[0322] For example, in Fig.23 , the affine parameter group of the current block can be determined from the history-based affine parameter group candidate list in which the affine parameter groups of the blocks 2301, 2303, 2305, 2307, 2311, 2314, and 2316 reconstructed by applying the affine mode before the current block 2317 are stored. Therefore, the affine parameter group of the current block can be determined based on the affine information on the blocks other than the neighboring blocks adjacent to the current block 2317.

[0323] In addition, when selecting available affine parameter group candidates from the history-based affine parameter group candidate list to determine the affine parameter group of the current block, a pruning process may be applied to select a more appropriate model.

[0324] According to an embodiment, an affine parameter group candidate in the history-based affine parameter group candidate list may be considered only when a boundary of the current block is shared.

[0325] According to an embodiment, the affine parameter group candidates may be arranged in the history-based affine parameter group candidate list according to the distance from the position of the current block (eg, the central position or the upper left corner position of the current block).

[0326] According to an embodiment, affine parameter group candidates in the history-based affine parameter group candidate list that are within a certain threshold distance from the current block may be considered.

[0327] According to an embodiment, when the x-coordinate at the right edge of a block reconstructed in an affine mode before the current block and the x-coordinate at the upper left corner of the current block are the same as each other, or when the y-coordinate at the lower edge of a block reconstructed in an affine mode before the current block and the y-coordinate at the upper right corner of the current block are the same as each other, the affine parameter group candidate in the history-based affine parameter group candidate list may be considered.

[0328] In this case, with Fig. 22B Unlike the affine parameter group derived from the motion information of the adjacent blocks in the image, the affine parameter group can be determined from a history-based affine parameter group candidate list in which N predetermined affine parameter group candidates are stored. Therefore, the number of buffers can be reduced by using a buffer with an appropriate capacity in which N predetermined affine parameter group candidates are stored instead of unnecessary additional line buffers.

[0329] The affine parameter group may include the width and height of the block, the upper left position, the upper left motion vector, the upper right motion vector, and the lower left motion vector, may include the upper left position, the upper right position, the lower left position, the upper left motion vector, the upper right motion vector, and the lower left motion vector, may include the width, height, the upper left position, the upper left motion vector, and the upper right motion vector, or may include the width, height, the upper left position, the upper left motion vector, the vertical change of the motion vector, and the horizontal change of the motion vector.

[0330] Fig.24 A flowchart of a video encoding method according to another embodiment is shown.

[0331] Fig.17 The video encoding device 1700 may perform the Fig.24 The operation of the video encoding method.

[0332] The video encoding device 1700 may include a memory 1710 and at least one processor 1720 connected to the memory 1710. The operation of the video encoding device 1700 according to the embodiment may be performed by a separate processor or by control of a central processing unit. In addition, the memory 1710 of the video encoding device 1700 may store data received from an external device and data generated by the processor, for example, information about a history-based motion vector candidate list in which motion vectors of blocks encoded before the current block are stored, etc.

[0333] The processor 1720 of the video encoding device 1700 can: determine whether the current block is a block to be encoded first in a predetermined area including the current block; when the current block is the block to be encoded first, reset the history-based motion vector candidate list and perform prediction on the current block based on motion information of neighboring blocks of the current block, in which motion vectors of blocks encoded before the current block are stored; and when the current block is not the block to be encoded first, perform prediction on the current block based on the motion information of the neighboring blocks of the current block and the history-based motion vector candidate list.

[0334] refer to Fig.24 , in operation S2410, the video encoding apparatus 1700 may determine whether a current block is a block to be encoded first in a predetermined region including the current block.

[0335] According to an embodiment, the predetermined area may be a maximum coding unit (CTU), a row of a maximum coding unit (CTUROW), or a slice. In operation S2430, when the current block is a block to be encoded first, the video encoding apparatus 1700 may reset a history-based motion vector candidate list in which motion vectors of blocks encoded before the current block are stored, and perform prediction on the current block based on motion information of neighboring blocks of the current block.

[0336] In operation S2450, when the current block is not a block to be encoded first, the video encoding apparatus 1700 may perform prediction on the current block according to motion information of neighboring blocks of the current block and a history-based motion vector candidate list.

[0337] According to an embodiment, the video encoding apparatus 1700 may store the motion vector of the current block in a history-based motion vector candidate list.

[0338] According to an embodiment, when the motion vector of the current block is stored in a history-based motion vector candidate list, when the number of motion vector candidates stored in the history-based motion vector candidate list is a predetermined maximum value, the video encoding device 1700 can remove the motion vector of the earliest stored block from the history-based motion vector candidate list.

[0339] According to an embodiment, when the motion vector of the current block is stored in the history-based motion vector candidate list, the video encoding device 1700 may maintain the history-based motion vector candidate list if the motion vector of the current block is the same as the motion vector existing in the history-based motion vector candidate list.

[0340] Fig.25 A flowchart of a video decoding method according to another embodiment is shown.

[0341] The video decoding apparatus 1900 may perform operations according to a video decoding method.

[0342] 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 the embodiment may be performed by a separate processor or by the control of a central processing unit. In addition, the memory 1910 of the video decoding device 1900 may store data received from an external device and data generated by the processor, for example, information about a history-based motion vector candidate list in which motion vectors of blocks reconstructed before a current block are stored, etc.

[0343] The processor 1920 of the video decoding device 1900 can: determine whether the current block is a block to be reconstructed first in a predetermined area including the current block; when the current block is a block to be reconstructed first, reset the history-based motion vector candidate list and perform prediction on the current block based on motion information of neighboring blocks of the current block, in which motion vectors of blocks reconstructed before the current block are stored; and when the current block is not a block to be reconstructed first, perform prediction on the current block based on the motion information of neighboring blocks of the current block and the history-based motion vector candidate list.

[0344] refer to Fig.25 , in operation S2510, the video decoding apparatus 1900 may determine whether the current block is a block to be reconstructed first in a predetermined region including the current block.

[0345] According to an embodiment, the predetermined area may be a maximum coding unit (CTU), a row of a maximum coding unit (CTU row), or a slice.

[0346] In operation S2530, when the current block is a block to be reconstructed first, the video decoding device 1900 can reset the history-based motion vector candidate list and perform prediction on the current block based on motion information of neighboring blocks of the current block, in which the motion vectors of blocks reconstructed before the current block are stored.

[0347] In operation S2550, when the current block is not a block to be reconstructed first, the video decoding apparatus 1900 may perform prediction on the current block according to motion information of neighboring blocks of the current block and a history-based motion vector candidate list.

[0348] According to an embodiment, the video decoding apparatus 1900 may store the motion vector of the current block in a history-based motion vector candidate list.

[0349] According to an embodiment, when the motion vector of the current block is stored in a history-based motion vector candidate list, when the number of motion vector candidates stored in the history-based motion vector candidate list is a predetermined maximum value, the video decoding device 1900 can remove the motion vector of the earliest stored block from the history-based motion vector candidate list.

[0350] According to an embodiment, when the motion vector of the current block is stored in the history-based motion vector candidate list, when the motion vector of the current block is the same as the motion vector existing in the history-based motion vector candidate list, the video decoding device 1900 may maintain the history-based motion vector candidate list.

[0351] Fig.26 The line buffer required to access motion information at the boundary of a maximum coding unit is shown.

[0352] refer to Fig.26 , when the upper side of the current block coincides with the upper boundary line of the maximum coding unit, blocks A, B, C, and D that the current block can refer to are located above the maximum coding unit including the current block, so it is necessary to access the motion vector line buffer using the motion information of blocks A, B, C, and D. Access to the line buffer can be completely eliminated by using a history-based motion vector candidate list, in which motion vectors of blocks reconstructed before the current block are stored. Even if access to the line buffer is completely eliminated, the derivation of the AMVP candidate or merge candidate only affects the blocks directly below the upper boundary line of the maximum coding unit, so the impact on performance is minimized.

[0353] Fig.27A An example of identifying each region having a history-based motion vector candidate list in a frame is shown, and Fig.27BAnother example of identifying each region in a frame that has a history-based motion vector candidate list is shown.

[0354] When using a history-based motion vector candidate list, all blocks processed before the current block can be requested according to the encoding order. In this case, since the adjacent blocks must be fully processed, effective parallel processing is not possible.

[0355] Will refer to Fig.27A and Fig.27B A method of using a plurality of history-based motion vector candidate lists based on specific regions, that is, a method of using a history-based motion vector candidate list for each specific region is described in detail. In detail, when the history-based motion vector candidate list of the current block is accessed, the history-based motion vector candidate list belonging to the specific region corresponding to the current block is selected, and when the history-based motion vector candidate list is updated, the history-based motion vector candidate list in the specific region corresponding to the current block is updated. Therefore, since each region has a history-based motion vector candidate list, the dependency on other regions can be removed and efficient parallel processing can be allowed.

[0356] refer to Fig.27A , the current frame (or current picture) may be divided into regions 1 to 6, and each history-based motion vector candidate list may be used. In detail, the history-based motion vector candidate list storing the motion vector candidates of region 1 is used for blocks belonging to region 1 having a size of M×N, and when prediction is performed on blocks of region 2, the history-based motion vector candidate list may be reset. Therefore, when prediction is performed on region 2, samples of region 2 may be reconstructed without relying on data of samples of region 1. Thereafter, the motion vector candidates of the reconstructed blocks belonging to region 2 may be stored in the history-based motion vector candidate list.

[0357] Region 1 to region 6 may be a slice unit, a slice unit, a maximum coding unit, or the like.

[0358] refer to Fig.27B , the current frame (or current picture) may be divided into regions 1 to 4, and each history-based motion vector candidate list may be used. In detail, the history-based motion vector candidate list storing the motion vector candidates of region 1 is used for the blocks belonging to region 1 having M lines, and when prediction is performed on the blocks of region 2, the history-based motion vector candidate list may be reset. Therefore, when prediction is performed on region 2, the samples of region 2 may be reconstructed without depending on the data of the samples of region 1. Thereafter, the motion vector candidates of the reconstructed blocks belonging to region 2 may be stored in the history-based motion vector candidate list.

[0359] Region 1 to Region 4 may be a slice unit, a slice unit, a maximum coding unit, etc. Also, Region 1 to Region 4 may be a row (CTU row) of a maximum coding unit.

[0360] Fig.28 The method of determining the motion vector of the current block in an affine mode is shown. The following equations 8 to 10 indicate the method of determining the motion vector of the current block in an affine mode. Fig.28 A method of determining a motion vector of a current block by using motion vector extraction positions 2800, 2810, and 2820.

[0361] In Equation 8 and Equation 9, w represents the horizontal distance between the first motion vector extraction position 2800 and the second motion vector extraction position 2810. h represents the vertical distance between the first motion vector extraction position 2800 and the third motion vector extraction position 2820. x represents the horizontal distance between the first motion vector extraction position 2800 and the third motion vector extraction position 2820. y represents the vertical distance between the first motion vector extraction position 2800 and the second motion vector extraction position 2810.

[0362] P 0 represents the first motion vector, P 1 represents the second motion vector, and P 2 represents the third motion vector. dx and dy represent the horizontal change and the vertical change respectively.

[0363] [Equation 8]

[0364]

[0365] [Equation 9]

[0366]

[0367] The horizontal change amount is determined according to Equation 8, and the vertical change amount is determined according to Equation 9. In addition, according to Equation 10, the motion vector of the sample 2830 of the current block is determined based on the horizontal change amount and the vertical change amount. In Equation 10, Pa represents the motion vector of the sample 2830 of the current block. In addition, i represents the horizontal distance between the first motion vector extraction position 2800 and the sample 2830 of the current block, and j represents the vertical distance between the first motion vector extraction position 2800 and the sample 2830 of the current block.

[0368] [Equation 10]

[0369] Pa=P0+idx+jdy

[0370] When three motion vectors and an extraction position of each motion vector are given according to Equation 8 to Equation 10, a motion vector of a sample included in the current block may be determined.

[0371] So far, various embodiments have been described. It will be appreciated by those skilled in the art that the scope of the present disclosure may be modified without departing from the inherent characteristics of the present disclosure. Therefore, the disclosed embodiments should be considered from a descriptive perspective rather than a restrictive perspective. The scope of the present disclosure is defined in the appended claims rather than in the above detailed description, and it should be noted that all differences falling within the claims and their equivalents are included within the scope of the present disclosure.

[0372] Meanwhile, the embodiments of the present disclosure may be written as a program executable on a computer and implemented on a general-purpose digital computer that uses a computer-readable recording medium to run the program. The computer-readable recording medium may include a storage medium such as a magnetic storage medium (e.g., a read-only memory (ROM), a floppy disk, a hard disk, etc.) and an optical reading medium (e.g., a compact disc ROM (CD-ROM) or a digital versatile disc (DVD), etc.).

Claims

1. A video decoding method, include: When a current block is a block to be decoded first in a predetermined area including the current block, determining a motion vector predictor of the current block based on motion information of neighboring blocks of the current block except for motion information stored in the history-based motion vector candidate list; as well as When the current block is not a block to be decoded first in a predetermined area including the current block, determining a motion vector predictor of the current block based on motion information of neighboring blocks of the current block and at least one of motion information stored in the history-based motion vector candidate list, and The predetermined area is a row including a maximum coding unit. The motion vector predictor of the current block is stored in the history-based motion vector candidate list.

2. A video encoding method, include: When a current block is a block to be encoded first in a predetermined area including the current block, determining a motion vector predictor of the current block based on motion information of neighboring blocks of the current block except for motion information stored in the history-based motion vector candidate list; as well as When the current block is not a block to be encoded first in a predetermined area including the current block, determining a motion vector predictor of the current block based on at least one of motion information of neighboring blocks of the current block and motion information stored in the history-based motion vector candidate list, and The predetermined area is a row including a maximum coding unit. The motion vector predictor of the current block is stored in the history-based motion vector candidate list.

3. A device for transmitting a bit stream, the bit stream being generated by the video encoding method according to claim 2.