Method and apparatus for decoding video, and method and apparatus for encoding video

By determining the availability of motion vectors of adjacent blocks in video encoding and decoding, and using the motion vectors of available adjacent blocks or default motion vectors for prediction, the problem of low coding efficiency when motion vectors are unavailable is solved, and more efficient video encoding and decoding is achieved.

CN114026870BActive Publication Date: 2025-09-19SAMSUNG ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202080047088.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-06-27
Filing Date
2020-06-26
Publication Date
2025-09-19
Estimated Expiration
2040-06-26

AI Technical Summary

Technical Problem

In video encoding and decoding processes, it is difficult in the prior art to effectively determine whether motion vectors of adjacent blocks at positions corresponding to the motion vector resolution are available, resulting in low encoding efficiency.

Method used

By determining whether the motion vectors of adjacent blocks at corresponding positions of multiple motion vector resolutions are available, when available, the motion vector of the adjacent block is used as a prediction factor of the current block; when unavailable, one of the motion vectors of the two adjacent blocks of the current block is used as a default motion vector, and prediction is performed based on the motion vector prediction factor of the current block.

Benefits of technology

Improves coding efficiency in video encoding and decoding processes, ensures reliable block motion vector insertion when motion vectors are unavailable, and improves encoding quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114026870B_ABST
    Figure CN114026870B_ABST
Patent Text Reader

Abstract

Provided are a method and apparatus for decoding a video, comprising: determining, in a video encoding and decoding process, whether a motion vector of a neighboring block at a position corresponding to one motion vector resolution among a plurality of motion vector resolutions is available; when the motion vector of the neighboring block corresponding to the one motion vector resolution is available, obtaining the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one motion vector resolution is unavailable, obtaining a default motion vector of the one motion vector resolution by using the motion vector of one neighboring block of two neighboring blocks of the current block, and obtaining the default motion vector as a motion vector predictor of the current block; and performing prediction on the current block based on the motion vector predictor of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a video decoding method and a video decoding device, and more particularly, to a video encoding method and device and a video decoding method and device, wherein the video encoding method and device and the video decoding method and device include: determining whether a motion vector of a neighboring block at a position corresponding to one motion vector resolution among multiple motion vector resolutions is available; when the motion vector of the neighboring block corresponding to one motion vector resolution is available, obtaining the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to one motion vector resolution is unavailable, obtaining a default motion vector of one motion vector resolution by using the motion vector of one of two neighboring blocks of the current block, and obtaining the default motion vector as the motion vector predictor of the current block; and performing prediction on the current block based on the motion vector predictor of the current block. Background Art

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

[0003] With the development and availability 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. Encoded image content can be reproduced by decoding it. Recently, methods for efficiently compressing such high-resolution or high-definition image content have been developed. For example, methods have been proposed for efficiently implementing image compression techniques by dividing the processing of an image to be encoded using a random method or by processing rendering data. Summary of the Invention

[0004] Technical issues

[0005] In video encoding and decoding processing, a method and apparatus are provided for determining whether a motion vector of a neighboring block at a position corresponding to one motion vector resolution among multiple motion vector resolutions is available; when the motion vector of the neighboring block corresponding to the one motion vector resolution is available, obtaining the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one motion vector resolution is not available, obtaining a default motion vector of the one motion vector resolution by using the motion vector of one neighboring block of two neighboring blocks of the current block, and obtaining the default motion vector as the motion vector predictor of the current block; and performing prediction on the current block based on the motion vector predictor of the current block.

[0006] Solution to the problem

[0007] In order to solve this technical problem, a video decoding method is provided, including: determining whether a motion vector of a neighboring block at a position corresponding to one motion vector resolution among multiple motion vector resolutions is available; when the motion vector of the neighboring block corresponding to the one motion vector resolution is available, obtaining the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one motion vector resolution is not available, obtaining a default motion vector of the one motion vector resolution by using the motion vector of one neighboring block of two neighboring blocks of the current block, and obtaining the default motion vector as the motion vector predictor of the current block; and performing prediction on the current block based on the motion vector predictor of the current block.

[0008] In order to solve this technical problem, a video decoding device is provided, including: a memory; and at least one processor connected to the memory, wherein the at least one processor is configured to perform the following operations: determine whether a motion vector of a neighboring block at a position corresponding to one motion vector resolution among multiple motion vector resolutions is available; when the motion vector of the neighboring block corresponding to the one motion vector resolution is available, obtain the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one motion vector resolution is not available, obtain a default motion vector of the one motion vector resolution by using the motion vector of one of two neighboring blocks of the current block, and obtain the default motion vector as the motion vector predictor of the current block; and perform prediction on the current block based on the motion vector predictor of the current block.

[0009] In order to solve this technical problem, a video encoding method is provided, including: determining whether a motion vector of a neighboring block at a position corresponding to one motion vector resolution among multiple motion vector resolutions is available; when the motion vector of the neighboring block corresponding to the one motion vector resolution is available, obtaining the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one motion vector resolution is not available, obtaining a default motion vector of the one motion vector resolution by using the motion vector of one neighboring block of two neighboring blocks of the current block, and obtaining the default motion vector as the motion vector predictor of the current block; and performing prediction on the current block based on the motion vector predictor of the current block.

[0010] In order to solve this technical problem, a video encoding device is provided, including: a memory; and at least one processor connected to the memory, wherein the at least one processor can be configured to perform the following operations: determine whether a motion vector of a neighboring block at a position corresponding to one motion vector resolution among multiple motion vector resolutions is available; when the motion vector of the neighboring block corresponding to the one motion vector resolution is available, obtain the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one motion vector resolution is not available, obtain a default motion vector of the one motion vector resolution by using the motion vector of one of the two neighboring blocks of the current block, and obtain the default motion vector as the motion vector predictor of the current block; and perform prediction on the current block based on the motion vector predictor of the current block.

[0011] Disclosed beneficial effects

[0012] In a video encoding and decoding process, it is determined whether a motion vector of a neighboring block at a position corresponding to one motion vector resolution among a plurality of motion vector resolutions is available; when the motion vector of the neighboring block corresponding to the one motion vector resolution is available, the motion vector of the neighboring block is obtained as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one motion vector resolution is not available, a default motion vector of the one motion vector resolution is obtained by using the motion vector of one neighboring block of two neighboring blocks of the current block, and the default motion vector is obtained as a motion vector predictor of the current block; and prediction is performed on the current block based on the motion vector predictor of the current block, so that when motion information of the neighboring block at a position corresponding to the motion vector resolution is not available, a motion vector of a reliable block can be inserted, thereby improving encoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

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

[0017] Figure 5 A process of splitting coding units 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.

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

[0019] Figure 7 Illustrated is 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.

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

[0021] Figure 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.

[0022] Figure 10 It is shown that when a second coding unit having a non-square shape determined when an image decoding apparatus splits a first coding unit satisfies a predetermined condition, shapes into which the second coding unit may be divided are limited according to an embodiment.

[0023] Figure 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.

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

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

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

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

[0028] Figure 16A processing block serving as a unit for determining an order of reference coding units included in a picture according to an embodiment is illustrated.

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

[0030] Figure 18 is a flowchart illustrating a video encoding method according to an embodiment.

[0031] Figure 19 A block diagram of a video decoding apparatus according to an embodiment is shown.

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

[0033] Figure 21 A diagram for describing a maximum coding unit and an encoding order of coding units included in the maximum coding unit.

[0034] Figure 22 This is a diagram for describing positions of multiple neighboring blocks corresponding to multiple motion vector resolutions (MVRs) and positions of two neighboring blocks for obtaining a default motion vector when motion information of a left neighboring block and a right neighboring block of a current block is unavailable or when motion information of a left neighboring block of the current block is available, according to an embodiment.

[0035] Figure 23 is a diagram for describing positions of a plurality of neighboring blocks corresponding to a plurality of MVRs and positions of two neighboring blocks for obtaining a default motion vector when motion information of a right neighboring block of a current block is available according to an embodiment.

[0036] Figure 24a is a diagram for describing positions of a plurality of neighboring blocks corresponding to a plurality of MVRs and positions of two neighboring blocks for obtaining a default motion vector when motion information of left and right neighboring blocks of a current block is available according to an embodiment.

[0037] Figure 24b is a diagram for describing positions of multiple neighboring blocks corresponding to multiple MVRs and positions of two neighboring blocks for obtaining a default motion vector when motion information of left and right neighboring blocks of a current block is available according to another embodiment.

[0038] Figure 25 is a diagram for describing interpolation for determining a motion vector according to various MVRs.

[0039] Figure 26 a to Figure 26d shows positions of pixels that the motion vector can indicate in response to 1 / 4 pixel unit MVR, 1 / 2 pixel unit MVR, 1 pixel unit MVR, and 2 pixel unit MVR when the supportable minimum MVR is 1 / 4 pixel unit MVR.

[0040] Figure 27 is a diagram for describing history-based motion vector prediction.

[0041] Figure 28a is a diagram for describing a method of using neighboring blocks other than two neighboring blocks for obtaining a default motion vector when motion information of both the left and right neighboring blocks of a current block is unavailable or when motion information of the left neighboring block of the current block is available, according to an embodiment.

[0042] Figure 28b is a diagram for describing a method of using neighboring blocks other than two neighboring blocks for obtaining a default motion vector when motion information of a right neighboring block of a current block is available, according to an embodiment.

[0043] Figure 28c is a diagram for describing a method of using neighboring blocks other than two neighboring blocks for obtaining a default motion vector when motion information of both left and right neighboring blocks of a current block is available, according to an embodiment.

[0044] Best Way

[0045] According to an embodiment of the present disclosure, a video decoding method may include: determining whether a motion vector of a neighboring block at a position corresponding to one motion vector resolution among multiple motion vector resolutions is available; when the motion vector of the neighboring block corresponding to the one motion vector resolution is available, obtaining the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one motion vector resolution is not available, obtaining a default motion vector of the one motion vector resolution by using the motion vector of one of two neighboring blocks of the current block, and obtaining the default motion vector as the motion vector predictor of the current block; and performing prediction on the current block based on the motion vector predictor of the current block.

[0046] According to an embodiment, the positions of the neighboring blocks corresponding to the plurality of motion vector resolutions may be determined based on availability of neighboring motion information of the current block.

[0047] According to an embodiment, the two neighboring blocks may include a first neighboring block and a second neighboring block, and the positions of the first neighboring block and the second neighboring block may be determined based on the availability of neighboring motion information of the current block. When the motion vector of the first neighboring block is available and the reference indexes of the first neighboring block and the current block are the same, the motion vector of the first neighboring block may be obtained as a default motion vector. When the default motion vector is not obtained, the motion vector of the second neighboring block is available, and the reference indexes of the second neighboring block and the current block are the same, the motion vector of the second neighboring block may be obtained as the default motion vector. When the default motion vector is not obtained, the motion vector of the first neighboring block is available, and the reference indexes of the first neighboring block and the current block are different, the motion vector of the first neighboring block may be obtained as the default motion vector. And when the default motion vector is not obtained, the motion vector of the second neighboring block is available, and the reference indexes of the second neighboring block and the current block are different, the motion vector of the second neighboring block may be obtained as the default motion vector.

[0048] According to an embodiment, when motion information of both the left neighboring block and the right neighboring block of the current block is unavailable or when motion information of the left neighboring block of the current block is available, the neighboring blocks corresponding to the multiple motion vector resolutions may include an upper left neighboring block, a left neighboring block, a lower left neighboring block, an upper neighboring block, and an upper right neighboring block, wherein the first neighboring block may be the left neighboring block, and the second neighboring block may be the upper neighboring block.

[0049] According to an embodiment, the neighboring block corresponding to the 1 / 4 pixel unit resolution among the multiple motion vector resolutions may be a left neighboring block, the neighboring block corresponding to the 1 / 2 pixel unit resolution among the multiple motion vector resolutions may be an upper neighboring block, the neighboring block corresponding to the 1 pixel unit resolution among the multiple motion vector resolutions may be an upper right neighboring block, the neighboring block corresponding to the 2 pixel unit resolution among the multiple motion vector resolutions may be a lower left neighboring block, and the neighboring block corresponding to the 4 pixel unit resolution among the multiple motion vector resolutions may be an upper left neighboring block.

[0050] According to an embodiment, when motion information of both the left neighboring block and the right neighboring block of the current block is available, the neighboring blocks corresponding to the multiple motion vector resolutions may include an upper left neighboring block, a left neighboring block, an upper neighboring block, an upper right neighboring block, and a right neighboring block, wherein the first neighboring block may be the left neighboring block, and the second neighboring block may be the right neighboring block.

[0051] According to an embodiment, the neighboring blocks corresponding to the 1 / 4 pixel unit resolution among the multiple motion vector resolutions may be the left neighboring blocks, the neighboring blocks corresponding to the 1 / 2 pixel unit resolution among the multiple motion vector resolutions may be the right neighboring blocks, the neighboring blocks corresponding to the 1 pixel unit resolution among the multiple motion vector resolutions may be the upper neighboring blocks, the neighboring blocks corresponding to the 2 pixel unit resolution among the multiple motion vector resolutions may be the upper right neighboring blocks, and the neighboring blocks corresponding to the 4 pixel unit resolution among the multiple motion vector resolutions may be the upper left neighboring blocks.

[0052] According to an embodiment, when motion information of a right neighboring block of the current block is available, the neighboring blocks corresponding to the multiple motion vector resolutions may include an upper left neighboring block, an upper neighboring block, an upper right neighboring block, a right neighboring block, and a lower right neighboring block, wherein the first neighboring block may be the right neighboring block, and the second neighboring block may be the upper neighboring block.

[0053] According to an embodiment, the neighboring block corresponding to the 1 / 4 pixel unit resolution among the multiple motion vector resolutions may be the right neighboring block, the neighboring block corresponding to the 1 / 2 pixel unit resolution among the multiple motion vector resolutions may be the upper neighboring block, the neighboring block corresponding to the 1 pixel unit resolution among the multiple motion vector resolutions may be the upper left neighboring block, the neighboring block corresponding to the 2 pixel unit resolution among the multiple motion vector resolutions may be the lower right neighboring block, and the neighboring block corresponding to the 4 pixel unit resolution among the multiple motion vector resolutions may be the upper right neighboring block.

[0054] According to an embodiment, the video decoding method may further include: when the motion vectors of two adjacent blocks are unavailable, obtaining a default motion vector based on a history-based motion vector list including motion vectors of blocks decoded before the current block, and obtaining the default motion vector as the motion vector predictor of the current block.

[0055] According to an embodiment, the video decoding method may further include: when motion vectors of two neighboring blocks are unavailable, obtaining a zero motion vector as a default motion vector, and obtaining the default motion vector as a motion vector predictor of the current block.

[0056] According to an embodiment, whether to use a motion vector predictor based on a neighboring block corresponding to one of the plurality of motion vector resolutions may be determined based on information obtained from a bitstream.

[0057] According to an embodiment, when motion vectors of two neighboring blocks are unavailable, remaining neighboring blocks of the current block may be searched, and a default motion vector may be obtained by using the motion vectors of the searched neighboring blocks.

[0058] According to an embodiment of the present disclosure, a video encoding method may include: determining whether a motion vector of a neighboring block at a position corresponding to one motion vector resolution among multiple motion vector resolutions is available; when the motion vector of the neighboring block corresponding to the one motion vector resolution is available, obtaining the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one motion vector resolution is not available, obtaining a default motion vector of the one motion vector resolution by using the motion vector of one of two neighboring blocks of the current block, and obtaining the default motion vector as the motion vector predictor of the current block; and performing prediction on the current block based on the motion vector predictor of the current block.

[0059] According to an embodiment of the present disclosure, a video decoding device may include: a memory; and at least one processor connected to the memory, wherein the at least one processor is configured to perform the following operations: determine whether a motion vector of a neighboring block at a position corresponding to one motion vector resolution among multiple motion vector resolutions is available; when the motion vector of the neighboring block corresponding to the one motion vector resolution is available, obtain the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one motion vector resolution is not available, obtain a default motion vector of the one motion vector resolution by using the motion vector of one of two neighboring blocks of the current block, and obtain the default motion vector as the motion vector predictor of the current block; and perform prediction on the current block based on the motion vector predictor of the current block. DETAILED DESCRIPTION

[0060] By referring to the examples and drawings, the advantages and features of the embodiments and the methods for achieving the advantages and features of the embodiments may be more easily understood. In this regard, the present disclosure may have different forms and should not be construed as being 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 concepts of the present disclosure to those of ordinary skill in the art.

[0061] Terms used in the specification will be briefly defined, and embodiments will be described in detail.

