Image decoding method and apparatus, and image encoding method and apparatus

By identifying sub-blocks with the same motion vector from adjacent sub-blocks in image encoding and decoding, representative motion vectors and position information are determined, and parameters are optimized for optimization of prediction models, the problem of low encoding efficiency in the prior art is solved, and more efficient image compression is achieved.

CN119744532APending Publication Date: 2025-04-01SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380061211.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-01-18
Filing Date
2023-08-18
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the encoding and decoding process of high resolution or high quality images, it is difficult to effectively utilize the information of neighboring blocks to optimize the parameters of the prediction model, resulting in low encoding efficiency.

Method used

By identifying sub-blocks with the same motion vector from adjacent adjacent sub-blocks, representative motion vectors and position information are determined, parameters of the motion vector model are determined based on this information, and used for prediction of the current sub-block.

Benefits of technology

Improve the efficiency of image encoding and decoding, reduce data redundancy through more accurate prediction models, and improve image compression performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119744532A_ABST
    Figure CN119744532A_ABST
Patent Text Reader

Abstract

Provided are an image decoding method and apparatus, in which: at least two adjacent sub-blocks that have the same motion vector and are adjacent to each other are identified from a plurality of adjacent sub-blocks adjacent to a current block; determining representative motion vectors and representative position information corresponding to the at least two adjacent sub-blocks; determining parameters of a model for determining the motion vector based on the representative motion vector and the representative position information; determining a motion vector of the current sub-block based on the parameter and position information of the current sub-block included in the current block; predicting the current block based on the motion vector of the current sub-block; the representative motion vector is determined based on the same motion vector; and the representative position information represents coordinates determined based on at least two adjacent sub-blocks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a method and apparatus for image encoding and decoding, and more particularly, to a method and apparatus in which, in a prediction mode in which prediction is performed in units of sub-blocks, parameters of a model for performing prediction are determined by using information of neighboring blocks of a current block, and prediction is performed on each sub-block included in the current block based on the determined parameters. Background Art

[0002] Image data may be encoded by a codec according to a specific data compression standard (eg, the Moving Picture Expert Group (MPEG) standard), and may then be stored in a recording medium as a bit stream, or transmitted through a communication channel.

[0003] With the development and distribution of hardware that can reproduce and store high-resolution or high-quality image content, there is an increasing need for codecs that can efficiently encode or decode high-resolution or high-quality image content. For example, such high-resolution or high-quality image content can be compressed using image compression techniques, which may include segmenting the image to be encoded or manipulating the data in any manner.

[0004] As an example of a method for manipulating data, neighboring information of a current block may be used to perform prediction of the current block. Summary of the invention

[0005] Solution to the problem

[0006] According to an embodiment of the present disclosure, an image decoding method includes: identifying at least two adjacent sub-blocks having the same motion vector and adjacent to each other from a plurality of adjacent sub-blocks adjacent to a current block, determining a representative motion vector and representative position information corresponding to the at least two adjacent sub-blocks, determining parameters of a model for determining a motion vector based on the representative motion vector and the representative position information, determining a motion vector of the current sub-block based on the position information and parameters of the current sub-block included in the current block, and predicting the current block based on the motion vector of the current sub-block, wherein the representative motion vector is determined based on the same motion vector, and the representative position information indicates coordinates determined based on at least two adjacent sub-blocks.

[0007] An image decoding device according to an embodiment of the present disclosure includes a memory in which one or more instructions are stored, and at least one processor configured to operate according to the one or more instructions. The at least one processor may be configured to identify at least two adjacent sub-blocks having the same motion vector and adjacent to each other from a plurality of adjacent sub-blocks adjacent to a current block. The at least one processor may be configured to determine a representative motion vector and representative position information corresponding to the at least two adjacent sub-blocks. The at least one processor may be configured to determine parameters of a model for determining a motion vector based on the representative motion vector and the representative position information. The at least one processor may be configured to determine the motion vector of a current sub-block in a current block based on the position information and parameters of the current sub-block. The at least one processor may be configured to predict a current block based on the motion vector of the current sub-block. The representative motion vector may be determined based on the same motion vector, and the representative position information may indicate coordinates determined based on at least two adjacent sub-blocks.

[0008] According to an embodiment of the present disclosure, an image decoding method includes: identifying a first neighboring block that is not encoded and decoded in units of sub-blocks and a second neighboring block that is encoded and decoded in units of sub-blocks from neighboring blocks adjacent to a current block, determining a first motion vector and first position information corresponding to the first neighboring block, determining parameters of a model for determining a motion vector based on the first motion vector and the first position information, determining a motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and predicting the current block using the motion vector of the current sub-block, wherein the first position information indicates coordinates determined based on the first neighboring block.

[0009] An image decoding device according to an embodiment of the present disclosure includes a memory storing one or more instructions, and at least one processor configured to operate according to the one or more instructions. The at least one processor may be configured to identify a first adjacent block that is not encoded and decoded in units of sub-blocks and a second adjacent block that is encoded and decoded in units of sub-blocks from adjacent blocks adjacent to a current block. The at least one processor may be configured to determine a first motion vector and first position information corresponding to the first adjacent block. The at least one processor may be configured to determine parameters of a model for determining a motion vector based on the first motion vector and the first position information. The at least one processor may be configured to determine the motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters. The at least one processor may be configured to predict the current block using the motion vector of the current sub-block. The first position information may indicate coordinates determined based on the first adjacent block.

[0010] An image decoding method according to an embodiment of the present disclosure includes: comparing motion vectors of a first adjacent block and a second adjacent block that are adjacent to each other among adjacent blocks adjacent to a current block, indicating based on a result of the comparison that a first motion vector of the first adjacent block and a second motion vector of the second adjacent block are the same motion vector, determining representative position information corresponding to the first adjacent block and the second adjacent block, and determining parameters of a model for determining a motion vector based on the representative position information and one of the first motion vector and the second motion vector, indicating based on a result of the comparison that the first motion vector and the second motion vector are different from each other, determining parameters based on the first motion vector, the second motion vector, a first position information about the first adjacent block, and a second position information about the second adjacent block, determining a motion vector of a current sub-block based on position information about a current sub-block included in the current block and the determined parameters, and predicting a current block based on the motion vector of the current sub-block.

[0011] An image decoding device according to an embodiment of the present disclosure includes a memory storing one or more instructions, and at least one processor configured to operate according to the one or more instructions. The at least one processor may be configured to compare the motion vectors of a first adjacent block and a second adjacent block adjacent to each other in adjacent blocks adjacent to the current block. The at least one processor may be configured to indicate that the first motion vector of the first adjacent block and the second motion vector of the second adjacent block are the same motion vector based on the result of the comparison, determine the representative position information corresponding to the first adjacent block and the second adjacent block, and determine the parameters of the model for determining the motion vector based on the representative position information and one of the first motion vector and the second motion vector. The at least one processor may be configured to indicate that the first motion vector and the second motion vector are different from each other based on the result of the comparison, and determine the parameters based on the first motion vector, the second motion vector, the first position information about the first adjacent block, and the second position information about the second adjacent block. The at least one processor may be configured to determine the motion vector of the current subblock based on the position information about the current subblock included in the current block and the determined parameters. The at least one processor may be configured to predict the current block based on the motion vector of the current subblock.

[0012] According to an embodiment of the present disclosure, an image encoding method includes: identifying at least two adjacent sub-blocks having the same motion vector and adjacent to each other from a plurality of adjacent sub-blocks adjacent to a current block, determining a representative motion vector and representative position information corresponding to the at least two adjacent sub-blocks, determining parameters of a model for determining a motion vector based on the representative motion vector and the representative position information, determining a motion vector of the current sub-block based on position information and parameters of the current sub-block included in the current block, and predicting the current block based on the motion vector of the current sub-block, wherein the representative motion vector is determined based on the same motion vector, and the representative position information indicates coordinates determined based on at least two adjacent sub-blocks.

[0013] An image encoding device according to an embodiment of the present disclosure includes a memory storing one or more instructions, and at least one processor configured to operate according to the one or more instructions. The at least one processor may be configured to identify at least two adjacent sub-blocks that are the same motion vector and adjacent to each other from a plurality of adjacent sub-blocks adjacent to a current block. The at least one processor may be configured to determine a representative motion vector and representative position information corresponding to at least two adjacent sub-blocks. The at least one processor may be configured to determine parameters of a model for determining a motion vector based on the representative motion vector and the representative position information. The at least one processor may be configured to determine the motion vector of the current sub-block based on the position information and parameters of the current sub-block included in the current block. The at least one processor may be configured to predict the current block based on the motion vector of the current sub-block. The representative motion vector may be determined based on the same motion vector, and the representative position information may indicate coordinates determined based on at least two adjacent sub-blocks.

[0014] According to an embodiment of the present disclosure, an image encoding method includes: identifying a first neighboring block that is not encoded or decoded in units of sub-blocks and a second neighboring block that is encoded or decoded in units of sub-blocks from neighboring blocks adjacent to a current block, determining a first motion vector and first position information corresponding to the first neighboring block, determining parameters of a model for determining a motion vector based on the first motion vector and the first position information, determining a motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and predicting the current block using the motion vector of the current sub-block, wherein the first position information indicates coordinates determined based on the first neighboring block.

[0015] An image encoding device according to an embodiment of the present disclosure includes a memory storing one or more instructions, and at least one processor configured to operate according to the one or more instructions. The at least one processor may be configured to identify a first adjacent block that is not encoded and decoded in units of sub-blocks and a second adjacent block that is encoded and decoded in units of sub-blocks from adjacent blocks adjacent to a current block. The at least one processor may be configured to determine a first motion vector and first position information corresponding to the first adjacent block. The at least one processor may be configured to determine parameters of a model for determining a motion vector based on the first motion vector and the first position information. The at least one processor may be configured to determine the motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters. The at least one processor may be configured to predict the current block by using the motion vector of the current sub-block. The first position information may indicate coordinates determined based on the first adjacent block.

[0016] An image encoding method according to an embodiment of the present disclosure includes: comparing motion vectors of a first adjacent block and a second adjacent block adjacent to each other among adjacent blocks adjacent to a current block, indicating based on a result of the comparison that a first motion vector of the first adjacent block and a second motion vector of the second adjacent block are the same motion vector, determining representative position information corresponding to the first adjacent block and the second adjacent block, and determining parameters of a model for determining a motion vector based on the representative position information and one of the first motion vector and the second motion vector, indicating based on a result of the comparison that the first motion vector and the second motion vector are different from each other, determining parameters based on the first motion vector, the second motion vector, the first position information about the first adjacent block, and the second position information about the second adjacent block, determining a motion vector of a current sub-block based on position information about a current sub-block included in the current block and the determined parameters, and predicting a current block based on the motion vector of the current sub-block.

[0017] An image encoding device according to an embodiment of the present disclosure includes a memory storing one or more instructions, and at least one processor configured to operate according to the one or more instructions. The at least one processor may be configured to compare the motion vectors of a first adjacent block and a second adjacent block adjacent to each other in adjacent blocks adjacent to the current block. The at least one processor may be configured to indicate that the first motion vector of the first adjacent block and the second motion vector of the second adjacent block are the same motion vector based on the result of the comparison, determine the representative position information corresponding to the first adjacent block and the second adjacent block, and determine the parameters of the model for determining the motion vector based on the representative position information and one of the first motion vector and the second motion vector. The at least one processor may be configured to indicate that the first motion vector and the second motion vector are different from each other based on the result of the comparison, and determine the parameters based on the first motion vector, the second motion vector, the first position information about the first adjacent block, and the second position information about the second adjacent block. The at least one processor may be configured to determine the motion vector of the current subblock based on the position information about the current subblock included in the current block and the determined parameters. The at least one processor may be configured to predict the current block based on the motion vector of the current subblock. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other aspects, features and advantages of certain embodiments of the present disclosure will become more apparent through the following description in conjunction with the accompanying drawings, in which:

[0019] Figure 1 is a schematic block diagram showing an image decoding apparatus according to an embodiment of the present disclosure;

[0020] Figure 2 is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure;

[0021] Figure 3 A process in which an image decoding apparatus determines at least one codec unit by dividing a current codec unit according to an embodiment of the present disclosure is shown;

[0022] Figure 4 A process in which an image decoding device determines at least one codec unit by dividing a non-square codec unit according to an embodiment of the present disclosure is shown;

[0023] Figure 5 A process in which an image decoding device divides a codec unit based on at least one of block shape information or segmentation shape mode information according to an embodiment of the present disclosure is shown;

[0024] Figure 6 A method in which an image decoding device determines a specific codec unit from an odd number of codec units according to an embodiment of the present disclosure is shown;

[0025] Figure 7 The present invention shows the order of processing multiple codec units when the image decoding device determines multiple codec units by dividing the current codec unit according to an embodiment of the present disclosure;

[0026] Figure 8 The present invention shows a process in which an image decoding apparatus determines that a current codec unit is to be divided into an odd number of codec units when codec units cannot be processed in a specific order according to an embodiment of the present disclosure;

[0027] Fig. 9 A process in which an image decoding device determines at least one codec unit by dividing a first codec unit according to an embodiment of the present disclosure is shown;

[0028] Fig.10 An example is shown in which, when a second codec unit having a non-square shape determined when an image decoding device divides a first codec unit satisfies a specific condition, shapes into which the second codec unit can be divided are restricted according to an embodiment of the present disclosure;

[0029] Fig.11 A process of dividing a square codec unit by an image decoding apparatus when the division shape mode information indicates that the square codec unit is not to be divided into four square codec units according to an embodiment of the present disclosure is shown;

[0030] Fig.12 An example is shown in which the processing order among a plurality of codec units may be changed according to a process of dividing the codec units according to an embodiment of the present disclosure;

[0031] Fig.13 A process of determining the depth of a codec unit as the shape and size of the codec unit change when the codec unit is recursively split to determine a plurality of codec units according to an embodiment of the present disclosure is shown;

[0032] Fig.14 The invention shows a depth that can be determined based on the shape and size of a codec unit and a part index (PID) for distinguishing a codec unit according to an embodiment of the present disclosure;

[0033] Fig.15 An example is shown in which a plurality of coding units are determined according to a plurality of specific data units included in a picture according to an embodiment of the present disclosure;

[0034] Fig.16 A processing block serving as a unit for determining a determination order of reference codec units included in a picture according to an embodiment of the present disclosure is shown;

[0035] Fig.17a is a diagram for describing a method of obtaining parameter candidates of a model for determining a motion vector from neighboring blocks according to an embodiment of the present disclosure;

[0036] Fig.17b is a diagram for describing a method of deriving parameters of a model for determining a motion vector from neighboring blocks according to an embodiment of the present disclosure;

[0037] Fig.18 is a diagram for describing a method of deriving parameters of a model for determining a motion vector from a neighboring block by considering all neighboring subblocks according to an embodiment of the present disclosure;

[0038] Fig.19 is a diagram for describing a method of deriving parameters of a model for determining a motion vector from neighboring blocks when all inter-predicted neighboring blocks are predicted in units of sub-blocks according to an embodiment of the present disclosure;

[0039] Fig. 20 is a diagram for describing a method of deriving parameters of a model for determining a motion vector from neighboring blocks when all inter-predicted neighboring blocks are not predicted in units of sub-blocks according to an embodiment of the present disclosure;

[0040] Fig.21 is a diagram for describing a method of deriving parameters of a model for determining a motion vector from a neighboring block when an inter-predicted neighboring block includes both a neighboring block predicted in a subblock unit and a neighboring block not predicted in a subblock unit according to an embodiment of the present disclosure;

[0041] Fig. 22 is a diagram for describing a method of deriving parameters of a model for determining a motion vector from neighboring blocks when all inter-predicted neighboring blocks are not predicted in units of sub-blocks according to an embodiment of the present disclosure;

[0042] Fig.23 is a diagram for describing a method of deriving parameters of a model for determining a motion vector from a neighboring block when an inter-predicted neighboring block includes both a neighboring block predicted in a subblock unit and a neighboring block not predicted in a subblock unit according to an embodiment of the present disclosure;

[0043] Fig.24 is a diagram for describing a method of deriving parameters of a model for determining a motion vector by scanning an inter-predicted neighboring block in units of sub-blocks according to an embodiment of the present disclosure;

[0044] Fig.25 is a block diagram showing an image decoding apparatus according to an embodiment of the present disclosure;

[0045] Fig.26is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure;

[0046] Fig. 27 is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure;

[0047] Fig.28 is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure;

[0048] Fig.29 is a block diagram showing an image encoding apparatus according to an embodiment of the present disclosure;

[0049] Fig.30 is a flowchart illustrating an image encoding method according to an embodiment of the present disclosure;

[0050] Fig.31 is a flowchart illustrating an image encoding method according to an embodiment of the present disclosure; and

[0051] Fig.32 is a flowchart illustrating an image encoding method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0052] Throughout this disclosure, the expression "at least one of a, b, or c" refers to only a, only b, only c, both a and b, both a and c, both b and c, or all of a, b, and c, or variations thereof.

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

[0054] The terms used herein are briefly described, and the disclosed embodiments of the present disclosure are described in detail.

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

[0056] As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise.

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

[0058] Furthermore, ordinal numbers (eg, first and second) used in the description of the specification are merely identifier codes for distinguishing one element from another.

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

[0060] According to an embodiment of the present disclosure, the "... unit" may include a processor and a memory. The term "processor" should be broadly interpreted to cover a general-purpose processor, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a controller, a microcontroller, a state machine, etc. In some cases, a "processor" may refer to an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), etc. The term "processor" may refer to a combination of processing devices, such as a combination of a digital signal processor (DSP) and a microprocessor, a plurality of microprocessors, a combination of one or more microprocessors and a digital signal processor (DSP) core, or any other such configuration.