[0062] All terms used in this specification, including descriptive terms or technical terms, should be interpreted as having meanings that are obvious to those of ordinary skill in the art. However, these terms may have different meanings according to the intentions of those of ordinary skill in the art, precedents, or the emergence of new technologies. In addition, some terms may be arbitrarily selected by the applicant, and in this case, the meaning of the selected terms will be described in detail in the specific embodiments of the present disclosure. Therefore, the terms used in this disclosure should not be interpreted based solely on their names, but must be defined based on the meaning of the terms and the description throughout the specification.

[0063] In the following description, a singular form includes a plural form unless the context clearly indicates otherwise.

[0064] When a component “includes” or “comprising” an element, unless there is a specific description contrary thereto, the component may further include other elements, rather than excluding other elements.

[0065] In the following description, terms such as "unit" indicate software or hardware components, and "units" perform specific functions. However, "units" are not limited to software or hardware. "Units" can be formed in an addressable storage medium, or can be formed to operate one or more processors. Thus, for example, the term "unit" can refer to components such as software components, object-oriented software components, class components, and task components, and can include processes, functions, properties, procedures, subroutines, program code segments, drivers, firmware, microcode, circuits, data, databases, data structures, tables, arrays, and variables. The functions provided by components and "units" can be associated with a smaller number of components and "units", or can be divided into additional components and "units".

[0066] 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 environments, 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 (e.g., a combination of a DSP and a microprocessor, a combination of multiple microprocessors, a combination of one or more microprocessors in conjunction with a DSP core, or a combination of any other such configurations).

[0067] The term "memory" should be interpreted broadly to include any electronic component capable of storing electronic information. The term "memory" can refer to various types of processor-readable media (such as random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable PROM (EEPROM), flash memory, magnetic or optical data storage devices, registers, etc.). When 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 that is integrated into a processor is in electronic communication with the processor.

[0068] Hereinafter, an “image” may be a static image such as a still image of a video, or may be a dynamic image such as a moving image, ie, a video itself.

[0069] Hereinafter, "sample" refers to data assigned to a sampling position of an image (i.e., data to be processed). For example, pixel values ​​of an image in the spatial domain and transform coefficients in the transform domain can be samples. A unit including at least one such sample can be defined as a block.

[0070] Also, in this 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.

[0071] Hereinafter, the present disclosure will now be described more fully with reference to the accompanying drawings so that those skilled in the art can perform the embodiments without difficulty. In addition, in order to clearly describe the present disclosure, parts not related to the description will be omitted in the accompanying drawings.

[0072] 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 The method for determining the data unit of an image according to an embodiment will be described below with reference to Figures 17 to 20 and Figures 22 to 27A video encoding / decoding method according to an embodiment is described, wherein the video encoding / decoding method includes: determining whether a motion vector of a neighboring block at a position corresponding to one of a plurality of motion vector resolutions (MVRs) is available; when the motion vector of the neighboring block corresponding to the one MVR is available, obtaining the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one MVR is not available, obtaining a default motion vector of the one MVR by using the motion vector of one of two neighboring blocks of the current block, and obtaining the default motion vector as a motion vector predictor of the current block; and performing prediction on the current block based on the motion vector predictor of the current block, which will be referred to below Figure 21 Describe the encoding order of the encoding unit, and refer to Figures 28a to 28c A method for obtaining a default motion vector according to another embodiment is described.

[0073] 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 various shapes of a coding unit according to an embodiment of the present disclosure are described.

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

[0075] 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 to be executed by the at least one processor.

[0076] The receiver 110 can receive a bitstream. The bitstream includes information about an image encoded by the image encoding device 2200 described below. In addition, the bitstream can be transmitted from the image encoding device 2200. The image encoding device 2200 and the image decoding device 100 can be connected via a wired or wireless connection, and the receiver 110 can receive the bitstream via a wired or wireless connection. The receiver 110 can receive the bitstream from a storage medium (such as an optical medium or a hard disk). The decoder 120 can reconstruct the image based on the information obtained from the received bitstream. The decoder 120 can obtain syntax elements for reconstructing the image from the bitstream. The decoder 120 can reconstruct the image based on the syntax elements.

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

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

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

[0080] The image decoding apparatus 100 obtains a binary bit string corresponding to a division shape pattern of a coding unit from a bitstream (operation 210). The image decoding apparatus 100 determines a division rule of the coding unit (operation 220). In addition, the image decoding apparatus 100 divides the coding unit into a plurality of coding units based on at least one of the binary bit string corresponding to the division shape pattern and the division rule (operation 230). The image decoding apparatus 100 may determine an allowable first range of the size of the coding unit according to the aspect ratio of the coding unit in order to determine the division rule. The image decoding apparatus 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.

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

[0082] First, a picture can be divided into one or more slices or one or more tiles. A slice or a tile can be a sequence of one or more maximum coding units (coding tree units (CTUs)). Conceptually, there is a maximum coding block (coding tree block (CTB)) compared to the maximum coding unit (CTU).

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

[0084] When a picture has three sample arrays (sample arrays for 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 the luma samples and the 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 coded in color planes separated by color components, the maximum coding unit includes a syntax structure for encoding the picture and the samples of the picture.

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

[0086] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) includes a coding block of luma samples, two corresponding coding blocks of chroma samples, and syntax structures for encoding the luma samples and chroma samples. When the picture is a monochrome picture, a coding unit includes a coding block of monochrome samples and syntax structures for encoding monochrome samples. When the picture is coded in color planes separated by color components, a coding unit includes syntax structures for encoding the picture and its samples.

[0087] 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 including 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 predetermined size including a predetermined number of samples, unless otherwise specified, the maximum coding block and the maximum coding unit or the coding block and the coding unit are mentioned in the following description without distinction.

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

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

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

[0091] According to an embodiment, since information about the maximum size of a binary-dividable luma coding block is obtained from a bitstream, the maximum size of a binary-dividable luma coding block can be variably determined. In contrast, the maximum size of a ternary-dividable luma coding block can be fixed. For example, the maximum size of a ternary-dividable luma coding block in an I-picture can be 32×32, and the maximum size of a ternary-dividable luma coding block in a P-picture or a B-picture can be 64×64.

[0092] In addition, the maximum coding unit may be hierarchically split into coding units based on split shape pattern information obtained from a bitstream. At least one of information indicating whether to perform quadruple splitting, information indicating whether to perform multi-component splitting, split direction information, and split type information may be obtained from the bitstream as the split shape pattern information.

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

[0094] When the current coding unit is not quadripartitioned, the information indicating whether multi-ary splitting is performed may indicate that the current coding unit is no longer split (NO_SPLIT) or is binary / ternary split.

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

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

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

[0098] The image decoding device 100 may obtain division shape pattern information from a binary bit string from a bitstream. The bitstream received by the image decoding device 100 may be in the form of a fixed-length binary code, a unary code, a truncated unary code, a predetermined binary code, or the like. A binary bit string is information about a binary number. A binary bit string may include at least one bit. The image decoding device 100 may obtain division shape pattern information corresponding to the binary bit string based on a division rule. Based on the binary bit string, the image decoding device 100 may determine whether to perform quadruple division on a coding unit, whether to perform non-division on the coding unit, the division direction, and the division type.

[0099] The coding unit may be smaller than or equal to the maximum coding unit. For example, since the maximum coding unit is a coding unit having the largest 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 a plurality of 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 the coding unit is described in detail.

[0100] Furthermore, one or more prediction blocks for prediction may be determined from a coding unit. A prediction block may be the same as or smaller than a coding unit. Furthermore, one or more transform blocks for transformation may be determined from a coding unit. A transform block may be the same as or smaller than a coding unit.

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

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

[0103] Will refer to Figures 3 to 16 The division of coding units is described in detail. The current block and neighboring block of the present invention may refer to one of a maximum coding unit, a coding unit, a prediction block, and a transform block. Furthermore, the current block of the current coding unit is the block currently being decoded or encoded, or the block currently being divided. The neighboring block may be a block reconstructed before the current block. The neighboring block may be spatially or temporally adjacent to the current block. The neighboring block may be located at one of the following: the lower left, left, upper left, upper, upper right, right, or lower right of the current block.

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

[0105] 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, orientation, aspect ratio, or size of the coding unit.

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

[0107] When the width and height of a coding unit are different from each other (i.e., 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 of 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 aspect ratio in the block shape information of 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.

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

[0109] 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 for 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 quadruple division. In addition, the image decoding device 100 may determine the division shape pattern information about the minimum coding unit as "no division". 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 quadruple division. Quaternary division is a division shape pattern in which both the width and height of the coding unit are divided into two equal parts. 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 “do not perform division” with respect to the minimum coding unit.

[0110] 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 not split the square coding unit, whether to split the square coding unit vertically, whether to split the square coding unit horizontally, or whether to split the square coding unit into four coding units based on the division shape mode information. Figure 3 , when the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may 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 may determine the divided coding unit 310b, 310c, 310d, 310e or 310f based on the division shape pattern information indicating a predetermined division method.

[0111] Reference Figure 3According to an embodiment, the image decoding apparatus 100 may determine two coding units 310b obtained by splitting 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 splitting 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 splitting 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 splitting the current coding unit 300 in the vertical direction based on the division shape pattern information indicating that ternary division is performed in the vertical direction. The image decoding apparatus 100 may determine three coding units 310f obtained by splitting the current coding unit 300 in the horizontal direction based on the division shape pattern information indicating that ternary 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. A predetermined division method for dividing the square coding unit will be described in detail below with respect to various embodiments.

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

[0113] 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 split the non-square current coding unit or to split the non-square current coding unit by using a predetermined splitting method based on the split shape pattern information. Figure 4 When the block shape information of 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 may determine coding units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c divided based on the division shape pattern information indicating a predetermined division method. The predetermined division method for dividing the non-square coding unit will be described in detail below with respect to various embodiments.

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

[0115] According to an embodiment, when the image decoding apparatus 100 splits the non-square current coding unit 400 or 450 based on the division shape pattern information, the image decoding apparatus 100 may split 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, the image decoding apparatus 100 may determine a plurality of coding units by splitting the current coding unit 400 or 450 in a direction of the long side in which the current coding unit 400 or 450 is divided, considering the shape of the current coding unit 400 or 450.

[0116] According to an embodiment, when the division shape pattern information indicates that the coding unit is divided (ternary division) 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.

[0117] According to an embodiment, the aspect ratio of the current coding unit 400 or 450 may be 4:1 or 1:4. When the aspect ratio is 4:1, the width is longer than the height, so the block shape information may indicate the horizontal direction. When the aspect ratio is 1:4, the width is shorter than the height, so the block shape information may indicate the vertical direction. The image decoding device 100 may determine whether to split the current coding unit into an odd number of blocks based on the division shape pattern information. Furthermore, 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 coding units 430a, 430b, and 430c by dividing the current coding unit 400 in the horizontal direction. Furthermore, when the current coding unit 450 is in the horizontal direction, the image decoding device 100 may determine coding units 480a, 480b, and 480c by dividing the current coding unit 450 in the vertical direction.

[0118] According to an embodiment, the image decoding apparatus 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, a predetermined coding unit 430b or 480b among the determined odd number of coding units 430a, 430b, and 430c or 480a, 480b, and 480c may have a size different from that of the other coding units 430a and 430c or 480a and 480c. That is, the coding units 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.

[0119] 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 predetermined restriction to at least one of 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 a decoding process for a coding unit 430b or 480b located in the middle of the three coding units 430a, 430b, and 430c or 480a, 480b, and 480c generated when the current coding unit 400 or 450 is split to be different from decoding processes of the other coding units 430a and 430c or 480a and 480c. 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 located in the middle to not be split again or to be split only a predetermined number of times.

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

[0121] According to an embodiment, the image decoding device 100 may determine whether to split the square first coding unit 500 into coding units based on at least one of the block shape information and the division shape pattern information. According to an embodiment, when the division shape pattern information indicates that the first coding unit 500 is to be split horizontally, the image decoding device 100 may determine the second coding unit 510 by splitting the first coding unit 500 horizontally. The first coding unit, second coding unit, and third coding unit used in the embodiment are terms used to understand the relationship between before and after the coding unit is split. For example, the second coding unit may be determined by splitting the first coding unit, and the third coding unit may be determined by splitting 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.

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

[0123] Reference Figure 5, a predetermined coding unit (e.g., a coding unit at a middle position or a square coding unit) among the odd-numbered third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510 may be recursively divided. According to an embodiment, the square third coding unit 520c among the odd-numbered third coding units 520b, 520c, and 520d may be divided into a plurality of fourth coding units in the horizontal direction. The non-square fourth coding unit 530b or 530d among the plurality of fourth coding units 530a, 530b, 530c, and 530d may be re-divided into a plurality of coding units. For example, the non-square fourth coding unit 530b or 530d may be re-divided into an odd-numbered coding unit. A method for recursively dividing coding units will be described below with respect to various embodiments.

[0124] According to an embodiment, the image decoding apparatus 100 may divide each of the third coding units 520a or 520b, 520c, and 520d into coding units based on the division shape pattern information. Furthermore, the image decoding apparatus 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 apparatus 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 apparatus 100 may impose a predetermined restriction on a predetermined third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding apparatus 100 may restrict the third coding unit 520c at an intermediate position among the odd number of third coding units 520b, 520c, and 520d to no longer being divided or to being divided a set number of times.

[0125] Reference Figure 5 , the image decoding apparatus 100 may limit the third coding unit 520c located at the middle position 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 predetermined division method (for example, to be divided only into four coding units or to be divided by using the division method of the second coding unit 510), or to be divided only a predetermined 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 middle position is not limited to the above example, and may include various limitations for decoding the third coding unit 520c at the middle position differently from the other third coding units 520b and 520d.

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

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

[0128] Reference Figure 6 , the division shape pattern information of the current coding unit 600 or 650 may be obtained from a sample at a predetermined position (e.g., a sample 640 or 690 at a middle position) among a plurality of samples included in the current coding unit 600 or 650. However, the predetermined position in the current coding unit 600 from which at least one piece of division shape pattern information may be obtained is not limited to Figure 6 , and may include various positions (e.g., above, below, left, right, upper left, lower left, upper right, lower right, etc.) included in the current coding unit 600. The image decoding apparatus 100 may obtain the division shape pattern information from a predetermined position and may determine whether to divide the current coding unit into coding units of various shapes and sizes.

[0129] According to an embodiment, when the current coding unit is split into a predetermined number of coding units, the image decoding apparatus 100 may select one of the coding units. As will be described below with respect to various embodiments, various methods may be used to select one of the plurality of coding units.

[0130] 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 predetermined position.

[0131] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a middle position 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 odd-numbered coding units 620a, 620b, and 620c or odd-numbered 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 an intermediate coding unit 620b or an intermediate coding unit 660b by using information about the positions of the odd-numbered coding units 620a, 620b, and 620c or the odd-numbered coding units 660a, 660b, and 660c. For example, the image decoding apparatus 100 may determine the intermediate-positioned coding unit 620b by determining the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of predetermined samples included in the coding units 620a, 620b, and 620c. Specifically, the image decoding apparatus 100 may determine the coding unit 620b at the middle 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.

[0132] According to an embodiment, the information indicating the positions of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, 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 top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively, 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 middle 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 information about the width or height of the coding unit corresponding to the difference between the coordinates.

[0133] According to an embodiment, the information indicating the position of the upper left sample 630a of the upper coding unit 620a may include coordinates (xa, ya), the information indicating the position of the upper left sample 630b of the middle coding unit 620b may include coordinates (xb, yb), and the 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 can determine the middle coding unit 620b by using the coordinates of the upper left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively. For example, when the coordinates of the upper left samples 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b including the coordinates (xb, yb) of the sample 630b at the middle position may be determined as the coding unit at the middle position among the coding units 620a, 620b, and 620c determined by splitting the current coding unit 600. However, the coordinates indicating the positions of the upper left samples 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 630b of the intermediate coding unit 620b relative to the position of the upper left sample 630a of the upper coding unit 620a and coordinates (dxc, dyc) indicating the relative position of the upper left sample 630c of the lower coding unit 620c relative to the position of the upper left sample 630a of the upper coding unit 620a may be used. The method of determining the coding unit at a predetermined position by using the coordinates of the samples included in the coding unit as information indicating the positions of the samples is not limited to the above method, and may include various arithmetic methods capable of using the coordinates of the samples.

[0134] According to an embodiment, the image decoding apparatus 100 may divide the current 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 predetermined criterion. For example, the image decoding apparatus 100 may select a coding unit 620b having a size different from that of the other coding units from among the coding units 620a, 620b, and 620c.

[0135] According to an embodiment, the image decoding apparatus 100 may determine the width or height of each of the coding units 620a, 620b, and 620c using the coordinates (xa, ya) indicating the position of the upper left sample 630a of the upper coding unit 620a, the coordinates (xb, yb) indicating the position of the upper left sample 630b of the middle coding unit 620b, and the coordinates (xc, yc) indicating the position of the upper left sample 630c of the lower coding unit 620c. The image decoding apparatus 100 may determine the respective sizes of the coding units 620a, 620b, and 620c 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 apparatus 100 may determine the width of the intermediate coding unit 620b as the width of the current coding unit 600. The image decoding apparatus 100 may determine the height of the intermediate coding unit 620b as yc-yb. According to an embodiment, the image decoding apparatus 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 apparatus 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 620a, 620b, and 620c. With reference to Figure 6 , the image decoding apparatus 100 may determine the intermediate coding unit 620b having a size different from that of the upper coding unit 620a and the lower coding unit 620c as the coding unit at the predetermined position. However, the above-described method of determining a coding unit having a size different from that of other coding units, performed by the image decoding apparatus 100, corresponds only to an example of determining a coding unit at a predetermined position by using a size of a coding unit determined based on coordinates of sample points, and thus various methods of determining a coding unit at a predetermined position by comparing the sizes of coding units determined based on coordinates of predetermined sample points may be used.

[0136] 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 corresponding 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.

[0137] According to an embodiment, the image decoding apparatus 100 may determine the width of the left coding unit 660a as xe-xd. The image decoding apparatus 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 apparatus 100 may determine the width of the middle coding unit 660b as xf-xe. The image decoding apparatus 100 may determine the height of the middle coding unit 660b as the height of the current coding unit 650. According to an embodiment, the image decoding apparatus 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 middle coding unit 660b. The image decoding apparatus 100 may determine a coding unit having a size different from that of other coding units based on the determined widths and heights of the coding units 660a, 660b, and 660c. With reference to 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 predetermined position. However, the above-described method of determining a coding unit having a size different from the sizes of other coding units, performed by the image decoding apparatus 100, corresponds only to an example of determining the coding unit at the predetermined 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 predetermined position by comparing the sizes of the coding units determined based on the coordinates of the predetermined sample points may be used.

[0138] 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 the samples included in the coding unit may be used.

[0139] According to an embodiment, the image decoding apparatus 100 may select a coding unit at a predetermined position from 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 greater than the height, the image decoding apparatus 100 may determine a coding unit at a predetermined position in the horizontal direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions in the horizontal direction, and may restrict 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 apparatus 100 may determine a coding unit at a predetermined position in the vertical direction. That is, the image decoding apparatus 100 may determine one of the coding units at different positions in the vertical direction, and may restrict the coding unit.

[0140] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a predetermined position from among the even-numbered coding units using information indicating corresponding positions of the even-numbered coding units. The image decoding apparatus 100 may determine the even-numbered coding units by dividing (binary division) the current coding unit, and may determine the coding unit at the predetermined position by using information about the positions of the even-numbered coding units. Operations related thereto may be similar to those described above with respect to Figure 6 The operation of determining a coding unit at a predetermined position (eg, a middle position) from among the odd-numbered coding units corresponds to the operation described in detail, and thus a detailed description thereof is not provided here.

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

[0142] Reference Figure 6, the image decoding apparatus 100 may split the current coding unit 600 into multiple coding units 620a, 620b, and 620c based on the division shape pattern information, and may determine a coding unit 620b located at a middle position among the multiple coding units 620a, 620b, and 620c. Furthermore, the image decoding apparatus 100 may determine the coding unit 620b located at a middle position by considering the position at which the division shape pattern information was obtained. That is, the division shape pattern information of the current coding unit 600 may be obtained from a sample 640 located at a middle position of the current coding unit 600, and when the current coding unit 600 is split into multiple 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 a coding unit located at a middle position. However, the information used to determine the coding unit located at a middle position is not limited to the division shape pattern information, and various types of information may be used to determine the coding unit located at a middle position.

[0143] According to an embodiment, predetermined information for identifying a coding unit at a predetermined position may be obtained from predetermined 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 predetermined position in the current coding unit 600 (for example, the sample at the middle position of the current coding unit 600) to determine the coding unit at the predetermined position (for example, the coding unit at the middle position among the plurality of divided coding units) 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 predetermined position by considering the block shape of the current coding unit 600, may determine the coding unit 620b including the sample for which the predetermined information (for example, the division shape pattern information) may be obtained from the plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may impose a predetermined restriction on the coding unit 620b. With reference to Figure 6 According to an embodiment, the image decoding apparatus 100 may determine a sample 640 at a middle position of the current coding unit 600 as a sample from which predetermined information may be obtained, and may impose a predetermined restriction on the coding unit 620b including the sample 640 in a decoding operation. However, the position of the sample from which the predetermined information may be obtained is not limited to the above-mentioned position, and may include any position of the sample included in the coding unit 620b determined to be subject to restriction.

[0144] According to an embodiment, the position of the sample from which the predetermined 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 predetermined information can be obtained may be determined based on the shape. For example, the image decoding apparatus 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 in half as a sample from which the predetermined 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 apparatus 100 may determine, among the samples adjacent to the boundary for dividing the long side of the current coding unit in half, as a sample from which the preset information can be obtained.

[0145] 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 predetermined position in 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 predetermined position in the coding unit, and may 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 predetermined 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 predetermined position in each coding unit. Figure 5 An operation of recursively splitting the coding unit is described, and thus a detailed description thereof will not be provided here.

[0146] 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 predetermined block (for example, the current coding unit).

[0147] Figure 7 Illustrated is 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.

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

[0149] Reference Figure 7, the image decoding apparatus 100 may determine to process the second coding units 710a and 710b determined by splitting 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 splitting 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 splitting the first coding unit 700 in the vertical and horizontal directions according to a predetermined order (e.g., a raster scan order or a zigzag scan order 750e) of processing coding units in one row and then processing coding units in the next row.

[0150] 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 may recursively divide each of the determined plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. A division method of the plurality of coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d may correspond to a division method of the first coding unit 700. Accordingly, 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. Referring to Figure 7 , the image decoding apparatus 100 may determine the second coding units 710a and 710b by splitting the first coding unit 700 in a vertical direction, and may determine whether to independently split or not split each of the second coding units 710a and 710b.

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

[0152] According to an embodiment, the processing order of coding units may be determined based on the operation of splitting the coding units. In other words, the processing order of the split coding units may be determined based on the processing order of the coding units immediately before the split. The image decoding apparatus 100 may determine the processing order of the third coding units 720a and 720b determined by splitting the left second coding unit 710a independently of the right second coding unit 710b. Because the third coding units 720a and 720b are determined by splitting the left second coding unit 710a in the horizontal direction, the third coding units 720a and 720b may be processed in a vertical order 720c. Because the left second coding unit 710a and the right second coding unit 710b are processed in the horizontal 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 the vertical 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 coding units split and determined into various shapes may be independently processed in a predetermined order using various methods.

[0153] 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 predetermined order, according to an embodiment is illustrated.

[0154] According to an embodiment, the image decoding apparatus 100 may determine whether 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, 820d, and 820e. According to an embodiment, the image decoding apparatus 100 may determine a plurality of third coding units 820a and 820b by horizontally dividing the left second coding unit 810a, and may divide the right second coding unit 810b into an odd number of third coding units 820c, 820d, and 820e.

[0155] 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, 820d, and 820e can be processed in a predetermined order. Figure 8, the image decoding apparatus 100 may determine the third coding units 820a and 820b, 820c, 820d, and 820e by recursively dividing the first coding unit 800. The image decoding apparatus 100 may 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, 820c, 820d, and 820e is divided into an odd number of coding units based on at least one of the block shape information and the division shape pattern information. For example, the coding unit located on the right side of the second coding units 810a and 810b may 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 predetermined order (for example, a zigzag scanning order 830), and the image decoding device 100 can determine whether the third coding units 820c, 820d and 820e determined by dividing the second coding unit 810b on the right into an odd number of coding units meet the conditions for processing in a predetermined order.

[0156] According to an embodiment, the image decoding apparatus 100 may determine whether the third coding units 820a and 820b, and 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition for being processed in a predetermined order, and the condition is related to whether at least one of the width and height of the second coding units 810a and 810b is divided in half along the boundary of the third coding units 820a and 820b, and 820c, 820d, and 820e. For example, the third coding units 820a and 820b determined when the height of the non-square left second coding unit 810a is divided in half may satisfy the condition. However, because the boundary of the third coding units 820c, 820d, and 820e determined when the right second coding unit 810b is divided into three coding units does not divide the width or height of the right second coding unit 810b in half, it may be determined that the third coding units 820c, 820d, and 820e do not satisfy the condition. When this condition is not satisfied as described above, the image decoding apparatus 100 may determine that the scanning order is disconnected, and may determine that the second right coding unit 810b is divided into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose a predetermined restriction on the coding units at a predetermined position in the divided coding units. The restrictions or predetermined positions have been described above with respect to various embodiments, and therefore a detailed description thereof will not be provided here.

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

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

[0159] 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 predetermined order, and the condition is related to whether at least one of the width and height of the first coding unit 900 is divided in half along the boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Figure 9 Because the boundaries of the second coding units 910a, 910b, and 910c determined by vertically dividing the square first coding unit 900 do not divide the width of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not meet the conditions for being processed in the predetermined order. Furthermore, because the boundaries of the second coding units 920a, 920b, and 920c determined by horizontally dividing the square first coding unit 900 do not divide the height of the first coding unit 900 in half, it can be determined that the first coding unit 900 does not meet the conditions for being processed in the predetermined order. When the conditions are not met as described above, the image decoding apparatus 100 may decide to interrupt the scanning order and, based on the result of the decision, determine that the first coding unit 900 is divided into an odd number of coding units. According to an embodiment, when a coding unit is divided into an odd number of coding units, the image decoding apparatus 100 may impose predetermined restrictions on coding units at predetermined positions within the divided coding units. The restrictions or predetermined positions have been described above with respect to various embodiments, and therefore a detailed description thereof will not be provided here.

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

[0161] Reference Figure 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.

[0162] Figure 10 It is shown that when a second coding unit having a non-square shape determined when an image decoding apparatus splits a first coding unit satisfies a predetermined condition, shapes into which the second coding unit may be divided are limited according to an embodiment.

[0163] According to an embodiment, the image decoding apparatus 100 may determine whether to split the square first coding unit 1000 into the 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 split independently. Therefore, the image decoding apparatus 100 may determine whether to split each of the second coding units 1010a and 1010b or 1020a and 1020b into multiple coding units based on the division shape pattern information of each of the second coding units 1010a and 1010b or 1020a and 1020b. According to an embodiment, the image decoding apparatus 100 may determine the third coding units 1012a and 1012b by horizontally splitting the non-square left second coding unit 1010a determined by vertically splitting the first coding unit 1000. However, when the left second coding unit 1010a is split horizontally, the image decoding apparatus 100 may restrict the right second coding unit 1010b from being split in the same horizontal direction as the left second coding unit 1010a. When the third coding units 1014a and 1014b are determined by splitting 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 split horizontally, the third coding units 1012a and 1012b or 1014a and 1014b may be determined. However, this situation also functions as the situation in which the image decoding apparatus 1000 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 terms of image decoding.

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

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

[0166] According to an embodiment, the image decoding apparatus 100 may determine 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 regarding various methods of dividing the coding unit, but the information regarding the various division methods may not include information for dividing the coding unit into four square coding units. Based on this division shape pattern information, the image decoding apparatus 100 may not divide the square first coding unit 1100 into the four square second coding units 1130a, 1130b, 1130c, and 1130d. The image decoding apparatus 100 may determine non-square second coding units 1110a and 1110b, or 1120a and 1120b, etc. based on the division shape pattern information.

[0167] 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 predetermined order, and the division method may correspond to the method of dividing the first coding unit 1100 based on the division shape pattern information.

[0168] For example, the image decoding apparatus 100 may determine square third coding units 1112a and 1112b by horizontally dividing the left second coding unit 1110a, and square third coding units 1114a and 1114b by horizontally dividing the right second coding unit 1110b. Furthermore, the image decoding apparatus 100 may determine square third coding units 1116a, 1116b, 1116c, and 1116d by horizontally dividing both the left second coding unit 1110a and the right second coding unit 1110b. In this case, coding units 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.

[0169] As another example, the image decoding apparatus 100 may determine square third coding units 1122a and 1122b by vertically dividing the upper second coding unit 1120a, and square third coding units 1124a and 1124b by vertically dividing the lower second coding unit 1120b. Furthermore, the image decoding apparatus 100 may determine square third coding units 1126a, 1126b, 1126c, and 1126d by vertically dividing both the upper second coding unit 1120a and the lower second coding unit 1120b. In this case, coding units 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.

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

[0171] 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 a horizontal direction and a vertical direction, 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. Figure 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 may be independently divided based on the division shape pattern information of each coding unit. For example, the image decoding apparatus 100 may determine 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 may determine 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. As has been described above with respect to Figure 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.

[0172] According to an embodiment, the image decoding apparatus 100 may process coding units in a predetermined order. Figure 7 The operation of processing the coding units in a predetermined order is described, and thus a detailed description thereof will not be provided here. Figure 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, and 1226a, 1226b, 1226c, and 1226d based on a division shape into which the first coding unit 1200 is divided.

[0173] According to an embodiment, the image decoding device 100 may 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 may process the third coding units 1216a, 1216b, 1216c and 1216d in a processing order 1217 so that the third coding units 1216a and 1216c included in the left second coding unit 1210a are first processed in the vertical direction, and then the third coding units 1216b and 1216d included in the right second coding unit 1210b are processed in the vertical direction.

[0174] According to an embodiment, the image decoding device 100 may 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, and may process the third coding units 1226a, 1226b, 1226c and 1226d in a processing order 1227 so that the third coding units 1226a and 1226b included in the upper second coding unit 1220a are first processed in the horizontal direction, and then the third coding units 1226c and 1226d included in the lower second coding unit 1220b are processed in the horizontal direction.

[0175] Reference Figure 12 , square third coding units 1216a, 1216b, 1216c, and 1216d, and 1226a, 1226b, 1226c, and 1226d 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, unlike the second coding units 1220a and 1220b determined by dividing the first coding unit 1200 in the horizontal direction, the divided third coding units 1216a, 1216b, 1216c, and 1216d, and 1226a, 1226b, 1226c, and 1226d ultimately show the same shaped coding units divided from the first coding unit 1200. Therefore, by recursively splitting the coding units in different manners based on the division shape pattern information, the image decoding apparatus 100 may process a plurality of coding units in different orders even when the coding units are ultimately determined to be the same shape.

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

[0177] According to an embodiment, the image decoding apparatus 100 may determine the depth of the coding unit based on a predetermined criterion. For example, the predetermined 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 split is 2n times (n>0) the length of the long side of the current coding unit to be split, the image decoding apparatus 100 may determine that the depth of the current coding unit is increased by n from the depth of the coding unit before being split. In the following description, a coding unit with an increased depth is referred to as a coding unit of a deeper depth.

[0178] Reference Figure 13According to an embodiment, the image decoding apparatus 100 may determine a second coding unit 1302 and a 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 the width and height 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 whose width and height are 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 whose width and height are 1 / 4 times the width and height of the first coding unit 1300 may be D+2.

[0179] 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 expressed as "1:NS_VER" indicating a non-square shape in which the height is longer than the width, or as "2:NS_HOR" indicating a non-square shape in which the width is longer than the height).

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

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

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

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

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

[0185] According to an embodiment, the image decoding apparatus 100 may split the square coding unit 1300, 1302, or 1304 in a horizontal direction or a vertical direction. For example, the image decoding apparatus 100 may determine a 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 a 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 direction or a vertical direction may be the same as the depth of the first coding unit 1300.

[0186] 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 whose width and height are 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 whose width and height are 1 / 4 times the width and height of the first coding unit 1310 or 1320 may be D+2.

[0187] Figure 14 Depth that may be determined based on the shape and size of a coding unit and a partial index (PID) for distinguishing coding units, according to an embodiment, is illustrated.

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

[0189] According to an embodiment, the depths of the second coding units 1402a and 1402b, 1404a and 1404b, and 1406a, 1406b, 1406c, and 1406d, which may be determined based on the division shape pattern information of the square first coding unit 1400, may be determined based on the length of their long sides. For example, since 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.

[0190] 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 horizontally dividing the first coding unit 1410 whose height is longer than its width 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 vertically dividing the first coding unit 1420 whose width is longer than its height based on the division shape pattern information.

[0191] 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 of 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 1 deeper than the depth D of the non-square first coding unit 1410.