[0061] The term "memory" should be interpreted broadly to cover any electronic component capable of storing electronic information. The term "memory" may refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), nonvolatile random access memory (NVRAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable PROM (EEPROM), flash memory, magnetic or optical data storage, registers, etc. When a 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.

[0062] Hereinafter, the term "image" may refer to a still image of a video, or a moving image, ie, the video itself.

[0063] In addition, the term "sample" used in this article refers to data assigned to a sampling position of an image and to be processed. For example, a pixel value of an image in a spatial domain or a transform coefficient in a transform domain may be a sample. A unit including one or more samples may be defined as a block.

[0064] In addition, in the present specification, a 'current block' may refer to 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.

[0065] Hereinafter, embodiments of the present disclosure are described in detail with reference to the accompanying drawings so that those skilled in the art can implement and practice the present disclosure. In addition, in order to clearly describe the present disclosure, some parts that may not be very relevant to the description of the present disclosure may be omitted in the accompanying drawings.

[0066] In the following, reference Figures 1 to 16 The image encoding device and the image decoding device, and the image encoding method and the image decoding method according to the embodiments of the present disclosure are described in detail. Figures 3 to 16 A method for determining a data unit of an image according to an embodiment of the present disclosure is described, and reference is made to Figures 17a to 32 An image encoding / decoding method of determining parameters of a model for subblock unit prediction in a subblock unit prediction mode and performing prediction on each subblock by using the determined parameters according to an embodiment of the present disclosure is described.

[0067] refer to Figure 1 and Figure 2 Methods and apparatus for adaptively selecting context models based on various types of codec unit shapes according to embodiments of the present disclosure are described.

[0068] Figure 1 is a schematic block diagram showing an image decoding apparatus according to an embodiment of the present disclosure.

[0069] 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 in which instructions to be executed by the at least one processor are stored.

[0070] The receiver 110 may receive a bitstream. The bitstream includes information obtained when the image encoding device 2900 described below encodes an image. In addition, the bitstream may be received from the image encoding device 2900. The image encoding device 2900 and the image decoding device 100 may be connected to each other by wire or wirelessly, and the receiver 110 may receive the bitstream by wire or wirelessly. The receiver 110 may receive the bitstream from a storage medium such as an optical medium or a hard disk. The decoder 120 may reconstruct the image based on the information obtained from the received bitstream. The decoder 120 may obtain syntax elements for reconstructing the image from the bitstream. The decoder 120 may reconstruct the image based on the syntax elements.

[0071] Reference together Figure 2 An example of the operation of the image decoding device 100 is described in more detail.

[0072] Figure 2 is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure.

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

[0074] The image decoding device 100 performs an operation 210 of obtaining a binary string corresponding to a segmentation shape pattern of a codec unit from a bitstream. The image decoding device 100 performs an operation 220 of determining a segmentation rule of a codec unit. In addition, the image decoding device 100 performs an operation 230 of segmenting a codec unit into a plurality of codec units based on at least one of the binary string corresponding to the segmentation shape pattern or the segmentation rule. The image decoding device 100 may determine a first range as an allowable size range of the codec unit according to a ratio of a height to a width of the codec unit in order to determine the segmentation rule. The image decoding device 100 may determine a second range as an allowable size range of the codec unit according to the segmentation shape pattern of the codec unit in order to determine the segmentation rule.

[0075] Hereinafter, an example of segmentation of a coding unit according to an embodiment of the present disclosure is described in detail.

[0076] 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 maximum codec units, which can be, for example, a codec tree unit (CTU). As a concept compared to the maximum codec unit (or CTU), there can also be a maximum codec block, which can be, for example, a codec tree block (CTB).

[0077] A maximum codec block (or CTB) represents an N×N block (where N is an integer) comprising N×N samples. Each color component can be partitioned into one or more maximum codec blocks.

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

[0079] One maximum codec block (or CTB) may be partitioned into M×N codec blocks (M and N are integers) including M×N samples.

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

[0081] As described above, the maximum codec block and the maximum codec unit are conceptually distinguished from each other, and the codec block and the codec unit are conceptually distinguished from each other. That is, the codec unit or the maximum codec unit refers to a data structure including a codec block or a maximum codec block, including corresponding samples and a syntax structure corresponding to the codec block or the maximum codec block. However, because a person of ordinary skill in the art understands that a codec unit, a maximum codec unit, a codec block or a maximum codec block refers to a block of a certain size including a certain number of samples, the maximum codec block and the maximum codec unit or the codec block and the codec unit are mentioned in the following description, unless otherwise described, otherwise no distinction is made.

[0082] The image may be divided into maximum codec units (or CTUs). The size of each maximum codec unit may be determined based on information obtained from the bitstream. The shape of each maximum codec unit may be a square shape of the same size. However, the embodiments of the present disclosure are not limited thereto.

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

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

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

[0086] In addition, the maximum codec unit can be hierarchically split into codec units based on the split shape mode information obtained from the bitstream. At least one of information indicating whether to perform quad splitting, information indicating whether to perform multi-splitting, split direction information, or split type information can be obtained from the bitstream as the split shape mode information.

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

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

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

[0090] When the current codec unit is split in the horizontal direction or the vertical direction, the split type information indicates whether the current codec unit is split by two or three branches.

[0091] The segmentation mode of the current codec unit may be determined according to the segmentation direction information and the segmentation type information. The segmentation mode in which the current codec unit is bifurcated in the horizontal direction may be determined as a bifurcated horizontal segmentation mode (SPLIT_BT_HOR), the segmentation mode in which the current codec unit is trifurcated in the horizontal direction may be determined as a trifurcated horizontal segmentation mode (SPLIT_TT_HOR), the segmentation mode in which the current codec unit is bifurcated in the vertical direction may be determined as a bifurcated vertical segmentation mode (SPLIT_BT_VER), and the segmentation mode in which the current codec unit is trifurcated in the vertical direction may be determined as a trifurcated vertical segmentation mode (SPLIT_TT_VER).

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

[0093] The codec unit may be smaller than the maximum codec unit or the same as the maximum codec unit. For example, because the maximum codec unit is a codec unit having the maximum size, the maximum codec unit is one of the codec units. When the segmentation shape pattern information about the maximum codec unit indicates that segmentation is not performed, the codec unit determined in the maximum codec unit has the same size as that of the maximum codec unit. When the segmentation shape pattern information about the maximum codec unit indicates that segmentation is performed, the maximum codec unit may be segmented into codec units. In addition, when the segmentation shape pattern information about the codec unit indicates that segmentation is performed, the codec unit may be segmented into smaller codec units. However, segmentation of an image is not limited thereto, and the maximum codec unit and the codec unit may not be distinguished. Reference Figures 3 to 16 Examples of segmentation of codec units are described in more detail.

[0094] In addition, one or more prediction blocks for prediction may be determined from the codec unit. The prediction block may be equal to or smaller than the codec unit. In addition, one or more transform blocks for transform may be determined from the codec unit. The transform block may be equal to or smaller than the codec unit.

[0095] The shapes and sizes of the transform block and the prediction block may be independent of each other.

[0096] In an embodiment of the present disclosure, prediction may be performed by using a codec unit as a prediction unit. In addition, transformation may be performed by using a codec unit as a transformation block.

[0097] refer to Figures 3 to 16 An example of segmentation of a codec unit is described in more detail. The current block and the adjacent block of the present disclosure may indicate one of a maximum codec unit, a codec unit, a prediction block, and a transform block. In addition, the current block or the current codec unit is a block currently being decoded or encoded or a block currently being segmented. The adjacent block may be a block reconstructed before the current block. The adjacent block may be adjacent to the current block in space or time. The adjacent block may be located at one of the lower left, left side, upper left, top, upper right, right side, and lower right side of the current block.

[0098] Figure 3 A process in which an image decoding device determines at least one codec unit by dividing a current codec unit according to an embodiment of the present disclosure is shown.

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

[0100] The shape of the codec unit may include a square and a non-square. When the width and height of the codec unit are the same (for example, when the block shape of the codec unit is 4N×4N), the image decoding device 100 may determine the block shape information of the codec unit as a square. The image decoding device 100 may determine the shape of the codec unit as a non-square.

[0101] When the width and height of the codec unit are different from each other (for example, when the block shape of the codec 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 device 100 may determine the block shape information of the codec unit as a non-square. When the shape of the codec unit is a non-square, the image decoding device 100 may determine the ratio of the width and height in the block shape information of the codec unit to be at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, or 32:1. In addition, the image decoding device 100 may determine whether the codec unit is in the horizontal direction or in the vertical direction based on the length of the width and the length of the height of the codec unit. In addition, the image decoding device 100 may determine the size of the codec unit based on at least one of the length of the width, the length of the height, or the area of ​​the codec unit.

[0102] According to an embodiment of the present disclosure, the image decoding device 100 can determine the shape of the codec unit by using the block shape information, and can determine the segmentation method of the codec unit by using the segmentation shape mode information. That is, the codec unit segmentation method indicated by the segmentation shape mode information can be determined based on the block shape indicated by the block shape information used by the image decoding device 100.

[0103] The image decoding device 100 may obtain the segmentation shape mode information from the bitstream. However, the embodiments of the present disclosure are not limited thereto, and the image decoding device 100 and the image encoding device 2900 may determine the pre-agreed segmentation shape mode information based on the block shape information. The image decoding device 100 may determine the pre-agreed segmentation shape mode information about the maximum codec unit or the minimum codec unit. For example, the image decoding device 100 may determine the segmentation shape mode information about the maximum codec unit as a quadrilateral segmentation. In addition, the image decoding device 100 may determine the segmentation shape mode information about the minimum codec unit as "no segmentation" or no segmentation. Specifically, the image decoding device 100 may determine the size of the maximum codec unit to be 256×256. The image decoding device 100 may determine the pre-agreed segmentation shape mode information as a quadrilateral segmentation. Quadrilateral segmentation is a segmentation shape mode in which both the width and height of the codec unit are divided into two equal parts. The image decoding device 100 may obtain a codec unit of 128×128 size from a maximum codec unit of 256×256 size based on the segmentation shape mode information. Furthermore, the image decoding device 100 may determine the size of the minimum decoding unit to be 4 × 4. The image decoding device 100 may obtain the division shape mode information indicating “do not perform division” with respect to the minimum decoding unit.

[0104] According to an embodiment of the present disclosure, the image decoding device 100 may use block shape information indicating that the current codec unit has a square shape. For example, the image decoding device 100 may determine whether to not split the square codec unit, whether to split the square codec unit vertically, whether to split the square codec unit horizontally, or whether to split the square codec unit into four codec units based on the split shape mode information. Figure 3 , when the block shape information of the current codec unit 300 indicates a square shape, the decoder 120 may not split the codec unit 310a having the same size as the current codec unit 300 based on the split shape mode information indicating that the split is not performed, or may determine the codec unit 310b, 310c, 310d, 310e, or 310f to be split based on the split shape mode information indicating a specific split method. In an embodiment of the present disclosure, the codec unit 310b, 310c, 310d, 310e, or 310f may be determined or obtained by splitting the current codec unit 300 based on the indicated split method.

[0105] refer to Figure 3According to an embodiment of the present disclosure, the image decoding device 100 may determine two codec units 310b obtained by dividing the current codec 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 device 100 may determine two codec units 310c obtained by dividing the current codec 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 device 100 may determine four codec units 310d obtained by dividing the current codec 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 of the present disclosure, the image decoding device 100 may determine three codec units 310e obtained by dividing the current codec unit 300 in the vertical direction based on the division shape pattern information indicating that three-fork division is performed in the vertical direction. The image decoding device 100 may determine three codec units 310f obtained by dividing the current codec unit 300 in the horizontal direction based on the division shape pattern information indicating that three-fork division is performed in the horizontal direction. However, the segmentation method of the square codec unit is not limited to the above method, and the segmentation shape mode information may indicate various methods. The following describes in detail an example of a segmentation method of segmenting a square codec unit through various embodiments of the present disclosure.

[0106] Figure 4 A process in which an image decoding device determines at least one codec unit by dividing a non-square codec unit according to an embodiment of the present disclosure is shown.

[0107] According to an embodiment of the present disclosure, the image decoding device 100 may use block shape information indicating that the current codec unit has a non-square shape. The image decoding device 100 may determine whether to not segment the non-square current codec unit or whether to segment the non-square current codec unit by using a specific segmentation method based on the segmentation shape mode information. Figure 4, when the block shape information of the current codec unit 400 or 450 indicates a non-square shape, the image decoding device 100 may determine a codec unit 410 having the same size as the current codec unit 400 or a codec unit 460 having the same size as the current codec unit 450 based on the segmentation shape mode information indicating that segmentation is not performed, or may determine the codec units 420a and 420b, 430a to 430c, 470a and 470b, or 480a to 480c segmented based on the segmentation shape mode information indicating a specific segmentation method. In an embodiment of the present disclosure, the codec units 420a and 420b or 430a to 430c may be determined or obtained by segmenting the current codec unit 400 based on the indicated segmentation method, and the codec units 470a and 470b or 480a to 480c may be determined or obtained by segmenting the current codec unit 450 based on the indicated segmentation method. An example of a segmentation method for segmenting a non-square codec unit is described in detail below through various embodiments of the present disclosure.

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

[0109] According to an embodiment of the present disclosure, when the image decoding device 100 divides the non-square current codec unit 400 or 450 based on the division shape mode information, the image decoding device 100 may consider the position of the long side of the non-square current codec unit 400 or 450 to divide the current codec unit. For example, considering the shape of the current codec unit 400 or 450, the image decoding device 100 may determine a plurality of codec units by dividing the current codec unit 400 or 450 in the direction of dividing the long side of the current codec unit 400 or 450.

[0110] According to an embodiment of the present disclosure, when the segmentation shape mode information indicates that the codec unit is segmented into an odd number of blocks, for example, in a three-way segmentation, the image decoding device 100 may determine an odd number of codec units included in the current codec unit 400 or 450. For example, when the segmentation shape mode information indicates that the current codec unit 400 or 450 is segmented into three codec units, the image decoding device 100 may segment the current codec unit 400 into three codec units 430a, 430b, and 430c, or segment the current codec unit 450 into three codec units 480a, 480b, and 480c.

[0111] According to an embodiment of the present disclosure, the ratio of the width and height of the current codec unit 400 or 450 may be 4:1 or 1:4. When the ratio of the width and the height is 4:1, the block shape information may indicate the horizontal direction because the length of the width is longer than the length of the height. When the ratio of the width and the height is 1:4, the block shape information may indicate the vertical direction because the length of the width is shorter than the length of the height. The image decoding device 100 may determine to divide the current codec unit into an odd number of blocks based on the segmentation shape mode information. In addition, the image decoding device 100 may determine the segmentation direction of the current codec unit 400 or 450 based on the block shape information of the current codec unit 400 or 450. For example, when the current codec unit 400 is in a vertical direction, the image decoding device 100 may determine the codec units 430a, 430b, and 430c by dividing the current codec unit 400 in the horizontal direction. In addition, when the current codec unit 450 is in the horizontal direction, the image decoding device 100 may determine the codec units 480 a , 480 b , and 480 c by dividing the current codec unit 450 in the vertical direction.

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

[0113] According to an embodiment of the present disclosure, when the segmentation shape mode information indicates that the codec unit is segmented into an odd number of blocks, the image decoding device 100 may determine the odd number of codec units included in the current codec unit 400 or 450, and further, may impose a specific restriction on at least one of the odd number of codec units generated by segmenting the current codec unit 400 or 450. Figure 4 , the image decoding device 100 may set the decoding process of the codec unit 430b located at the center among the three codec units 430a, 430b, and 430c generated when the current codec unit 400 is divided to be different from the decoding process of the other codec units 430a and 430c, or may set the decoding process of the codec unit 480b located at the center among the three codec units 480a, 480b, and 480c generated when the current codec unit 450 is divided to be different from the decoding process of the other codec units 480a and 480c. For example, unlike the other codec units 430a and 430c or 480a and 480c, the image decoding device 100 may restrict the codec unit 430b or 480b at the center position from being further divided or being divided only a specific number of times.

[0114] Figure 5 A process in which an image decoding device divides a codec unit based on at least one of block shape information or division shape mode information according to an embodiment of the present disclosure is shown.

[0115] According to an embodiment of the present disclosure, the image decoding device 100 may determine whether to segment the square first codec unit 500 into codec units or not to segment the square first codec unit 500 into codec units based on at least one of the block shape information or the segmentation shape mode information. According to an embodiment of the present disclosure, when the segmentation shape mode information indicates that the first codec unit 500 is segmented in the horizontal direction, the image decoding device 100 may determine the second codec unit 510 by segmenting the first codec unit 500 in the horizontal direction. The first codec unit, the second codec unit, and the third codec unit used according to the embodiment of the present disclosure are terms for understanding the relationship before and after the segmentation of the codec unit. For example, the second codec unit may be determined by segmenting the first codec unit, and the third codec unit may be determined by segmenting the second codec unit. In an embodiment of the present disclosure, the relationship between the first codec unit, the second codec unit, and the third codec unit may follow the above description.

[0116] According to an embodiment of the present disclosure, the image decoding apparatus 100 may determine whether to split the determined second codec unit 510 into codec units based on the split shape mode information. Figure 5Based on the segmentation shape pattern information, the image decoding device 100 may segment the non-square second codec unit 510 determined by segmenting the first codec unit 500 into one or more third codec units 520a, 520b, 520c, and 520d, or may not segment the non-square second codec unit 510 into one or more third codec units 520a, 520b, 520c, and 520d. The image decoding device 100 may obtain the segmentation shape pattern information, and may obtain a plurality of second codec units (e.g., the second codec unit 510) of various shapes by segmenting the first codec unit 500 based on the obtained segmentation shape pattern information, and the second codec unit 510 may be segmented by using the segmentation method of the first codec unit 500 based on the segmentation shape pattern information. According to an embodiment of the present disclosure, when the first codec unit 500 is divided into the second codec unit 510 based on the segmentation shape mode information of the first codec unit 500, the second codec unit 510 may also be divided into the third codec unit (e.g., 520a or 520b, 520c, and 520d) based on the segmentation shape mode information of the second codec unit 510. That is, the codec unit may be recursively divided based on the segmentation shape mode information of each codec unit. Therefore, a square codec unit may be determined by dividing a non-square codec unit, and a non-square codec unit may be determined by recursively dividing a square codec unit.

[0117] refer to Figure 5 , a specific codec unit (e.g., a codec unit or a square codec unit located at a center position) among the odd number of third codec units 520b, 520c, and 520d determined by segmenting the non-square second codec unit 510 can be recursively segmented. According to an embodiment of the present disclosure, the square third codec unit 520c among the odd number of third codec units 520b, 520c, and 520d can be segmented into a plurality of fourth codec units in the horizontal direction. A non-square fourth codec unit 530b or 530d among the plurality of fourth codec units 530a, 530b, 530c, and 530d can be segmented into a plurality of codec units again. For example, a non-square fourth codec unit 530b or 530d can be segmented into an odd number of codec units again. An example of a method that can be used to recursively segment a codec unit is described below through various embodiments of the present disclosure.

[0118] According to an embodiment of the present disclosure, the image decoding device 100 may divide each of the third codec units 520a, 520b, 520c, and 520d into codec units based on the segmentation shape pattern information. In addition, the image decoding device 100 may determine not to divide the second codec unit 510 based on the segmentation shape pattern information. According to an embodiment of the present disclosure, the image decoding device 100 may divide the non-square second codec unit 510 into an odd number of third codec units 520b, 520c, and 520d. The image decoding device 100 may impose specific restrictions on a specific third codec unit among the odd number of third codec units 520b, 520c, and 520d. For example, the image decoding device 100 may limit the third codec unit 520c at the center position among the odd number of third codec units 520b, 520c, and 520d to no longer be divided or to be divided a set number of times.

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

[0120] According to an embodiment of the present disclosure, the image decoding apparatus 100 may obtain segmentation shape pattern information for segmenting the current codec unit from a specific position in the current codec unit.

[0121] Figure 6 A method in which an image decoding device determines a specific codec unit from an odd number of codec units according to an embodiment of the present disclosure is shown.

[0122] refer to Figure 6 , the segmentation shape mode information of the current codec unit 600 or 650 can be obtained from a sample point at a specific position (e.g., a sample point 640 or 690 at a center position) among a plurality of sample points included in the current codec unit 600 or 650. However, the specific position in the current codec unit 600 from which at least one piece of segmentation shape mode information can be obtained is not limited to Figure 6The image decoding device 100 may include the center position of the current codec unit 600, and may include various positions (e.g., top, bottom, left, right, upper left, lower left, upper right, lower right, etc.) included in the current codec unit 600. The image decoding device 100 may obtain the segmentation shape mode information from a specific position, and may determine whether to segment the current codec unit into codec units of various shapes and sizes or not.

[0123] According to an embodiment of the present disclosure, when the current codec unit is divided into a specific number of codec units, the image decoding device 100 can select one of the codec units. Various methods can be used to select one of the multiple codec units, and examples thereof are described below through various embodiments of the present disclosure.

[0124] According to an embodiment of the present disclosure, the image decoding device 100 may split a current codec unit into a plurality of codec units, and may determine a codec unit at a specific position.

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

[0126] According to an embodiment of the present disclosure, the information indicating the positions of the upper left samples 630a, 630b, and 630c respectively included in the codec units 620a, 620b, and 620c may include information about the positions or coordinates of the codec units 620a, 620b, and 620c in the picture. According to an embodiment of the present disclosure, the information indicating the positions of the upper left samples 630a, 630b, and 630c respectively included in the codec units 620a, 620b, and 620c may include information indicating the width or height of the codec units 620a, 620b, and 620c included in the current codec unit 600, and the width or height may correspond to information indicating the difference between the coordinates of the codec units 620a, 620b, and 620c in the picture. That is, the image decoding device 100 can determine the codec unit 620b at the center position by directly using information about the position or coordinates of the codec units 620a, 620b and 620c in the picture, or by using information about the width or height of the codec units (which corresponds to the difference between the coordinates).

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

[0128] According to an embodiment of the present disclosure, the image decoding device 100 may divide the current codec unit 600 into a plurality of codec units 620a, 620b, and 620c, and may select one of the codec units 620a, 620b, and 620c based on a specific criterion. For example, the image decoding device 100 may select a codec unit 620b having a different size from the other codec units from the codec units 620a, 620b, and 620c.

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

[0130] The image decoding device 100 may determine the width or height of each of the codec 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 codec unit 660a, the coordinates (xe, ye) as information indicating the position of the upper left sample 670b of the middle codec unit 660b, and the coordinates (xf, yf) as information indicating the position of the upper left sample 670c of the right codec unit 660c. The image decoding device 100 may determine the respective sizes of the codec units 660a, 660b, and 660c by using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the codec units 660a, 660b, and 660c.

[0131] According to an embodiment of the present disclosure, the image decoding device 100 may determine the width of the left codec unit 660a as xe-xd. The image decoding device 100 may determine the height of the left codec unit 660a as the height of the current codec unit 650. According to an embodiment of the present disclosure, the image decoding device 100 may determine the width of the middle codec unit 660b as xf-xe. The image decoding device 100 may determine the height of the middle codec unit 660b as the height of the current codec unit 650. According to an embodiment of the present disclosure, the image decoding device 100 may determine the width or height of the right codec unit 660c by using the width or height of the current codec unit 650 and the width or height of the left codec unit 660a and the middle codec unit 660b. The image decoding device 100 may determine a codec unit having a size different from the sizes of other codec units based on the determined widths and heights of the codec units 660a, 660b, and 660c. Reference Figure 6 , the image decoding device 100 may determine the middle codec unit 660b having a size different from the sizes of the left codec unit 660a and the right codec unit 660c as the codec unit at the specific position. However, the above-mentioned process in which the image decoding device 100 determines the codec unit having a size different from the sizes of the other codec units only corresponds to an example of determining the codec unit at the specific position by using the size of the codec unit determined based on the coordinates of the sample points, and thus various processes of determining the codec unit at the specific position by comparing the size of the codec unit determined based on the coordinates of the specific sample points may be used.

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

[0133] According to an embodiment of the present disclosure, the image decoding device 100 can select a codec unit at a specific position from an odd number of codec units determined by dividing the current codec unit by considering the shape of the current codec unit. For example, when the current codec unit has a non-square shape whose width is longer than the height, the image decoding device 100 can determine the codec unit at a specific position in the horizontal direction. That is, the image decoding device 100 can determine one of the codec units at different positions in the horizontal direction, and can impose restrictions on the codec unit. When the current codec unit has a non-square shape whose height is longer than the width, the image decoding device 100 can determine the codec unit at a specific position in the vertical direction. That is, the image decoding device 100 can determine one of the codec units at different positions in the vertical direction, and can impose restrictions on the codec unit.

[0134] According to an embodiment of the present disclosure, the image decoding device 100 may use information indicating the corresponding positions of the even-numbered codec units to determine the codec unit at a specific position from the even-numbered codec units. The image decoding device 100 may determine the even-numbered codec units by splitting (binary splitting) the current codec unit, and may determine the codec unit at the specific position by using information about the positions of the even-numbered codec units. Operations related thereto may correspond to operations of determining the codec unit at a specific position (e.g., a center position) from the odd-numbered codec units, which have been referred to above. Figure 6 This has been described in detail, so redundant or repeated description thereof may be omitted.

[0135] According to an embodiment of the present disclosure, when a non-square current codec unit is divided into a plurality of codec units, specific information about a codec unit at a specific position may be used in a division operation to determine the codec unit at the specific position from the plurality of codec units. For example, the image decoding apparatus 100 may use at least one of the division shape mode information or the block shape information stored in the samples included in the intermediate codec unit in the division operation to determine the codec unit at the center position from the plurality of codec units determined by dividing the current codec unit.

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

[0137] According to an embodiment of the present disclosure, specific information for identifying a codec unit at a specific position may be obtained from a specific sample point included in the codec unit to be determined. Figure 6 , the image decoding device 100 can use the segmentation shape pattern information obtained from the sample at the specific position in the current codec unit 600 (for example, the sample at the center position of the current codec unit 600) to determine the codec unit at the specific position (for example, the codec unit at the center position of the multiple segmented codec units) from the multiple codec units 620a, 620b, and 620c determined by segmenting the current codec unit 600. That is, the image decoding device 100 can determine the sample at the specific position by considering the block shape of the current codec unit 600, and can determine the codec unit 620b including the sample from which the specific information (for example, the segmentation shape pattern information) can be obtained from the multiple codec units 620a, 620b, and 620c determined by segmenting the current codec unit 600, and can impose specific restrictions on the codec unit 620b. Reference Figure 6 According to an embodiment of the present disclosure, the image decoding device 100 may determine the sample 640 at the center position of the current codec unit 600 as the sample from which specific information can be obtained, and may impose specific restrictions on the codec unit 620b including the sample 640 during decoding. However, the position of the sample from which specific information can be obtained is not limited to the above-mentioned position, and may include any position of the sample included in the codec unit 620b to be determined as subject to restriction.

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

[0139] According to an embodiment of the present disclosure, when the current codec unit is divided into multiple codec units, the image decoding device 100 can use the segmentation shape pattern information to determine the codec unit at a specific position from the multiple codec units. According to an embodiment of the present disclosure, the image decoding device 100 can obtain the segmentation shape pattern information from the sample points at the specific position in the codec unit, and can segment the multiple codec units generated by segmenting the current codec unit by using the segmentation shape pattern information obtained from the sample points at the specific position in each of the multiple codec units. That is, the codec unit can be recursively segmented based on the segmentation shape pattern information obtained from the sample points at the specific position in each of the codec units. Reference has been made to the above Figure 5 The process of recursively splitting the codec unit is described, and thus redundant or repeated description thereof may be omitted.

[0140] According to an embodiment of the present disclosure, the image decoding device 100 may determine one or more codec units by segmenting the current codec unit, and may determine the order of decoding the one or more codec units based on a specific block (eg, the current codec unit).

[0141] Figure 7 The order of processing a plurality of codec units when an image decoding apparatus determines a plurality of codec units by dividing a current codec unit according to an embodiment of the present disclosure is shown.

[0142] According to an embodiment of the present disclosure, based on the segmentation shape pattern information, the image decoding device 100 can determine the second codec units 710a and 710b by segmenting the first codec unit 700 in the vertical direction, can determine the second codec units 730a and 730b by segmenting the first codec unit 700 in the horizontal direction, or can determine the second codec units 750a, 750b, 750c and 750d by segmenting the first codec unit 700 in the vertical and horizontal directions.

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

[0144] According to an embodiment of the present disclosure, the image decoding apparatus 100 may recursively divide the coding unit. Figure 7 , the image decoding device 100 may determine a plurality of codec units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d by segmenting the first codec unit 700, and may recursively segment each of the determined plurality of codec units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. The segmentation method of the plurality of codec units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d may correspond to the segmentation method of the first codec unit 700. Therefore, each of the plurality of codec units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d may be independently segmented into a plurality of codec units. Reference Figure 7 , the image decoding device 100 may determine the second codec units 710a and 710b by dividing the first codec unit 700 in the vertical direction, and may determine whether to divide or not divide each of the second codec units 710a and 710b independently.

[0145] According to an embodiment of the present disclosure, the image decoding device 100 may determine the third codec units 720a and 720b by splitting the left second codec unit 710a in the horizontal direction, and may not split the right second codec unit 710b.

[0146] According to an embodiment of the present disclosure, the processing order of the codec unit can be determined based on the process of segmenting the codec unit. In other words, the processing order of the segmented codec unit can be determined based on the processing order of the codec unit immediately before being segmented. The image decoding device 100 can determine the processing order of the third codec units 720a and 720b determined by segmenting the left second codec unit 710a independently of the right second codec unit 710b. Because the third codec units 720a and 720b are determined by segmenting the left second codec unit 710a in the horizontal direction, the third codec units 720a and 720b can be processed in a vertical direction order 720c. Because the left second codec unit 710a and the right second codec unit 710b are processed in a horizontal direction order 710c, the right second codec unit 710b can be processed after the third codec units 720a and 720b included in the left second codec unit 710a are processed in a vertical direction order 720c. The process of determining the processing order of codec units based on the codec units before being segmented is not limited to the above example, and various methods may be used to independently process codec units segmented and determined into various shapes in a specific order.

[0147] Figure 8 A process in which an image decoding apparatus determines that a current codec unit is to be divided into an odd number of codec units when codec units cannot be processed in a specific order according to an embodiment of the present disclosure is shown.

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

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

[0150] According to an embodiment of the present disclosure, the image decoding device 100 may determine whether the third codec units 820a and 820b and 820c, 820d, and 820e included in the first codec unit 800 satisfy a condition for processing in a specific order, and the condition is related to whether at least one of the width or height of the second codec units 810a and 810b is to be divided in half along the boundary of the third codec units 820a and 820b and 820c, 820d, and 820e. For example, the third codec units 820a and 820b determined when the height of the second codec unit 810a on the left side of the non-square shape is divided in half may satisfy the condition. It can be determined that the third codec units 820c, 820d, and 820e do not meet the condition because the boundaries of the third codec units 820c, 820d, and 820e determined when the right second codec unit 810b is divided into three codec units cannot divide the width or height of the right second codec unit 810b in half. When the condition is not met as described above, the image decoding device 100 can decide the disconnection of the scanning order, and can determine that the right second codec unit 810b will be divided into an odd number of codec units based on the result of the decision. According to an embodiment of the present disclosure, when the codec unit is divided into an odd number of codec units, the image decoding device 100 can impose specific restrictions on the codec units at specific positions in the divided codec units. The restrictions or specific positions have been described above through various embodiments of the present disclosure, so redundant or repeated descriptions thereof can be omitted.

[0151] Fig. 9 A process in which an image decoding device determines at least one codec unit by dividing a first codec unit according to an embodiment of the present disclosure is shown.

[0152] According to an embodiment of the present disclosure, the image decoding device 100 may divide the first codec unit 900 based on the division shape pattern information obtained by the receiver 110. The square first codec unit 900 may be divided into four square codec units, or may be divided into a plurality of non-square codec units. Fig. 9, when the first codec unit 900 has a square shape and the segmentation shape mode information indicates that the first codec unit 900 is segmented into non-square codec units, the image decoding device 100 may segment the first codec unit 900 into a plurality of non-square codec units. For example, when the segmentation shape mode information indicates that an odd number of codec units is determined by segmenting the first codec unit 900 in the horizontal direction or the vertical direction, the image decoding device 100 may segment the square first codec unit 900 into an odd number of codec units, such as second codec units 910a, 910b, and 910c determined by segmenting the square first codec unit 900 in the vertical direction, or second codec units 920a, 920b, and 920c determined by segmenting the square first codec unit 900 in the horizontal direction.

[0153] According to an embodiment of the present disclosure, the image decoding device 100 may determine whether the second codec units 910a, 910b, 910c, 920a, 920b, and 920c included in the first codec unit 900 satisfy a condition for being processed in a specific order, and the condition is related to whether at least one of the width or height of the first codec unit 900 is to be divided in half along the boundary of the second codec units 910a, 910b, 910c, 920a, 920b, and 920c. Fig. 9 , because the boundary of the second codec units 910a, 910b, and 910c determined by dividing the square first codec unit 900 in the vertical direction does not divide the width of the first codec unit 900 in half, it can be determined that the first codec unit 900 does not meet the condition sufficient for processing in a specific order. In addition, because the boundary of the second codec units 920a, 920b, and 920c determined by dividing the square first codec unit 900 in the horizontal direction does not divide the height of the first codec unit 900 in half, it can be determined that the first codec unit 900 does not meet the condition sufficient for processing in a specific order. When the condition as described above is not satisfied, the image decoding device 100 can decide the disconnection of the scanning order, and can determine that the first codec unit 900 will be divided into an odd number of codec units based on the result of the decision. According to an embodiment of the present disclosure, when the codec unit is divided into an odd number of codec units, the image decoding device 100 can impose specific restrictions on the codec units at specific positions in the divided codec units. The limitations or specific locations have been described above through various embodiments of the present disclosure, and thus redundant or repeated descriptions thereof may be omitted.

[0154] According to an embodiment of the present disclosure, the image decoding device 100 may determine codec units of various shapes by dividing the first codec unit.

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

[0156] Fig.10 It is shown that according to an embodiment of the present disclosure, when a second codec unit having a non-square shape determined when an image decoding device divides a first codec unit satisfies a specific condition, the shapes into which the second codec unit can be divided are restricted.

[0157] According to an embodiment of the present disclosure, the image decoding device 100 may determine to split the square first codec unit 1000 into non-square second codec units 1010a and 1010b or 1020a and 1020b based on the split shape pattern information obtained by the receiver 110. The second codec units 1010a and 1010b or 1020a and 1020b may be split independently. Therefore, the image decoding device 100 may determine to split or not split each of the second codec units 1010a and 1010b or 1020a and 1020b into a plurality of codec units based on the split shape pattern information of each of the second codec units 1010a and 1010b or 1020a and 1020b. According to an embodiment of the present disclosure, the image decoding device 100 may determine the third codec units 1012a and 1012b by splitting the non-square left second codec unit 1010a determined by splitting the first codec unit 1000 in the vertical direction in the horizontal direction. However, when the left second codec unit 1010a is split in the horizontal direction, the image decoding device 100 may restrict the right second codec unit 1010b from being split in the horizontal direction in which the left second codec unit 1010a is split. When the third codec units 1014a and 1014b are determined by splitting the right second codec unit 1010b in the same direction, since the left second codec unit 1010a and the right second codec unit 1010b are independently split in the horizontal direction, the third codec units 1012a, 1012b, 1014a, and 1014b may be determined. However, this case also serves as a case in which the image decoding device 100 splits the first codec unit 1000 into four square second codec units 1030a, 1030b, 1030c, and 1030d based on the split shape pattern information, and may be inefficient in image decoding.

[0158] According to an embodiment of the present disclosure, the image decoding device 100 may determine the third codec units 1022a and 1022b or 1024a and 1024b by vertically dividing the non-square second codec unit 1020a or 1020b determined by horizontally dividing the first codec unit 1000. However, when the second codec unit (e.g., the upper second codec unit 1020a) is divided in the vertical direction, the image decoding device 100 may restrict another second codec unit (e.g., the lower second codec unit 1020b) from being divided in the vertical direction in which the upper second codec unit 1020a is divided for the above-mentioned reason.

[0159] Fig.11 A process is shown in which an image decoding device divides a square codec unit when division shape mode information indicates that the square codec unit is not to be divided into four square codec units according to an embodiment of the present disclosure.

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

[0161] According to an embodiment of the present disclosure, the image decoding device 100 may independently segment the non-square second codec units 1110a and 1110b or 1120a and 1120b, etc. Each of the second codec units 1110a and 1110b or 1120a and 1120b, etc. may be recursively segmented in a specific order, and the segmentation method may correspond to the method of segmenting the first codec unit 1100 based on the segmentation shape pattern information.

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

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

[0164] Fig.12 It is shown that according to an embodiment of the present disclosure, the processing order among a plurality of codec units may be changed according to a process of dividing a codec unit.

[0165] According to an embodiment of the present disclosure, the image decoding device 100 may divide the first codec unit 1200 based on the segmentation shape mode information. When the block shape indicates a square shape and the segmentation shape mode information indicates that the first codec unit 1200 is divided in at least one of the horizontal direction or the vertical direction, the image decoding device 100 may determine the second codec unit (e.g., 1210a and 1210b, or 1220a and 1220b, etc.) by dividing the first codec unit 1200. Fig.12, the non-square second codec units 1210a and 1210b or 1220a and 1220b determined by dividing the first codec unit 1200 only in the horizontal direction or the vertical direction can be divided independently based on the division shape pattern information of each codec unit. For example, the image decoding device 100 can determine the third codec units 1216a, 1216b, 1216c and 1216d by dividing the second codec units 1210a and 1210b generated by dividing the first codec unit 1200 in the vertical direction in the horizontal direction, and can determine the third codec units 1226a, 1226b, 1226c and 1226d by dividing the second codec units 1220a and 1220b generated by dividing the first codec unit 1200 in the horizontal direction in the vertical direction. Reference has been made to the above Fig.11 The process of splitting the second codec units 1210a and 1210b or 1220a and 1220b is described, and thus a detailed description thereof is omitted.

[0166] According to an embodiment of the present disclosure, the image decoding apparatus 100 may process the encoding and decoding units in a specific order. Figure 7 The operations of processing the codec units in a specific order are described, and thus redundant or repeated descriptions thereof may be omitted. Fig.12 , the image decoding device 100 can determine four square third codec units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d by dividing the square first codec unit 1200. According to an embodiment of the present disclosure, the image decoding device 100 can determine the processing order of the third codec units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d based on the divided shapes into which the first codec unit 1200 is divided.

[0167] According to an embodiment of the present disclosure, the image decoding device 100 can determine the third codec units 1216a, 1216b, 1216c and 1216d by splitting the second codec units 1210a and 1210b generated by splitting the first codec unit 1200 in the vertical direction in the horizontal direction, and can process the third codec units 1216a, 1216b, 1216c and 1216d in the following processing order 1217: first process the third codec units 1216a and 1216c included in the left second codec unit 1210a in the vertical direction, and then process the third codec units 1216b and 1216d included in the right second codec unit 1210b in the vertical direction.

[0168] According to an embodiment of the present disclosure, the image decoding device 100 can determine the third codec units 1226a, 1226b, 1226c and 1226d by splitting the second codec units 1220a and 1220b generated by splitting the first codec unit 1200 in the horizontal direction in the vertical direction, and can process the third codec units 1226a, 1226b, 1226c and 1226d in the following processing order 1227: first, the third codec units 1226a and 1226b included in the upper second codec unit 1220a are processed in the horizontal direction, and then the third codec units 1226c and 1226d included in the lower second codec unit 1220b are processed in the horizontal direction.

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

[0170] Fig.13 A process of determining the depth of a codec unit as the shape and size of the codec unit change when the codec unit is recursively split to determine a plurality of codec units according to an embodiment of the present disclosure is shown.

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

[0172] refer to Fig.13 According to an embodiment of the present disclosure, the image decoding device 100 may determine the second codec unit 1302 and the third codec unit 1304 of a lower depth by dividing the square first codec 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 codec unit 1300 is 2N×2N, the second codec unit 1302 determined by dividing the width and height of the first codec unit 1300 by 1 / 2 may have a size of N×N. In addition, the third codec unit 1304 determined by dividing the width and height of the second codec unit 1302 by 1 / 2 may have a size of N / 2×N / 2. In this case, the width and height of the third codec unit 1304 are 1 / 4 times the width and height of the first codec unit 1300. When the depth of the first codec unit 1300 is D, the depth of the second codec unit 1302 whose width and height are 1 / 2 times the width and height of the first codec unit 1300 may be D+1, and the depth of the third codec unit 1304 whose width and height are 1 / 4 times the width and height of the first codec unit 1300 may be D+2.

[0173] According to an embodiment of the present disclosure, the image decoding device 100 can determine the second codec unit 1312 or 1322 and the third codec unit 1314 or 1324 of a lower depth by segmenting the non-square first codec unit 1310 or 1320 based on block shape information indicating a non-square shape (for example, the block shape information can be represented as "1: NS_VER" indicating a non-square shape, whose height is greater than the width, or as "2: NS_HOR" indicating a non-square shape, whose width is greater than the height).

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

[0175] According to an embodiment of the present disclosure, the image decoding device 100 may determine the second codec unit (e.g., 1302, 1312, or 1322) by dividing at least one of the width or the height of the first codec unit 1320 having a size of 2N×N. That is, the image decoding device 100 may determine the second codec unit 1302 having a size of N×N or the second codec unit 1312 having a size of N / 2×N by dividing the first codec unit 1320 in the vertical direction, or may determine the second codec unit 1322 having a size of N×N / 2 by dividing the first codec unit 1320 in the horizontal direction and the vertical direction.

[0176] According to an embodiment of the present disclosure, the image decoding device 100 may determine the third codec unit (e.g., 1304, 1314, or 1324) by dividing at least one of the width or height of the second codec unit 1302 having a size of N×N. That is, the image decoding device 100 may determine the third codec unit 1304 having a size of N / 2×N / 2, the third codec unit 1314 having a size of N / 4×N / 2, or the third codec unit 1324 having a size of N / 2×N / 4 by dividing the second codec unit 1302 in the vertical direction and the horizontal direction.

[0177] According to an embodiment of the present disclosure, the image decoding device 100 may determine the third codec unit (e.g., 1304, 1314, or 1324) by dividing at least one of the width or height of the second codec unit 1312 having a size of N / 2×N. That is, the image decoding device 100 may determine the third codec unit 1304 having a size of N / 2×N / 2 or the third codec unit 1324 having a size of N / 2×N / 4 by dividing the second codec unit 1312 in the horizontal direction, or may determine the third codec unit 1314 having a size of N / 4×N / 2 by dividing the second codec unit 1312 in the vertical direction and the horizontal direction.

[0178] According to an embodiment of the present disclosure, the image decoding device 100 may determine the third codec unit (e.g., 1304, 1314, or 1324) by dividing at least one of the width or height of the second codec unit 1322 having a size of N×N / 2. That is, the image decoding device 100 may determine the third codec unit 1304 having a size of N / 2×N / 2 or the third codec unit 1314 having a size of N / 4×N / 2 by dividing the second codec unit 1322 in the vertical direction, or may determine the third codec unit 1324 having a size of N / 2×N / 4 by dividing the second codec unit 1322 in the vertical direction and the horizontal direction.

[0179] According to an embodiment of the present disclosure, the image decoding device 100 may split a square codec unit (e.g., 1300, 1302, or 1304) in a horizontal direction or a vertical direction. For example, the image decoding device 100 may determine a first codec unit 1310 having a size of N×2N by splitting a first codec unit 1300 having a size of 2N×2N in a vertical direction, or may determine a first codec unit 1320 having a size of 2N×N by splitting the first codec unit 1300 in a horizontal direction. According to an embodiment of the present disclosure, when the depth is determined based on the length of the longest side of the codec unit, the depth of the codec unit determined by splitting the first codec 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 codec unit 1300.

[0180] According to an embodiment of the present disclosure, the width and height of the third codec unit 1314 or 1324 may be 1 / 4 times the width and height of the first codec unit 1310 or 1320. When the depth of the first codec unit 1310 or 1320 is D, the depth of the second codec unit 1312 or 1322 whose width and height are 1 / 2 times the first codec unit 1310 or 1320 may be D+1, and the depth of the third codec unit 1314 or 1324 whose width and height are 1 / 4 times the first codec unit 1310 or 1320 may be D+2.

[0181] Fig.14 Detailed description is given of a depth that may be determined based on a shape and a size of a codec unit and a part index (PID) for distinguishing a codec unit according to an embodiment of the present disclosure.

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

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

[0184] According to an embodiment of the present disclosure, the image decoding device 100 may determine a plurality of second codec units 1412a and 1412b and 1414a, 1414b and 1414c by dividing the first codec unit 1410 whose height is longer than the width in the horizontal direction based on the division shape pattern information. According to an embodiment of the present disclosure, the image decoding device 100 may determine a plurality of second codec units 1422a and 1422b and 1424a, 1424b and 1424c by dividing the first codec unit 1420 whose width is longer than the height in the vertical direction based on the division shape pattern information.

[0185] According to an embodiment of the present disclosure, the depth of the second codec units 1412a and 1412b and 1414a, 1414b and 1414c or 1422a and 1422b and 1424a, 1424b and 1424c determined based on the segmentation shape mode information of the non-square first codec unit 1410 or 1420 can be determined based on the length of its long side. For example, because the length of the side of the square second codec units 1412a and 1412b is 1 / 2 times the length of the long side of the first codec unit 1410 having a non-square shape whose height is longer than the width, the depth of the square second codec units 1412a and 1412b is D+1 which is 1 deeper than the depth D of the non-square first codec unit 1410.

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

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

[0188] According to an embodiment of the present disclosure, the image decoding apparatus 100 may determine whether to use a specific segmentation method based on a PID value for identifying a plurality of codec units determined by segmenting the current codec unit. Fig.14, the image decoding device 100 may determine the even number of codec units 1412a and 1412b or the odd number of codec units 1414a, 1414b, and 1414c by segmenting the first codec unit 1410 having a rectangular shape whose height is longer than the width. The image decoding device 100 may use the PID indicating each codec unit to identify each codec unit. According to an embodiment of the present disclosure, the PID may be obtained from a sample point at a specific position of each codec unit (e.g., a top left sample point).

[0189] According to an embodiment of the present disclosure, the image decoding device 100 can determine a codec unit at a specific position from the segmented codec units by using a PID for distinguishing codec units. According to an embodiment of the present disclosure, when the segmentation shape mode information of the first codec unit 1410 having a rectangular shape whose height is longer than the width indicates that the codec unit is segmented into three codec units, the image decoding device 100 can segment the first codec unit 1410 into three codec units 1414a, 1414b, and 1414c. The image decoding device 100 can assign a PID to each of the three codec units 1414a, 1414b, and 1414c. The image decoding device 100 can compare the PIDs of the odd-numbered segmented codec units to determine the codec unit at the center position from the codec units. The image decoding device 100 can determine the codec unit 1414b having a PID corresponding to an intermediate value in the PIDs of the codec units as the codec unit at the center position among the codec units determined by segmenting the first codec unit 1410. According to an embodiment of the present disclosure, when the divided codec units do not have the same size, the image decoding device 100 may determine a PID for distinguishing the divided codec units based on a size ratio between the codec units. Fig.14, the codec unit 1414b generated by dividing the first codec unit 1410 may have a width equal to the width of the other codec units 1414a and 1414c and a height twice the height of the other codec units 1414a and 1414c. In this case, when the PID of the codec unit 1414b at the center position is 1, the PID of the codec unit 1414c located next to the codec unit 1414b may increase by 2 and thus may be 3. When the PID increases non-uniformly as described above, the image decoding device 100 may determine that the codec unit is divided into a plurality of codec units including codec units having sizes different from those of other codec units. According to an embodiment of the present disclosure, when the segmentation shape pattern information indicates that the codec unit is divided into an odd number of codec units, the image decoding device 100 may divide the current codec unit in such a manner that the codec unit at a specific position among the odd number of codec units (e.g., the codec unit at the center position) has a size different from that of the other codec units. In this case, the image decoding device 100 can determine the codec unit with a center position of different sizes by using the PID of the codec unit. However, the PID and size or position of the codec unit of the specific position to be determined is not limited to the above example, and various PIDs and various positions and sizes of the codec unit can be used.

[0190] According to an embodiment of the present disclosure, the image decoding device 100 may use a specific data unit to be recursively split starting from a coding unit.

[0191] Fig.15 It is shown that a plurality of coding units are determined based on a plurality of specific data units included in a picture according to an embodiment of the present disclosure.

[0192] According to an embodiment of the present disclosure, a specific data unit may be defined as a data unit to be recursively segmented by a codec unit starting by using segmentation shape pattern information. That is, the specific data unit may correspond to a codec unit of the topmost depth, which is used to determine a plurality of codec units segmented from a current picture. In the following description, for ease of explanation, the specific data unit is referred to as a reference data unit.

[0193] According to an embodiment of the present disclosure, the reference data unit may have a specific size and a specific shape. According to an embodiment of the present disclosure, the reference codec unit may include M×N samples. Here, M and N may be equal to each other and may be an integer expressed as a power of 2. That is, the reference data unit may have a square or non-square shape and may be divided into an integer number of codec units.

[0194] According to an embodiment of the present disclosure, the image decoding device 100 may divide the current picture into a plurality of reference data units. According to an embodiment of the present disclosure, the image decoding device 100 may divide the plurality of reference data units divided from the current picture by using the division shape pattern information of each reference data unit. The process of dividing the reference data unit may correspond to a division process using a quadtree structure.

[0195] According to an embodiment of the present disclosure, the image decoding device 100 may predetermine the minimum size allowed for the reference data unit included in the current picture. Therefore, the image decoding device 100 may determine reference data units of various sizes equal to or greater than the minimum size, and may determine one or more coding units by using the partition shape mode information with reference to the determined reference data unit.

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

[0197] According to an embodiment of the present disclosure, the receiver 110 of the image decoding device 100 may obtain at least one of the reference codec unit shape information or the reference codec unit size information of each of the various data units from the bitstream. Figure 3 The process of dividing the current codec unit 300 describes the process of dividing the square reference codec unit 1500 into one or more codec units, and the above has been combined with Figure 4 The process of splitting the current codec unit 400 or 450 describes the process of splitting the non-square reference codec unit 1502 into one or more codec units, so redundant or repeated description thereof may be omitted.

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

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

[0200] Fig.16 A processing block serving as a unit for determining a determination order of reference codec units included in a picture according to an embodiment of the present disclosure is shown.

[0201] According to an embodiment of the present disclosure, the image decoding device 100 may determine one or more processing blocks segmented from a picture. A processing block is a data unit including one or more reference codec units segmented from an image, and the one or more reference codec 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 codec units determined in each processing block may correspond to one of the types of various orders for determining the reference codec units, and may vary according to the processing block. The determination order of the reference codec units determined for each processing block may be one of various orders, such as raster scanning, Z scanning, N scanning, upper right diagonal scanning, horizontal scanning, or vertical scanning, but is not limited to these scanning orders.

[0202] According to an embodiment of the present disclosure, the image decoding device 100 can obtain processing block size information and can determine the size of one or more processing blocks included in the image. The image decoding device 100 can obtain processing block size information from a bitstream and can determine the size of one or more processing blocks included in the image. The size of the processing block may be a specific size of a data unit indicated by the processing block size information.

[0203] According to an embodiment of the present disclosure, the receiver 110 of the image decoding device 100 can obtain processing block size information from the bitstream for each specific data unit. For example, the processing block size information can be obtained from the bitstream in a data unit such as an image, a sequence, a picture, a slice, a slice segment, a tile, or a tile group. That is, the receiver 110 can obtain processing block size information from the bitstream for each of the various data units, and the image decoding device 100 can determine the size of one or more processing blocks segmented from the picture by using the obtained processing block size information, and the size of the processing block can be an integer multiple of the size of the reference codec unit.

[0204] According to an embodiment of the present disclosure, the image decoding device 100 may determine the size of the processing blocks 16021 and 1612 included in the picture 1600. For example, the image decoding device 100 may determine the size of the processing block based on the processing block size information obtained from the bitstream. Fig.16 According to an embodiment of the present disclosure, the image decoding apparatus 100 may determine the width of the processing blocks 1602 and 1612 to be 4 times the width of the reference codec unit, and determine the height of the processing blocks 1602 and 1612 to be 4 times the height of the reference codec unit. The image decoding apparatus 100 may determine the determination order of one or more reference codec units in one or more processing blocks.

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

[0206] According to an embodiment of the present disclosure, the image decoding device 100 can obtain the determination order information of one or more reference codec units in one or more processing blocks from the bitstream, and can determine the determination order of the one or more reference codec units based on the obtained determination order information. The determination order information can be defined as the order or direction of the reference codec units in the determination processing block. That is, the determination order of the reference codec units can be determined independently for each processing block.

[0207] According to an embodiment of the present disclosure, the image decoding device 100 may obtain the determination order information of the reference codec unit from the bitstream for each specific data unit. For example, the receiver 110 may obtain the determination order information of the reference codec unit from the bitstream for each data unit, such as an image, a sequence, a picture, a slice, a slice segment, a tile, a tile group, or a processing block. Because the determination order information of the reference codec unit indicates the order of determining the reference codec unit in the processing block, the determination order information may be obtained for each specific data unit including an integer number of processing blocks.

[0208] According to an embodiment of the present disclosure, the image decoding device 100 may determine one or more reference codec units based on the determined determination order.

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

[0210] According to an embodiment of the present disclosure, the image decoding device 100 may decode the determined one or more reference codec units. The image decoding device 100 may decode the image based on the reference codec unit determined by the above embodiment of the present disclosure. The method of decoding the reference codec unit may include various image decoding methods.

[0211] According to an embodiment of the present disclosure, the image decoding device 100 can obtain block shape information indicating the shape of the current codec unit or segmentation shape mode information indicating the segmentation method of the current codec unit from the bitstream, and can use the obtained information. The segmentation shape mode information can be included in the bitstream associated with various data units. For example, the image decoding device 100 can use the segmentation shape mode information included in the sequence parameter set, the picture parameter set, the video parameter set, the slice header, the slice segment header, the tile header, or the tile group header. In addition, the image decoding device 100 can obtain the syntax elements corresponding to the block shape information or the segmentation shape mode information according to each maximum codec unit, each reference codec unit, or each processing block from the bitstream, and can use the obtained syntax elements.

[0212] Hereinafter, an example of a method of determining a segmentation rule according to an embodiment of the present disclosure is described in detail.

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

[0214] The image decoding device 100 may determine the segmentation rule based on the block shape of the codec unit. The block shape may include the size, shape, ratio of width and height, and direction of the codec unit. The image encoding device 2900 and the image decoding device 100 may predetermine the segmentation rule based on the block shape of the codec unit. However, the embodiments of the present disclosure are not limited thereto. The image decoding device 100 may determine the segmentation rule based on information obtained from the bit stream received from the image encoding device 2900.

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

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

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

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

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

[0220] The image decoding apparatus 100 may adaptively determine the segmentation rule based on the position of the coding unit. The image decoding apparatus 100 may adaptively determine the segmentation rule based on the position of the coding unit in the image.

[0221] In addition, the image decoding device 100 may determine the segmentation rule so that the codec units generated via different segmentation paths do not have the same block shape. However, the embodiments of the present disclosure are not limited thereto, and the codec units generated via different segmentation paths have the same block shape. The codec units generated via different segmentation paths may have different decoding processing orders. As has been mentioned above, Fig.12 The decoding process order is described, so redundant or repeated description thereof may be omitted.

[0222] Fig.17a is a diagram for describing a method of obtaining parameter candidates of a model for determining a motion vector from neighboring blocks according to an embodiment of the present disclosure.

[0223] refer to Fig.17a , when the current block 1700 is in a prediction mode for performing prediction in sub-block units, parameter candidates for a model for determining a motion vector can be obtained from a neighboring block predicted in sub-block units among neighboring blocks, and the obtained parameter candidates can be used for sub-block unit prediction. In an embodiment of the present disclosure, a model for determining a motion vector may be referred to as a motion vector model.

[0224] The "subblock unit mode" may refer to a mode in which prediction is performed on each subblock unit, and may include, for example, an affine mode. The size of the subblock may be 4×4.

[0225] It may be determined whether the lower left neighboring block A0 1730 located on the lower left side of the current block 1700 is predicted in a sub-block unit mode, and when the lower left neighboring block A0 1730 is predicted in a sub-block unit mode, parameters used in the lower left neighboring block A0 1730 may be determined as parameter candidates for a model for determining a motion vector. When the lower left neighboring block A0 1730 is not predicted in a sub-block unit mode, it may be determined whether the left neighboring block A1 1720 located on the left side of the current block 1700 is predicted in a sub-block unit mode, and when the left neighboring block A1 1720 is predicted in a sub-block unit mode, parameters used in the left neighboring block A1 1720 may be used as parameter candidates for a model for determining a motion vector.

[0226] In addition, it may be determined whether the upper right neighboring block B0 1750 located on the upper right side of the current block 1700 is predicted in the sub-block unit mode, and when the upper right neighboring block B0 1750 is predicted in the sub-block unit mode, the parameters used in the upper right neighboring block B0 1750 may be determined as parameter candidates for the model for determining the motion vector. When the upper right neighboring block B0 1750 is not predicted in the sub-block unit mode, it may be determined whether the upper neighboring block B1 1740 located above the current block 1700 is predicted in the sub-block unit mode, and when the upper neighboring block B1 1740 is predicted in the sub-block unit mode, the parameters used in the upper neighboring block B1 1740 may be determined as parameter candidates for the model for determining the motion vector. When the upper neighboring block B1 1740 is not predicted in a sub-block unit mode, it can be determined whether the upper left neighboring block B2 1710 located on the upper left side of the current block 1700 is predicted in a sub-block unit mode, and when the upper left neighboring block B2 1710 is predicted in a sub-block unit mode, the parameters used in the upper left neighboring block B2 1710 can be used as parameter candidates for a model for determining a motion vector.

[0227] That is, at most two parameter candidates may be determined from neighboring blocks located around the current block 1700 .

[0228] An example of a model for determining a motion vector obtained from a neighboring block is shown in Equation 1 below:

[0229] [Equation 1]

[0230]

[0231] Here, mv x The x component of the motion vector of the current sub-block on which prediction is to be performed, mv yrepresents the y component of the motion vector of the current subblock on which prediction is to be performed among the subblocks included in the current block 1700, x represents the x coordinate of the center of the current subblock, y represents the y coordinate of the center of the current subblock, and a xx 、a xy 、a yx 、a yy , b x and b y Represents the parameters obtained from neighboring blocks.

[0232] In Equation 1, since the number of parameters is six, the number of parameter models is six.

[0233] In addition, in Equation 1, when a xx and a yy Same and a xy and a yx When the same, since the number of parameters is four, the number of parameter models is four.

[0234] In addition to obtaining parameter candidates from neighboring blocks, we also refer to Fig.17b An example of a method of deriving parameter candidates from neighboring blocks of vertices of a current block is described.

[0235] Fig.17b is a diagram for describing a method of deriving parameters of a model for determining a motion vector from neighboring blocks according to an embodiment of the present disclosure.

[0236] refer to Fig.17b When the current block 1700 is in a prediction mode in which prediction is performed in sub-block units, motion vectors of vertices of the current block 1700 can be obtained from adjacent blocks, and parameter candidates for a model for determining the motion vector can be obtained by using the obtained motion vector, and the obtained parameter candidates can be used for sub-block unit prediction.

[0237] In the 4-parameter model, motion vectors of two vertices are used, and in the 6-parameter model, motion vectors of three vertices are used.

[0238] The first motion vector 1715 of the upper left vertex of the current block 1700 can be determined by identifying the motion vectors in the order of the upper left neighboring block B2 1711 located on the upper left side of the current block 1700, the first upper neighboring block B3 1712 located to the right of the upper left neighboring block B2 1711 and above the current block 1700, and the left neighboring block A2 1713 located below the upper left neighboring block B2 1711 and on the left side of the current block 1700.

[0239] The second motion vector 1725 of the upper right vertex of the current block 1700 can be determined by identifying motion vectors in the order of the second upper neighboring block B1 1712 and the upper right neighboring block B0 1722 located on the upper right side of the current block 1700 and above the current block 1700.

[0240] The third motion vector 1735 of the lower left vertex of the current block 1700 can be determined by identifying the motion vectors in the order of the second left neighboring block A11731 which is above the lower left neighboring block A0 1732 located on the lower left side of the current block 1700 and on the left side of the current block 1700, and the lower left neighboring block A0 1732.

[0241] When the temporal motion vector 1741 of the current block 1700 is available, the fourth motion vector 1745 of the lower right vertex of the current block 1700 may be determined as the temporal motion vector 1741 .

[0242] In the 4-parameter model, the first motion vector 1715 and the second motion vector 1725 may be used, or the first motion vector 1715 and the third motion vector 1735 may be used.

[0243] An example of a 4-parameter model using the first motion vector and the second motion vector 1725 is shown below in Equation 2:

[0244] [Equation 2]

[0245]

[0246] Here, mv x The x component of the motion vector of the current sub-block on which prediction is to be performed, mv y The y component of the motion vector of the current sub-block on which prediction is to be performed, mv 0x represents the x component of the first motion vector 1715, mv 0y represents the y component of the first motion vector 1715, mv 1x represents the x component of the second motion vector 1725, mv 1y represents the y component of the second motion vector 1725, w represents the width of the current block 1700, x represents the x coordinate of the center of the current subblock, and y represents the y coordinate of the center of the current subblock.

[0247] An example of a 4-parameter model using the first motion vector 1715 and the third motion vector 1735 is shown below in Equation 3:

[0248] [Equation 3]

[0249]

[0250] Here, mv x The x component of the motion vector of the current sub-block on which prediction is to be performed, mv y The y component of the motion vector of the current sub-block on which prediction is to be performed, mv 0x represents the x component of the first motion vector 1715, mv 0y represents the y component of the first motion vector 1715, mv 2x represents the x component of the third motion vector 1735, mv 2y represents the y component of the third motion vector 1735, h represents the height of the current block 1700, x represents the x coordinate of the center of the current subblock, and y represents the y coordinate of the center of the current subblock.

[0251] An example of a 6-parameter model using the first motion vector 1715, the second motion vector 1725, and the third motion vector 1735 is shown in Equation 4 below:

[0252] [Equation 4]

[0253]

[0254] Here, mv x The x component of the motion vector of the current sub-block on which prediction is to be performed, mv y The y component of the motion vector of the current sub-block on which prediction is to be performed, mv 0x represents the x component of the first motion vector 1715, mv 0y represents the y component of the first motion vector 1715, mv 1x represents the x component of the second motion vector 1725, mv 1y represents the y component of the second motion vector 1725, mv 2x represents the x component of the third motion vector 1735, mv 2y represents the y component of the third motion vector 1735, w represents the width of the current block 1700, h represents the height of the current block 1700, x represents the x coordinate of the center of the current subblock, and y represents the y coordinate of the center of the current subblock.

[0255] An example of a 6-parameter model using the first motion vector 1715, the second motion vector 1725, and the fourth motion vector 1745 is shown in Equation 5 below:

[0256] [Equation 5]

[0257]

[0258] Here, mv x The x component of the motion vector of the current sub-block on which prediction is to be performed, mv y The y component of the motion vector of the current sub-block on which prediction is to be performed, mv 0x represents the x component of the first motion vector 1715, mv 0y represents the y component of the first motion vector 1715, mv 1x represents the x component of the second motion vector 1725, mv 1y represents the y component of the second motion vector 1725, mv 3x represents the x component of the fourth motion vector 1745, mv 3y represents the y component of the fourth motion vector 1745, w represents the width of the current block 1700, h represents the height of the current block 1700, x represents the x coordinate of the center of the current subblock, and y represents the y coordinate of the center of the current subblock.

[0259] An example of a 6-parameter model using the first motion vector 1715, the third motion vector 1735, and the fourth motion vector 1745 is shown in Equation 6.

[0260] [Equation 6]

[0261]

[0262] Here, mv x The x component of the motion vector of the current sub-block on which prediction is to be performed, mv y The y component of the motion vector of the current sub-block on which prediction is to be performed, mv 0x represents the x component of the first motion vector 1715, mv 0y represents the y component of the first motion vector 1715, mv 2x represents the x component of the third motion vector 1735, mv 2y represents the y component of the third motion vector 1735, mv 3x represents the x component of the fourth motion vector 1745, mv 3y represents the y component of the fourth motion vector 1745, w represents the width of the current block 1700, h represents the height of the current block 1700, x represents the x coordinate of the center of the current subblock, and y represents the y coordinate of the center of the current subblock.

[0263] An example of a 6-parameter model using the second motion vector 1725, the third motion vector 1735, and the fourth motion vector 1745 is shown in Equation 7.

[0264] [Equation 7]

[0265]

[0266] Here, mv x The x component of the motion vector of the current sub-block on which prediction is to be performed, mv y The y component of the motion vector of the current sub-block on which prediction is to be performed, mv 1x represents the x component of the second motion vector 1725, mv 1y represents the y component of the second motion vector 1725, mv 2x represents the x component of the third motion vector 1735, mv 2y represents the y component of the third motion vector 1735, mv 3x represents the x component of the fourth motion vector 1745, mv 3y represents the y component of the fourth motion vector 1745, w represents the width of the current block 1700, h represents the height of the current block 1700, x represents the x coordinate of the center of the current sub-block, and y represents the y coordinate of the center of the current sub-block.

[0267] Can be obtained by using Fig.17a and Fig.17b The method obtains or derives a candidate for selecting and using a parameter of a model for determining a motion vector.

[0268] like Fig.17a As shown, when the parameters of the model for determining the motion vector obtained from the neighboring blocks are used, the neighboring information of the current block is not reflected because the model used in the neighboring blocks is used. Therefore, the prediction accuracy of the sub-block unit mode may be reduced.

[0269] like Fig.17b As shown, when parameters of a model for determining a motion vector are determined by using motion vectors corresponding to two or three vertices, prediction accuracy of a subblock unit mode may be reduced because only motion vectors of blocks located around the two or three vertices are considered.

[0270] refer to Fig.18 An example of a method of deriving parameters of a model for determining a motion vector by considering all neighboring sub-blocks is described.

[0271] Fig.18is a diagram for describing a method of deriving parameters of a model for determining a motion vector from a neighboring block by considering all neighboring subblocks according to an embodiment of the present disclosure.

[0272] refer to Fig.18 , parameters of a model for determining a motion vector may be derived by using motion vectors and position information of neighboring subblocks of the current block 1800 .

[0273] Among the first neighboring block 1810, the second neighboring block 1820, the third neighboring block 1830, the fourth neighboring block 1840, the fifth neighboring block 1850, the sixth neighboring block 1860 and the seventh neighboring block 1870 located around the current block 1800, since the sixth neighboring block 1860 predicted in an intra mode does not have a motion vector, the neighboring sub-blocks 1861 and 1862 included in the sixth neighboring block 1860 are not used to derive parameters of a model for determining a motion vector.

[0274] Among the neighboring blocks of the current block 1800, the first neighboring block 1810, the second neighboring block 1820, the third neighboring block 1830, the fourth neighboring block 1840, the fifth neighboring block 1850 and the seventh neighboring block 1870 predicted in an inter mode are used to derive parameters of a model for determining a motion vector.

[0275] Regardless of whether prediction is performed in sub-block units, the first neighboring block 1810, the second neighboring block 1820, the third neighboring block 1830, the fourth neighboring block 1840, the fifth neighboring block 1850 and the seventh neighboring block 1870 are divided into sub-blocks, and motion vectors and position information are obtained for each neighboring sub-block adjacent to the current block 1800, and are used to derive parameters of a model for determining motion vectors.

[0276] For example, the motion vector mv18 of the first neighboring sub-block 1811 and the position information of A18 indicating the coordinates of the center of the first neighboring sub-block 1811 are obtained from the first neighboring sub-block 1811 included in the first neighboring block 1810, and the motion vector mv17 of the second neighboring sub-block 1812 and the position information of A17 indicating the coordinates of the center of the second neighboring sub-block 1812 are obtained from the second neighboring sub-block 1812 included in the first neighboring block 1810.

[0277] The motion vector mv16 of the third adjacent sub-block 1821 and the position information of A16 indicating the coordinates of the center of the third adjacent sub-block 1821 are obtained from the third adjacent sub-block 1821 included in the second adjacent block 1820, the motion vector mv15 of the fourth adjacent sub-block 1822 and the position information of A15 indicating the coordinates of the center of the fourth adjacent sub-block 1822 are obtained from the fourth adjacent sub-block 1822 included in the second adjacent block 1820, the motion vector mv14 of the fifth adjacent sub-block 1823 and the position information of A14 indicating the coordinates of the center of the fifth adjacent sub-block 1823 are obtained from the fifth adjacent sub-block 1823 included in the second adjacent block 1820, and the motion vector mv13 of the sixth adjacent sub-block 1824 and the position information of A13 indicating the coordinates of the center of the sixth adjacent sub-block 1824 are obtained from the sixth adjacent sub-block 1824 included in the second adjacent block 1820.

[0278] A motion vector mv0 of the seventh neighboring subblock 1831 and position information A0 indicating the coordinates of the center of the seventh neighboring subblock 1831 are obtained from the seventh neighboring subblock 1831 included in the third neighboring block 1830 .

[0279] The motion vector mv1 of the eighth adjacent sub-block 1841 and the position information A1 indicating the coordinates of the center of the eighth adjacent sub-block 1841 are obtained from the eighth adjacent sub-block 1841 included in the fourth adjacent block 1840, the motion vector mv2 of the ninth adjacent sub-block 1842 and the position information A2 indicating the coordinates of the center of the ninth adjacent sub-block 1842 are obtained from the ninth adjacent sub-block 1842 included in the fourth adjacent block 1840, the motion vector mv3 of the tenth adjacent sub-block 1843 and the position information A3 indicating the coordinates of the center of the tenth adjacent sub-block 1843 are obtained from the tenth adjacent sub-block 1843 included in the fourth adjacent block 1840, and the motion vector mv4 of the eleventh adjacent sub-block 1844 and the position information A4 indicating the coordinates of the center of the eleventh adjacent sub-block 1844 are obtained from the eleventh adjacent sub-block 1844 included in the fourth adjacent block 1840.

[0280] The motion vector mv5 of the twelfth adjacent sub-block 1851 and the position information of A5 indicating the coordinates of the center of the twelfth adjacent sub-block 1851 are obtained from the twelfth adjacent sub-block 1851 included in the fifth adjacent block 1850, and the motion vector mv6 of the thirteenth adjacent sub-block 1852 and the position information of A6 indicating the coordinates of the center of the thirteenth adjacent sub-block 1852 are obtained from the thirteenth adjacent sub-block 1852 included in the fifth adjacent block 1850.

[0281] The motion vector mv9 of the fourteenth adjacent sub-block 1871 and the position information of A9 indicating the coordinates of the center of the fourteenth adjacent sub-block 1871 are obtained from the fourteenth adjacent sub-block 1871 included in the seventh adjacent block 1870, the motion vector mv10 of the fifteenth adjacent sub-block 1872 and the position information of A10 indicating the coordinates of the center of the fifteenth adjacent sub-block 1872 are obtained from the fifteenth adjacent sub-block 1872 included in the seventh adjacent block 1870, the motion vector mv11 of the sixteenth adjacent sub-block 1873 and the position information of A11 indicating the coordinates of the center of the sixteenth adjacent sub-block 1873 are obtained from the sixteenth adjacent sub-block 1873 included in the seventh adjacent block 1870, and the motion vector mv12 of the seventeenth adjacent sub-block 1874 and the position information of A12 indicating the coordinates of the center of the seventeenth adjacent sub-block 1874 are obtained from the seventeenth adjacent sub-block 1874 included in the seventh adjacent block 1870.

[0282] In this way, parameters of a model for determining a motion vector as shown in Equation 1 may be derived using a linear regression analysis method by using motion vectors and position information of each of the neighboring subblocks obtained from the neighboring subblocks of the current block 1800 .

[0283] Parameters of a model for determining a motion vector may be determined through a linear regression analysis by using the motion vector and position information of each of the neighboring subblocks without an initial value.

[0284] In addition, the parameters may be determined by refining the parameters via linear regression based on the parameters of the model present in the previously encoded or decoded block and the motion vector and position information of each of the adjacent sub-blocks. The previously encoded or decoded block may be selected from a history-based parameter candidate in which the parameters of the block previously encoded or decoded in the sub-block unit mode are stored, may be a block encoded or decoded in the sub-block unit mode before the current block among blocks not adjacent to the current block, or may be a block encoded or decoded in the sub-block unit mode before the current block among adjacent blocks of the current block.

[0285] Because with Fig.18 The corresponding method considers all adjacent sub-blocks but does not consider whether the motion vectors are the same, so the complexity may increase, redundant calculations may occur, and when adjacent sub-blocks with the same motion vector are redundantly calculated, the prediction accuracy of the sub-block unit mode may decrease. For example, in a codec unit or block having a size of N and not predicted in a sub-block unit mode, N / 4 sub-blocks having the same motion vector but with different position information of the coordinates indicating the center are used in the linear regression process of the model for determining the motion vector. Because there may be a bias to translational motion, this may lead to an inaccurate fit of the model for determining the motion vector.

[0286] refer to Figures 19 to 32 An example of a method of improving accuracy while considering all neighboring information is described by determining representative information of neighboring subblocks having the same motion vector and using these neighboring subblocks as one subblock instead of using information of all neighboring subblocks.

[0287] Fig.19 is a diagram for describing a method of deriving parameters of a model for determining a motion vector from neighboring blocks when all inter-predicted neighboring blocks are predicted in units of sub-blocks according to an embodiment of the present disclosure.

[0288] Among the first neighboring block 1910, the second neighboring block 1920, the third neighboring block 1930, the fourth neighboring block 1940, the fifth neighboring block 1950, the sixth neighboring block 1960 and the seventh neighboring block 1970 located around the current block 1900, since the sixth neighboring block 1960 predicted in the intra-frame mode does not have a motion vector, the neighboring sub-blocks 1961 and 1962 included in the sixth neighboring block 1960 are not used to derive parameters of the model for determining the motion vector.

[0289] Among the neighboring blocks of the current block 1900, the first neighboring block 1910, the second neighboring block 1920, the third neighboring block 1930, the fourth neighboring block 1940, the fifth neighboring block 1950 and the seventh neighboring block 1970 predicted in a sub-block unit mode are used to derive parameters of a model for determining a motion vector.

[0290] The adjacent subblocks in each of the first adjacent block 1910, the second adjacent block 1920, the third adjacent block 1930, the fourth adjacent block 1940, the fifth adjacent block 1950, and the seventh adjacent block 1970 have non-uniform motion vectors. The non-uniform motion vector may mean, for example, that all adjacent subblocks have different motion vectors or that adjacent adjacent subblocks have different motion vectors.

[0291] For example, the motion vector mv18 of the first neighboring sub-block 1911 and the position information of A18 indicating the coordinates of the center of the first neighboring sub-block 1911 are obtained from the first neighboring sub-block 1911 included in the first neighboring block 1910, and the motion vector mv17 of the second neighboring sub-block 1912 and the position information of A17 indicating the coordinates of the center of the second neighboring sub-block 1912 are obtained from the second neighboring sub-block 1912 included in the first neighboring block 1910.

[0292] The motion vector mv16 of the third adjacent sub-block 1921 and the position information of A16 indicating the coordinates of the center of the third adjacent sub-block 1921 are obtained from the third adjacent sub-block 1921 included in the second adjacent block 1920, the motion vector mv15 of the fourth adjacent sub-block 1922 and the position information of A15 indicating the coordinates of the center of the fourth adjacent sub-block 1922 are obtained from the fourth adjacent sub-block 1922 included in the second adjacent block 1920, the motion vector mv14 of the fifth adjacent sub-block 1923 and the position information of A14 indicating the coordinates of the center of the fifth adjacent sub-block 1923 are obtained from the fifth adjacent sub-block 1923 included in the second adjacent block 1920, and the motion vector mv13 of the sixth adjacent sub-block 1924 and the position information of A13 indicating the coordinates of the center of the sixth adjacent sub-block 1924 are obtained from the sixth adjacent sub-block 1924 included in the second adjacent block 1920.

[0293] A motion vector mv0 of the seventh neighboring subblock 1931 and position information A0 indicating the coordinates of the center of the seventh neighboring subblock 1931 are obtained from the seventh neighboring subblock 1931 included in the third neighboring block 1930 .

[0294] The motion vector mv1 of the eighth adjacent sub-block 1941 and the position information A1 indicating the coordinates of the center of the eighth adjacent sub-block 1941 are obtained from the eighth adjacent sub-block 1941 included in the fourth adjacent block 1940, the motion vector mv2 of the ninth adjacent sub-block 1942 and the position information A2 indicating the coordinates of the center of the ninth adjacent sub-block 1942 are obtained from the ninth adjacent sub-block 1942 included in the fourth adjacent block 1940, the motion vector mv3 of the tenth adjacent sub-block 1943 and the position information A3 indicating the coordinates of the center of the tenth adjacent sub-block 1943 are obtained from the tenth adjacent sub-block 1943 included in the fourth adjacent block 1940, and the motion vector mv4 of the eleventh adjacent sub-block 1944 and the position information A4 indicating the coordinates of the center of the eleventh adjacent sub-block 1944 are obtained from the eleventh adjacent sub-block 1944 included in the fourth adjacent block 1940.

[0295] The motion vector mv5 of the twelfth adjacent sub-block 1951 and the position information of A5 indicating the coordinates of the center of the twelfth adjacent sub-block 1951 are obtained from the twelfth adjacent sub-block 1951 included in the fifth adjacent block 1950, and the motion vector mv6 of the thirteenth adjacent sub-block 1952 and the position information of A6 indicating the coordinates of the center of the thirteenth adjacent sub-block 1952 are obtained from the thirteenth adjacent sub-block 1952 included in the fifth adjacent block 1950.

[0296] The motion vector mv9 of the fourteenth adjacent sub-block 1971 and the position information of A9 indicating the coordinates of the center of the fourteenth adjacent sub-block 1971 are obtained from the fourteenth adjacent sub-block 1971 included in the seventh adjacent block 1970, the motion vector mv10 of the fifteenth adjacent sub-block 1972 and the position information of A10 indicating the coordinates of the center of the fifteenth adjacent sub-block 1972 are obtained from the fifteenth adjacent sub-block 1972 included in the seventh adjacent block 1970, the motion vector mv11 of the sixteenth adjacent sub-block 1973 and the position information of A11 indicating the coordinates of the center of the sixteenth adjacent sub-block 1973 are obtained from the sixteenth adjacent sub-block 1973 included in the seventh adjacent block 1970, and the motion vector mv12 of the seventeenth adjacent sub-block 1974 and the position information of A12 indicating the coordinates of the center of the seventeenth adjacent sub-block 1974 are obtained from the seventeenth adjacent sub-block 1974 included in the seventh adjacent block 1970.

[0297] In this way, parameters of a model for determining a motion vector as shown in Equation 1 may be derived by using the motion vector and position information of each of the neighboring subblocks obtained from the neighboring subblocks of the current block 1900 .

[0298] Parameters of a model for determining a motion vector may be determined through linear regression by using the motion vector and position information of each of the neighboring subblocks without an initial value.

[0299] In addition, the parameters may be determined by refining the parameters via linear regression based on the parameters of the model present in the previously encoded or decoded block and the motion vector and position information of each of the adjacent sub-blocks. The previously encoded or decoded block may be selected from a history-based parameter candidate in which the parameters of the block previously encoded or decoded in the sub-block unit mode are stored, may be a block encoded or decoded in the sub-block unit mode before the current block among blocks not adjacent to the current block, or may be a block encoded or decoded in the sub-block unit mode before the current block among adjacent blocks of the current block.

[0300] Fig. 20 is a diagram for describing a method of deriving parameters of a model for determining a motion vector from neighboring blocks when all inter-predicted neighboring blocks are not predicted in units of subblocks according to an embodiment of the present disclosure.

[0301] Among the first neighboring block 2010, the second neighboring block 2020, the third neighboring block 2030, the fourth neighboring block 2040, the fifth neighboring block 2050, the sixth neighboring block 2060 and the seventh neighboring block 2070 located around the current block 2000, since the sixth neighboring block 2060 predicted in the intra-frame mode does not have a motion vector, the neighboring sub-blocks 2061 and 2062 included in the sixth neighboring block 2060 are not used to derive parameters of the model for determining the motion vector.

[0302] Among the neighboring blocks of the current block 2000, the first neighboring block 2010, the second neighboring block 2020, the third neighboring block 2030, the fourth neighboring block 2040, the fifth neighboring block 2050 and the seventh neighboring block 2070 predicted in the inter-frame mode and not predicted in the sub-block unit mode are used to derive parameters of a model for determining a motion vector.

[0303] Because the first neighboring block 2010, the second neighboring block 2020, the third neighboring block 2030, the fourth neighboring block 2040, the fifth neighboring block 2050 and the seventh neighboring block 2070 are all predicted in the inter-frame mode and not in the sub-block unit mode, the adjacent sub-blocks in each of the first neighboring block 2010, the second neighboring block 2020, the third neighboring block 2030, the fourth neighboring block 2040, the fifth neighboring block 2050 and the seventh neighboring block 2070 have the same motion vector, that is, a uniform motion vector.

[0304] For example, the first adjacent sub-block 2011 and the second adjacent sub-block 2012 included in the first adjacent block 2010 have the same motion vector mv6. The same motion vector mv6 is determined as a representative motion vector. Since the first adjacent sub-block 2011 and the second adjacent sub-block 2012 have the same motion vector, the position information also indicates the same coordinates. The coordinate B6 located at the center of the area including the first adjacent sub-block 2011 and the second adjacent sub-block 2012 is determined as the representative position information.

[0305] The third adjacent sub-block 2021, the fourth adjacent sub-block 2022, the fifth adjacent sub-block 2023, and the sixth adjacent sub-block 2024 included in the second adjacent block 2020 have the same motion vector mv5. The same motion vector mv5 is determined as a representative motion vector. The coordinate B5 located at the center of the area including the third adjacent sub-block 2021, the fourth adjacent sub-block 2022, the fifth adjacent sub-block 2023, and the sixth adjacent sub-block 2024 is determined as representative position information.

[0306] The third neighboring block 2030 has a motion vector mv0. The same motion vector mv0 is determined as a representative motion vector. A0 indicating the coordinates of the center of the seventh neighboring subblock 2031 adjacent to the current block 2000 in the third neighboring block 2030 is determined as representative position information.

[0307] The eighth adjacent sub-block 2041, the ninth adjacent sub-block 2042, the tenth adjacent sub-block 2043, and the eleventh adjacent sub-block 2044 included in the fourth adjacent block 2040 have the same motion vector mv1. The same motion vector mv1 is determined as a representative motion vector. The coordinate B1 located at the center of the area including the eighth adjacent sub-block 2041, the ninth adjacent sub-block 2042, the tenth adjacent sub-block 2043, and the eleventh adjacent sub-block 2044 is determined as representative position information.

[0308] The twelfth adjacent sub-block 2051 and the thirteenth adjacent sub-block 2052 included in the fifth adjacent block 2050 have the same motion vector mv2. The same motion vector mv2 is determined as a representative motion vector. The coordinate B2 located at the center of the area including the twelfth adjacent sub-block 2051 and the thirteenth adjacent sub-block 2052 is determined as representative position information.

[0309] The fourteenth adjacent sub-block 2071, the fifteenth adjacent sub-block 2072, the sixteenth adjacent sub-block 2073, and the seventeenth adjacent sub-block 2074 included in the seventh adjacent block 2070 have the same motion vector mv4. The same motion vector mv4 is determined as a representative motion vector. The coordinate B4 located at the center of the area including the fourteenth adjacent sub-block 2071, the fifteenth adjacent sub-block 2072, the sixteenth adjacent sub-block 2073, and the seventeenth adjacent sub-block 2074 is determined as representative position information.

[0310] In this way, parameters of a model for determining a motion vector as shown in Equation 1 can be derived by using the motion vector of a neighboring block of the current block 2000 predicted in an inter-frame mode and not in a sub-block unit mode and representative position information indicating the coordinates of the center of an area including a neighboring sub-block in the neighboring block.

[0311] Parameters of a model for determining a motion vector may be determined through linear regression by using motion vectors of neighboring blocks and representative position information without initial values.

[0312] In addition, the parameters may be determined by refining the parameters via linear regression based on the parameters of the model present in the previously encoded or decoded block and the motion vector and representative position information of the neighboring blocks. The previously encoded or decoded block may be selected from the history-based parameter candidates in which the parameters of the block previously encoded or decoded in the sub-block unit mode are stored, may be a block encoded or decoded in the sub-block unit mode before the current block in a block not adjacent to the current block, or may be a block encoded or decoded in the sub-block unit mode before the current block in a neighboring block of the current block.

[0313] Fig.21A diagram for describing a method of deriving parameters of a model for determining a motion vector from a neighboring block when an inter-predicted neighboring block includes both a neighboring block predicted in a sub-block unit and a neighboring block not predicted in a sub-block unit according to an embodiment of the present disclosure.

[0314] Among the first neighboring block 2110, the second neighboring block 2120, the third neighboring block 2130, the fourth neighboring block 2140, the fifth neighboring block 2150, the sixth neighboring block 2160 and the seventh neighboring block 2170 located around the current block 2100, since the sixth neighboring block predicted in the intra-frame mode does not have a motion vector, the neighboring sub-blocks 2161 and 2162 included in the sixth neighboring block 2160 are not used to derive parameters of the model for determining the motion vector.

[0315] From the neighboring blocks of the current block 2100, the first neighboring block 2110, the second neighboring block 2120, the third neighboring block 2130, the fourth neighboring block 2140, the fifth neighboring block 2150 and the seventh neighboring block 2170 predicted in the inter-frame mode are used to derive parameters of a model for determining a motion vector.

[0316] The first neighboring block 2110, the third neighboring block 2130, and the fifth neighboring block 2150 are predicted in a subblock unit mode, and the adjacent subblocks in each of the first neighboring block 2110, the third neighboring block 2130, and the fifth neighboring block 2150 have non-uniform motion vectors. The non-uniform motion vector may mean, for example, that all neighboring subblocks have different motion vectors or that adjacent neighboring subblocks have different motion vectors.

[0317] Because the second neighboring block 2120, the fourth neighboring block 2140 and the seventh neighboring block 2170 are all predicted in the inter-frame mode and not in the sub-block unit mode, the adjacent sub-blocks in each of the second neighboring block 2120, the fourth neighboring block 2140 and the seventh neighboring block 2170 have the same motion vector, that is, a uniform motion vector.

[0318] For example, the motion vector mv18 of the first neighboring sub-block 2111 and the position information of A18 indicating the coordinates of the center of the first neighboring sub-block 2111 are obtained from the first neighboring sub-block 2111 included in the first neighboring block 2110, and the motion vector mv17 of the second neighboring sub-block 2112 and the position information of A17 indicating the coordinates of the center of the second neighboring sub-block 2112 are obtained from the second neighboring sub-block 2112 included in the first neighboring block 2110.

[0319] The third adjacent sub-block 2121, the fourth adjacent sub-block 2122, the fifth adjacent sub-block 2123, and the sixth adjacent sub-block 2124 included in the second adjacent block 2120 have the same motion vector mv5. The same motion vector mv5 is determined as a representative motion vector. The coordinate B5 located at the center of the area including the third adjacent sub-block 2121, the fourth adjacent sub-block 2122, the fifth adjacent sub-block 2123, and the sixth adjacent sub-block 2124 is determined as representative position information.

[0320] A motion vector mv0 of the seventh neighboring subblock 2131 and position information A0 indicating the coordinates of the center of the seventh neighboring subblock 2131 are obtained from the seventh neighboring subblock 2131 included in the third neighboring block 2130 .

[0321] The eighth adjacent sub-block 2141, the ninth adjacent sub-block 2142, the tenth adjacent sub-block 2143, and the eleventh adjacent sub-block 2144 included in the fourth adjacent block 2140 have the same motion vector mv1. The same motion vector mv1 is determined as a representative motion vector. The coordinate B1 located at the center of the area including the eighth adjacent sub-block 2141, the ninth adjacent sub-block 2142, the tenth adjacent sub-block 2143, and the eleventh adjacent sub-block 2144 is determined as representative position information.

[0322] The motion vector mv5 of the twelfth adjacent sub-block 2151 and the position information of A5 indicating the coordinates of the center of the twelfth adjacent sub-block 2151 are obtained from the twelfth adjacent sub-block 2151 included in the fifth adjacent block 2150, and the motion vector mv6 of the thirteenth adjacent sub-block 2152 and the position information of A6 indicating the coordinates of the center of the thirteenth adjacent sub-block 2152 are obtained from the thirteenth adjacent sub-block 2152 included in the fifth adjacent block 2150.

[0323] The fourteenth adjacent sub-block 2171, the fifteenth adjacent sub-block 2172, the sixteenth adjacent sub-block 2173, and the seventeenth adjacent sub-block 2174 included in the seventh adjacent block 2170 have the same motion vector mv4. The same motion vector mv4 is determined as a representative motion vector. The coordinate B4 located at the center of the area including the fourteenth adjacent sub-block 2171, the fifteenth adjacent sub-block 2172, the sixteenth adjacent sub-block 2173, and the seventeenth adjacent sub-block 2174 is determined as representative position information.

[0324] In this way, parameters of a model for determining a motion vector as shown in Equation 1 can be derived by using the motion vector and position information of each of the neighboring subblocks predicted in the subblock unit mode from the current block 2100, the motion vector of the neighboring block predicted in the inter-frame mode and not in the subblock unit mode, and the representative position information indicating the coordinates of the center of the area including the neighboring subblock in the neighboring blocks of the current block 2100.

[0325] Parameters of a model for determining a motion vector may be determined via linear regression by using the motion vector and position information of each of the neighboring subblocks and the motion vector and representative position information of the neighboring blocks without an initial value.

[0326] In addition, the parameters may be determined by refining the parameters via linear regression based on the parameters of the model present in the previously encoded or decoded block and the motion vector and position information of each of the adjacent sub-blocks and the motion vector and representative position information of the adjacent blocks. The previously encoded or decoded block may be selected from the history-based parameter candidates in which the parameters of the block previously encoded or decoded in the sub-block unit mode are stored, may be a block encoded or decoded in the sub-block unit mode before the current block in a block not adjacent to the current block, or may be a block encoded or decoded in the sub-block unit mode before the current block in a neighboring block of the current block.

[0327] Fig. 22 is a diagram for describing a method of deriving parameters of a model for determining a motion vector from neighboring blocks when all inter-predicted neighboring blocks are not predicted in units of subblocks according to an embodiment of the present disclosure.

[0328] Among the first neighboring block 2210, the second neighboring block 2220, the third neighboring block 2230, the fourth neighboring block 2240, the fifth neighboring block 2250, the sixth neighboring block 2260 and the seventh neighboring block 2270 located around the current block 2200, since the sixth neighboring block 2260 predicted in the intra-frame mode does not have a motion vector, the neighboring sub-blocks 2261 and 2262 included in the sixth neighboring block 2260 are not used to derive parameters of the model for determining the motion vector.

[0329] Among the neighboring blocks of the current block 2200, the first neighboring block 2210, the second neighboring block 2220, the third neighboring block 2230, the fourth neighboring block 2240, the fifth neighboring block 2250 and the seventh neighboring block 2270, all of which are predicted in inter-frame mode and not predicted in sub-block unit mode, are used to derive parameters of a model for determining a motion vector.

[0330] Because the first neighboring block 2210, the second neighboring block 2220, the third neighboring block 2230, the fourth neighboring block 2240, the fifth neighboring block 2250 and the seventh neighboring block 2270 are all predicted in the inter-frame mode and not in the sub-block unit mode, the adjacent sub-blocks in each of the first neighboring block 2210, the second neighboring block 2220, the third neighboring block 2230, the fourth neighboring block 2240, the fifth neighboring block 2250 and the seventh neighboring block 2270 have the same motion vector, that is, a uniform motion vector.

[0331] For example, the first adjacent sub-block 2211 and the second adjacent sub-block 2212 included in the first adjacent block 2210 have the same motion vector mv6. The same motion vector mv6 is determined as a representative motion vector. Because the first adjacent sub-block 2211 and the second adjacent sub-block 2212 have the same motion vector, the position information also indicates the same coordinates. The coordinate C6 located at the center of the first adjacent block 2210 is determined as the representative position information.

[0332] The third adjacent sub-block 2221, the fourth adjacent sub-block 2222, the fifth adjacent sub-block 2223 and the sixth adjacent sub-block 2224 included in the second adjacent block 2220 have the same motion vector mv5. The same motion vector mv5 is determined as a representative motion vector. The coordinate C5 located at the center of the second adjacent block 2220 is determined as representative position information.

[0333] The third neighboring block 2230 has a motion vector mv0. The motion vector mv0 is determined as a representative motion vector. C0 indicating the coordinates of the center of the third neighboring block 2230 is determined as representative position information.

[0334] The eighth neighboring subblock 2241, the ninth neighboring subblock 2242, the tenth neighboring subblock 2243, and the eleventh neighboring subblock 2244 included in the fourth neighboring block 2240 have the same motion vector mv1. The same motion vector mv1 is determined as a representative motion vector. The coordinate C1 located at the center of the fourth neighboring block 2240 is determined as representative position information.

[0335] The twelfth neighboring subblock 2251 and the thirteenth neighboring subblock 2252 included in the fifth neighboring block 2250 have the same motion vector mv2. The same motion vector mv2 is determined as a representative motion vector. The coordinate C2 located at the center of the fifth neighboring block 2250 is determined as representative position information.

[0336] The 14th adjacent sub-block 2271, the 15th adjacent sub-block 2272, the 16th adjacent sub-block 2273 and the 17th adjacent sub-block 2274 included in the seventh adjacent block 2270 have the same motion vector mv4. The motion vector mv4 is determined as the representative motion vector. The coordinate C4 located at the center of the seventh adjacent block 2270 is determined as the representative position information.

[0337] In this way, parameters of a model for determining a motion vector as shown in Equation 1 can be derived by using a motion vector of a neighboring block predicted in an inter mode and not predicted in a subblock unit mode and representative position information indicating coordinates of the center of the neighboring block.

[0338] Parameters of a model for determining a motion vector may be determined through linear regression by using motion vectors of neighboring blocks and representative position information without initial values.

[0339] In addition, the parameters may be determined by refining the parameters via linear regression based on the parameters of the model present in the previously encoded or decoded block and the motion vector and representative position information of the neighboring blocks. The previously encoded or decoded block may be selected from the history-based parameter candidates in which the parameters of the block previously encoded or decoded in the sub-block unit mode are stored, may be a block encoded or decoded in the sub-block unit mode before the current block in a block not adjacent to the current block, or may be a block encoded or decoded in the sub-block unit mode before the current block in a neighboring block of the current block.

[0340] Fig.23 A diagram for describing a method of deriving parameters of a model for determining a motion vector from a neighboring block when an inter-predicted neighboring block includes both a neighboring block predicted in a sub-block unit and a neighboring block not predicted in a sub-block unit according to an embodiment of the present disclosure.

[0341] Among the first neighboring block 2310, the second neighboring block 2320, the third neighboring block 2330, the fourth neighboring block 2340, the fifth neighboring block 2350, the sixth neighboring block 2360 and the seventh neighboring block 2370 located around the current block 2300, since the sixth neighboring block 2360 predicted in the intra-frame mode does not have a motion vector, the neighboring sub-blocks 2361 and 2362 included in the sixth neighboring block 2360 are not used to derive parameters of the model for determining the motion vector.

[0342] Among the neighboring blocks of the current block 2300, the first neighboring block 2310, the second neighboring block 2320, the third neighboring block 2330, the fourth neighboring block 2340, the fifth neighboring block 2350 and the seventh neighboring block 237 predicted in the inter-frame mode are used to derive parameters of a model for determining a motion vector.

[0343] Since the first neighboring block 2310, the third neighboring block 2330, and the fifth neighboring block 2350 are predicted in a subblock unit mode, the neighboring subblocks in each of the first neighboring block 2310, the third neighboring block 2330, and the fifth neighboring block 2350 have non-uniform motion vectors. The non-uniform motion vector may mean, for example, that all neighboring subblocks have different motion vectors or that adjacent neighboring subblocks have different motion vectors.

[0344] Because the second neighboring block 2320, the fourth neighboring block 2340 and the seventh neighboring block 2370 are all predicted in the inter-frame mode and not in the sub-block unit mode, the adjacent sub-blocks in each of the second neighboring block 2320, the fourth neighboring block 2340 and the seventh neighboring block 2370 have the same motion vector, that is, a uniform motion vector.

[0345] For example, the motion vector mv18 of the first neighboring sub-block 2311 and the position information of A18 indicating the coordinates of the center of the first neighboring sub-block 2311 are obtained from the first neighboring sub-block 2311 included in the first neighboring block 2310, and the motion vector mv17 of the second neighboring sub-block 2312 and the position information of A17 indicating the coordinates of the center of the second neighboring sub-block 2312 are obtained from the second neighboring sub-block 2312 included in the first neighboring block 2310.

[0346] The third adjacent sub-block 2321, the fourth adjacent sub-block 2322, the fifth adjacent sub-block 2323 and the sixth adjacent sub-block 2324 included in the second adjacent block 2320 have the same motion vector mv5. The same motion vector mv5 is determined as a representative motion vector. The coordinate C5 located at the center of the second adjacent block 2320 is determined as representative position information.

[0347] A motion vector mv0 of the seventh neighboring subblock 2331 and position information A0 indicating the coordinates of the center of the seventh neighboring subblock 2331 are obtained from the seventh neighboring subblock 2331 included in the third neighboring block 2330 .

[0348] The eighth neighboring subblock 2341, the ninth neighboring subblock 2342, the tenth neighboring subblock 2343, and the eleventh neighboring subblock 2344 included in the fourth neighboring block 2340 have the same motion vector mv1. The same motion vector mv1 is determined as a representative motion vector. The coordinate C1 located at the center of the fourth neighboring block 2340 is determined as representative position information.

[0349] The motion vector mv5 of the twelfth adjacent sub-block 2351 and the position information of A5 indicating the coordinates of the center of the twelfth adjacent sub-block 2351 are obtained from the twelfth adjacent sub-block 2351 included in the fifth adjacent block 2350, and the motion vector mv6 of the thirteenth adjacent sub-block 2352 and the position information of A6 indicating the coordinates of the center of the thirteenth adjacent sub-block 2352 are obtained from the thirteenth adjacent sub-block 2352 included in the fifth adjacent block 2350.

[0350] The 14th adjacent sub-block 2371, the 15th adjacent sub-block 2372, the 16th adjacent sub-block 2373 and the 17th adjacent sub-block 2374 included in the seventh adjacent block 2370 have the same motion vector mv4. The same motion vector mv4 is determined as a representative motion vector. The coordinate C4 located at the center of the seventh adjacent block 2370 is determined as representative position information.

[0351] In this way, parameters of a model for determining a motion vector as shown in Equation 1 can be derived by using the motion vector and position information of each of the neighboring subblocks predicted in a subblock unit mode from the current block 2300, the motion vectors of the neighboring blocks predicted in an inter-frame mode and not in a subblock unit mode, and representative position information indicating the coordinates of the center of the neighboring blocks of the current block 2300.

[0352] Parameters of a model for determining a motion vector may be determined via linear regression by using the motion vector and position information of each of the neighboring subblocks and the motion vector and representative position information of the neighboring blocks without an initial value.

[0353] In addition, the parameters may be determined by refining the parameters via linear regression based on the parameters of the model present in the previously encoded or decoded block, the motion vector and position information of each of the adjacent sub-blocks, and the motion vector and representative position information of the adjacent blocks. The previously encoded or decoded block may be selected from the history-based parameter candidates in which the parameters of the block previously encoded or decoded in the sub-block unit mode are stored, may be a block encoded or decoded in the sub-block unit mode before the current block in a block not adjacent to the current block, or may be a block encoded or decoded in the sub-block unit mode before the current block in a block adjacent to the current block.

[0354] exist Figures 19 to 23 In the present invention, whether the adjacent block is predicted in the sub-block unit mode or not in the sub-block unit mode can be determined by identifying at least two adjacent sub-blocks having the same motion vector and adjacent to each other from the adjacent sub-blocks adjacent to the current block, or can be determined by identifying whether the adjacent block adjacent to the current block is a block that is not encoded and decoded in sub-block units or a block that is encoded and decoded in sub-block units.

[0355] Fig.24 is a diagram for describing a method of deriving parameters of a model for determining a motion vector by scanning inter-predicted neighboring blocks in units of sub-blocks according to an embodiment of the present disclosure.

[0356] refer to Fig.24 , parameters of a model for determining a motion vector may be derived by dividing neighboring blocks 2410, 2420, 2430, 2440, 2450, 2460, and 2470 adjacent to the current block 2400 into predetermined sub-block units and by scanning the neighboring sub-blocks adjacent to the current block 2400 to compare motion vectors.

[0357] That is, the parameters of the model for determining the motion vector may be derived by comparing the motion vectors of adjacent neighboring subblocks regardless of whether the neighboring block predicted in the inter mode is predicted in the subblock unit mode.

[0358] For example, starting from the first neighboring subblock 2431 located on the upper left side of the current block 2400, motion vectors of neighboring subblocks adjacent above in the right direction or the downward direction are compared.

[0359] Because the motion vector mv0 of the first neighboring subblock 2431 and the motion vector mv1 of the second neighboring subblock 2441 adjacent to the first neighboring subblock 2431 in the right direction are different from each other, the motion vector mv0 of the first neighboring subblock 2431 is determined as the motion vector, and the coordinates A0 of the center of the first neighboring subblock 2431 are determined as the position information.

[0360] According to an embodiment of the present disclosure, since the fourteenth adjacent sub-block 2424 is adjacent to the first adjacent sub-block 2431 in the downward direction, the first adjacent sub-block 2431 and the fourteenth adjacent sub-block 2424 may be additionally compared with each other. Even in this case, since the motion vector mv0 of the first adjacent sub-block 2431 and the motion vector mv5 of the fourteenth adjacent sub-block 2424 are different from each other, the motion vector mv0 of the first adjacent sub-block 2431 is determined as the motion vector, and the coordinates A0 of the center of the first adjacent sub-block 2431 are determined as the position information.

[0361] Since the motion vector mv1 of the second adjacent subblock 2441 is the same as the motion vector mv1 of the third adjacent subblock 2442 adjacent to the second adjacent subblock 2441 in the right direction, the comparison is continued. Since the motion vector mv1 of the third adjacent subblock 2442 is the same as the motion vector mv1 of the fourth adjacent subblock 2443 adjacent to the third adjacent subblock 2442 in the right direction, the comparison is continued. Since the motion vector mv1 of the fourth adjacent subblock 2443 is the same as the motion vector mv1 of the fifth adjacent subblock 2444 adjacent to the fourth adjacent subblock 2443 in the right direction, the comparison is continued. Because the motion vector mv1 of the fifth neighboring sub-block 2444 and the motion vector mv2 of the sixth neighboring sub-block 2451 adjacent to the fifth neighboring sub-block 2444 in the right direction are different from each other, the representative motion vectors of the second neighboring sub-block 2441, the third neighboring sub-block 2442, the fourth neighboring sub-block 2443 and the fifth neighboring sub-block 2444 are determined to be mv1, and the representative position information of the second neighboring sub-block 2441, the third neighboring sub-block 2442, the fourth neighboring sub-block 2443 and the fifth neighboring sub-block 2444 is determined to be the coordinates B1 of the center of the area including the second neighboring sub-block 2441, the third neighboring sub-block 2442, the fourth neighboring sub-block 2443 and the fifth neighboring sub-block 2444.

[0362] Since the motion vector mv2 of the sixth adjacent sub-block 2451 is the same as the motion vector mv2 of the seventh adjacent sub-block 2452 adjacent to the sixth adjacent sub-block 2451 in the right direction, the comparison is continued. Since the motion vector mv2 of the seventh adjacent sub-block 2452 is the same as the motion vector mv3 of the eighth adjacent sub-block 2461 adjacent to the seventh adjacent sub-block 2452 in the right direction, the comparison is continued. Since the motion vector mv3 of the eighth adjacent sub-block 2461 is the same as the motion vector mv3 of the ninth adjacent sub-block 2462 adjacent to the eighth adjacent sub-block 2461 in the right direction, the comparison is continued. Because the tenth adjacent sub-block 2471 adjacent to the ninth adjacent sub-block 2462 in the right direction does not have a motion vector and the motion vector mv3 of the ninth adjacent sub-block 2462 is different from the motion vector of the tenth adjacent sub-block 2471, the representative motion vectors of the sixth adjacent sub-block 2451, the seventh adjacent sub-block 2452, the eighth adjacent sub-block 2461 and the ninth adjacent sub-block 2462 are determined to be mv2, and the representative position information of the sixth adjacent sub-block 2451, the seventh adjacent sub-block 2452, the eighth adjacent sub-block 2461 and the ninth adjacent sub-block 2462 is determined to be the coordinates B2 of the center of the area including the sixth adjacent sub-block 2451, the seventh adjacent sub-block 2452, the eighth adjacent sub-block 2461 and the ninth adjacent sub-block 2462. Since the sixth and seventh neighboring subblocks 2451 and 2452 and the eighth and ninth neighboring subblocks 2461 and 2462 are included in different neighboring blocks but mv2 and mv3 are the same, the representative position information is determined as the coordinates of the centers of adjacent neighboring subblocks having the same motion vector.

[0363] Since the motion vector mv5 of the fourteenth adjacent sub-block 2424 is the same as the motion vector mv5 of the fifteenth adjacent sub-block 2423 which is adjacent to the fourteenth adjacent sub-block 2424 in the downward direction, the comparison is continued. Since the motion vector mv5 of the fifteenth adjacent sub-block 2423 is the same as the motion vector mv5 of the sixteenth adjacent sub-block 2422 which is adjacent to the fifteenth adjacent sub-block 2423 in the downward direction, the comparison is continued. Since the motion vector mv5 of the sixteenth adjacent sub-block 2422 is the same as the motion vector mv5 of the seventeenth adjacent sub-block 2421 which is adjacent to the sixteenth adjacent sub-block 2422 in the downward direction, the comparison is continued. Because the motion vector mv5 of the seventeenth neighboring sub-block 2421 and the motion vector mv6 of the eighteenth neighboring sub-block 2412 adjacent to the seventeenth neighboring sub-block 2421 in the downward direction are different from each other, the representative motion vectors of the fourteenth neighboring sub-block 2424, the fifteenth neighboring sub-block 2423, the sixteenth neighboring sub-block 2422 and the seventeenth neighboring sub-block 2421 are determined to be mv5, and the representative position information of the fourteenth neighboring sub-block 2424, the fifteenth neighboring sub-block 2423, the sixteenth neighboring sub-block 2422 and the seventeenth neighboring sub-block 2421 is determined to be the coordinate B5 of the center of the area including the fourteenth neighboring sub-block 2424, the fifteenth neighboring sub-block 2423, the sixteenth neighboring sub-block 2422 and the seventeenth neighboring sub-block 2421.

[0364] Since the motion vector mv6 of the eighteenth adjacent subblock 2412 and the motion vector mv6 of the nineteenth adjacent subblock 2411 adjacent to the eighteenth adjacent subblock 2412 in the downward direction are the same, the comparison is continued. Since the area below the nineteenth adjacent subblock 2411 is an area that is not allowed to be scanned due to the absence of available adjacent blocks, the comparison is terminated, and the representative motion vectors of the eighteenth adjacent subblock 2412 and the nineteenth adjacent subblock 2411 are determined to be mv6, and the representative position information of the eighteenth adjacent subblock 2412 and the nineteenth adjacent subblock 2411 is determined to be the coordinates B6 of the center of the area including the eighteenth adjacent subblock 2412 and the nineteenth adjacent subblock 2411.

[0365] According to an embodiment of the present disclosure, in addition to determining whether the motion vectors are the same, it is also possible to determine whether the reference frames of adjacent adjacent sub-blocks are the same. That is, when the motion vectors are the same and the reference frames are the same, scanning can continue, and when the motion vectors or the reference frames are different, scanning can be stopped.

[0366] The start time and comparison direction for comparing motion vectors are examples, and embodiments of the present disclosure are not limited thereto.

[0367] When there is no neighboring block predicted in sub-block unit mode and the adjacent neighboring blocks have the same motion vector, Fig.24The corresponding method has a motion vector and a position information, and when there is no neighboring block predicted in sub-block unit mode and the adjacent neighboring blocks have the same motion vector, Fig.18 The corresponding method has two motion vectors and two pieces of position information.

[0368] Fig.25 is a block diagram illustrating an image decoding apparatus according to an embodiment of the present disclosure.

[0369] The image decoding device 2500 according to an embodiment of the present disclosure may include a memory 2510 and at least one processor 2520 connected to the memory 2510. The operation of the image decoding device 2500 according to an embodiment of the present disclosure may be performed by each processor or may be performed under the control of a central processor. In addition, the memory 2510 of the image decoding device 2500 may store data received from the outside and data generated by the processor, for example, information about parameters for determining a motion vector of a block decoded in a sub-block unit mode before a current block.

[0370] The processor 2520 of the image decoding device 2500 can identify at least two adjacent sub-blocks having the same motion vector and adjacent to each other from adjacent sub-blocks adjacent to the current block, can determine the representative motion vector and representative position information of the identified at least two adjacent sub-blocks, can determine the parameters of the model for determining the motion vector by using the representative motion vector and the representative position information, can determine the motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and can predict the current block by using the motion vector of the current sub-block.

[0371] In addition, the processor 2520 of the image decoding device 2500 can identify a first neighboring block that is not encoded and decoded in units of sub-blocks and a second neighboring block that is encoded and decoded in units of sub-blocks from neighboring blocks adjacent to the current block, can identify a first motion vector and first position information corresponding to the first neighboring block, can determine parameters of a model for determining a motion vector based on the first motion vector and the first position information, can determine the motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and can predict the current block by using the motion vector of the current sub-block.

[0372] In addition, the processor 2520 of the image decoding device 2500 can compare the motion vectors of the first adjacent block and the second adjacent block that are adjacent to each other among the adjacent blocks adjacent to the current block, can identify representative position information of the first adjacent block and the second adjacent block based on the result of the comparison indicating that the first motion vector of the first adjacent block and the second motion vector of the second adjacent block are the same, can determine parameters of a model for determining a motion vector by using one of the first motion vector and the second motion vector and the representative position information, can determine parameters by using the first motion vector, the second motion vector, the first position information of the first adjacent block and the second position information of the second adjacent block based on the result of the comparison indicating that the first motion vector and the second motion vector are different from each other, can determine parameters by using the first motion vector, the second motion vector, the first position information of the first adjacent block and the second position information of the second adjacent block, can determine the motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and can predict the current block by using the motion vector of the current sub-block.

[0373] Fig.25 The image decoding apparatus 2500 may perform the following Figure 26 to Figure 28 The operation of the image decoding method.

[0374] Fig.26 is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure.

[0375] refer to Fig.26 In operation 2610, the image decoding device 2500 may identify at least two neighboring sub blocks that have the same motion vector and are adjacent to each other from among neighboring sub blocks adjacent to the current block.

[0376] According to an embodiment of the present disclosure, the image decoding device 2500 may receive information indicating whether the prediction mode of the current block is a sub-block unit mode. The information indicating whether the prediction mode of the current block is a sub-block unit mode may be determined during the encoding process and signaled. When the current block is in the sub-block unit mode, the image decoding device 2500 may identify at least two adjacent sub-blocks having the same motion vector and adjacent to each other from adjacent sub-blocks adjacent to the current block.

[0377] In operation 2620, the image decoding device 2500 may determine a representative motion vector and representative position information corresponding to the identified at least two neighboring subblocks. The representative motion vector may be determined based on the same motion vector, and the representative position information may indicate coordinates determined based on the identified at least two neighboring subblocks.

[0378] According to an embodiment of the present disclosure, the representative position information may include coordinates corresponding to centers of the identified at least two adjacent sub-blocks or coordinates of centers of adjacent blocks including the identified at least two adjacent sub-blocks.

[0379] In operation 2630 , the image decoding device 2500 may determine parameters of a model for determining a motion vector by using the representative motion vector and the representative position information.

[0380] According to an embodiment of the present disclosure, the image decoding device 2500 can obtain initial parameters of a model for determining a motion vector from a block reconstructed in a sub-block unit mode before the current block, and can refine the parameters by using the initial parameters, representative motion vectors, and representative position information.

[0381] According to an embodiment of the present disclosure, the image decoding device 2500 can determine individual motion vectors and pieces of individual location information of adjacent sub-blocks having different motion vectors or adjacent sub-blocks that are not adjacent to each other in adjacent sub-blocks adjacent to the current block, and can determine parameters by further using the individual motion vectors and pieces of individual location information.

[0382] According to an embodiment of the present disclosure, the image decoding device 2500 can obtain initial parameters of a model for determining a motion vector from a block reconstructed in a sub-block unit mode before the current block, and can refine the parameters by using the initial parameters, representative motion vectors, representative position information, individual motion vectors, and individual position information.

[0383] In operation 2640, the image decoding device 2500 may determine a motion vector of the current subblock based on the position information of the current subblock included in the current block and the determined parameter.

[0384] In operation 2650 , the image decoding device 2500 may predict the current block by using the motion vector of the current subblock.

[0385] Fig. 27 is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure.

[0386] refer to Fig. 27 In operation 2710, the image decoding apparatus 2500 may identify a first neighboring block that is not encoded and decoded in units of subblocks and a second neighboring block that is encoded and decoded in units of subblocks from among neighboring blocks adjacent to the current block.

[0387] According to an embodiment of the present disclosure, the image decoding device 2500 may receive information indicating whether the prediction mode of the current block is a sub-block unit mode. The information indicating whether the prediction mode of the current block is a sub-block unit mode may be determined during the encoding process and signaled. When the current block is in the sub-block unit mode, the image decoding device 2500 may identify a first neighboring block that is not encoded and decoded in sub-block units and a second neighboring block that is encoded and decoded in sub-block units from neighboring blocks adjacent to the current block.

[0388] In operation 2720, the image decoding device 2500 may determine a first motion vector and first position information corresponding to the first neighboring block. The first position information may indicate coordinates determined based on the first neighboring block.

[0389] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of the first neighboring block.

[0390] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of an area, the area including a first neighboring sub-block adjacent to the current block in a first neighboring sub-block included in a first neighboring block, and the first neighboring sub-block may be obtained by dividing the first neighboring block into predetermined sub-block units.

[0391] In operation 2730, the image decoding device 2500 may determine a parameter of a model for determining a motion vector based on the first motion vector and the first position information.

[0392] According to an embodiment of the present disclosure, the image decoding device 2500 can obtain initial parameters of a model for determining a motion vector from a block reconstructed in a sub-block unit mode before the current block, and can refine the parameters by using the initial parameters, the first motion vector and the first position information.

[0393] According to an embodiment of the present disclosure, the image decoding device 2500 can determine multiple second motion vectors and multiple pieces of second location information corresponding to the second adjacent sub-blocks included in the second adjacent block, and can determine parameters by further using the multiple second motion vectors and multiple pieces of second location information.

[0394] According to an embodiment of the present disclosure, the image decoding device 2500 can obtain initial parameters of a model for determining a motion vector from a block reconstructed in a sub-block unit mode before the current block, and can refine the parameters by using the initial parameters, the first motion vector, the first position information, the second motion vector, and the second position information.

[0395] According to an embodiment of the present disclosure, based on the fact that at least two third adjacent sub-blocks in the second adjacent sub-blocks included in the second adjacent block have the same motion vector and are adjacent to each other, the image decoding device 2500 can determine the third position information corresponding to the center of the third adjacent sub-block, and can determine the parameters by using the same motion vector and the third position information of the third adjacent sub-block.

[0396] In operation 2740, the image decoding device 2500 may determine a motion vector of the current subblock based on the position information of the current subblock included in the current block and the determined parameter.

[0397] In operation 2750 , the image decoding device 2500 may predict the current block by using the motion vector of the current subblock.

[0398] Fig.28 is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure.

[0399] refer to Fig.28 In operation 2810, the image decoding device 2500 may compare motion vectors of a first neighboring block and a second neighboring block adjacent to each other among neighboring blocks adjacent to the current block.

[0400] According to an embodiment of the present disclosure, the image decoding device 2500 may receive information indicating whether the prediction mode of the current block is a sub-block unit mode. The information indicating whether the prediction mode of the current block is a sub-block unit mode may be determined during the encoding process and signaled. When the current block is in the sub-block unit mode, the image decoding device 2500 may compare motion vectors of a first adjacent block and a second adjacent block adjacent to each other among adjacent blocks adjacent to the current block.

[0401] In operation 2820, based on the comparison result indicating that the first motion vector of the first neighboring block and the second motion vector of the second neighboring block are the same, the image decoding device 2500 can determine representative position information of the first neighboring block and the second neighboring block, and can determine parameters of a model for determining a motion vector by using one of the first motion vector and the second motion vector and the representative position information.

[0402] According to an embodiment of the present disclosure, the representative position information may indicate coordinates corresponding to centers of the first neighboring block and the second neighboring block.

[0403] In operation 2830, based on the comparison result indicating that the first motion vector and the second motion vector are different from each other, the image decoding device 2500 may determine a parameter by using the first motion vector, the second motion vector, the first position information of the first neighboring block, and the second position information of the second neighboring block.

[0404] According to an embodiment of the present disclosure, the first position information may indicate coordinates corresponding to the center of the first neighboring block, and the second position information may indicate coordinates corresponding to the center of the second neighboring block.

[0405] According to an embodiment of the present disclosure, at least one of the first neighboring block and the second neighboring block may be a codec unit or a sub-block unit included in the codec unit.

[0406] According to an embodiment of the present disclosure, the image decoding device 2500 can obtain initial parameters of a model for determining a motion vector from a block reconstructed in a sub-block unit mode before the current block, and can refine the parameters by using the initial parameters, a motion vector, and representative position information based on the fact that the first motion vector and the second motion vector are the same motion vector, and can refine the parameters by using the initial parameters, the first motion vector, the second motion vector, the first position information, and the second position information based on the fact that the first motion vector and the second motion vector are different from each other.

[0407] In operation 2840, the image decoding device 2500 may determine a motion vector of the current subblock based on the position information of the current subblock included in the current block and the determined parameter.

[0408] In operation 2850 , the image decoding device 2500 may predict the current block by using the motion vector of the current subblock.

[0409] Fig.29 is a block diagram illustrating an image encoding apparatus according to an embodiment of the present disclosure.

[0410] The image encoding device 2900 according to an embodiment of the present disclosure may include a memory 2910 and at least one processor 2920 connected to the memory 2910. The operation of the image encoding device 2900 according to an embodiment of the present disclosure may be performed by each processor or may be performed under the control of a central processor. In addition, the memory 2910 of the image encoding device 2900 may store data received from the outside and data generated by the processor, for example, information about parameters for determining a motion vector of a block encoded in a sub-block unit mode before a current block.

[0411] The processor 2920 of the image encoding device 2900 can identify at least two adjacent sub-blocks having the same motion vector and adjacent to each other from adjacent sub-blocks adjacent to the current block, can determine the representative motion vector and representative position information of the at least two identified adjacent sub-blocks, can determine the parameters of the model for determining the motion vector by using the representative motion vector and the representative position information, can determine the motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and can predict the current block by using the motion vector of the current sub-block.

[0412] In addition, the processor 2920 of the image encoding device 2900 can identify a first neighboring block that is not encoded and decoded in units of sub-blocks and a second neighboring block that is encoded and decoded in units of sub-blocks from neighboring blocks adjacent to the current block, can determine a first motion vector and first position information corresponding to the first neighboring block, can determine parameters of a model for determining a motion vector based on the first motion vector and the first position information, can determine the motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and can predict the current block by using the motion vector of the current sub-block.

[0413] In addition, the processor 2920 of the image encoding device 2900 can compare the motion vectors of the first adjacent block and the second adjacent block that are adjacent to each other among the adjacent blocks adjacent to the current block, can determine the representative position information of the first adjacent block and the second adjacent block based on the result of the comparison indicating that the first motion vector of the first adjacent block and the second motion vector of the second adjacent block are the same, can determine the parameters of the model for determining the motion vector by using one of the first motion vector and the second motion vector and the representative position information, can determine the parameters by using the first motion vector, the second motion vector, the first position information of the first adjacent block and the second position information of the second adjacent block based on the result of the comparison indicating that the first motion vector and the second motion vector are different from each other, can determine the parameters by using the first motion vector, the second motion vector, the first position information of the first adjacent block and the second position information of the second adjacent block, can determine the motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and can predict the current block by using the motion vector of the current sub-block.

[0414] Fig.29 The image encoding apparatus 2900 may perform the following Figure 30 to Figure 32 The operation of the image encoding method.

[0415] Fig.30 is a flowchart illustrating an image encoding method according to an embodiment of the present disclosure.

[0416] refer to Fig.30 In operation 3010, the image encoding device 2900 may identify at least two neighboring subblocks having the same motion vector and being adjacent to each other from among neighboring subblocks adjacent to the current block.

[0417] According to an embodiment of the present disclosure, the image encoding device 2900 may determine whether the prediction mode of the current block is a sub-block unit mode. Whether the prediction mode of the current block is a sub-block unit mode may be determined by a sum of transform differences (ATD) or a rate-distortion optimization (RDO) calculation, and information about whether the prediction mode of the current block is a sub-block unit mode may be encoded and signaled. When the prediction mode of the current block is a sub-block unit mode, the image encoding device 2900 may identify at least two adjacent sub-blocks having the same motion vector and adjacent to each other from adjacent sub-blocks adjacent to the current block.

[0418] In operation 3020, the image encoding device 2900 may determine a representative motion vector and representative position information of the identified at least two neighboring subblocks. The representative motion vector may be determined based on the same motion vector, and the representative position information may indicate coordinates determined based on the identified at least two neighboring subblocks.

[0419] According to an embodiment of the present disclosure, the representative position information may include coordinates corresponding to centers of the identified at least two adjacent sub-blocks or coordinates of centers of adjacent blocks including the identified at least two adjacent sub-blocks.

[0420] In operation 3030, the image encoding device 2900 may determine parameters of a model for determining a motion vector by using the representative motion vector and the representative position information.

[0421] According to an embodiment of the present disclosure, the image encoding device 2900 can obtain initial parameters of a model for determining a motion vector from a block encoded in a sub-block unit mode before the current block, and can refine the parameters by using the initial parameters, representative motion vectors, and representative position information.

[0422] According to an embodiment of the present disclosure, the image encoding device 2900 can determine the respective motion vectors and respective position information of adjacent sub-blocks adjacent to the current block having different motion vectors or adjacent sub-blocks that are not adjacent to each other, and can determine parameters by further using the respective motion vectors and respective position information.

[0423] According to an embodiment of the present disclosure, the image encoding device 2900 can obtain initial parameters of a model for determining a motion vector from a block encoded in a sub-block unit mode before the current block, and can refine the parameters by using the initial parameters, representative motion vectors, representative position information, individual motion vectors, and individual position information.

[0424] In operation 3040, the image encoding device 2900 may determine a motion vector of the current subblock based on the position information of the current subblock included in the current block and the determined parameter.

[0425] In operation 3050, the image encoding device 2900 may predict the current block by using the motion vector of the current subblock.

[0426] Fig.31 is a flowchart illustrating an image encoding method according to an embodiment of the present disclosure.

[0427] refer to Fig.31 In operation 3110, the image encoding device 2900 may identify a first neighboring block that is not encoded and decoded in units of subblocks and a second neighboring block that is encoded and decoded in units of subblocks from neighboring blocks adjacent to the current block.

[0428] According to an embodiment of the present disclosure, the image encoding device 2900 may determine whether the prediction mode of the current block is a sub-block unit mode. Whether the prediction mode of the current block is a sub-block unit mode may be determined by ATD or RDO calculation, and information about whether the prediction mode of the current block is a sub-block unit mode may be encoded and signaled. When the prediction mode of the current block is a sub-block unit mode, the image encoding device 2900 may identify a first neighboring block that is not encoded and decoded in sub-block units and a second neighboring block that is encoded and decoded in sub-block units from neighboring blocks adjacent to the current block.

[0429] In operation 3120, the image encoding device 2900 may determine a first motion vector and first position information corresponding to the first neighboring block. The first position information may indicate coordinates determined based on the first neighboring block.

[0430] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of the first neighboring block.

[0431] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of an area, the area including a first neighboring sub-block adjacent to the current block in a first neighboring sub-block included in a first neighboring block, and the first neighboring sub-block may be obtained by dividing the first neighboring block into predetermined sub-block units.

[0432] In operation 3130, the image encoding device 2900 may determine a parameter of a model for determining a motion vector based on the first motion vector and the first position information.

[0433] According to an embodiment of the present disclosure, the image encoding device 2900 can obtain initial parameters of a model for determining a motion vector from a block encoded in a sub-block unit mode before the current block, and can refine the parameters by using the initial parameters, the first motion vector and the first position information.

[0434] According to an embodiment of the present disclosure, the image encoding device 2900 can determine multiple second motion vectors and multiple second position information corresponding to the second neighboring subblocks included in the second neighboring block, and can determine parameters by further using the multiple second motion vectors and multiple second position information.

[0435] According to an embodiment of the present disclosure, the image encoding device 2900 can obtain initial parameters of a model for determining a motion vector from a block encoded in a sub-block unit mode before the current block, and can refine the parameters by using the initial parameters, the first motion vector, the first position information, the second motion vector, and the second position information.

[0436] According to an embodiment of the present disclosure, based on the fact that at least two third adjacent sub-blocks in the second adjacent sub-blocks included in the second adjacent block have the same motion vector and are adjacent to each other, the image encoding device 2900 can determine third position information corresponding to the center of the third adjacent sub-block, and can determine parameters by using the same motion vector and third position information of the third adjacent sub-block.

[0437] In operation 3140, the image encoding device 2900 may determine a motion vector of the current subblock based on the position information of the current subblock included in the current block and the determined parameter.

[0438] In operation 3150, the image encoding device 2900 may predict the current block by using the motion vector of the current subblock.

[0439] Fig.32 is a flowchart illustrating an image encoding method according to an embodiment of the present disclosure.

[0440] refer to Fig.32 In operation 3210, the image encoding device 2900 may compare motion vectors of a first neighboring block and a second neighboring block adjacent to each other among neighboring blocks adjacent to the current block.

[0441] According to an embodiment of the present disclosure, the image encoding device 2900 may determine whether the prediction mode of the current block is a sub-block unit mode. Whether the prediction mode of the current block is a sub-block unit mode may be determined by ATD or RDO calculation, and information about whether the prediction mode of the current block is a sub-block unit mode may be encoded and signaled. When the prediction mode of the current block is a sub-block unit mode, the image encoding device 2900 may compare motion vectors of a first neighboring block and a second neighboring block adjacent to each other among neighboring blocks adjacent to the current block.

[0442] In operation 3220, based on the comparison result indicating that the first motion vector of the first neighboring block and the second motion vector of the second neighboring block are the same, the image encoding device 2900 can determine representative position information of the first neighboring block and the second neighboring block, and can determine parameters of a model for determining a motion vector by using one of the first motion vector and the second motion vector and the representative position information.

[0443] According to an embodiment of the present disclosure, the representative position information may indicate coordinates corresponding to centers of the first neighboring block and the second neighboring block.

[0444] In operation 3230, based on the comparison result indicating that the first motion vector and the second motion vector are different from each other, the image encoding device 2900 may determine a parameter by using the first motion vector, the second motion vector, the first position information of the first neighboring block, and the second position information of the second neighboring block.

[0445] According to an embodiment of the present disclosure, the first position information may indicate coordinates corresponding to the center of the first neighboring block, and the second position information may indicate coordinates corresponding to the center of the second neighboring block.

[0446] According to an embodiment of the present disclosure, at least one of the first neighboring block and the second neighboring block may be a codec unit or a sub-block unit included in the codec unit.

[0447] According to an embodiment of the present disclosure, the image encoding device 2900 can obtain initial parameters of a model for determining a motion vector from a block encoded in a sub-block unit mode before the current block, and can refine the parameters by using the initial parameters, a motion vector, and representative position information based on the fact that the first motion vector and the second motion vector are the same motion vector, and can refine the parameters by using the initial parameters, the first motion vector, the second motion vector, the first position information, and the second position information based on the fact that the first motion vector and the second motion vector are different from each other.

[0448] In operation 3240, the image encoding device 2900 may determine a motion vector of the current subblock based on the position information of the current subblock included in the current block and the determined parameter.

[0449] In operation 3250, the image encoding device 2900 may predict the current block by using the motion vector of the current subblock.

[0450] According to an embodiment of the present disclosure, an image decoding method includes: identifying at least two adjacent sub-blocks having the same motion vector and adjacent to each other from adjacent sub-blocks adjacent to a current block; determining a representative motion vector and representative position information of the identified at least two adjacent sub-blocks; determining parameters of a model for determining a motion vector by using the representative motion vector and the representative position information; determining a motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters; and predicting the current block by using the motion vector of the current sub-block, wherein the representative motion vector is determined based on the same motion vector, and the representative position information indicates coordinates determined based on the identified at least two adjacent sub-blocks.

[0451] According to the image decoding method of an embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved while considering all adjacent information.

[0452] According to an embodiment of the present disclosure, the representative position information may include coordinates corresponding to centers of the identified at least two adjacent sub-blocks or coordinates of centers of adjacent blocks including the identified at least two adjacent sub-blocks.

[0453] According to the image decoding method of an embodiment of the present disclosure, when the coordinates corresponding to the centers of at least two identified adjacent sub-blocks are representative position information, the positions of adjacent sub-blocks adjacent to the current block can be reflected, and therefore, the accuracy of sub-block unit prediction can be improved, and when the coordinates of the centers of adjacent blocks including at least two identified adjacent sub-blocks are representative position information, adjacent sub-blocks having the same motion vector can belong to one adjacent block, and therefore, the positions of adjacent blocks can be reflected, and the accuracy of sub-block unit prediction can be improved.

[0454] According to an embodiment of the present disclosure, determining parameters may further include obtaining initial parameters of a model for determining a motion vector from a block reconstructed in a subblock unit mode before the current block, and refining the parameters by using the initial parameters, representative motion vectors, and representative position information.

[0455] According to an embodiment of the present disclosure, the image decoding method may further include: determining each motion vector and each piece of position information of adjacent sub-blocks adjacent to the current block that have different motion vectors or are not adjacent to each other, wherein determining the parameters also includes: determining the parameters by further using each motion vector and each piece of position information.

[0456] According to an embodiment of the present disclosure, determining parameters may also include: obtaining initial parameters of a model for determining a motion vector from a block reconstructed in a sub-block unit mode before the current block, and refining the parameters by using the initial parameters, representative motion vectors, representative position information, individual motion vectors and individual pieces of position information.

[0457] According to an embodiment of the present disclosure, an image decoding method includes: identifying a first neighboring block that is not encoded and decoded in units of sub-blocks and a second neighboring block that is encoded and decoded in units of sub-blocks from neighboring blocks adjacent to a current block, determining a first motion vector and first position information corresponding to the first neighboring block, determining parameters of a model for determining a motion vector based on the first motion vector and the first position information, determining a motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and predicting the current block by using the motion vector of the current sub-block, wherein the first position information indicates coordinates determined based on the first neighboring block.

[0458] According to the image decoding method of an embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved while considering all adjacent information.

[0459] According to an embodiment of the present disclosure, the image decoding method may further include: determining multiple second motion vectors and multiple second position information corresponding to second adjacent sub-blocks included in the second adjacent block, wherein determining the parameters includes: determining the parameters by further using the multiple second motion vectors and multiple second position information.

[0460] According to an embodiment of the present disclosure, based on the fact that at least two third adjacent sub-blocks in the second adjacent sub-blocks included in the second adjacent block have the same motion vector and are adjacent to each other, determining multiple second motion vectors and multiple second position information may also include: determining third position information corresponding to the center of the third adjacent sub-block, wherein determining the parameters also includes: determining the parameters by using the same motion vector and third position information of the third adjacent sub-block.

[0461] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of the first neighboring block.

[0462] According to the image decoding method of the embodiment of the present disclosure, since the positions of neighboring blocks adjacent to the current block are reflected, the accuracy of sub-block unit prediction can be improved.

[0463] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of an area, wherein the area includes a first neighboring sub-block adjacent to the current block in a first neighboring sub-block included in a first neighboring block, wherein the first neighboring sub-block is obtained by dividing the first neighboring block into predetermined sub-block units.

[0464] According to the image decoding method of the embodiment of the present disclosure, since the positions of adjacent subblocks belonging to adjacent blocks are reflected, the accuracy of subblock unit prediction can be improved.

[0465] An image decoding method according to an embodiment of the present disclosure includes: comparing motion vectors of a first adjacent block and a second adjacent block adjacent to each other among adjacent blocks adjacent to a current block, indicating based on a result of the comparison that a first motion vector of the first adjacent block and a second motion vector of the second adjacent block are the same, determining representative position information of the first adjacent block and the second adjacent block, and determining parameters of a model for determining a motion vector by using one of the first motion vector and the second motion vector and the representative position information, indicating based on a result of the comparison that the first motion vector and the second motion vector are different from each other, determining parameters by using the first motion vector, the second motion vector, the first position information of the first adjacent block, and the second position information of the second adjacent block, determining a motion vector of the current sub-block based on the position information of a current sub-block included in the current block and the determined parameters, and predicting the current block by using the motion vector of the current sub-block.

[0466] According to the image decoding method of an embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved while considering all adjacent information.

[0467] According to an embodiment of the present disclosure, the representative position information may indicate coordinates corresponding to centers of the first neighboring block and the second neighboring block.

[0468] According to the image decoding method of the embodiment of the present disclosure, since the positions of the neighboring sub-blocks adjacent to the current block are reflected, the accuracy of the prediction of the sub-block unit can be improved.

[0469] According to an embodiment of the present disclosure, the first position information may indicate coordinates corresponding to the center of the first neighboring block, and the second position information may indicate coordinates corresponding to the center of the second neighboring block.

[0470] According to an embodiment of the present disclosure, at least one of the first neighboring block and the second neighboring block may be a codec unit or a sub-block unit included in the codec unit.

[0471] According to an embodiment of the present disclosure, determining the parameters may also include: based on the first motion vector and the second motion vector being the same motion vector, obtaining initial parameters of a model for determining the motion vector from a block reconstructed in a sub-block mode before the current block, refining the parameters by using the initial parameters, a motion vector and representative position information, and based on the first motion vector and the second motion vector being different from each other, refining the parameters by using the initial parameters, the first motion vector, the second motion vector, the first position information and the second position information.

[0472] According to an embodiment of the present disclosure, an image decoding device includes a memory storing one or more instructions, and at least one processor, which operates according to the one or more instructions to: identify at least two adjacent sub-blocks having the same motion vector and adjacent to each other from adjacent sub-blocks adjacent to a current block, determine a representative motion vector and representative position information of the identified at least two adjacent sub-blocks, determine parameters of a model for determining a motion vector by using the representative motion vector and the representative position information, determine the motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and predict the current block by using the motion vector of the current sub-block, wherein the representative motion vector is determined based on the same motion vector, and the representative position information indicates coordinates determined based on the identified at least two adjacent sub-blocks.

[0473] According to the image decoding device of an embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved while considering all adjacent information.

[0474] According to an embodiment of the present disclosure, the representative position information may include coordinates corresponding to centers of the identified at least two adjacent sub-blocks or coordinates of centers of adjacent blocks including the identified at least two adjacent sub-blocks.

[0475] According to the image decoding device of an embodiment of the present disclosure, when the coordinates corresponding to the centers of at least two identified adjacent sub-blocks are representative position information, the positions of adjacent sub-blocks adjacent to the current block can be reflected, and therefore, the accuracy of sub-block unit prediction can be improved, and when the coordinates of the centers of adjacent blocks including at least two identified adjacent sub-blocks are representative position information, adjacent sub-blocks having the same motion vector can belong to one adjacent block, and therefore, the positions of the adjacent blocks can be reflected, and the accuracy of sub-block unit prediction can be improved.

[0476] According to an embodiment of the present disclosure, the at least one processor may also be configured to obtain initial parameters of a model for determining a motion vector from a block reconstructed in a sub-block unit mode before the current block, and refine the parameters by using the initial parameters, representative motion vectors, and representative position information.

[0477] According to an embodiment of the present disclosure, the at least one processor may also be configured to determine respective motion vectors and respective pieces of position information of adjacent sub-blocks adjacent to the current block that have different motion vectors or are not adjacent to each other, and determine parameters by further using the respective motion vectors and respective pieces of position information.

[0478] According to an embodiment of the present disclosure, the at least one processor may also be configured to obtain initial parameters of a model for determining a motion vector from a block reconstructed in a sub-block unit mode before the current block, and refine the parameters by using the initial parameters, representative motion vectors, representative position information, individual motion vectors and individual pieces of position information.

[0479] According to an embodiment of the present disclosure, an image decoding device includes a memory storing one or more instructions, and at least one processor, which operates according to the one or more instructions to: identify a first neighboring block that is not encoded and decoded in units of sub-blocks and a second neighboring block that is encoded and decoded in units of sub-blocks from neighboring blocks adjacent to a current block, determine a first motion vector and first position information corresponding to the first neighboring block, determine parameters of a model for determining a motion vector based on the first motion vector and the first position information, determine a motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and predict the current block by using the motion vector of the current sub-block, wherein the first position information indicates coordinates determined based on the first neighboring block.

[0480] According to the image decoding device of an embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved while considering all adjacent information.

[0481] According to an embodiment of the present disclosure, the at least one processor may also be configured to determine multiple second motion vectors and multiple second position information corresponding to the second adjacent sub-blocks included in the second adjacent block, and determine parameters by further using the multiple second motion vectors and multiple second position information.

[0482] According to an embodiment of the present disclosure, based on the fact that at least two third adjacent sub-blocks among the second adjacent sub-blocks included in the second adjacent block have the same motion vector and are adjacent to each other, the at least one processor may also be configured to determine third position information corresponding to the center of the third adjacent sub-block, and determine parameters by using the same motion vector and the third position information of the third adjacent sub-block.

[0483] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of the first neighboring block.

[0484] According to the image decoding apparatus of the embodiment of the present disclosure, since the positions of neighboring blocks adjacent to the current block are reflected, the accuracy of sub-block unit prediction can be improved.

[0485] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of a first neighboring subblock adjacent to the current block in a first neighboring subblock included in the first neighboring block, and the first neighboring subblock may be obtained by dividing the first neighboring block into predetermined subblock units.

[0486] According to the image decoding device of the embodiment of the present disclosure, since the positions of adjacent subblocks belonging to adjacent blocks are reflected, the accuracy of subblock unit prediction can be improved.

[0487] An image decoding device according to an embodiment of the present disclosure includes: a memory storing one or more instructions; and at least one processor, which operates according to the one or more instructions to: compare motion vectors of a first adjacent block and a second adjacent block adjacent to each other among adjacent blocks adjacent to a current block, determine representative position information of the first adjacent block and the second adjacent block based on a result of the comparison indicating that the first motion vector of the first adjacent block and the second motion vector of the second adjacent block are the same, and determine parameters of a model for determining a motion vector by using one of the first motion vector and the second motion vector and the representative position information, determine parameters by using the first motion vector, the second motion vector, the first position information of the first adjacent block, and the second position information of the second adjacent block based on a result of the comparison indicating that the first motion vector and the second motion vector are different from each other, determine parameters by using the first motion vector, the second motion vector, the first position information of the first adjacent block, and the second position information of the second adjacent block, determine the motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and predict the current block by using the motion vector of the current sub-block.

[0488] According to the image decoding device of an embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved while considering all adjacent information.

[0489] According to an embodiment of the present disclosure, the representative position information may indicate coordinates corresponding to centers of the first neighboring block and the second neighboring block.

[0490] According to the image decoding device of the embodiment of the present disclosure, since the positions of adjacent subblocks having the same motion vector are reflected, the accuracy of prediction in subblock units can be improved.

[0491] According to an embodiment of the present disclosure, the first position information may indicate coordinates corresponding to the center of the first neighboring block, and the second position information may indicate coordinates corresponding to the center of the second neighboring block.

[0492] According to an embodiment of the present disclosure, at least one of the first neighboring block and the second neighboring block may be a codec unit or a sub-block unit included in the codec unit.

[0493] According to an embodiment of the present disclosure, the at least one processor may also be configured to obtain initial parameters of a model for determining a motion vector from a block reconstructed in a sub-block unit mode before the current block, refine the parameters by using the initial parameters, a motion vector and representative position information based on that the first motion vector and the second motion vector are the same, and refine the parameters by using the initial parameters, the first motion vector, the second motion vector, the first position information and the second position information based on that the first motion vector and the second motion vector are different from each other.

[0494] According to an embodiment of the present disclosure, an image encoding method includes: identifying at least two adjacent sub-blocks having the same motion vector and adjacent to each other from adjacent sub-blocks adjacent to a current block, determining a representative motion vector and representative position information of the identified at least two adjacent sub-blocks, determining parameters of a model for determining a motion vector by using the representative motion vector and the representative position information, determining a motion vector of the current sub-block based on position information of the current sub-block included in the current block and the determined parameters, and predicting the current block by using the motion vector of the current sub-block, wherein the representative motion vector is determined based on the same motion vector, and the representative position information indicates coordinates determined based on the identified at least two adjacent sub-blocks.

[0495] According to the image encoding method of an embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved while considering all adjacent information.

[0496] According to an embodiment of the present disclosure, the representative position information may include coordinates corresponding to centers of the identified at least two adjacent sub-blocks or coordinates of centers of adjacent blocks including the identified at least two adjacent sub-blocks.

[0497] According to the image encoding method of an embodiment of the present disclosure, when the coordinates corresponding to the centers of at least two identified adjacent sub-blocks are representative position information, the positions of adjacent sub-blocks adjacent to the current block can be reflected, and therefore, the accuracy of sub-block unit prediction can be improved, and when the coordinates of the centers of adjacent blocks including at least two identified adjacent sub-blocks are representative position information, adjacent sub-blocks having the same motion vector can belong to one adjacent block, and therefore, the positions of the adjacent blocks can be reflected, and the accuracy of sub-block unit prediction can be improved.

[0498] According to an embodiment of the present disclosure, determining parameters may further include obtaining initial parameters of a model for determining a motion vector from a block encoded in a subblock unit mode before the current block, and refining the parameters by using the initial parameters, the representative motion vector and the representative position information.

[0499] According to an embodiment of the present disclosure, the image encoding method may further include: determining each motion vector and each piece of position information of adjacent sub-blocks adjacent to the current block that have different motion vectors or are not adjacent to each other, wherein determining the parameters also includes: determining the parameters by further using each motion vector and each piece of position information.

[0500] According to an embodiment of the present disclosure, determining parameters may also include: obtaining initial parameters of a model for determining a motion vector from a block encoded in a sub-block unit mode before the current block, and refining the parameters by using the initial parameters, representative motion vectors, representative position information, individual motion vectors, and individual pieces of position information.

[0501] According to an embodiment of the present disclosure, an image encoding method includes: identifying a first neighboring block that is not encoded and decoded in units of sub-blocks and a second neighboring block that is encoded and decoded in units of sub-blocks from neighboring blocks adjacent to a current block, determining a first motion vector and first position information corresponding to the first neighboring block, determining parameters of a model for determining a motion vector based on the first motion vector and the first position information, determining a motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and predicting the current block by using the motion vector of the current sub-block, wherein the first position information indicates coordinates determined based on the first neighboring block.

[0502] According to the image encoding method of an embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved while considering all adjacent information.

[0503] According to an embodiment of the present disclosure, the image encoding method may further include: determining multiple second motion vectors and multiple second position information corresponding to second adjacent sub-blocks included in the second adjacent block, wherein determining the parameters includes: determining the parameters by further using the multiple second motion vectors and multiple second position information.

[0504] According to an embodiment of the present disclosure, based on the fact that at least two third adjacent sub-blocks in the second adjacent sub-blocks included in the second adjacent block have the same motion vector and are adjacent to each other, determining multiple second motion vectors and multiple second position information may also include: determining third position information corresponding to the center of the third adjacent sub-block, wherein determining the parameters also includes: determining the parameters by using the same motion vector and third position information of the third adjacent sub-block.

[0505] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of the first neighboring block.

[0506] According to the image encoding method of the embodiment of the present disclosure, since the positions of neighboring blocks adjacent to the current block are reflected, the accuracy of sub-block unit prediction can be improved.

[0507] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of a first neighboring sub-block adjacent to the current block in a first neighboring sub-block included in a first neighboring block, wherein the first neighboring sub-block is obtained by dividing the first neighboring block into predetermined sub-block units.

[0508] According to the image encoding method of the embodiment of the present disclosure, since the positions of adjacent subblocks belonging to adjacent blocks are reflected, the accuracy of subblock unit prediction can be improved.

[0509] An image encoding method according to an embodiment includes: comparing motion vectors of a first adjacent block and a second adjacent block adjacent to each other among adjacent blocks adjacent to a current block, indicating based on a result of the comparison that a first motion vector of the first adjacent block and a second motion vector of the second adjacent block are the same, determining representative position information of the first adjacent block and the second adjacent block, determining parameters of a model for determining a motion vector by using one of the first motion vector and the second motion vector and the representative position information, indicating based on a result of the comparison that the first motion vector and the second motion vector are different from each other, determining parameters by using the first motion vector, the second motion vector, the first position information of the first adjacent block, and the second position information of the second adjacent block, determining a motion vector of a current subblock based on the position information of a current subblock included in the current block and the determined parameters, and predicting the current block by using the motion vector of the current subblock.

[0510] According to the image encoding method of the embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved.

[0511] According to an embodiment of the present disclosure, the representative position information may indicate coordinates corresponding to centers of the first neighboring block and the second neighboring block.

[0512] According to the image encoding method of the embodiment of the present disclosure, since the positions of adjacent sub-blocks having the same motion vector are reflected, the accuracy of prediction in sub-block units can be improved.

[0513] According to an embodiment of the present disclosure, the first position information may indicate coordinates corresponding to the center of the first neighboring block, and the second position information may indicate coordinates corresponding to the center of the second neighboring block.

[0514] According to an embodiment of the present disclosure, at least one of the first neighboring block and the second neighboring block may be a codec unit or a sub-block unit included in the codec unit.

[0515] According to an embodiment of the present disclosure, determining parameters may also include: obtaining initial parameters of a model for determining a motion vector from a block encoded in a sub-block unit mode before the current block, refining the parameters by using the initial parameters, a motion vector and representative position information based on that the first motion vector and the second motion vector are the same motion vector, and refining the parameters by using the initial parameters, the first motion vector, the second motion vector, the first position information and the second position information based on that the first motion vector and the second motion vector are different from each other.

[0516] According to an embodiment of the present disclosure, an image encoding device includes a memory storing one or more instructions, and at least one processor, which operates according to the one or more instructions to: identify at least two adjacent sub-blocks having the same motion vector and adjacent to each other from adjacent sub-blocks adjacent to a current block, determine a representative motion vector and representative position information of the identified at least two adjacent sub-blocks, determine parameters of a model for determining a motion vector by using the representative motion vector and the representative position information, determine the motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and predict the current block by using the motion vector of the current sub-block, wherein the representative motion vector is determined based on the same motion vector, and the representative position information indicates coordinates determined based on the identified at least two adjacent sub-blocks.

[0517] According to the image encoding device of an embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved while considering all adjacent information.

[0518] According to an embodiment of the present disclosure, the representative position information may include coordinates corresponding to centers of the identified at least two adjacent sub-blocks or coordinates of centers of adjacent blocks including the identified at least two adjacent sub-blocks.

[0519] According to the image encoding device of an embodiment of the present disclosure, when the coordinates corresponding to the centers of at least two identified adjacent sub-blocks are representative position information, the positions of adjacent sub-blocks adjacent to the current block can be reflected, and therefore, the accuracy of sub-block unit prediction can be improved, and when the coordinates of the centers of adjacent blocks including at least two identified adjacent sub-blocks are representative position information, adjacent sub-blocks having the same motion vector can belong to one adjacent block, and therefore, the positions of the adjacent blocks can be reflected, and the accuracy of sub-block unit prediction can be improved.

[0520] According to an embodiment of the present disclosure, the at least one processor may also be configured to obtain initial parameters of a model for determining a motion vector from a block encoded in a sub-block unit mode before the current block, and refine the parameters by using the initial parameters, representative motion vectors, and representative position information.

[0521] According to an embodiment of the present disclosure, the at least one processor may also be configured to determine respective motion vectors and respective pieces of position information of adjacent sub-blocks adjacent to the current block that have different motion vectors or are not adjacent to each other, and determine parameters by further using the respective motion vectors and respective pieces of position information.

[0522] According to an embodiment of the present disclosure, the at least one processor may also be configured to obtain initial parameters of a model for determining a motion vector from a block encoded in a sub-block unit mode before the current block, and refine the parameters by using the initial parameters, representative motion vectors, representative position information, individual motion vectors, and individual pieces of position information.

[0523] According to an embodiment of the present disclosure, an image encoding device includes a memory storing one or more instructions, and at least one processor, which operates according to the one or more instructions to: identify a first neighboring block that is not encoded and decoded in units of sub-blocks and a second neighboring block that is encoded and decoded in units of sub-blocks from neighboring blocks adjacent to a current block, determine a first motion vector and first position information corresponding to the first neighboring block, determine parameters of a model for determining a motion vector based on the first motion vector and the first position information, determine a motion vector of the current sub-block based on the position information of the current sub-block included in the current block and the determined parameters, and predict the current block by using the motion vector of the current sub-block, wherein the first position information indicates coordinates determined based on the first neighboring block.

[0524] According to the image encoding device of an embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved while considering all adjacent information.

[0525] According to an embodiment of the present disclosure, the at least one processor may also be configured to determine multiple second motion vectors and multiple second position information corresponding to the second adjacent sub-blocks included in the second adjacent block, and determine parameters by further using the multiple second motion vectors and multiple second position information.

[0526] According to an embodiment of the present disclosure, based on the fact that at least two third adjacent sub-blocks in the second adjacent sub-blocks included in the second adjacent block have the same motion vector, the at least one processor may also be configured to determine third position information corresponding to the center of the third adjacent sub-block, and determine parameters by using the same motion vector and the third position information of the third adjacent sub-block.

[0527] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of the first neighboring block.

[0528] According to the image encoding apparatus of the embodiment of the present disclosure, since the positions of neighboring blocks adjacent to the current block are reflected, the accuracy of sub-block unit prediction can be improved.

[0529] According to an embodiment of the present disclosure, the first position information may include coordinates corresponding to the center of a first neighboring sub-block adjacent to the current block in a first neighboring sub-block included in a first neighboring block, wherein the first neighboring sub-block is obtained by dividing the first neighboring block into predetermined sub-block units.

[0530] According to the image encoding device of the embodiment of the present disclosure, since the positions of adjacent subblocks belonging to adjacent blocks are reflected, the accuracy of subblock unit prediction can be improved.

[0531] According to an embodiment of the present disclosure, an image encoding device includes a memory storing one or more instructions, and at least one processor, which operates according to the one or more instructions to: compare motion vectors of a first adjacent block and a second adjacent block adjacent to each other among adjacent blocks adjacent to a current block, indicate based on a result of the comparison that a first motion vector of the first adjacent block and a second motion vector of the second adjacent block are the same, determine representative position information of the first adjacent block and the second adjacent block, determine parameters of a model for determining a motion vector by using one of the first motion vector and the second motion vector and the representative position information, and indicate based on a result of the comparison that the first motion vector and the second motion vector are different from each other, determine parameters by using the first motion vector, the second motion vector, the first position information of the first adjacent block and the second position information of the second adjacent block, determine a motion vector of a current sub-block based on the position information of a current sub-block included in the current block and the determined parameters, and predict the current block by using the motion vector of the current sub-block.

[0532] According to the image encoding device of an embodiment of the present disclosure, since representative information of adjacent subblocks having the same motion vector is determined and the adjacent subblocks are used as one subblock while considering all adjacent subblocks, the accuracy of subblock unit prediction can be improved while considering all adjacent information.

[0533] According to an embodiment of the present disclosure, the representative position information may indicate coordinates corresponding to centers of the first neighboring block and the second neighboring block.

[0534] According to the image encoding device of the embodiment of the present disclosure, since the positions of adjacent subblocks having the same motion vector are reflected, the accuracy of subblock unit prediction can be improved.

[0535] According to an embodiment of the present disclosure, the first position information may indicate coordinates corresponding to the center of the first neighboring block, and the second position information may indicate coordinates corresponding to the center of the second neighboring block.

[0536] According to an embodiment of the present disclosure, at least one of the first neighboring block and the second neighboring block may be a codec unit or a sub-block unit included in the codec unit.

[0537] According to an embodiment of the present disclosure, the at least one processor may also be configured to obtain initial parameters of a model for determining a motion vector from a block encoded in a sub-block unit mode before the current block, refine the parameters by using the initial parameters, a motion vector and representative position information based on that the first motion vector and the second motion vector are the same motion vector, and refine the parameters by using the initial parameters, the first motion vector, the second motion vector, the first position information and the second position information based on that the first motion vector and the second motion vector are different from each other.

[0538] The machine-readable storage medium may be provided as a non-transitory storage medium. Here, "non-transitory" means that the storage medium does not include a signal (e.g., an electromagnetic wave) and is tangible, but does not distinguish whether the data is stored in the storage medium semi-permanently or temporarily. For example, a "non-transitory storage medium" may include a buffer in which data is temporarily stored.

[0539] According to an embodiment of the present disclosure, the method according to various embodiments of the present disclosure may be provided in a computer program product. The computer program product may be a product that can be purchased between a seller and a buyer. The computer program product may be distributed in the form of a machine-readable storage medium (e.g., a compact disc read-only memory (CD-ROM)), or distributed online (e.g., downloaded or uploaded) via an application store, or distributed directly between two user devices (e.g., smart phones). When distributed online, at least a portion of the computer program product (e.g., a downloadable application) may be temporarily generated or at least temporarily stored in a machine-readable storage medium (such as a memory of a manufacturer's server, an application store's server, or a relay server).

Claims

1. An image decoding method, comprising: identifying at least two neighboring sub-blocks having the same motion vector and being adjacent to each other from among a plurality of neighboring sub-blocks adjacent to the current block (2610); Determining representative motion vectors and representative position information corresponding to the at least two adjacent sub-blocks (2620); determining parameters of a model for determining a motion vector based on the representative motion vector and the representative position information (2630); Determine a motion vector of the current subblock based on position information of the current subblock included in the current block and the parameter (2640); and Predicting a current block based on a motion vector of a current sub-block (2650), wherein the representative motion vector is determined based on the same motion vector, and The representative position information indicates coordinates determined based on the at least two adjacent sub-blocks.

2. The image decoding method according to claim 1, wherein: The coordinates correspond to at least one of centers of the at least two adjacent sub-blocks or a center of an adjacent block including the at least two adjacent sub-blocks.

3. The image decoding method according to claim 1 or 2, wherein: Determining the parameters further comprises: obtaining initial parameters of the model from a block reconstructed in a sub-block unit mode before the current block; and The parameters are refined based on the initial parameters, the representative motion vectors, and the representative position information.

4. The image decoding method according to any one of claims 1 to 3, further comprising: determining respective motion vectors and respective pieces of position information corresponding to adjacent subblocks having different motion vectors or not adjacent to each other among the plurality of adjacent subblocks, Wherein, determining the parameters further comprises determining the parameters using the respective motion vectors and the respective pieces of position information.

5. The image decoding method according to any one of claims 1 to 4, wherein: Determining the parameters further comprises: obtaining initial parameters of the model from a block reconstructed in a sub-block unit mode before the current block; and The parameters are refined based on initial parameters, representative motion vectors, representative position information, the respective motion vectors and the respective pieces of position information.

6. An image decoding method, comprising: Identifying, from neighboring blocks adjacent to the current block, a first neighboring block that is not encoded and decoded in units of subblocks and a second neighboring block that is encoded and decoded in units of subblocks (2710); Determining a first motion vector and first position information corresponding to a first neighboring block (2720); determining parameters of a model for determining a motion vector based on the first motion vector and the first position information (2730); determining a motion vector of the current subblock based on position information of the current subblock included in the current block and the determined parameter (2740); and Predicting the current block using the motion vector of the current sub-block (2750), The first position information indicates coordinates determined based on the first adjacent block.

7. The image decoding method according to claim 6, further comprising: determining a plurality of second motion vectors and a plurality of second position information corresponding to a plurality of second adjacent subblocks included in the second adjacent block, Wherein, determining the parameter further includes further determining the parameter based on a plurality of second motion vectors and a plurality of second position information.

8. The image decoding method according to claim 6 or 7, wherein: Based on the fact that at least two third adjacent sub-blocks among the plurality of second adjacent sub-blocks have the same motion vector and are adjacent to each other, determining the plurality of second motion vectors and the plurality of second position information further comprises: determining third position information corresponding to the centers of the at least two third adjacent sub-blocks, Wherein, determining the parameter further comprises determining the parameter based on the same motion vector and third position information.

9. The image decoding method according to any one of claims 6 to 8, wherein: The first position information includes coordinates corresponding to a center of the first neighboring block.

10. The image decoding method according to any one of claims 6 to 9, wherein: The first position information includes coordinates corresponding to a center of an area including a first neighboring subblock adjacent to the current block among a plurality of first neighboring subblocks included in the first neighboring block, The first adjacent sub-block is obtained by dividing the first adjacent block into predetermined sub-block units.

11. An image decoding method, comprising: comparing motion vectors of a first neighboring block and a second neighboring block that are adjacent to each other among neighboring blocks adjacent to the current block (2810); determining representative position information corresponding to the first neighboring block and the second neighboring block based on the result of the comparison indicating that the first motion vector of the first neighboring block and the second motion vector of the second neighboring block are the same motion vector, and determining parameters of a model for determining a motion vector based on the representative position information and one of the first motion vector and the second motion vector (2820); determining the parameter based on the first motion vector, the second motion vector, the first position information about the first neighboring block, and the second position information about the second neighboring block based on an indication from the comparison result that the first motion vector and the second motion vector are different from each other (2830); determining a motion vector of the current subblock based on position information about the current subblock included in the current block and the determined parameter (2840); and The current block is predicted based on the motion vector of the current sub-block (2850).

12. The image decoding method according to claim 11, wherein: The representative position information indicates coordinates corresponding to centers of the first neighboring block and the second neighboring block.

13. The image decoding method according to claim 11 or 12, wherein: The first position information indicates coordinates corresponding to the center of the first neighboring block, The second position information indicates coordinates corresponding to the center of the second neighboring block.

14. The image decoding method according to any one of claims 11 to 13, wherein: At least one of the first neighboring block or the second neighboring block is a codec unit or a sub-block unit included in the codec unit.

15. The image decoding method according to any one of claims 11 to 14, wherein: Determining the parameters further comprises: obtaining initial parameters of the model from a block reconstructed in a sub-block mode before the current block; Based on the first motion vector and the second motion vector being the same motion vector, refining the parameters using initial parameters, the same motion vector and representative position information; and Based on the fact that the first motion vector and the second motion vector are different from each other, the parameters are refined by using the initial parameters, the first motion vector, the second motion vector, the first position information, and the second position information.