[0192] In addition, the image decoding apparatus 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 1 deeper than the depth D of the non-square first coding unit 1410. The image decoding apparatus 100 may determine the depths of the coding units split from the first coding unit 1420 having the non-square shape having a width longer than height by using the above-described method of determining the depths of the coding units split from the first coding unit 1410 .

[0193] According to an embodiment, when the odd-numbered split coding units do not have equal sizes, the image decoding apparatus 100 may determine a PID for identifying the split coding units based on a size ratio between the coding units. Figure 14 , coding unit 1414b positioned in the middle of 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 that of the other coding units 1414a and 1414c. That is, in this case, coding unit 1414b positioned in the middle may include two of the other coding units 1414a or 1414c. Therefore, the PID of coding unit 1414b positioned in the middle may be increased by 2, and thus may be 3, based on the scanning order being 1, while the PID of coding unit 1414c located subsequent to coding unit 1414b may be increased by 2. In other words, there may be discontinuity in the PID values. According to an embodiment, the image decoding apparatus 100 may determine whether the odd-numbered divided coding units are not of equal size based on whether there is discontinuity in the PIDs used to identify the divided coding units.

[0194] According to an embodiment, the image decoding apparatus 100 may determine whether to use a predetermined splitting method based on a PID value for identifying a plurality of coding units determined by splitting a current coding unit. Figure 14, the image decoding apparatus 100 may determine an even number of coding units 1412a and 1412b or an odd number of coding units 1414a, 1414b, and 1414c by dividing the first coding unit 1410 having a rectangular shape having a height longer than a width. The image decoding apparatus 100 may use a PID indicating each coding unit to identify each coding unit. According to an embodiment, the PID may be obtained from a sample at a predetermined position (e.g., a top left sample) of each coding unit.

[0195] According to an embodiment, the image decoding apparatus 100 may determine a coding unit at a predetermined position from among the divided coding units by using PIDs used to distinguish between the 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 its width indicates that the coding unit is divided into three coding units, the image decoding apparatus 100 may divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The image decoding apparatus 100 may assign a PID to each of the three coding units 1414a, 1414b, and 1414c. The image decoding apparatus 100 may compare the PIDs of the odd-numbered divided coding units to determine a coding unit located at an intermediate position from among the coding units. The image decoding apparatus 100 may determine the coding unit 1414b having a PID corresponding to an intermediate value among the PIDs of the coding units as the coding unit located at an intermediate position 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. Figure 14, coding unit 1414b generated by splitting the first coding unit 1410 may have a width equal to that of the other coding units 1414a and 1414c and a height twice that of the other coding units 1414a and 1414c. In this case, when the PID of coding unit 1414b at a middle position is 1, the PID of coding unit 1414c located next to coding unit 1414b may increase by 2 and thus may be 3. When the PIDs are not increased uniformly as described above, the image decoding apparatus 100 may determine that the coding unit is split into a plurality of coding units including coding units having sizes different from those of the other coding units. According to an embodiment, when the division shape pattern information indicates that the coding unit is split into an odd number of coding units, the image decoding apparatus 100 may split the current coding unit such that a coding unit at a predetermined position (e.g., a coding unit at a middle position) among the odd number of coding units has a size different from that of the other coding units. In this case, the image decoding apparatus 100 may determine the coding units at the middle positions having different sizes by using the PIDs of the coding units. However, the PID and the size or position of the coding unit at the predetermined position are not limited to the above examples, and various PIDs and various positions and sizes of the coding unit may be used.

[0196] According to an embodiment, the image decoding apparatus 100 may use a predetermined data unit to start recursively splitting a coding unit.

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

[0198] According to an embodiment, a predetermined data unit may be defined as a data unit for recursively splitting a coding unit by starting with division shape pattern information. That is, the predetermined data unit may correspond to a coding unit for determining the highest depth of a plurality of coding units split from the current picture. In the following description, for ease of explanation, the predetermined data unit is referred to as a reference data unit.

[0199] Depending on the embodiment, the reference data unit may have a predetermined size and a predetermined shape. Depending on the embodiment, the reference coding unit may include M×N samples. Here, M and N may be equal to each other and may be integers expressed as powers of 2. That is, the reference data unit may have a square or non-square shape and may be divided into an integer number of coding units.

[0200] 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 division shape pattern information of each reference data unit. The operation of dividing the reference data units may correspond to a division operation using a quadtree structure.

[0201] According to an embodiment, the image decoding apparatus 100 may 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 having a size equal to or larger than the minimum size, and may determine one or more coding units using the partition shape pattern information by referring to the determined reference data units.

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

[0203] 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. Figure 3 The operation of dividing the square reference coding unit 1500 into one or more coding units has been described above. Figure 4 The operation of splitting the current coding unit 400 or 450 described above describes an operation of splitting the non-square reference coding unit 1502 into one or more coding units. Therefore, a detailed description thereof will not be provided here.

[0204] 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 based on a predetermined set of data units. That is, the receiver 110 may obtain from the bitstream only the PID for identifying the size and shape of the reference coding unit for each slice, slice segment, tile, tile group, or largest coding unit that satisfies the predetermined condition (e.g., a data unit with a size equal to or smaller than a slice) in various data units (e.g., a sequence, picture, slice, slice segment, tile, tile group, or largest coding unit). The image decoding apparatus 100 may determine the size and shape of the reference data unit for each data unit that satisfies the predetermined condition by using the PID. When obtaining and using reference coding unit shape information and reference coding unit size information from the bitstream based on each relatively small data unit, the use of the bitstream may be inefficient. Therefore, instead of directly obtaining the reference coding unit shape information and reference coding unit size information, only the PID may be obtained and used. 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 sizes and shapes of the reference coding units included in the data unit serving as the unit for obtaining the PID by selecting at least one of the sizes and shapes of the previously determined reference coding units based on the PID.

[0205] According to an embodiment, the image decoding apparatus 100 may use one or more reference coding units included in a 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 apparatus 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 block shape information and division shape pattern information.

[0206] Figure 16 A processing block serving as a unit for determining an order of reference coding units included in a picture according to an embodiment is illustrated.

[0207] According to an embodiment, the image decoding apparatus 100 may determine one or more processing blocks divided from a picture. A processing block is a data unit including one or more reference 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 the 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 (e.g., raster scan order, zigzag scan, N-shaped scan, upper right diagonal scan, horizontal scan, and vertical scan), but is not limited to the above-mentioned scan order.

[0208] 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 predetermined size of a data unit indicated by the processing block size information.

[0209] According to an embodiment, the receiver 110 of the image decoding device 100 may obtain processing block size information from the bitstream according to each specific data unit. For example, the processing block size information may be obtained from the bitstream according to a data unit (such as an image, a sequence, a picture, a slice, a slice segment, a tile, or a tile group). That is, the receiver 110 may obtain processing block size information from the 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 size of the reference coding unit.

[0210] According to an embodiment, the image decoding apparatus 100 may determine the sizes of the processing blocks 1602 and 1612 included in the picture 1600. For example, the image decoding apparatus 100 may determine the sizes of the processing blocks based on processing block size information obtained from a bitstream. Figure 16 According to an embodiment, the image decoding apparatus 100 may determine the width of the processing blocks 1602 and 1612 to be four times the width of 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 order in which one or more reference coding units in one or more processing blocks are determined.

[0211] 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, determining the reference coding unit may include determining the size of the reference coding unit.

[0212] According to an embodiment, the image decoding apparatus 100 may obtain determination order information of one or more reference coding units included in one or more processing blocks from a bitstream, and may determine a determination order for the 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.

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

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

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

[0216] 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 the image based on the reference coding units determined as described above. Methods for decoding the reference coding units may include various image decoding methods.

[0217] According to an embodiment, the image decoding apparatus 100 may obtain block shape information indicating the shape of the current coding unit or division shape pattern information indicating a division method of the current coding unit from a 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 apparatus 100 may use 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 parallel block header, or a parallel block group header. In addition, the image decoding apparatus 100 may obtain syntax elements corresponding to the block shape information or the division shape pattern information from a bitstream according to each maximum coding unit, each reference coding unit, or each processing block, and may use the obtained syntax elements.

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

[0219] The image decoding apparatus 100 may determine a division rule for an image. The division rule may be predetermined between the image decoding apparatus 100 and the image encoding apparatus 2200. The image decoding apparatus 100 may determine the division rule for an image based on information obtained from a bitstream. The image decoding apparatus 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 tile header, and a tile group header. The image decoding apparatus 100 may determine the division rule differently based on a frame, a slice, a tile, a temporal layer, a maximum coding unit, or a coding unit.

[0220] 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, aspect ratio, 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 to this. The image decoding device 100 may determine the division rule based on information obtained from the bitstream received from the image encoding device 2200.

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

[0222] 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 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 apparatus 100 may apply the same division rule to the coding units classified into the same group. For example, the image decoding apparatus 100 may classify coding units having the same long side length as having the same size. In addition, the image decoding apparatus 100 may apply the same division rule to coding units having the same long side length.

[0223] The aspect ratio 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 that the width of the coding unit is longer than the height thereof. The vertical direction may indicate that the width of the coding unit is shorter than the height thereof.

[0224] The image decoding apparatus 100 may adaptively determine a division rule based on the size of a coding unit. The image decoding apparatus 100 may determine different allowable division shape patterns based on the size of a coding unit. For example, the image decoding apparatus 100 may determine whether division is allowed based on the size of a coding unit. The image decoding apparatus 100 may determine a division direction based on the size of a coding unit. The image decoding apparatus 100 may determine an allowable division type based on the size of a coding unit.

[0225] The division rule determined based on the size of the coding unit may be a division rule predetermined between the image encoding apparatus 2200 and the image decoding apparatus 100. Also, the image decoding apparatus 100 may determine the division rule based on information obtained from a bitstream.

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

[0227] 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 above reference Figure 12 The decoding process order is described, so its details are not provided again.

[0228] In the following, reference will now be made to Figures 17 to 20 A method and apparatus for encoding or decoding a video according to an embodiment of the present specification are described, the method and apparatus involving: determining whether a motion vector of a neighboring block at a position corresponding to one MVR among a plurality of MVRs is available; when the motion vector of the neighboring block corresponding to the one MVR is available, obtaining the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to the one MVR is unavailable, obtaining a default motion vector of the one MVR by using the motion vector of one of two neighboring blocks of the current block, and obtaining the default motion vector as a motion vector predictor of the current block; and performing prediction on the current block based on the motion vector predictor of the current block.

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

[0230] The video encoding apparatus 1700 according to an embodiment may include a memory 1710 and at least one processor 1720 connected to the memory 1710. The operation of the video encoding apparatus 1700 according to an embodiment may be performed by each processor or under the control of a central processing unit. In addition, the memory 1710 of the video encoding apparatus 1700 may store data received from the outside and data generated by the processor (e.g., a motion vector of a neighboring block corresponding to one of a plurality of MVRs, a default motion vector, a motion vector predictor of a current block, etc.).

[0231] The processor 1720 of the video encoding device 1700 can determine whether a motion vector of a neighboring block at a position corresponding to one MVR among multiple MVRs is available; when the motion vector of the neighboring block corresponding to one MVR is available, obtain the motion vector of the neighboring block as a motion vector predictor of the current block; when the motion vector of the neighboring block corresponding to one MVR is not available, obtain the motion vector of the neighboring block as the motion vector predictor of the current block; obtain a default motion vector of one MVR by using the motion vector of one of two neighboring blocks of the current block, and obtain the default motion vector as the motion vector predictor of the current block; and perform prediction on the current block based on the motion vector predictor of the current block.

[0232] In the following, reference will now be made to Figure 18 Detailed operations of a video encoding method according to an embodiment are described, wherein the video encoding apparatus 1700 determines whether a motion vector of a neighboring block at a position corresponding to one MVR among a plurality of MVRs is available; when the motion vector of the neighboring block corresponding to one MVR is available, the video encoding apparatus 1700 obtains the motion vector of the neighboring block as a motion vector predictor of a current block; when the motion vector of the neighboring block corresponding to one MVR is not available, the video encoding apparatus 1700 obtains the motion vector of the neighboring block as a motion vector predictor of the current block; a default motion vector of one MVR is obtained by using the motion vector of one of two neighboring blocks of the current block, and the default motion vector is obtained as a motion vector predictor of the current block, and prediction is performed on the current block based on the motion vector predictor of the current block.

[0233] Figure 18 is a flowchart illustrating a video encoding method according to an embodiment.

[0234] Reference Figure 18 , in operation S1810, the video encoding apparatus 1700 may determine whether a motion vector of a neighboring block at a position corresponding to one MVR among a plurality of MVRs is available.

[0235] According to an embodiment, positions of neighboring blocks corresponding to a plurality of MVRs may be determined based on availability of neighboring motion information of a current block.

[0236] According to an embodiment, whether to use a motion vector predictor based on a neighboring block corresponding to an MVR among multiple MVRs may be determined by calculating a sum of transform differences (SATD) or rate-distortion optimization (RDO), so that information about whether to use a motion vector predictor based on a neighboring block corresponding to an MVR among multiple MVRs may be encoded and signaled.

[0237] In operation S1830, when a motion vector of a neighboring block corresponding to one MVR is available, the video encoding apparatus 1700 may obtain the motion vector of the neighboring block as a motion vector predictor of the current block.

[0238] In operation S1850, when a motion vector of a neighboring block corresponding to an MVR is unavailable, the video encoding apparatus 1700 may obtain a default motion vector of an MVR by using a motion vector of one of two neighboring blocks of the current block, and obtain the default motion vector as a motion vector predictor of the current block.

[0239] According to an embodiment, the two neighboring blocks may include a first neighboring block and a second neighboring block, and positions of the first neighboring block and the second neighboring block may be determined based on availability of neighboring motion information of the current block.

[0240] According to an embodiment, when the motion vector of the first neighboring block is available and the reference index of the first neighboring block and the current block is the same, the motion vector of the first neighboring block can be obtained as the default motion vector. When the default motion vector is not obtained, the motion vector of the second neighboring block is available, and the reference index of the second neighboring block and the current block is the same, the motion vector of the second neighboring block can be obtained as the default motion vector. When the default motion vector is not obtained, the motion vector of the first neighboring block is available, and the reference index of the first neighboring block and the current block is different, the motion vector of the first neighboring block can be obtained as the default motion vector. When the default motion vector is not obtained, the motion vector of the second neighboring block is available, and the reference index of the second neighboring block and the current block is different, the motion vector of the second neighboring block can be obtained as the default motion vector.

[0241] According to an embodiment, when the motion information of both the left neighboring block and the right neighboring block of the current block is unavailable, or when the motion information of the left neighboring block of the current block is available, the neighboring blocks corresponding to the multiple MVRs may include an upper left neighboring block, a left neighboring block, a lower left neighboring block, an upper neighboring block, and an upper right neighboring block, the first neighboring block may be the left neighboring block, and the second neighboring block may be the upper neighboring block.

[0242] According to an embodiment, when motion information of both the left and right neighboring blocks of the current block is unavailable, or when motion information of the left neighboring block of the current block is available, the neighboring block corresponding to 1 / 4 pixel unit resolution in multiple MVRs may be the left neighboring block, the neighboring block corresponding to 1 / 2 pixel unit resolution in multiple MVRs may be the top neighboring block, the neighboring block corresponding to 1 pixel unit resolution in multiple MVRs may be the top right neighboring block, the neighboring block corresponding to 2 pixel unit resolution in multiple MVRs may be the bottom left neighboring block, and the neighboring block corresponding to 4 pixel unit resolution in multiple MVRs may be the top left neighboring block.

[0243] According to an embodiment, when motion information of both the left neighboring block and the right neighboring block of the current block is available, the neighboring blocks corresponding to the multiple MVRs may include an upper left neighboring block, a left neighboring block, an upper neighboring block, an upper right neighboring block, and a right neighboring block, the first neighboring block may be the left neighboring block, and the second neighboring block may be the right neighboring block.

[0244] According to an embodiment, when motion information of both the left and right neighboring blocks of the current block is available, the neighboring blocks corresponding to the 1 / 4 pixel unit resolution in the multiple MVRs may be the left neighboring blocks, the neighboring blocks corresponding to the 1 / 2 pixel unit resolution in the multiple MVRs may be the right neighboring blocks, and the neighboring blocks corresponding to the 1 pixel unit resolution in the multiple MVRs may be the top neighboring blocks. The neighboring blocks corresponding to the 2 pixel unit resolution in the multiple MVRs may be the top right neighboring blocks, and the neighboring blocks corresponding to the 4 pixel unit resolution in the multiple MVRs may be the top left neighboring blocks.

[0245] According to an embodiment, when the right motion information of the current block is available, the neighboring blocks corresponding to the multiple MVRs may include an upper left neighboring block, an upper neighboring block, an upper right neighboring block, a right neighboring block, and a lower right neighboring block, the first neighboring block may be the right neighboring block, and the second neighboring block may be the upper neighboring block.

[0246] According to an embodiment, when right motion information of a current block is available, a neighboring block corresponding to a 1 / 4 pixel unit resolution in a plurality of MVRs may be a right neighboring block, a neighboring block corresponding to a 1 / 2 pixel unit resolution in a plurality of MVRs may be an upper neighboring block, a neighboring block corresponding to a 1 pixel unit resolution in a plurality of MVRs may be an upper left neighboring block, a neighboring block corresponding to a 2 pixel unit resolution in a plurality of MVRs may be a lower right neighboring block, and a neighboring block corresponding to a 4 pixel unit resolution in a plurality of MVRs may be an upper right neighboring block.

[0247] The following will refer to Figures 22 to 24b A method of obtaining a motion vector of a neighboring block at a position corresponding to an MVR as a motion vector predictor of a current block, and a method of obtaining a default motion vector of an MVR and obtaining the default motion vector as a motion vector predictor of the current block when no motion vector of the neighboring block exists at the corresponding position are described.

[0248] According to an embodiment, the video encoding method may further include: when the motion vectors of two adjacent blocks are unavailable, obtaining a default motion vector based on a history-based motion vector list including motion vectors of blocks encoded before the current block, and obtaining the default motion vector as a motion vector predictor of the current block.

[0249] According to an embodiment, when motion information of two adjacent blocks is unavailable, if motion information stored in a history-based motion vector candidate list is available, a motion vector stored in the history-based motion vector candidate list may be obtained as a default motion vector. Specifically, when the reference frame (or reference index) of the motion vector in the history-based motion vector candidate list is the same as the reference frame (or reference index) of the current block, the motion vector may be selected and obtained as the default motion vector. Even if the reference frame (or reference index) of the motion vector in the history-based motion vector candidate list is different from the reference frame (or reference index) of the current block, the motion vector may be selected and obtained as the default motion vector to terminate the default motion vector acquisition process. Furthermore, using a history-based motion vector candidate list may be an option. That is, information regarding whether to use the history-based motion vector candidate list may be encoded and signaled.

[0250] The following will refer to Figure 27 A method of obtaining motion information by using a history-based motion vector list is described.

[0251] According to an embodiment, the video encoding method may further include: when a motion vector in the history-based motion vector list is unavailable, obtaining a zero motion vector as a default motion vector, and obtaining the default motion vector as a motion vector predictor of the current block.

[0252] According to an embodiment, the video encoding method may further include: when the history-based motion vector list is not used and the motion vectors of two neighboring blocks are unavailable, obtaining a zero motion vector as a default motion vector, and obtaining the default motion vector as a motion vector predictor of the current block.

[0253] According to an embodiment, when motion vectors of two neighboring blocks are unavailable, remaining neighboring blocks of the current block may be searched, and a default motion vector may be obtained by using the motion vectors of the searched neighboring blocks.

[0254] In operation S1870, the video encoding apparatus 1700 may perform prediction on the current block based on the motion vector predictor of the current block.

[0255] According to an embodiment, in order to perform prediction on a current block, a motion vector difference between a motion vector predictor of the current block and an original motion vector of the current block may be encoded.

[0256] Figure 19 and Figure 20 Shown are a block diagram of a video decoding apparatus according to an embodiment and a flowchart of a video decoding method according to an embodiment, which correspond to the above-described video encoding apparatus and video encoding method, respectively.

[0257] Figure 19A block diagram of a video decoding apparatus according to an embodiment is shown.

[0258] The video decoding apparatus 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 apparatus 1900 according to an embodiment may be performed by each processor or under the control of a central processing unit. In addition, the memory 1910 of the video decoding apparatus 1900 may store data received from the outside and data generated by the processor, such as a motion vector of a neighboring block corresponding to one of a plurality of MVRs, a default motion vector, a motion vector predictor of a current block, and the like.

[0259] The processor 1920 of the video decoding device 1900 can determine whether the motion vector of the neighboring block at a position corresponding to one MVR among multiple MVRs is available; when the motion vector of the neighboring block corresponding to one MVR is available, obtain the motion vector of the neighboring block as the motion vector predictor of the current block; when the motion vector of the neighboring block corresponding to one MVR is not available, obtain the motion vector of the neighboring block as the motion vector predictor of the current block; obtain a default motion vector of one MVR by using the motion vector of one of two neighboring blocks of the current block, and obtain the default motion vector as the motion vector predictor of the current block; and perform prediction on the current block based on the motion vector predictor of the current block.

[0260] In the following, reference will now be made to Figure 20 Detailed operations of a video decoding method according to an embodiment are described, wherein the video decoding device 1900 determines whether a motion vector of a neighboring block at a position corresponding to one MVR among multiple MVRs is available; when the motion vector of the neighboring block corresponding to one MVR is available, the video decoding device 1900 obtains the motion vector of the neighboring block as a motion vector predictor of the current block; when the motion vector of the neighboring block corresponding to one MVR is not available, the video decoding device 1900 obtains the motion vector of the neighboring block as a motion vector predictor of the current block; obtains a default motion vector of one MVR by using the motion vector of one of two neighboring blocks of the current block, and obtains the default motion vector as the motion vector predictor of the current block; and performs prediction on the current block based on the motion vector predictor of the current block.

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

[0262] Reference Figure 20 In operation S2010, the video decoding apparatus 1900 may determine whether a motion vector of a neighboring block at a position corresponding to one MVR among a plurality of MVRs is available.

[0263] According to an embodiment, positions of neighboring blocks corresponding to a plurality of MVRs may be determined based on availability of neighboring motion information of a current block.

[0264] According to an embodiment, whether to use a motion vector predictor based on a neighboring block corresponding to an MVR among a plurality of MVRs may be determined based on information obtained from a bitstream.

[0265] In operation S2030, when a motion vector of a neighboring block corresponding to one MVR is available, the video decoding apparatus 1900 may obtain the motion vector of the neighboring block as a motion vector predictor of the current block.

[0266] In operation S2050, when a motion vector of a neighboring block corresponding to an MVR is unavailable, the video decoding apparatus 1900 may obtain a default motion vector of an MVR by using a motion vector of one of two neighboring blocks of the current block, and obtain the default motion vector as a motion vector predictor of the current block.

[0267] According to an embodiment, the two neighboring blocks may include a first neighboring block and a second neighboring block, and the positions of the first neighboring block and the second neighboring block may be determined based on the availability of neighboring motion information of the current block. When the motion vector of the first neighboring block is available and the reference indexes of the first neighboring block and the current block are the same, the motion vector of the first neighboring block may be obtained as a default motion vector. When the default motion vector is not obtained, the motion vector of the second neighboring block is available, and the reference indexes of the second neighboring block and the current block are the same, the motion vector of the second neighboring block may be obtained as the default motion vector. When the default motion vector is not obtained, the motion vector of the first neighboring block is available, and the reference indexes of the first neighboring block and the current block are different, the motion vector of the first neighboring block may be obtained as the default motion vector. When the default motion vector is not obtained, the motion vector of the second neighboring block is available, and the reference indexes of the second neighboring block and the current block are different, the motion vector of the second neighboring block may be obtained as the default motion vector.

[0268] According to an embodiment, when the motion information of both the left neighboring block and the right neighboring block of the current block is unavailable, or when the motion information of the left neighboring block of the current block is available, the neighboring blocks corresponding to the multiple MVRs may include an upper left neighboring block, a left neighboring block, a lower left neighboring block, an upper neighboring block, and an upper right neighboring block, the first neighboring block may be the left neighboring block, and the second neighboring block may be the upper neighboring block.

[0269] According to an embodiment, when motion information of both the left neighboring block and the right neighboring block of the current block is unavailable, or when motion information of the left neighboring block of the current block is available, the neighboring block corresponding to the 1 / 4 pixel unit resolution in multiple MVRs may be the left neighboring block, the neighboring block corresponding to the 1 / 2 pixel unit resolution in multiple MVRs may be the upper neighboring block, the neighboring block corresponding to the 1 pixel unit resolution in multiple MVRs may be the upper right neighboring block, the neighboring block corresponding to the 2 pixel unit resolution in multiple MVRs may be the lower left neighboring block, and the neighboring block corresponding to the 4 pixel unit resolution in multiple MVRs may be the upper left neighboring block.

[0270] According to an embodiment, when motion information of both the left neighboring block and the right neighboring block of the current block is available, the neighboring blocks corresponding to the multiple MVRs may include an upper left neighboring block, a left neighboring block, an upper neighboring block, an upper right neighboring block, and a right neighboring block, the first neighboring block may be the left neighboring block, and the second neighboring block may be the right neighboring block.

[0271] According to an embodiment, when motion information of both the left neighboring block and the right neighboring block of the current block is available, the neighboring block corresponding to the 1 / 4 pixel unit resolution in multiple MVRs may be the left neighboring block, the neighboring block corresponding to the 1 / 2 pixel unit resolution in multiple MVRs may be the right neighboring block, the neighboring block corresponding to the 1 pixel unit resolution in multiple MVRs may be the top neighboring block, the neighboring block corresponding to the 2 pixel unit resolution in multiple MVRs may be the top right neighboring block, and the neighboring block corresponding to the 4 pixel unit resolution in multiple MVRs may be the top left neighboring block.

[0272] According to an embodiment, when the right motion information of the current block is available, the neighboring blocks corresponding to the multiple MVRs may include an upper left neighboring block, an upper neighboring block, an upper right neighboring block, a right neighboring block, and a lower right neighboring block, the first neighboring block may be the right neighboring block, and the second neighboring block may be the upper neighboring block.

[0273] According to an embodiment, when the right motion information of the current block is available, the neighboring blocks corresponding to the 1 / 4 pixel unit resolution in multiple MVRs may be the right neighboring blocks, the neighboring blocks corresponding to the 1 / 2 pixel unit resolution in multiple MVRs may be the upper neighboring blocks, the neighboring blocks corresponding to the 1 pixel unit resolution in multiple MVRs may be the upper left neighboring blocks, the neighboring blocks corresponding to the 2 pixel unit resolution in multiple MVRs may be the lower right neighboring blocks, and the neighboring blocks corresponding to the 4 pixel unit resolution in multiple MVRs may be the upper right neighboring blocks.

[0274] According to an embodiment, the video encoding method may further include: when motion vectors of two adjacent blocks are unavailable, obtaining a default motion vector based on a history-based motion vector list including motion vectors of blocks decoded before the current block, and obtaining the default motion vector as a motion vector predictor for the current block. In addition, whether to use the history-based motion vector list may be determined based on information regarding whether to use the history-based motion vector obtained from the bitstream.

[0275] According to an embodiment, the video encoding method may further include: when the information about whether to use the history-based motion vector indicates the use of the history-based motion vector list and the motion vector in the history-based motion vector list is not available, obtaining a zero motion vector as a default motion vector, and obtaining the default motion vector as a motion vector predictor of the current block.

[0276] According to an embodiment, the video encoding method may further include: when the information about whether to use the history-based motion vector indicates that the history-based motion vector list is not used and the motion vectors of two adjacent blocks are unavailable, obtaining a zero motion vector as a default motion vector, and obtaining the default motion vector as a motion vector predictor of the current block.

[0277] According to an embodiment, when motion vectors of two neighboring blocks are unavailable, remaining neighboring blocks of the current block may be searched, and a default motion vector may be obtained by using the motion vectors of the searched neighboring blocks.

[0278] In operation S2070, the video decoding apparatus 1900 may perform prediction on the current block based on the motion vector predictor of the current block.

[0279] According to an embodiment, a motion vector difference of the current block may be obtained, and a motion vector of the current block may be reconstructed based on a motion vector predictor of the current block and the motion vector difference of the current block.

[0280] Figure 21 A diagram for describing a maximum coding unit and an encoding order of coding units included in the maximum coding unit.

[0281] The maximum coding unit 2150 is divided into a plurality of coding units 2156, 2158, 2160, 2162, 2168, 2170, 2172, 2174, 2180, 2182, 2184, and 2186. The maximum coding unit 2150 corresponds to the topmost node 2100 of the tree structure. In addition, the plurality of coding units 2156, 2158, 2160, 2162, 2168, 2170, 2172, 2174, 2180, 2182, 2184, and 2186 correspond to the plurality of nodes 2106, 2108, 2110, 2112, 2118, 2121, 2122, 2124, 2130, 2132, 2134, and 2136, respectively. In the tree structure, upper coding order flags 2102 , 2114 , and 2126 indicating the coding order correspond to arrows 2152 , 2164 , and 2176 , and lower coding order flags 2104 , 2116 , and 2128 may correspond to arrows 2154 , 2166 , and 2178 .

[0282] The upper coding order flag indicates the coding order of the two coding units located above the four coding units divided from the one coding unit. When the upper coding order flag is 0, encoding is performed in the forward direction. Conversely, when the upper coding order flag is 1, encoding is performed in the reverse direction.

[0283] Similarly, the lower coding order flag indicates the coding order of the two coding units located below in the four coding units divided from the one coding unit. When the lower coding order flag is 0, encoding is performed in the forward direction. Conversely, when the lower coding order flag is 1, encoding is performed in the reverse direction.

[0284] For example, since the upper coding order flag 2114 is 0, the coding order between the coding units 2168 and 2170 is determined in the direction from the left to the right, which is the forward direction. In addition, since the lower coding order flag 2116 is 1, the coding order between the coding units 2172 and 2174 is determined in the direction from the right to the left, which is the reverse direction.

[0285] According to an embodiment, the upper coding order flag and the lower coding order flag may be set to have the same value. For example, when the upper coding order flag 2102 is determined to be 1, the lower coding order flag 2104 corresponding to the upper coding order flag 2102 may be determined to be 1. Since the values ​​of the upper coding order flag and the lower coding order flag are determined to be 1 bit, the amount of information in the coding order information is reduced.

[0286] According to an embodiment, the upper coding order flag and the lower coding order flag of the current coding unit can be determined by referring to at least one of the upper coding order flag and the lower coding order flag applied to a coding unit larger than the current coding unit. For example, the upper coding order flag 2126 and the lower coding order flag 2128 applied to coding units 2180, 2182, 2184, and 2186 can be determined based on the lower coding order flag 2116 applied to coding units 2172 and 2174. Therefore, the upper coding order flag 2126 and the lower coding order flag 2128 can be determined to have the same value as the lower coding order flag 2116. Because the values ​​of the upper coding order flag and the lower coding order flag are determined from the upper coding unit, the coding order information is not obtained from the bitstream. Accordingly, the amount of information in the coding order information is reduced.

[0287] According to an embodiment, whether to obtain the coding order flag of a block can be determined based on the size or depth of the block. For example, the coding order flag may be obtained only for blocks of a predetermined size, and the coding order flag may not be obtained for blocks of different sizes. When the current block is larger than a block of a predetermined size, the coding order can be determined in the forward direction without obtaining the coding order flag. When the current block is smaller than a block of a predetermined size, the coding order can be determined based on the block above the current block without obtaining the coding order flag. The size of the block for which the coding order flag is obtained can be arbitrarily determined. For example, the size of the block for which the coding order flag is obtained can be determined to be 16×16 and 32×32.

[0288] The positions of the available adjacent blocks in the current block can be determined according to the above Figure 21 The positions of the currently available left and right adjacent blocks can be classified by an availability check. Specifically, when an adjacent block of the current block has not been encoded or decoded, the adjacent block can be determined to be unavailable. When an adjacent block of the current block is located outside the boundary of the tile containing the current block, that is, when the adjacent block is included in the tile containing the current block and another tile, the adjacent block included in the other tile can be determined to be unavailable. Furthermore, even when the adjacent block is located outside the boundary of the picture containing the current block, the adjacent block can be determined to be unavailable. When all conditions for the adjacent block to be unavailable are not met, the adjacent block can be determined to be available. Furthermore, information regarding the availability check of the currently available left and right adjacent blocks can be represented as AvailLR, where L indicates the left side, R indicates the right side, and 0 or 1 indicates whether reference is possible, so that the value of AvailLR can be classified as LR_10, LR_01, LR_11, and LR_00.

[0289] The method of obtaining a motion vector predictor by using the motion vector of a neighboring block at a position corresponding to one of multiple MVRs is referred to as adaptive motion vector resolution (AMVR). AMVR can improve coding efficiency by transmitting motion information at various MVRs. Because AMVR uses motion information of neighboring blocks fixed at predetermined positions of each MVR, the motion vector predictor can be determined even if an MVR index indicating the MVR or a motion vector predictor index indicating the motion vector of the neighboring block is transmitted. In addition, when there is no motion vector at a predetermined position, another reliable motion vector needs to be inserted. To this end, a default motion vector can be obtained by identifying two neighboring blocks at a predetermined position. For example, in the case where the MVR has a 2-pixel unit resolution, when the motion vector of the neighboring block at a position corresponding to the 2-pixel unit resolution is not available, a default motion vector can be obtained by using the motion vectors of the two neighboring blocks at the predetermined position. The obtained default motion vector is a motion vector corresponding to the 2-pixel unit resolution (amvr_idx=3) and can therefore be represented as a value corresponding to the 2-pixel unit resolution.

[0290] The following will refer to Figures 22 to 24b The positions of neighboring blocks corresponding to multiple MVRs of an AMVR according to the availability of neighboring blocks of a current block and a method of searching for another reliable motion vector when there is no motion vector in the neighboring blocks are described.

[0291] Figure 22 This is a diagram for describing positions of multiple neighboring blocks corresponding to multiple MVRs and positions of two neighboring blocks for obtaining a default motion vector when motion information of a left neighboring block and a right neighboring block of a current block is unavailable or when motion information of a left neighboring block of the current block is available, according to an embodiment.

[0292] Reference Figure 22 , when the motion information of the left neighboring block and the right neighboring block of the current block 2200 is not available (LR_00) or when the motion information of the left neighboring block of the current block is available (LR_10), the motion vectors of the left neighboring block A1 2210, the upper neighboring block B1 2220, the upper right neighboring block B0 2230, the lower left neighboring block A0 2240, and the upper left neighboring block B2 2250 of the current block 2200 may be used.

[0293] When the position of the upper left sample point of the current block 2200 is (xCb, yCb), the right direction of xCb is the positive direction of the x-axis, the lower direction of yCb is the positive direction of the y-axis, and the width and height of the current block 2200 are nCbW and nCbH, respectively, the left neighboring block A1 2210 is a neighboring block including a pixel located at (xCb-1, yCb+nCbH-1), the upper neighboring block B1 2220 is a neighboring block including a pixel located at (xCb+nCbW-1, yCb-1), the upper right neighboring block B0 2230 is a neighboring block including a pixel located at (xCb+nCbW, yCb-1), the lower left neighboring block A0 2240 is a neighboring block including a pixel located at (xCb-1, yCb+nCbH), and the upper right neighboring block B2 2250 is a neighboring block including a pixel located at (xCb-1, yCb-1).

[0294] When the multiple MVRs include 1 / 4 pixel unit resolution, 1 / 2 pixel unit resolution, 1 pixel unit resolution, 2 pixel unit resolution and 4 pixel unit resolution, in the case of 1 / 4 pixel unit resolution, the motion vector of the left neighboring block A1 2210 can be obtained as the motion vector predictor of the current block; in the case of 1 / 2 pixel unit resolution, the motion vector of the upper neighboring block B1 2220 can be obtained as the motion vector predictor of the current block; in the case of 1 pixel unit resolution, the motion vector of the upper right neighboring block B0 2230 can be obtained as the motion vector predictor of the current block; in the case of 2 pixel unit resolution, the motion vector of the lower left neighboring block A0 2240 can be obtained as the motion vector predictor of the current block; and in the case of 4 pixel unit resolution, the motion vector of the upper right neighboring block B2 2250 can be obtained as the motion vector predictor of the current block.

[0295] Multiple MVRs can be represented as MVR indexes. In detail, the MVR index can be represented as amvr_idx, and the value of amvr_idx for 1 / 4 pixel unit resolution can be 0, the value of amvr_idx for 1 / 2 pixel unit resolution can be 1, the value of amvr_idx for 1 pixel unit resolution can be 2, the value of amvr_idx for 2 pixel unit resolution can be 3, and the value of amvr_idx for 4 pixel unit resolution can be 4.

[0296] In addition, when the MVR is 1 / 4, the motion vector of the neighboring block corresponding to the 1 / 4 pixel unit resolution is obtained as the motion vector predictor of the current block, but in the case of 1 / 2 pixel unit resolution, 1 pixel unit resolution, 2 pixel unit resolution and 4 pixel unit resolution, the motion vector of the neighboring block corresponding to each pixel unit resolution determined according to the following equations 1 and 2 is obtained as the motion vector predictor of the current block.

[0297] [Equation 1]

[0298] mvpLX[0]=mvpLX[0]>=0? ((mvpLX[0]+(1<<(amvr_idx-1)))>>amvr_idx)< <amvr_idx:-(((-mvpLX[0]+(1<<(amvr_idx-1)))> >amvr_idx)< <amvr_idx

[0299] [Equation 2]

[0300] mvpLX[1]=mvpLX[1]>=0? ((mvpLX[1]+(1<<(amvr_idx-1)))>>amvr_idx)< <amvr_idx:-(((-mvpLX[1]+(1<<(amvr_idx-1)))> >amvr_idx)< <amvr_idx

[0301] In Equations 1 and 2, mvpLX[0] and mvpLX[1] are the x component and y component of the motion vector predictor in the reference list of X (X is 0 or 1), respectively. The x component and y component of the motion vector predictor are rounded according to MVR.

[0302] The following will refer to Figure 25 and Figure 26 A method of determining a motion vector based on a plurality of MVRs and a method of expressing a motion vector having a 1 / 4 pixel unit resolution at different pixel unit resolutions are described.

[0303] The availability of a neighboring block at a position corresponding to one of the MVRs in a plurality of MVRs can be determined according to the following conditions. Specifically, when the neighboring block of the current block is not encoded or decoded, the neighboring block can be determined to be unavailable. When the neighboring block of the current block is located outside the boundary of the parallel block including the current block, that is, when the neighboring block is included in the parallel block including the current block and another parallel block, the neighboring block included in the other parallel block can be determined to be unavailable. In addition, even when the neighboring block is located outside the boundary of the picture including the current block, the neighboring block can be determined to be unavailable. Even when the neighboring block is encoded or decoded in intra mode or intra block copy mode, the neighboring block can be determined to be unavailable. When all conditions for the neighboring block to be unavailable are not met, the neighboring block can be determined to be available. This also applies to the following description Figure 23 、 Figure 24a and Figure 24b situation.

[0304] Furthermore, when motion information of a neighboring block at a position corresponding to one of the multiple MVRs is unavailable, it may be impossible to obtain a motion vector of the one MVR as a motion vector predictor for the current block. Therefore, it is necessary to obtain another motion vector as a motion vector predictor for the current block. In this case, a default motion vector can be obtained by using the motion vector of the left neighboring block A1 2210 or the upper neighboring block B1 2220 of the current block 2200. The obtained default motion vector can be rounded off according to the above equations 1 and 2 based on the one MVR (amvr_idx) and obtained as the motion vector predictor for the current block.

[0305] Specifically, as a first priority, when the motion vector of the left neighboring block A1 2210 is available and the reference index of the left neighboring block A1 2210 and the current block 2200 is the same, the motion vector of the left neighboring block A1 2210 is obtained as the default motion vector. Otherwise, as a second priority, when the motion vector of the upper neighboring block B1 2220 is available and the reference index of the upper neighboring block B1 2220 and the current block is the same, the motion vector of the upper neighboring block B1 2220 is obtained as the default motion vector. Otherwise, as a third priority, when the motion vector of the left neighboring block A1 2210 is available and the reference index of the left neighboring block A1 2210 and the current block is different, the motion vector of the left neighboring block A1 2210 is obtained as the default motion vector. Otherwise, as a fourth priority, when the motion vector of the upper neighboring block B1 2220 is available and the reference index of the upper neighboring block B1 2220 and the current block is different, the motion vector of the upper neighboring block B1 2220 is obtained as the default motion vector.

[0306] In addition, when the reference indexes of the left neighboring block A1 2210 and the current block are not the same, the motion vector of the left neighboring block A1 2210 can be scaled according to the distance between the reference frame of the current block and the reference frame of the left neighboring block A1 2210, and the scaled motion vector can be obtained as the default motion vector.

[0307] Similarly, when the reference indexes of the upper neighboring block B1 2220 and the current block are different, the motion vector of the upper neighboring block B1 2220 can be scaled according to the distance between the reference frame of the current block and the reference frame of the upper neighboring block B1 2220, and the scaled motion vector can be obtained as the default motion vector.

[0308] Figure 23 is a diagram for describing positions of a plurality of neighboring blocks corresponding to a plurality of MVRs and positions of two neighboring blocks for obtaining a default motion vector when motion information of a right neighboring block of a current block is available according to an embodiment.

[0309] Reference Figure 23 , when the motion information of the right neighboring block of the current block 2300 is available (LR_01), the motion vectors of the right neighboring block A1 2310, the upper neighboring block B1 2320, the upper left neighboring block B0 2330, the lower right neighboring block A0 2340 and the upper right neighboring block B2 2350 of the current block 2300 can be used.

[0310] When the position of the upper left sample point of the current block 2300 is (xCb, yCb), the right direction of xCb is the positive direction of the x-axis, the lower direction of yCb is the positive direction of the y-axis, and the width and height of the current block 2300 are nCbW and nCbH, respectively, the right neighboring block A1 2310 is a neighboring block including a pixel located at (xCb+nCbW, yCb+nCbH-1), the upper neighboring block B1 2320 is a neighboring block including a pixel located at (xCb, yCb-1), the upper left neighboring block B0 2330 is a neighboring block including a pixel located at (xCb-1, yCb-1), the lower right neighboring block A0 2340 is a neighboring block including a pixel located at (xCb+nCbW, yCb+nCbH), and the upper right neighboring block B2 2350 is a neighboring block including a pixel located at (xCb+nCbW, yCb-1).

[0311] When the multiple MVRs include 1 / 4 pixel unit resolution, 1 / 2 pixel unit resolution, 1 pixel unit resolution, 2 pixel unit resolution and 4 pixel unit resolution, in the case of 1 / 4 pixel unit resolution, the motion vector of the right neighboring block A1 2310 can be obtained as the motion vector predictor of the current block; in the case of 1 / 2 pixel unit resolution, the motion vector of the upper neighboring block B1 2320 can be obtained as the motion vector predictor of the current block; in the case of 1 pixel unit resolution, the motion vector of the upper left neighboring block B0 2330 can be obtained as the motion vector predictor of the current block; in the case of 2 pixel unit resolution, the motion vector of the lower right neighboring block A0 2340 can be obtained as the motion vector predictor of the current block; and in the case of 4 pixel unit resolution, the motion vector of the upper right neighboring block B2 2350 can be obtained as the motion vector predictor of the current block.

[0312] In addition, if Figure 22 As shown, when the MVR is 1 / 4, the motion vector of the neighboring block corresponding to the 1 / 4 pixel unit resolution is obtained as the motion vector predictor of the current block, but in the case of 1 / 2 pixel unit resolution, 1 pixel unit resolution, 2 pixel unit resolution and 4 pixel unit resolution, the motion vector of the neighboring block corresponding to each pixel unit resolution determined according to the above Equations 1 and 2 is obtained as the motion vector predictor of the current block.

[0313] Furthermore, when motion information of a neighboring block corresponding to one of the multiple MVRs is unavailable, it may be impossible to obtain a motion vector of the one MVR as a motion vector predictor for the current block. Therefore, it is necessary to obtain another motion vector as a motion vector predictor for the current block. In this case, a default motion vector can be obtained by using the motion vector of the right neighboring block A1 2310 or the upper neighboring block B1 2320 of the current block 2300. The obtained default motion vector can be rounded off according to the above equations 1 and 2 based on the one MVR (amvr_idx) and obtained as the motion vector predictor for the current block.

[0314] Specifically, as a first priority, when the motion vector of right-neighboring block A1 2310 is available and the reference index of right-neighboring block A1 2310 and the current block 2300 is the same, the motion vector of right-neighboring block A1 2310 is obtained as the default motion vector. Otherwise, as a second priority, when the motion vector of upper-neighboring block B1 2320 is available and the reference index of upper-neighboring block B1 2320 and the current block is the same, the motion vector of upper-neighboring block B1 2320 is obtained as the default motion vector. Otherwise, as a third priority, when the motion vector of right-neighboring block A1 2310 is available and the reference index of right-neighboring block A1 2310 and the current block is different, the motion vector of right-neighboring block A1 2310 is obtained as the default motion vector. Otherwise, as a fourth priority, when the motion vector of upper-neighboring block B1 2320 is available and the reference index of upper-neighboring block B1 2320 and the current block is different, the motion vector of upper-neighboring block B1 2320 is obtained as the default motion vector.

[0315] In addition, when the reference indexes of the right neighboring block A1 2310 and the current block are not the same, the motion vector of the right neighboring block A1 2310 can be scaled according to the distance between the reference frame of the current block and the reference frame of the right neighboring block A1 2310, and the scaled motion vector can be obtained as the default motion vector.

[0316] Similarly, when the reference indexes of the upper neighboring block B1 2320 and the current block are different, the motion vector of the upper neighboring block B1 2320 can be scaled according to the distance between the reference frame of the current block and the reference frame of the upper neighboring block B1 2320, and the scaled motion vector can be obtained as the default motion vector.

[0317] Figure 24a is a diagram for describing positions of a plurality of neighboring blocks corresponding to a plurality of MVRs and positions of two neighboring blocks for obtaining a default motion vector when motion information of left and right neighboring blocks of a current block is available according to an embodiment.

[0318] Reference Figure 24a , when the motion information of the left neighboring block and the right neighboring block of the current block 2400 is available (LR_11), the motion vectors of the left neighboring block A1 2410, the right neighboring block B1 2420, the upper neighboring block B0 2430, the upper right neighboring block A0 2440 and the upper left neighboring block B2 2450 of the current block 2400 may be used.

[0319] When the position of the upper left sample point of the current block 2400 is (xCb, yCb), the right direction of xCb is the positive direction of the x-axis, the lower direction of yCb is the positive direction of the y-axis, and the width and height of the current block 2400 are nCbW and nCbH, respectively, the left neighboring block A1 2410 is a neighboring block including a pixel located at (xCb-1, yCb+nCbH-1), the right neighboring block B1 2420 is a neighboring block including a pixel located at (xCb+nCbW, yCb+nCbH-1), the upper neighboring block B0 2430 is a neighboring block including a pixel located at (xCb, yCb-1), the upper right neighboring block A0 2440 is a neighboring block including a pixel located at (xCb+nCbW, yCb-1), and the upper left neighboring block B2 2450 is a neighboring block including a pixel located at (xCb-1, yCb-1).

[0320] When the multiple MVRs include 1 / 4 pixel unit resolution, 1 / 2 pixel unit resolution, 1 pixel unit resolution, 2 pixel unit resolution and 4 pixel unit resolution, in the case of 1 / 4 pixel unit resolution, the motion vector of the left neighboring block A1 2410 can be obtained as the motion vector predictor of the current block; in the case of 1 / 2 pixel unit resolution, the motion vector of the right neighboring block B1 2420 can be obtained as the motion vector predictor of the current block; in the case of 1 pixel unit resolution, the motion vector of the upper neighboring block B0 2430 can be obtained as the motion vector predictor of the current block; in the case of 2 pixel unit resolution, the motion vector of the upper right neighboring block A0 2440 can be obtained as the motion vector predictor of the current block; and in the case of 4 pixel unit resolution, the motion vector of the upper left neighboring block B2 2450 can be obtained as the motion vector predictor of the current block.

[0321] In addition, if Figure 22 As shown, when the MVR is 1 / 4, the motion vector of the neighboring block corresponding to the 1 / 4 pixel unit resolution is obtained as the motion vector predictor of the current block, but in the case of 1 / 2 pixel unit resolution, 1 pixel unit resolution, 2 pixel unit resolution and 4 pixel unit resolution, the motion vector of the neighboring block corresponding to each pixel unit resolution determined according to the above Equations 1 and 2 is obtained as the motion vector predictor of the current block.

[0322] In addition, when motion information of a neighboring block at a position corresponding to one of the multiple MVRs is unavailable, it may be impossible to obtain the motion vector of the one MVR as the motion vector predictor of the current block, and therefore it is necessary to include another motion vector. In this case, a default motion vector can be obtained by using the motion vector of the left neighboring block A1 2410 or the right neighboring block B1 2420 of the current block 2400. The obtained default motion vector can be rounded according to the above equations 1 and 2 based on the one MVR (amvr_idx) and can be obtained as the motion vector predictor of the current block.

[0323] Specifically, as a first priority, when the motion vector of the left neighboring block A1 2410 is available and the reference index of the left neighboring block A1 2410 and the current block 2400 is the same, the motion vector of the left neighboring block A1 2410 is obtained as the default motion vector. Otherwise, as a second priority, when the motion vector of the right neighboring block B1 2420 is available and the reference index of the right neighboring block B1 2420 and the current block is the same, the motion vector of the right neighboring block B1 2420 is obtained as the default motion vector. Otherwise, as a third priority, when the motion vector of the left neighboring block A1 2410 is available and the reference index of the left neighboring block A1 2410 and the current block is different, the motion vector of the left neighboring block A1 2410 is obtained as the default motion vector. Otherwise, as a fourth priority, when the motion vector of the right neighboring block B1 2420 is available and the reference index of the right neighboring block B1 2420 and the current block is different, the motion vector of the right neighboring block B1 2420 is obtained as the default motion vector.

[0324] In addition, when the reference indexes of the left neighboring block A1 2410 and the current block are not the same, the motion vector of the left neighboring block A1 2410 can be scaled according to the distance between the reference frame of the current block and the reference frame of the left neighboring block A1 2410, and the scaled motion vector can be obtained as the default motion vector.

[0325] Similarly, when the reference indexes of the right neighboring block B1 2420 and the current block are different, the motion vector of the right neighboring block B1 2420 can be scaled according to the distance between the reference frame of the current block and the reference frame of the right neighboring block B1 2420, and the scaled motion vector can be obtained as the default motion vector.

[0326] Figure 24b is a diagram for describing positions of multiple neighboring blocks corresponding to multiple MVRs and positions of two neighboring blocks for obtaining a default motion vector when motion information of left and right neighboring blocks of a current block is available according to another embodiment.

[0327] Reference Figure 24b , when the motion information of the left neighboring block and the right neighboring block of the current block 2400 is available (LR_11), the motion vectors of the left neighboring block A1 2410, the right neighboring block B1 2420, the upper neighboring block B0 2430, the upper right neighboring block A0 2440 and the upper left neighboring block B2 2450 of the current block 2400 may be used.

[0328] Figure 24b Examples and Figure 24a The difference between the embodiments is that the positions of the left adjacent block A1 2410 and the right adjacent block B1 2420 are different. Figure 24a Differently, when the position of the upper left sample point of the current block 2400 is (xCb, yCb), the right direction of xCb is the positive direction of the x-axis, the bottom direction of yCb is the positive direction of the y-axis, and the width and height of the current block 2400 are nCbW and nCbH respectively, Figure 24b The left-side neighboring block A1 2410 is a neighboring block including a pixel located at (xCb-1, yCb), and the right-side neighboring block B1 2420 is a neighboring block including a pixel located at (XCb+NCbW, YCb).

[0329] Specifically, when multiple MVRs include 1 / 4 pixel unit resolution, 1 / 2 pixel unit resolution, 1 pixel unit resolution, 2 pixel unit resolution and 4 pixel unit resolution, in the case of 1 / 4 pixel unit resolution, the motion vector of the left neighboring block A1 2410 can be obtained as the motion vector predictor of the current block; in the case of 1 / 2 pixel unit resolution, the motion vector of the right neighboring block B1 2420 can be obtained as the motion vector predictor of the current block; in the case of 1 pixel unit resolution, the motion vector of the upper neighboring block B0 2430 can be obtained as the motion vector predictor of the current block; in the case of 2 pixel unit resolution, the motion vector of the upper right neighboring block A0 2440 can be obtained as the motion vector predictor of the current block; and in the case of 4 pixel unit resolution, the motion vector of the upper left neighboring block B2 2450 can be obtained as the motion vector predictor of the current block.

[0330] In addition, if Figure 22 As shown, when the MVR is 1 / 4, the motion vector of the neighboring block corresponding to the 1 / 4 pixel unit resolution is obtained as the motion vector predictor of the current block, but in the case of 1 / 2 pixel unit resolution, 1 pixel unit resolution, 2 pixel unit resolution and 4 pixel unit resolution, the motion vector of the neighboring block corresponding to each pixel unit resolution determined according to the above Equations 1 and 2 is obtained as the motion vector predictor of the current block.

[0331] In addition, when motion information of a neighboring block at a position corresponding to one of the multiple MVRs is unavailable, it may be impossible to obtain a motion vector of the one MVR as a motion vector predictor for the current block. Therefore, it is necessary to obtain another motion vector as a motion vector predictor for the current block. In this case, a default motion vector can be obtained by using the motion vector of the left neighboring block A1 2410 or the right neighboring block B1 2420 of the current block 2400. The obtained default motion vector can be rounded according to the above equations 1 and 2 based on the one MVR (amvr_idx) and can be obtained as the motion vector predictor for the current block.

[0332] Specifically, as a first priority, when the motion vector of the left neighboring block A1 2410 is available and the reference index of the left neighboring block A1 2410 and the current block 2400 is the same, the motion vector of the left neighboring block A1 2410 is obtained as the default motion vector. Otherwise, as a second priority, when the motion vector of the right neighboring block B1 2420 is available and the reference index of the right neighboring block B1 2420 and the current block is the same, the motion vector of the right neighboring block B1 2420 is obtained as the default motion vector. Otherwise, as a third priority, when the motion vector of the left neighboring block A1 2410 is available and the reference index of the left neighboring block A1 2410 and the current block is different, the motion vector of the left neighboring block A1 2410 is obtained as the default motion vector. Otherwise, as a fourth priority, when the motion vector of the right neighboring block B1 2420 is available and the reference index of the right neighboring block B1 2420 and the current block is different, the motion vector of the right neighboring block B1 2420 is obtained as the default motion vector.

[0333] In addition, when the reference indexes of the left neighboring block A1 2410 and the current block are not the same, the motion vector of the left neighboring block A1 2410 can be scaled according to the distance between the reference frame of the current block and the reference frame of the left neighboring block A1 2410, and the scaled motion vector can be obtained as the default motion vector.

[0334] Similarly, when the reference indexes of the right neighboring block B1 2420 and the current block are different, the motion vector of the right neighboring block B1 2420 can be scaled according to the distance between the reference frame of the current block and the reference frame of the right neighboring block B1 2420, and the scaled motion vector can be obtained as the default motion vector.

[0335] Figure 25 is a diagram for describing interpolation for determining a motion vector according to various MVRs.

[0336] The video encoding apparatus 1700 may determine a motion vector of a current block according to at least one candidate MVR in order to perform inter-frame prediction on the current block. The candidate MVRs that can be supported may include 2 k When k is greater than 0, the motion vector may indicate only integer pixels in the interpolated reference image, and when k is less than 0, the motion vector may indicate both sub-pixels and integer pixels.

[0337] For example, when the minimum MVR has a 1 / 4 pixel unit, the video encoding device 1700 may interpolate the reference image to generate sub-pixels of 1 / 4 pixel units, and may determine a motion vector to indicate a pixel corresponding to a candidate MVR (e.g., a 1 / 4 pixel unit MVR, a 1 / 2 pixel unit MVR, a 1 pixel unit MVR, or a 2 pixel unit MVR).

[0338] For example, the video encoding apparatus 1700 may generate sub-pixels a to l in 1 / 2 pixel units by interpolating a reference image using an N-tap finite impulse response (FIR) filter. Regarding the 1 / 2 sub-pixels in the vertical direction, sub-pixel a may be generated by interpolating A1, A2, A3, A4, A5, and A6 in integer pixel units, and sub-pixel b may be generated by interpolating B1, B2, B3, B4, B5, and B6 in integer pixel units. Sub-pixels c, d, e, and f may also be generated in the same manner.

[0339] The pixel values ​​of the 1 / 2 sub-pixels in the vertical direction can be calculated as follows. For example, the pixel values ​​can be calculated as a=(A1-5×A2+20×A3+20×A4-5×A5+A6) / 32 and b=(B1-5×B2+20×B3+20×B4-5×B5+B6) / 32. The pixel values ​​of sub-pixels c, d, e, and f can also be calculated in the same way.

[0340] The video encoding apparatus 1700 may generate sub-pixels in the horizontal direction by performing interpolation using a 6-tap FIR filter as in the sub-pixels in the vertical direction. Sub-pixel g may be generated by using A1, B1, C1, D1, E1, and F1, and sub-pixel h may be generated by using A2, B2, C2, D2, E2, and F2.

[0341] The pixel values ​​of the sub-pixels in the horizontal direction are also calculated in the same manner as the pixel values ​​of the sub-pixels in the vertical direction. For example, the pixel value can be calculated as g=(A1-5×B1+20×C1+20×D1-5×E1+F1) / 32.

[0342] A sub-pixel m of 1 / 2 pixel unit in the diagonal direction can be interpolated by using another sub-pixel of 1 / 2 pixel unit. In other words, the pixel value of sub-pixel M can be calculated as m=(a-5×b+20×b+20×d-5×e+f) / 32.

[0343] After generating the 1 / 2 pixel unit sub-pixels, the video encoding apparatus 1700 may generate the 1 / 4 pixel unit sub-pixels by using the integer pixel and the 1 / 2 pixel unit sub-pixels. The video encoding apparatus 1700 may generate the 1 / 4 pixel unit sub-pixels by performing interpolation using two adjacent pixels. Alternatively, the video encoding apparatus 1700 may generate the 1 / 4 pixel unit sub-pixels by directly applying an interpolation filter to the pixel values ​​of the integer pixel without using the values ​​of the 1 / 2 pixel unit sub-pixels.

[0344] The interpolation filter described above is an example of a 6-tap filter, but the video encoding apparatus 1700 can interpolate a picture by using filters having different numbers of taps. For example, the interpolation filter may include a 4-tap filter, a 7-tap filter, an 8-tap filter, and a 12-tap filter.

[0345] Figure 26 a to Figure 26 d shows positions of pixels that the motion vector can indicate in response to 1 / 4 pixel unit MVR, 1 / 2 pixel unit MVR, 1 pixel unit MVR, and 2 pixel unit MVR when the supportable minimum MVR is 1 / 4 pixel unit MVR.

[0346] Figure 26 a. Figure 26 b. Figure 26 c and Figure 26 d shows coordinates (expressed as black squares) of pixels that can be indicated by motion vectors of 1 / 4 pixel unit MVR, 1 / 2 pixel unit MVR, 1 pixel unit MVR, and 2 pixel unit MVR based on the coordinates (0,0), respectively.

[0347] When the minimum MVR is a 1 / 4 pixel unit MVR, the coordinates of the pixel that can be indicated by the motion vector having the 1 / 4 pixel unit MVR are (a / 4, b / 4) (a and b are integers), the coordinates of the pixel that can be indicated by the motion vector having the 1 / 2 pixel unit MVR are (2c / 4, 2d / 4) (c and d are integers), the coordinates of the pixel that can be indicated by the motion vector having the 1 pixel unit MVR are (4e / 4, 4f / 4) (e and f are integers), and the coordinates of the pixel that can be indicated by the motion vector having the 2 pixel unit MVR are (8g / 4, 8h / 4) (g and h are integers). That is, when the minimum MVR has 2 m When there are pixel units (m is an integer), 2n The coordinates of the pixel indicated by the pixel unit MVR (n is an integer) are (2 n-m *i / 2 -m ,2 n-m *j / 2 -m )(i and j are integers.) Although the motion vector is determined based on a specific MVR, the motion vector is expressed as coordinates in the image interpolated according to a 1 / 4 pixel unit.

[0348] In an embodiment, since the video encoding apparatus 1700 determines a motion vector in an image interpolated according to the minimum MVR, the video encoding apparatus 1700 may calculate the interpolated motion vector by multiplying the motion vector (and the motion vector predictor) by the inverse of the pixel-unit value of the minimum MVR (for example, when the minimum MVR has 2 m 2 for pixel units (M is an integer) -m ) to express the motion vector in integer units so that the motion vector (and the motion vector predictor) can be expressed as an integer. The motion vector in integer units can be multiplied by 2 in the video encoding apparatus 1700 and the video encoding apparatus 1900. -m .

[0349] When a motion vector having a 1 / 2 pixel unit MVR starting from coordinates (0,0) indicates coordinates (2 / 4, 6 / 4) (a motion vector of a 1 / 2 pixel unit is a value (1, 3) obtained by multiplying the coordinates by an integer 2) and the minimum MVR has a 1 / 4 pixel unit, the video encoding device 1700 can determine a value (2, 6) obtained by multiplying the coordinates (2 / 4, 6 / 4) indicated by the motion vector by an integer 4 as the motion vector.

[0350] When the size of the MVR is less than 1 pixel unit, the video encoding device 1700 according to an embodiment can search for a block similar to the current block in the reference image based on a sub-pixel unit for a motion vector determined in integer pixel units, so as to perform motion prediction in sub-pixel units.

[0351] For example, when the MVR of the current block is a 1 / 4 pixel unit MVR, the video encoding apparatus 1700 may determine a motion vector in integer pixel units, interpolate a reference image to generate sub-pixels in 1 / 2 pixel units, and then search for the most similar prediction block within a range of (-1 to 1, -1 to 1) for the motion vector determined in integer pixel units. Next, the video encoding apparatus 1700 may interpolate the reference image again to generate sub-pixels in 1 / 4 pixel units, and then search for the most similar prediction block within a range for the motion vector determined in 1 / 2 pixel units, and determine a final motion vector having an MVR in 1 / 4 pixel units.

[0352] For example, when the motion vector in integer pixel units is (-4, -3) based on the coordinates (0, 0), the motion vector is (-8, -6) (= (-4*2, -3*2)) in accordance with the 1 / 2 pixel unit MVR, and when the motion vector moves (0, -1), the motion vector with the 1 / 2 pixel unit MVR is finally determined to be (-8, -7) (= (-8, -6-1)). In addition, the motion vector with the 1 / 4 pixel unit MVR may be changed to (-16, -14) (= (-8*2, -7*2)), and when the motion vector moves (-1, 0) again, the final motion vector with the 1 / 4 pixel unit MVR may be determined to be (-17, -14) (= (-16-1, -14)).

[0353] When the MVR of the current block is greater than the 1-pixel-unit MVR, the video encoding apparatus 1700 according to an embodiment may search for a block similar to the current block in the reference image based on pixel units greater than the 1-pixel unit for a motion vector determined in integer pixel units, so as to perform motion prediction in larger pixel units. Pixels located in pixel units greater than the 1-pixel unit (e.g., 2-pixel units, 3-pixel units, and 4-pixel units) may be referred to as super pixels.

[0354] Figure 27 is a diagram for describing history-based motion vector prediction.

[0355] In history-based motion vector prediction (HMVP), multiple pieces of motion information of blocks encoded or decoded before the current block in units of tiles or slices are stored as HMVP candidates. Specifically, a lookup table storing HMVP candidates (i.e., an HMVP list) is retrieved, and the block is encoded or decoded based on the HMVP candidates in the HMVP list.

[0356] Reference Figure 27 , among the N HMVP candidates stored in the HMVP lookup table, the index of the most recently stored HMVP candidate is 0, the index of the earliest stored HMVP candidate is N-1, and according to the lookup table sequence order, the search is performed from the HMVP with index N-1 to the HMVP with index 0.

[0357] Furthermore, when the HMVP list is updated and thus new HMVP candidates are added thereto, motion information of the oldest stored HMVP0 among the candidates stored in the HMVP list may be removed. That is, the HMVP list is updated according to a first-in-first-out (FIFO) logic.

[0358] In addition, the multiple recently stored motion information may be a repetition of the same motion information as the multiple motion information stored in the motion vector candidate list. In this case, the multiple recently stored motion information may not be used, and only up to the Mth recently stored motion information may be used.

[0359] The history-based motion vector candidate list may be accumulated and managed in units of tiles or slices, and may be initialized in units of new tiles or slices.

[0360] Figure 28a is a diagram for describing a method of using neighboring blocks other than two neighboring blocks for obtaining a default motion vector when motion information of both the left and right neighboring blocks of a current block is unavailable or when motion information of the left neighboring block of the current block is available, according to an embodiment.

[0361] Reference Figure 28a, when there is no available motion information in the left neighboring block A1 2810 and the upper neighboring block B1 2820 of the current block 2800, a default motion vector may be obtained by using the motion information of the neighboring blocks 2811, 2812, and 2813 located above the left neighboring block A1 2810 or the motion information of the neighboring blocks 2821, 2822, and 2823 located to the left of the upper neighboring block B1 2820. In addition, the default motion vector may be obtained by using the motion information of the other neighboring blocks 2814, 2815, and 2820. For example, when there is no motion information in left-side neighboring block A1 2810 and upper-side neighboring block B1 2820, the motion vector of neighboring block 2811 located above left-side neighboring block A1 2810 is identified. If a motion vector exists in neighboring block 2811 and the reference index of the current block is the same as the reference index of neighboring block 2811, the motion vector of neighboring block 2811 is determined as a default motion vector, and the process of obtaining the default motion vector is terminated. Furthermore, even if a motion vector exists in neighboring block 2811 and the reference index of the current block is different from the reference index of neighboring block 2811, the motion vector of neighboring block 2811 is determined as a default motion vector, and the process of obtaining the default motion vector is terminated. However, if there is no motion vector in neighboring block 2811, the motion vector of neighboring block 2812 located above neighboring block 2811 is identified. When a motion vector exists in the adjacent block 2812 and the reference index of the current block is the same as the reference index of the adjacent block 2812, the motion vector of the adjacent block 2812 is determined to be the default motion vector, and the process of obtaining the default motion vector is terminated. In addition, even if a motion vector exists in the adjacent block 2812 and the reference index of the current block is different from the reference index of the adjacent block 2812, the motion vector of the adjacent block 2812 is determined to be the default motion vector, and the process of obtaining the default motion vector is terminated. This process is repeated until the default motion vector is determined. This process can also be applied to the following described Figure 28b and Figure 28c middle.

[0362] Figure 28b is a diagram for describing a method of using neighboring blocks other than two neighboring blocks for obtaining a default motion vector when motion information of a right neighboring block of a current block is available, according to an embodiment.

[0363] Reference Figure 28b, when there is no available motion information in the right neighboring block A1 2830 and the upper neighboring block B1 2840 of the current block 2800, a default motion vector may be obtained by using the motion information of the neighboring blocks 2831, 2832, and 2833 located above the right neighboring block A1 2830 or the motion information of the neighboring blocks 2841, 2842, and 2843 located to the right of the upper neighboring block B1 2840. In addition, the default motion vector may be obtained by using the motion information of the other neighboring blocks 2834, 2835, and 2844.

[0364] Figure 28c is a diagram for describing a method of using neighboring blocks other than two neighboring blocks for obtaining a default motion vector when motion information of both left and right neighboring blocks of a current block is available, according to an embodiment.

[0365] Reference Figure 28c , when there is no available motion information in the left neighboring block A1 2850 and the right neighboring block B1 2860 of the current block 2800, a default motion vector may be obtained by using the motion information of neighboring blocks 2851, 2852, and 2853 located below the left neighboring block A1 2850 or the motion information of neighboring blocks 2861, 2862, and 2863 located to the right of the right neighboring block B1 2860. In addition, the default motion vector may be obtained by using the motion information of other neighboring blocks 2854, 2855, 2864, and 2865.

[0366] According to another embodiment, when information regarding the reference index of the current block is not received from the bitstream, a default reference index may be obtained and determined as the reference index of the current block. For example, when information regarding the motion vector and MVR of the current block is available but the reference index of the current block is unknown, the reference index of the neighboring block at the position corresponding to the MVR may be determined as the reference index of the current block. Furthermore, when the value of the reference index of the neighboring block is unknown due to unavailable motion information of the neighboring block at the position corresponding to the MVR, a default reference index may be determined by using the reference indices of two predetermined neighboring blocks, and the default reference index may be determined as the reference index of the current block.

[0367] Reference Figure 22 , when the motion information of the left neighboring block and the right neighboring block of the current block 2200 is not available (LR_00) or when the motion information of the left neighboring block of the current block is available (LR_10), the motion information of the left neighboring block A1 2210, the upper neighboring block B1 2220, the upper right neighboring block B0 2230, the lower left neighboring block A0 2240 and the upper left neighboring block B2 2250 of the current block 2200 can be used.

[0368] For example, when a motion vector value of the current block exists and the MVR of the current block is 1 / 4, the reference index of the current block may be set to the reference index of the left neighboring block A1 2210 corresponding to a 1 / 4 pixel unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 1 / 2, the reference index of the current block may be set to the reference index of the upper neighboring block B1 2220 corresponding to a 1 / 2 pixel unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 1, the reference index of the current block may be set to the reference index of the upper right neighboring block B0 2230 corresponding to a 1 pixel unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 2, the reference index of the current block may be set to the reference index of the lower left neighboring block A0 2240 corresponding to a 2 pixel unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 4, the reference index of the current block may be set to the reference index of the upper left neighboring block B2 2250 corresponding to a 4 pixel unit resolution.

[0369] Furthermore, when motion information of a neighboring block corresponding to the MVR of the current block is unavailable, a default reference index may be obtained by using the reference indices of the left neighboring block A1 2210 and the upper neighboring block B1 2220 of the current block 2200. Specifically, first, the reference index of the current block is set to 0, and as a first priority, when the motion information of the left neighboring block A1 2210 is available and the reference indices of the left neighboring block A1 2210 and the current block 2200 are the same, the reference index of the left neighboring block A1 2210 is obtained as the default reference index. Otherwise, as a second priority, when the motion information of the upper neighboring block B1 2220 is available and the reference indices of the upper neighboring block B1 2220 and the current block are the same, the reference index of the upper neighboring block B1 2220 is obtained as the default reference index. Otherwise, as a third priority, when the motion information of the left neighboring block A1 2210 is available and the reference indexes of the left neighboring block A1 2210 and the current block are different, the reference index of the left neighboring block A1 2210 is obtained as the default reference index. Otherwise, as a fourth priority, when the motion information of the upper neighboring block B1 2220 is available and the reference indexes of the upper neighboring block B1 2220 and the current block are different, the reference index of the upper neighboring block B1 2220 is obtained as the default reference index.

[0370] As another example, when there is a motion vector value of the current block and MVR is not applied, a default reference index may be obtained by using the reference indices of the left neighboring block A1 2210 and the upper neighboring block B1 2220 of the current block 2200. Specifically, first, the reference index of the current block is set to 0, and as a first priority, when the motion information of the left neighboring block A1 2210 is available and the reference indices of the left neighboring block A1 2210 and the current block 2200 are the same, the reference index of the left neighboring block A1 2210 is obtained as the default reference index. Otherwise, as a second priority, when the motion information of the upper neighboring block B1 2220 is available and the reference indices of the upper neighboring block B1 2220 and the current block are the same, the reference index of the upper neighboring block B1 2220 is obtained as the default reference index. Otherwise, as a third priority, when the motion information of the left neighboring block A1 2210 is available and the reference indexes of the left neighboring block A1 2210 and the current block are different, the reference index of the left neighboring block A1 2210 is obtained as the default reference index. Otherwise, as a fourth priority, when the motion information of the upper neighboring block B1 2220 is available and the reference indexes of the upper neighboring block B1 2220 and the current block are different, the reference index of the upper neighboring block B1 2220 is obtained as the default reference index.

[0371] Reference Figure 23 , when the motion information of the right neighboring block of the current block 2300 is available (LR_01), the motion information of the right neighboring block A1 2310, the upper neighboring block B1 2320, the upper left neighboring block B0 2330, the lower right neighboring block A0 2340 and the upper right neighboring block B2 2350 of the current block 2300 can be used.

[0372] For example, when a motion vector value of the current block exists and the MVR of the current block is 1 / 4, the reference index of the current block may be set to the reference index of the right neighboring block A1 2310 corresponding to a 1 / 4 pixel unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 1 / 2, the reference index of the current block may be set to the reference index of the upper neighboring block B1 2320 corresponding to a 1 / 2 pixel unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 1, the reference index of the current block may be set to the reference index of the upper left neighboring block B0 2330 corresponding to a 1 pixel unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 2, the reference index of the current block may be set to the reference index of the lower right neighboring block A0 2340 corresponding to a 2 pixel unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 4, the reference index of the current block may be set to the reference index of the upper right neighboring block B2 2350 corresponding to a 4 pixel unit resolution.

[0373] Furthermore, when motion information of a neighboring block corresponding to the MVR of the current block is unavailable, a default reference index may be obtained by using the reference indices of the right neighboring block A1 2310 and the upper neighboring block B1 2320 of the current block 2300. Specifically, first, the reference index of the current block is set to 0, and as a first priority, when the motion information of the right neighboring block A1 2310 is available and the reference indices of the right neighboring block A1 2310 and the current block 2300 are the same, the reference index of the right neighboring block A1 2310 is obtained as the default reference index. Otherwise, as a second priority, when the motion information of the upper neighboring block B1 2320 is available and the reference indices of the upper neighboring block B1 2320 and the current block are the same, the reference index of the upper neighboring block B1 2320 is obtained as the default reference index. Otherwise, as a third priority, when the motion information of the right neighboring block A1 2310 is available and the reference indexes of the right neighboring block A1 2310 and the current block are different, the reference index of the right neighboring block A1 2310 is obtained as the default reference index. Otherwise, as a fourth priority, when the motion information of the upper neighboring block B1 2320 is available and the reference indexes of the upper neighboring block B1 2320 and the current block are different, the reference index of the upper neighboring block B1 2320 is obtained as the default reference index.

[0374] As another example, when there is a motion vector value of the current block and MVR is not applied, a default reference index may be obtained by using the reference indices of the right neighboring block A1 2310 and the upper neighboring block B1 2320 of the current block 2300. Specifically, first, the reference index of the current block is set to 0, and as a first priority, when the motion information of the right neighboring block A1 2310 is available and the reference indices of the right neighboring block A1 2310 and the current block 2300 are the same, the reference index of the right neighboring block A1 2310 is obtained as the default reference index. Otherwise, as a second priority, when the motion information of the upper neighboring block B1 2320 is available and the reference indices of the upper neighboring block B1 2320 and the current block are the same, the reference index of the upper neighboring block B1 2320 is obtained as the default reference index. Otherwise, as a third priority, when the motion information of the right neighboring block A1 2310 is available and the reference indexes of the right neighboring block A1 2310 and the current block are different, the reference index of the right neighboring block A1 2310 is obtained as the default reference index. Otherwise, as a fourth priority, when the motion information of the upper neighboring block B1 2320 is available and the reference indexes of the upper neighboring block B1 2320 and the current block are different, the reference index of the upper neighboring block B1 2320 is obtained as the default reference index.

[0375] Reference Figure 24a and Figure 24b , when the motion information of the left neighboring block and the right neighboring block of the current block 2400 is available (LR_11), the motion information of the left neighboring block A1 2410, the right neighboring block B1 2420, the upper neighboring block B0 2430, the upper right neighboring block A0 2440 and the upper left neighboring block B2 2450 of the current block 2400 can be used.

[0376] For example, when a motion vector value of the current block exists and the MVR of the current block is 1 / 4, the reference index of the current block may be set to the reference index of the left neighboring block A1 2410 corresponding to a 1 / 4 pixel-unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 1 / 2, the reference index of the current block may be set to the reference index of the right neighboring block B1 2420 corresponding to a 1 / 2 pixel-unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 1, the reference index of the current block may be set to the reference index of the upper neighboring block B0 2430 corresponding to a 1 pixel-unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 2, the reference index of the current block may be set to the reference index of the upper right neighboring block A0 2440 corresponding to a 2 pixel-unit resolution. When a motion vector value of the current block exists and the MVR of the current block is 4, the reference index of the current block may be set to the reference index of the upper left neighboring block B2 2450 corresponding to a 4 pixel-unit resolution.

[0377] Furthermore, when motion information of a neighboring block corresponding to the MVR of the current block is unavailable, a default reference index may be obtained by using the reference indices of the left neighboring block A1 2410 and the right neighboring block B1 2420 of the current block 2400. Specifically, first, the reference index of the current block is set to 0, and as a first priority, when the motion information of the left neighboring block A1 2410 is available and the reference indices of the left neighboring block A1 2410 and the current block 2400 are the same, the reference index of the left neighboring block A1 2410 is obtained as the default reference index. Otherwise, as a second priority, when the motion information of the right neighboring block B1 2420 is available and the reference indices of the right neighboring block B1 2420 and the current block are the same, the reference index of the right neighboring block B1 2420 is obtained as the default reference index. Otherwise, as a third priority, when the motion information of the left neighboring block A1 2410 is available and the reference indexes of the left neighboring block A1 2410 and the current block are different, the reference index of the left neighboring block A1 2410 is obtained as the default reference index. Otherwise, as a fourth priority, when the motion information of the right neighboring block B1 2420 is available and the reference indexes of the right neighboring block B1 2420 and the current block are different, the reference index of the right neighboring block B1 2420 is obtained as the default reference index.

[0378] As another example, when there is a motion vector value of the current block and MVR is not applied, a default reference index may be obtained by using the reference indices of the left neighboring block A1 2410 and the right neighboring block B1 2420 of the current block 2400. Specifically, first, the reference index of the current block is set to 0, and as a first priority, when the motion information of the left neighboring block A1 2410 is available and the reference indices of the left neighboring block A1 2410 and the current block 2400 are the same, the reference index of the left neighboring block A1 2410 is obtained as the default reference index. Otherwise, as a second priority, when the motion information of the right neighboring block B1 2420 is available and the reference indices of the right neighboring block B1 2420 and the current block are the same, the reference index of the right neighboring block B1 2420 is obtained as the default reference index. Otherwise, as a third priority, when the motion information of the left neighboring block A1 2410 is available and the reference indexes of the left neighboring block A1 2410 and the current block are different, the reference index of the left neighboring block A1 2410 is obtained as the default reference index. Otherwise, as a fourth priority, when the motion information of the right neighboring block B1 2420 is available and the reference indexes of the right neighboring block B1 2420 and the current block are different, the reference index of the right neighboring block B1 2420 is obtained as the default reference index.

[0379] Even when motion information does not exist in the neighboring blocks corresponding to A1 and B1, by using the history-based motion vector candidate list storing motion information of a block encoded or decoded before the current block, motion information of the history-based motion vector candidate list can be identified, and a reference index of the identified motion information can be determined as a default reference index. When motion information does not exist in the history-based motion vector candidate list, the default reference index can be determined to be zero (0).

[0380] In addition, whether to use the history-based motion vector candidate list may be determined according to information on whether to use the history-based motion vector candidate list obtained from a bitstream.

[0381] Without using the history-based motion vector candidate list, when motion information does not exist even in the neighboring blocks corresponding to A1 and B1, the default reference index may be determined to be zero (0).

[0382] The availability of motion information of a neighboring block of a current block may be determined based on the following conditions. Specifically, when a neighboring block of the current block has not been encoded or decoded, the neighboring block may be determined to be unavailable. When a neighboring block of the current block is located outside the boundary of a parallel block including the current block, that is, when the neighboring block is included in both the parallel block including the current block and another parallel block, the neighboring block included in the other parallel block may be determined to be unavailable. Furthermore, even when the neighboring block is located outside the boundary of the picture including the current block, the neighboring block may be determined to be unavailable. Even when the neighboring block is encoded or decoded in intra mode or intra block copy mode, the neighboring block may be determined to be unavailable. When all conditions for the neighboring block to be unavailable are not met, the neighboring block may be determined to be available.

[0383] The present disclosure has been particularly shown and described with reference to the embodiments thereof. In this regard, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the scope of the present disclosure. Therefore, the embodiments should be considered in a descriptive sense only and not for purposes of limitation. The scope of the present disclosure is defined not by the detailed description of the present disclosure, but by the appended claims, and all differences within the scope are to be construed as included in the present disclosure.

[0384] In addition, the above-described embodiments of the present disclosure may be written as a program executable on a computer and implemented in a general-purpose digital computer that executes the program using a computer-readable recording medium. Examples of computer-readable recording media include magnetic storage media (e.g., ROM, floppy disks, hard disks, etc.), optical recording media (e.g., CD-ROMs or DVDs), and the like.

Claims

1. A video decoding method, comprising: determining available information about a plurality of neighboring blocks including a right neighboring block according to a coding order; When a first neighboring block corresponding to the motion vector resolution is a right neighboring block and the right neighboring block is available according to the available information and a motion vector of the right neighboring block exists, obtaining a motion vector predictor of the current block using the motion vector of the right neighboring block; When there is no motion vector of the right neighboring block, obtaining a default motion vector using a motion vector of at least one neighboring block among the plurality of neighboring blocks including an upper neighboring block and a left neighboring block; Using the default motion vector to obtain a motion vector predictor for the current block; and A motion vector of the current block is obtained using a motion vector predictor of the current block.

2. A video encoding method, comprising: determining available information about a plurality of neighboring blocks including a right neighboring block according to a coding order; When a first neighboring block corresponding to the motion vector resolution is a right neighboring block and the right neighboring block is available according to the available information and a motion vector of the right neighboring block exists, obtaining a motion vector predictor of the current block using the motion vector of the right neighboring block; When there is no motion vector of the right neighboring block, obtaining a default motion vector using at least one motion vector of the plurality of neighboring blocks including an upper neighboring block and a left neighboring block; Using the default motion vector to obtain a motion vector predictor for the current block; and A motion vector of the current block is obtained using a motion vector predictor of the current block.

Citation Information

Patent Citations

  • Apparatus and method for encoding motion vector determined using adaptive motion vector resolution, and apparatus and method for decoding motion vector

    WO2019009504A1

  • Encoding method and apparatus therefor, and decoding method and apparatus therefor

    WO2019066514A1