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

By performing layered splitting and inter-frame prediction methods on images, the problem of low image encoding and decoding efficiency in the prior art is solved, and efficient processing of high-resolution or high-quality images is achieved.

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

Patent Information

Application Number
CN202510129355.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-08-24
Filing Date
2019-08-26
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently encode or decode high-resolution or high-quality image content, especially when processing data units of various shapes.

Method used

By layering the image to determine multiple luminance blocks based on the split shape mode of the current luminance image, inter prediction is performed using the motion information of these luminance blocks and corresponding chrominance blocks to generate prediction blocks and reconstruction blocks.

Benefits of technology

It realizes efficient encoding and decoding of high-resolution or high-quality image content, improving the efficiency of image compression and recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119893133A_ABST
    Figure CN119893133A_ABST
Patent Text Reader

Abstract

Provided is an image decoding method, comprising: determining a rectangular current chroma block corresponding to a current luma block included in one of a plurality of luma blocks; determining one piece of motion information of the current chrominance block and an adjacent chrominance block by using motion information of the current chrominance block and the adjacent chrominance block adjacent to the current chrominance block; and performing inter prediction on the current chrominance block and the adjacent chrominance block by using one piece of motion information of the current chrominance block and the adjacent chrominance block to generate prediction blocks of the current chrominance block and the adjacent chrominance block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with the application date of August 26, 2019, application number 201980067876.9, and invention name “Method and device for image encoding and method and device for image decoding”. Technical Field

[0002] The method and apparatus according to the embodiment can encode or decode an image by using coding units, prediction units, or transformation units, which have various shapes and are included in the image. The method and apparatus according to the embodiment can encode or decode an image by performing inter-frame prediction on data units having various shapes. Background Art

[0003] With the development and widespread popularity of hardware that can reproduce and store high-resolution or high-quality image content, there is a high demand for codecs that can efficiently encode or decode high-resolution or high-quality image content. The encoded image content can be decoded to be reproduced. Currently, methods for effectively compressing high-resolution or high-quality image content are implemented. For example, an effective image compression method is implemented by processing the image to be encoded in an arbitrary method.

[0004] Various data units may be used to compress an image, and there may be an inclusion relationship between the data units. The data units used to compress an image may be split by various methods, and the image may be encoded or decoded by determining the optimal data unit according to the characteristics of the image. Summary of the invention

[0005] Technical Solution

[0006] According to an embodiment of the present disclosure, an image decoding method includes: determining a plurality of luminance blocks in a current luminance image by hierarchically splitting the current luminance image based on a split shape pattern of the current luminance image; determining a current chrominance block of a rectangular shape corresponding to the current luminance block included in one of the plurality of luminance blocks; determining a motion information segment of the current chrominance block and chrominance blocks adjacent to the current chrominance block by using motion information of the current chrominance block and the adjacent chrominance blocks; performing inter-frame prediction on the current chrominance block and the adjacent chrominance blocks by using the motion information segments of the current chrominance block and the adjacent chrominance blocks to generate a prediction block of the current chrominance block and the adjacent chrominance blocks; and generating a reconstructed block of the current chrominance block and the adjacent chrominance blocks based on the prediction block of the current chrominance block and the adjacent chrominance blocks, wherein the motion information of the current chrominance block used to determine the motion information segment of the current chrominance block and the adjacent chrominance blocks corresponds to the motion information of the current luminance block, and the motion information of the adjacent chrominance blocks used to determine the motion information segment of the current chrominance block and the adjacent chrominance blocks corresponds to the motion information of the adjacent luminance blocks corresponding to the adjacent chrominance blocks.

[0007] The chroma format of the current chroma image including the current chroma block may be 4:2:2.

[0008] The current chroma block and the adjacent chroma block may be blocks adjacent to each other in the left-right direction.

[0009] The motion information of the current chroma block and the adjacent chroma blocks may include a motion vector of the current chroma block and a motion vector of an adjacent chroma block adjacent to the current chroma block, and the motion information segments of the current chroma block and the adjacent chroma blocks may include a motion vector for the current chroma block and the adjacent chroma blocks, and the value of the motion vector of the current chroma block and the adjacent chroma blocks may be an average value of the motion vector of the current chroma block and the motion vector of the adjacent chroma blocks.

[0010] The height of the current chroma block may be equal to the height of the current luminance block, and the width of the current chroma block may be half the width of the current luminance block.

[0011] When the size of the current luminance block is 4×4, the size of the current chrominance block is 2×4.

[0012] The image decoding method may further include generating a prediction block of the current luminance block by performing motion compensation on the current luminance block using a motion vector of the current luminance block.

[0013] Generating a prediction block for the current luminance block may include:

[0014] determining a refined motion vector for the current luma block by using the motion vector of the current luma block based on a motion vector refinement search in a reference luma image of the current luma image; and

[0015] By performing motion compensation on the current luma block using the refined motion vector of the current luma block,

[0016] Determining a refined motion vector for the current luma block may include performing a motion vector refinement search using reconstructed pixel values ​​of a reference luma block in a reference luma image indicated by the motion vector of the current luma block without using reconstructed neighboring pixel values ​​of the reference luma block in the reference luma image.

[0017] Performing the motion vector refinement search may include determining neighboring pixel values ​​of the reference luminance block in the reference luminance image based on the reconstructed pixel values ​​of the reference luminance block, and performing the motion vector refinement search using the determined reconstructed pixel values ​​and the neighboring pixel values ​​of the reference luminance block in the reference luminance image.

[0018] The image decoding method may further include: obtaining a parity check flag indicating a parity check of a coefficient level in a current luminance block from a bit stream; and

[0019] Based on the value of the parity flag, a residual block of the current luminance block is generated by performing relevant inverse quantization on information of the transform coefficients of the current luminance block,

[0020] The parity flags may be obtained from the bit stream by limiting the number of parity flags to be obtained according to a predetermined scanning order.

[0021] The split shape mode may include a mode based on a split shape mode including one of four-split, two-split, and three-split.

[0022] According to an embodiment of the present disclosure, an image decoding apparatus may include at least one processor configured to: determine a plurality of luminance blocks in a current luminance image by hierarchically splitting the current luminance image based on a split shape mode of the current luminance image;

[0023] determining a current chrominance block of a rectangular shape corresponding to a current luminance block included in one of a plurality of luminance blocks;

[0024] Determine motion information segments of the current chroma block and chroma blocks adjacent to the current chroma block by using motion information of the current chroma block and adjacent chroma blocks;

[0025] Performing inter-frame prediction on the current chroma block and the adjacent chroma block by using the motion information segments of the current chroma block and the adjacent chroma block to generate prediction blocks of the current chroma block and the adjacent chroma block; and

[0026] Based on the prediction blocks of the current chroma block and the adjacent chroma blocks, reconstructed blocks of the current chroma block and the adjacent chroma blocks are generated.

[0027] The motion information of the adjacent chroma block used to determine the motion information segments of the current chroma block and the adjacent chroma block corresponds to the motion information of the adjacent luminance block corresponding to the adjacent chroma block.

[0028] The chroma format of the current chroma image including the current chroma block is 4:2:2, the height of the current chroma block may be equal to the height of the current luminance block, and the width of the current chroma block may be half the width of the current luminance block.

[0029] The at least one processor may be further configured to: generate a prediction block of the current luminance block by performing motion compensation on the current luminance block using a motion vector of the current luminance block,

[0030] During generation of a prediction block for a current luma block, refining a search based on a motion vector in a reference luma image of the current luma image, determining a refined motion vector for the current luma block by using the motion vector of the current luma block; and

[0031] Motion compensation is performed on the current luma block by using the refined motion vector of the current luma block.

[0032] During determining, by at least one processor, a refined motion vector for a current luminance block,

[0033] The motion vector refinement search is performed using reconstructed pixel values ​​of a reference luma block in a reference luma image indicated by a motion vector of a current luma block without using reconstructed neighboring pixel values ​​of the reference luma block in the reference luma image.

[0034] The at least one processor may be further configured to: obtain from the bitstream a parity flag indicating a parity of a coefficient level in a current luma block; and

[0035] Based on the value of the parity flag, a residual block of the current luminance block is generated by performing relevant inverse quantization on information of the transform coefficients of the current luminance block,

[0036] The parity flags may be obtained from the bit stream by limiting the number of parity flags to be obtained according to a predetermined scanning order.

[0037] According to an embodiment of the present disclosure, an image encoding method may include: determining a plurality of brightness blocks in a current brightness image by hierarchically splitting the current brightness image based on a split shape mode of the current brightness image;

[0038] determining a current chrominance block of a rectangular shape corresponding to a current luminance block included in one of a plurality of luminance blocks;

[0039] Determine motion information segments of the current chroma block and chroma blocks adjacent to the current chroma block by using motion information of the current chroma block and adjacent chroma blocks;

[0040] Performing inter-frame prediction on the current chroma block and the adjacent chroma block by using the motion information segments of the current chroma block and the adjacent chroma block to generate prediction blocks of the current chroma block and the adjacent chroma block; and

[0041] Generate residual blocks of the current chroma block and the adjacent chroma block based on the prediction blocks of the current chroma block and the adjacent chroma block, and encode the residual blocks of the current chroma block and the adjacent chroma block,

[0042] The motion information of the neighboring chroma block used to determine the motion information segments of the current chroma block and the neighboring chroma block may correspond to the motion information of the neighboring luminance block corresponding to the neighboring chroma block.

[0043] According to an embodiment of the present disclosure, a computer program for an image decoding method may be recorded on a computer-readable recording medium.

[0044] According to one embodiment of the present disclosure, an image decoding method includes: when the prediction mode of a coding unit is an affine mode, obtaining a first motion vector of a first N×N luminance subblock in the coding unit; obtaining a second motion vector of a second N×N luminance subblock in the coding unit, wherein the second N×N luminance subblock is on the right side of the first N×N luminance subblock; determining a chrominance motion vector using an average motion vector determined by averaging the first motion vector and the second motion vector; and obtaining a predicted sample of an N×N chrominance subblock using the chrominance motion vector and a reference image, wherein the N×N chrominance subblock includes a first N / 2×N chrominance subblock corresponding to the first N×N luminance subblock and a second N / 2×N chrominance subblock corresponding to the second N×N luminance subblock.

[0045] According to one embodiment of the present disclosure, an image decoding device includes at least one processor, which is configured to: when the prediction mode of the coding unit is an affine mode, obtain a first motion vector of a first N×N luminance subblock in the coding unit; obtain a second motion vector of a second N×N luminance subblock in the coding unit, wherein the second N×N luminance subblock is on the right side of the first N×N luminance subblock; determine a chrominance motion vector using an average motion vector determined by averaging the first motion vector and the second motion vector; and obtain a predicted sample of an N×N chrominance subblock using the chrominance motion vector and a reference image, wherein the N×N chrominance subblock includes a first N / 2×N chrominance subblock corresponding to the first N×N luminance subblock and a second N / 2×N chrominance subblock corresponding to the second N×N luminance subblock.

[0046] According to one embodiment of the present disclosure, an image encoding method includes: when the prediction mode of a coding unit is an affine mode, obtaining a first motion vector of a first N×N luminance subblock in the coding unit; obtaining a second motion vector of a second N×N luminance subblock in the coding unit, wherein the second N×N luminance subblock is on the right side of the first N×N luminance subblock; determining a chrominance motion vector using an average motion vector determined by averaging the first motion vector and the second motion vector; and obtaining a predicted sample of an N×N chrominance subblock using the chrominance motion vector and a reference image, wherein the N×N chrominance subblock includes a first N / 2×N chrominance subblock corresponding to the first N×N luminance subblock and a second N / 2×N chrominance subblock corresponding to the second N×N luminance subblock.

[0047] According to one embodiment of the present disclosure, a non-transitory computer-readable storage medium stores a bitstream, the bitstream being encoded by an image encoding method, the image encoding method comprising: when a prediction mode of a coding unit is an affine mode, obtaining a first motion vector of a first N×N luminance subblock in the coding unit; obtaining a second motion vector of a second N×N luminance subblock in the coding unit, wherein the second N×N luminance subblock is on the right side of the first N×N luminance subblock; determining a chrominance motion vector using an average motion vector determined by averaging the first motion vector and the second motion vector; and obtaining a predicted sample of an N×N chrominance subblock using the chrominance motion vector and a reference image, wherein the N×N chrominance subblock includes a first N / 2×N chrominance subblock corresponding to the first N×N luminance subblock and a second N / 2×N chrominance subblock corresponding to the second N×N luminance subblock. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1A is a block diagram of an image decoding apparatus according to various embodiments.

[0049] Figure 1B is a flowchart of an image decoding method according to various embodiments.

[0050] Figure 1C is a block diagram of an image decoder according to various embodiments.

[0051] Figure 2A is a block diagram of an image encoding apparatus according to various embodiments.

[0052] Figure 2B A flowchart of an image encoding method according to various embodiments is shown.

[0053] Figure 2C is a block diagram of an image encoder according to various embodiments.

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

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

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

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

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

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

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

[0061] Fig.10 It is shown that shapes into which the second coding unit can be split are restricted when a second coding unit having a non-square shape (determined when an image decoding device splits a first coding unit) satisfies a predetermined condition according to an embodiment.

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

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

[0064] Fig.13 A process of determining a depth of a coding unit as a shape and a size of a coding unit change when a coding unit is recursively split in order to determine a plurality of coding units according to an embodiment is illustrated.

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

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

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

[0068] FIG. 17A to FIG. 17C is a diagram for describing a process of determining a shape of a chroma block and motion information for motion compensation of the chroma block when the format of a chroma image is 4:2:2 according to an embodiment.

[0069] FIG. 18A to FIG. 18Cis a diagram for describing a problem of memory bandwidth increase during decoding based on a decoder-side motion vector refinement (DMVR) technique and a method of solving the problem according to an embodiment.

[0070] Fig.19 is a diagram for describing a delay problem that may occur during decoding based on a DMVR technology according to an embodiment and a method of solving the problem.

[0071] FIG. 20A to FIG. 20C is a diagram for describing a correlation quantization process according to an embodiment.

[0072] FIG. 21A to FIG. 21D is a diagram showing a residual encoding syntax structure according to various embodiments of the present disclosure. DETAILED DESCRIPTION

[0073] Best Mode

[0074] According to an embodiment of the present disclosure, an image decoding method includes: determining a plurality of luminance blocks in a current luminance image by hierarchically splitting the current luminance image based on a split shape pattern of the current luminance image; determining a current chrominance block of a rectangular shape corresponding to a current luminance block included in one of the plurality of luminance blocks; determining a motion information segment of the current chrominance block and a chrominance block adjacent to the current chrominance block by using motion information of the current chrominance block and a chrominance block adjacent to the current chrominance block; performing inter-frame prediction on the current chrominance block and the adjacent chrominance block by using the motion information segment of the current chrominance block and the adjacent chrominance block to generate a prediction block of the current chrominance block and the adjacent chrominance block; and generating a reconstructed block of the current chrominance block and the adjacent chrominance block based on the prediction block of the current chrominance block and the adjacent chrominance block, wherein the motion information of the current chrominance block used to determine the motion information segment of the current chrominance block and the adjacent chrominance block corresponds to the motion information of the current luminance block, and the motion information of the adjacent chrominance block used to determine the motion information segment of the current chrominance block and the adjacent chrominance block corresponds to the motion information of the adjacent luminance block corresponding to the adjacent chrominance block.

[0075] According to an embodiment of the present disclosure, an image decoding apparatus may include at least one processor configured to: determine a plurality of luminance blocks included in a current luminance image by hierarchically splitting the current luminance image based on a split shape mode of the current luminance image;

[0076] determining a current chrominance block of a rectangular shape corresponding to a current luminance block included in one of a plurality of luminance blocks;

[0077] Determine motion information segments of the current chroma block and the adjacent chroma blocks by using motion information of the current chroma block and the chroma blocks adjacent to the current chroma block;

[0078] Performing inter-frame prediction on the current chroma block and the adjacent chroma block by using the motion information segments of the current chroma block and the adjacent chroma block to generate prediction blocks of the current chroma block and the adjacent chroma block; and

[0079] Based on the prediction blocks of the current chroma block and the adjacent chroma blocks, reconstructed blocks of the current chroma block and the adjacent chroma blocks are generated.

[0080] The motion information of the neighboring chroma block used to determine the motion information segments of the current chroma block and the neighboring chroma block may correspond to the motion information of the neighboring luminance block corresponding to the neighboring chroma block.

[0081] According to an embodiment of the present disclosure, an image encoding method may include: determining a plurality of luminance blocks included in the current luminance image by hierarchically splitting the current luminance image based on a split shape mode of the current luminance image;

[0082] determining a current chrominance block of a rectangular shape corresponding to a current luminance block included in one of a plurality of luminance blocks;

[0083] Determine motion information segments of the current chroma block and the adjacent chroma blocks by using motion information of the current chroma block and the chroma blocks adjacent to the current chroma block;

[0084] Performing inter-frame prediction on the current chroma block and the adjacent chroma block by using the motion information segments of the current chroma block and the adjacent chroma block to generate prediction blocks of the current chroma block and the adjacent chroma block; and

[0085] Residual blocks of the current chroma block and the adjacent chroma block are generated based on the prediction blocks of the current chroma block and the adjacent chroma block, and the residual blocks of the current chroma block and the adjacent chroma block are encoded.

[0086] The motion information of the neighboring chroma block used to determine the motion information segments of the current chroma block and the neighboring chroma block may correspond to the motion information of the neighboring luminance block corresponding to the neighboring chroma block.

[0087] According to an embodiment of the present disclosure, a computer program for an image decoding method may be recorded on a computer-readable recording medium.

[0088] Public method

[0089] The advantages and features of the embodiments of the present disclosure set forth herein and methods for achieving them will be apparent from the following description of the embodiments of the present disclosure in conjunction with the accompanying drawings. However, the present disclosure is not limited to the embodiments of the present disclosure described herein, and may be embodied in many different forms. The embodiments of the present disclosure are provided only to make the present disclosure thorough and complete, and to fully convey the scope of the present disclosure to those of ordinary skill in the art.

[0090] The terms used herein will be briefly described, and then the disclosed embodiments set forth herein will be described in detail.

[0091] In this specification, taking into account the functions of the present disclosure, common terms that are currently widely used may be selected where possible, but non-common terms may be selected based on the intentions, precedents, or new technologies of those skilled in the art. Some terms may be selected arbitrarily by the applicant. In this case, the meanings of these terms will be explained in detail in the corresponding parts of the present disclosure. Therefore, the terms used herein should not be defined based on their names but on their meanings and the entire context of the present disclosure.

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

[0093] It will be understood that when an element is referred to as “comprising” another element, the element may further include other elements unless otherwise stated.

[0094] The term "unit" used in this article should be understood as a software or hardware component that performs a specific function. However, the term "unit" is not limited to software or hardware. The term "unit" can be configured to be stored in an addressable storage medium or reproduce one or more processors. Therefore, the term "unit" can include, for example, components, such as software components, object-oriented software components, class components and task components, processing, functions, attributes, programs, subroutines, program code segments, drivers, firmware, microcodes, circuits, data, databases, data structures, tables, arrays and parameters. The functions provided in components and "units" can be combined into a small number of components and "units", or divided into subcomponents and "subunits".

[0095] According to an embodiment of the present disclosure, a "unit" can be implemented with a processor and a memory. The term "processor" should be broadly interpreted to include a general-purpose processor, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a controller, a microcontroller, a state machine, etc. In some cases, a "processor" may refer to an application-specific 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 DSP and a microprocessor, a combination of multiple microprocessors, a combination of one or more microprocessors and a DSP core, or a combination of any other configuration.

[0096] The term "memory" should be interpreted broadly to include any electronic component capable of storing electronic information. The term "memory" may refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), nonvolatile RAM (NVRAM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable PROM (EEPROM), flash memory, magnetic or optical data storage devices, registers, etc. When the processor is able to read information from and / or write information to the memory, the memory may be said to be in electronic communication with the processor. Memory that is integrated into a processor is in electronic communication with the processor.

[0097] When the term "image" is used herein, it should be understood to include static images such as still images of a video and moving images such as a video, that is, dynamic images.

[0098] The term "sample" as used herein refers to data assigned to a sample position of an image, i.e., data to be processed. For example, a sample can be a pixel value in the spatial domain and a transform coefficient in the transform domain. A unit comprising at least one sample can be defined as a block.

[0099] Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement the embodiments of the present disclosure. For clarity, parts not related to the description of the present disclosure are omitted in the accompanying drawings.

[0100] 1 to 2 Fig.21D An image encoding device and an image decoding device as well as an image encoding method and an image decoding method according to various embodiments are described. Figures 3 to 16 , a method for determining a data unit of an image according to various embodiments will be described with reference to FIGS. 1 and 2 and FIG. 17A to FIG. 21D , an image encoding device and an image decoding device as well as an image encoding method and an image decoding method for performing inter-frame prediction on data units determined in various shapes according to various embodiments will be described.

[0101] Hereinafter, a coding or decoding method and apparatus for coding or decoding an image based on various shape data units according to an embodiment of the present disclosure will be described with reference to FIGS. 1 and 2 .

[0102] Figure 1A is a block diagram of an image decoding apparatus according to various embodiments.

[0103] The image decoding device 100 according to various embodiments may include an inter-frame predictor 105 and an image decoder 110. The inter-frame predictor 105 and the image decoder 110 may include at least one processor. In addition, the inter-frame predictor 105 and the image decoder 110 may include a memory storing instructions to be executed by at least one processor. The image decoder 110 and the inter-frame predictor 105 may be implemented as separate hardware components, or the image decoder 110 may include the inter-frame predictor 105.

[0104] A history-based motion vector prediction technique according to an embodiment will be described below.

[0105] The history-based motion vector prediction technology refers to a technology for storing a history-based motion information list including N (N is a positive integer) previously decoded motion information segments (preferably, the last N decoded motion information segments among the previously decoded motion information) in a buffer, and performing motion vector prediction based on the history-based motion information list.

[0106] The inter predictor 105 may generate an advanced motion vector prediction (AMVP) candidate list or a merge candidate list by using at least some motion information included in the history based motion information list.

[0107] Similar to the above-mentioned history-based motion vector prediction technique, the inter-frame predictor 105 may store a history-based motion information list including motion information of N previously decoded affine blocks in a buffer.

[0108] In this case, the affine block is a block smaller than the block size having motion information in a motion information unit (preferably, a sub-block unit or a pixel unit), and the motion information in the motion information unit may be generated based on an affine model. For example, the affine block may be a block having motion information generated according to an affine model-based motion compensation mode. In this case, the affine model-based motion compensation mode refers to a mode in which motion compensation is performed using one of various affine motion models such as a 4-parameter affine motion model and a 6-parameter affine motion model for motion compensation.

[0109] When the same motion information is generated multiple times, the inter predictor 105 may assign a relatively high priority to the same motion information in the history-based motion information list.

[0110] The inter-frame predictor 105 may generate an affine advanced motion vector prediction (AMVP) candidate list or an affine merge candidate list by using at least some affine motion information included in the history-based motion information list. In this case, all candidates included in the affine AMVP candidate list or the affine merge candidate list may be determined based on the motion information included in the history-based motion information list, or the candidates included in the history-based motion information list may be added to the affine AMVP candidate list or the affine merge candidate list with a higher or lower priority than the existing candidates.

[0111] The inter predictor 105 may derive the motion information of the current block from the motion information of one of the candidates included in the history-based motion information list.

[0112] For example, the motion information of the current block may be derived through an extrapolation process. That is, the inter-frame predictor 105 may derive the motion information of the current block from the motion information of one of the candidates included in the history-based motion information list by performing an extrapolation process similar to that performed by calculating an affine inheritance model using adjacent motion vectors. The inter-frame predictor 105 may derive the motion information of the current block from the motion information of one of the candidates included in the history-based motion information list, and therefore, unlike when an affine candidate is generated according to the prior art, the motion vectors of the adjacent blocks (e.g., the motion vectors of the block TL located on the upper left side of the adjacent block, the block TR located on the upper right side of the adjacent block, and the block BL located on the lower left side of the adjacent block) may not be accessed. Therefore, it is not necessary to determine whether the motion information of the adjacent blocks is available, thereby reducing the hardware implementation cost.

[0113] In this case, the history-based motion information list of the affine model may be managed by a first-in-first-out (FIFO) method.

[0114] In addition, the inter-frame predictor 105 may use the motion vector included in the history-based motion information list of the radial model for normal merge mode processing or AMVP mode processing. That is, the inter-frame predictor 105 may generate a motion information candidate list for normal merge mode processing or AMVP mode processing by using the motion vector included in the history-based motion information list of the affine model.

[0115] In this case, normal merge mode processing or AMVP mode processing refers to processing that does not substantially use motion information generated according to an affine model-based motion compensation mode. In this case, it can be understood that normal merge mode processing or AMVP mode processing refers to merge mode processing or AMVP mode processing disclosed in a standard such as the HEVC standard or the VVC standard.

[0116] The candidate re-ranking will be described below.

[0117] When there are multiple affine motion information segments available for neighboring blocks of the current block, the inter-frame predictor 105 may generate an affine merge candidate list or an affine AMVP candidate list so that a high priority is assigned to the motion information of a block having a larger size (larger length, height, or area) in the multiple affine motion information segments. Alternatively, the inter-frame predictor 105 may determine the priority of each neighboring block in the affine merge candidate list or the affine AMVP candidate list based on the width of the upper neighboring block having affine motion information. The inter-frame predictor 105 may determine the priority of each neighboring block in the affine merge candidate list or the affine AMVP candidate list based on the height of the left neighboring block having affine motion information.

[0118] The long-distance affine candidates will be described below.

[0119] To derive inherited affine motion information of the current block, the inter predictor 105 may search for neighboring blocks having affine motion information (hereinafter referred to as neighboring affine blocks), and use an extrapolation technique on the current block based on the affine motion information of the neighboring affine blocks.

[0120] The inter predictor 105 may derive inherited affine motion information of the current block by using blocks away from the current block and neighboring affine blocks.

[0121] For example, the affine blocks located above, to the left, and to the upper left of the current block may be scanned, and the affine motion information of one of the scanned affine blocks may be added to the affine AMVP candidate list or the affine merge candidate list. In this case, one of the scanned affine blocks may not be added immediately, but may be added to the affine AMVP candidate list or the affine merge candidate list after performing extrapolation processing on the motion information of the affine block.

[0122] Affine motion compensation based on motion information of a temporal affine candidate block will be described below.

[0123] The inter-frame predictor 105 can use the motion information of three positions on the current block to derive the affine motion information of the current block. In this case, the three positions can be the upper left (TL) corner, the upper right (TR) corner, and the lower left (BL) corner. However, the embodiments of the present disclosure are not limited to this, and the inter-frame predictor 105 can determine the three positions in time. For example, the inter-frame predictor 105 can determine the TL angle, TR angle, and BL angle of a collocated block as three surrounding positions. In this case, the collocated block refers to a block included in an image decoded before the current image and located at the same position as the current block. When the reference index is different, the motion information can be scaled. The inter-frame predictor 105 can derive the affine motion information of the current block based on the motion information of the three positions determined in time.

[0124] In order to determine the motion information for deriving the affine motion information of the current block from the reference frame, the inter-frame predictor 105 may determine the motion information of three positions on the corresponding block as the motion information for deriving the affine motion information of the current block, instead of the three positions on the collocated block. In this case, the corresponding block refers to a block located at a position away from the current block by an offset defined by a motion vector. The motion vector can be obtained from blocks located around the current block in time and space.

[0125] The inter predictor 105 may temporally determine at least some of the three positions and determine the remaining positions by using inherited candidates or motion information of blocks spatially adjacent to the current block.

[0126] When the collocated block or corresponding block of the reference frame has no motion information, the inter predictor 105 may search for motion information of a neighboring block of the collocated block or corresponding block and determine motion information for deriving affine motion information of the current block by using the searched motion information.

[0127] The inter predictor 105 may perform the following operation to fill the internal area of ​​the current block with the affine motion information by using the inherited affine candidate.

[0128] The inter-frame predictor 105 may determine three points in the adjacent blocks as starting points, and derive the motion vector of the internal area of ​​the current block based on these starting points. Alternatively, the inter-frame predictor 105 may first derive the motion vector of the three points in the current block, and derive the motion vector of the remaining area of ​​the current block based on the motion vector of the three points.

[0129] The adaptive motion vector resolution technique will be described below.

[0130] The adaptive motion vector resolution technique refers to a technique for representing the resolution of a motion vector difference (hereinafter referred to as MVD) relative to a current coding unit to be decoded. In this case, information about the resolution of the MVD may be transmitted by a bitstream signal.

[0131] The inter predictor 105 is not limited to signaling information (preferably, index information) about the resolution of the MVD, and may derive the resolution of the current block based on at least one of the MVD of the previous block and the MVD of the current block.

[0132] For example, when the MVD of the current block is an odd number, the inter predictor 105 may determine the resolution of the MVD of the current block to be 4 or 1 / 4. The inter predictor 105 may determine the resolution of the MVD of the current block by combining explicit signaling and implicit derivation.

[0133] For example, the inter-frame predictor 105 may determine whether the resolution of the MVD of the current block is 1 / 4 based on a flag obtained from the bitstream. That is, when the flag is a first value, it may indicate that the resolution of the MVD of the current block is 1 / 4, and when the flag is a second value, it may indicate that the resolution of the MVD of the current block is not 1 / 4. When the flag is the second value, the inter-frame predictor 105 may derive the resolution of the MVD of the current block based on the MVD.

[0134] Specifically, when the AMVR flag amvr_flag obtained from the bitstream is 0, the inter-frame predictor 105 may determine that a quarter-pixel motion accuracy is used for the MVD of the current block. That is, when the AMVR flag amvr_flag is 0, the inter-frame predictor 105 may perform the same MVD decoding process as disclosed in a standard such as the HEVC standard or the VVC standard.

[0135] When the AMVR flag amvr_flag is 1, the inter predictor 105 may determine that motion accuracy of another pixel is used for the MVD of the current block.

[0136] When the AMVR flag amvr_flag is 1, the inter-frame predictor 105 may additionally perform a derivation process of a motion vector resolution between one pixel precision and four pixel precision. The image decoder 110 may first decode the MVD of the current block, and the inter-frame predictor 105 may determine the resolution of the MVD of the current block by checking the least significant bit (LSB) of the MVD of the current block. When the LSB is 0, the inter-frame predictor 105 may determine a resolution of one pixel as the resolution of the MVD of the current block. When the LSB is 1, the inter-frame predictor 105 may determine a resolution of four pixels as the resolution of the MVD of the current block. The embodiments of the present disclosure are not limited thereto, and when the LSB is 0, the resolution of the MVD of the current block may be determined as a resolution of four pixels, and when the LSB is 1, the resolution of the MVD of the current block may be determined as a resolution of one pixel.

[0137] The inter-frame predictor 105 may determine the MVD of the current block based on the resolution of the MVD of the current block. That is, the inter-frame predictor 105 may determine the resolution of the MVD of the current block based on the information about the MVD of the current block obtained from the bitstream, and determine the MVD of the current block based on the information about the MVD of the current block and the resolution of the MVD of the current block.

[0138] For example, when the resolution of the MVD of the current block is determined as a resolution of one pixel, the inter-frame predictor 105 may determine the MVD of the current block based on the following equation 1. In this case, when the MVD is 1, it may mean 1 / 4 pixel. The MVD on the right side of equation 1 may be a value obtained by decoding information about the MVD of the current block included in the bitstream.

[0139] [Equation 1]

[0140] MVD=(MVD>>1)*4

[0141] When the resolution of the MVD of the current block is determined as a resolution of four pixels, the inter-frame predictor 105 may determine the MVD of the current block based on the following equation 2. In this case, when the MVD is 1, it may mean 1 / 4 pixel. The MVD on the right side of equation 1 may be a value obtained by decoding information about the MVD of the current block included in the bitstream.

[0142] [Equation 2]

[0143] MVD (MVD>>1)*16

[0144] A history-based motion vector prediction technique according to an embodiment will be described below.

[0145] The image decoder 110 may store the most recently decoded N intra prediction modes in a history-based list. When the same intra prediction mode appears in the history-based list, the image decoder 110 may determine the priority of the intra prediction mode to be high. The image decoder 110 may determine the intra prediction mode in the history-based list based on index or flag information included in the bitstream. The image decoder 110 may derive the most probable mode (MPM) by using the intra prediction mode in the history-based list.

[0146] The image decoder 110 may store the most recently decoded N modes in a history-based list. In this case, the stored N modes may be, but are not limited to, intra mode, inter mode, decoder-side motion vector refinement (DMVR) mode, affine mode, skip mode, etc. The image decoder 110 may obtain information in the form of an index indicating a mode in the history-based list from a bitstream, decode the information, and determine a mode of a current block based on the decoded information.

[0147] The image decoder 110 may determine the context model based on the history-based list. For example, the image decoder 110 may store the most recently decoded N modes (e.g., prediction modes such as inter mode or intra prediction mode) in the history-based list, and derive a context model for entropy decoding information about the prediction mode of the current block based on the modes included in the history-based list.

[0148] The motion information candidate list reordering technique will be described below.

[0149] The inter-frame predictor 105 may determine the priority of the adjacent candidate blocks in the AMVP candidate list or the merge candidate list based on the size of the adjacent candidate blocks. For example, the inter-frame predictor 105 may determine that the priority of the adjacent candidate blocks in the AMVP candidate list or the merge candidate list is higher as the width, height or area of ​​the adjacent candidate blocks increases. Specifically, when the width of the adjacent candidate block above the current block is large, the inter-frame predictor 105 may determine the priority of the adjacent candidate block to be high. When the height of the adjacent candidate block on the left side of the current block is large, the inter-frame predictor 105 may determine the priority of the adjacent candidate block to be high.

[0150] Motion compensation of a chroma block according to an embodiment will be described below.

[0151] The image decoder 110 can determine a plurality of brightness blocks in the current brightness image by hierarchically splitting the current brightness image based on the split shape mode of the current brightness image. The split shape mode of the current brightness image can be provided in units of blocks. That is, after the current block is split into a plurality of blocks according to the split shape mode of the current block, the corresponding blocks can be further split according to the split shape modes of the plurality of blocks. The split shape mode of the current brightness image can be determined by obtaining information about the split shape mode from the bitstream. The split shape mode can be a mode based on a split shape mode including one of four splits, two splits, and three splits.

[0152] The image decoder 110 may determine a current rectangular chrominance block corresponding to a current luminance block having a square shape included in one of a plurality of luminance blocks. In this case, the current luminance block having a square shape may be a sub-block included in a coding unit of a luminance component, particularly a motion information unit in a motion compensation mode based on an affine model, but the embodiment is not limited thereto. For example, the current luminance block having a square shape may have a size of N×N (N is an integer). The size of the current luminance block having a square shape may be 4×4, but is not limited thereto. The current luminance block having a square shape has been described above, but the embodiments of the present disclosure are not limited thereto, and the current luminance block may have a rectangular shape. For example, the current luminance block may have a size of 2N×N or N×2N (N is an integer), such as 8×4 or 4×8.

[0153] The height of the current chroma block having a rectangular shape may be the same as the height of the current luminance block, and the width of the current chroma block may be half the width of the current luminance block, but the embodiments of the present disclosure are not limited thereto, and the width of the current chroma block may be the same as the width of the current luminance block, and the height of the current chroma block may be half the height of the current luminance block. For example, when the size of the current luminance block is 4×4, the size of the chroma block may be 4×2 or 2×4. In this case, the chroma format of the chroma image including the current chroma block may be 4:2:2.

[0154] However, the embodiments of the present disclosure are not limited thereto, and the height of the rectangular current chroma block may be half the height of the current luminance block, and its width may be half the width of the current luminance block. For example, the current chroma block corresponding to the current rectangular luminance block of size 8×4 or 4×8 may have a size of 4×2 or 2×4. In this case, the chroma format of the chroma image including the current chroma block may be 4:2:0. The inter-frame predictor 105 may determine the motion information of the current chroma block and the adjacent chroma blocks by using the motion information of the current chroma block and the chroma blocks adjacent to the current chroma block. In this case, the motion information of the current chroma block used to determine the motion information segment of the current chroma block and the adjacent chroma block may correspond to the motion information of the current luminance block. In addition, the motion information of the adjacent chroma blocks used to determine the motion information segment of the current chroma block and the adjacent chroma blocks may correspond to the motion information of the adjacent luminance blocks corresponding to the adjacent chroma blocks.

[0155] For example, the motion information of the current chroma block may be the same as the motion information of the current luminance block, and the motion information of the adjacent chroma block may be the same as the motion information of the adjacent luminance block.

[0156] In this case, the current chroma block and the adjacent chroma block may be blocks adjacent to each other in the left-right direction. However, the embodiments of the present disclosure are not limited thereto, and the current chroma block and the adjacent chroma block may be blocks adjacent to each other vertically. The block as a combination of the current chroma block and the adjacent chroma block may be a square block and have a size of 4×4, but the embodiments of the present disclosure are not limited thereto.

[0157] The motion information of the current chroma block and blocks adjacent to the current chroma block may include motion vectors of the current chroma block and the adjacent chroma blocks, and the motion information segments of the current chroma block and the adjacent chroma blocks may include motion vectors of the current chroma block and the adjacent chroma blocks.

[0158] The inter predictor 105 may determine an average value of the motion vector of the current chroma block and the motion vectors of the neighboring chroma blocks as the values ​​of the motion vectors of the current chroma block and the neighboring chroma blocks.

[0159] The inter-frame predictor 105 may perform motion compensation on the chrominance block by using different filters in the horizontal direction and the vertical direction. In this case, the filter may vary according to its coefficient and the number of filter taps.

[0160] The inter predictor 105 may determine the motion information of the chroma block by merging the motion information of the two chroma blocks, and thus may have a low memory bandwidth when performing motion compensation.

[0161] Alternatively, the inter-frame predictor 105 may perform interpolation based on the motion information of the rectangular chroma block to determine the motion information of a square chroma block smaller than the rectangular chroma block. For example, the inter-frame predictor 105 may perform interpolation based on the motion information of the 2×4 chroma block to determine the motion information of the 2×2 chroma block.

[0162] The inter predictor 105 may perform inter prediction on the current chroma block and the adjacent chroma blocks by generating prediction blocks of the current chroma block and the adjacent chroma blocks using motion information of the current chroma block and the adjacent chroma blocks.

[0163] The following will refer to Fig.17A and Fig. 17C An embodiment of the present disclosure in which the inter-frame predictor 105 determines a chroma block corresponding to a current luminance block and an embodiment of the present disclosure in which motion information of the chroma block is described when the chroma format of the chroma image is 4:2:2.

[0164] The decoder-side motion vector refinement (DMVR) technique will be described below. The DMVR technique refers to a technique for determining a refined motion vector by determining a reference block of a reference frame based on a motion vector and searching an adjacent region (e.g., a block extending two pixels in the upper, lower, left, and right directions). In this case, when the inter-frame predictor 105 searches the adjacent region to determine the refined motion vector, the pixel value of the adjacent region should be fetched additionally. Therefore, the memory bandwidth can be increased.

[0165] The inter-frame predictor 105 may generate a prediction block of the current luminance block or chrominance block by performing motion compensation on the current luminance block or chrominance block using the motion vector of the current luminance block. In this case, the inter-frame predictor 105 may refine the search based on the motion vector in the reference luminance image or the reference chrominance image of the current luminance or chrominance image, and determine the refined motion vector of the current luminance or chrominance block by using the motion vector of the current luminance or chrominance block.

[0166] Specifically, the inter-frame predictor 105 may perform a motion vector refinement search using a reconstructed pixel value of a reference luminance block or a reference chrominance block in a reference luminance image or a reference chrominance image indicated by a motion vector of a current luminance block or a current chrominance block, without using a reconstructed neighboring pixel value of a reference luminance block or a reference chrominance block in a reference luminance image or a reference chrominance image. Memory bandwidth may be reduced by performing a motion vector refinement search without using a reconstructed neighboring pixel value.

[0167] The following will refer to 18A to 18C Described are problems that may occur when the inter-frame predictor 105 performs decoding according to the DMVR technique and embodiments of the present disclosure for solving the problems.

[0168] When the size of the current block is greater than a predetermined size, the inter-frame predictor 105 may determine not to perform inter-frame prediction based on the DMVR technique on the current block. That is, when inter-frame prediction is performed by the DMVR technique, the smaller the block is compared to the size of the block, the larger the block to be expanded to perform the motion vector refinement search, and therefore, for smaller blocks, the rate of increase of the memory bandwidth in the DMVR is higher. To solve this problem, inter-frame prediction based on the DMVR technique may be performed on the current block having a size greater than a predetermined size to prevent an increase in the memory bandwidth.

[0169] When the inter-frame predictor 105 performs inter-frame prediction based on the DMVR technology, a delay problem may occur. That is, the inter-frame predictor 105 may perform inter-frame prediction on a neighboring block to be decoded after the current block by using motion information refined by the DMVR technology only after performing motion vector refinement based on the DMVR technology on the current block.

[0170] In order to solve the delay problem, the inter-frame predictor 105 may decode a block to be decoded after the current block using unrefined motion information obtained from the bitstream instead of refined motion information obtained through an inter-frame prediction process based on the DMVR technique for inter-frame prediction of the current block. However, when the refined motion vector is not used, a loss may occur.

[0171] To prevent loss, during the derivation of the motion vector of the current block based on AMVP or the merge candidate list, the inter-frame prediction unit 105 may determine the priority of the motion vector of the neighboring block that is inter-frame predicted based on the DMVR technology to be low, thereby preventing the motion vector of the current block from being derived using the motion vector of the neighboring block.

[0172] Alternatively, when a predetermined number or more of blocks in the neighboring blocks of the current block are inter-predicted based on the DMVR technique, the inter-predictor 105 may determine not to perform inter-prediction based on the DMVR technique on the current block. Therefore, the number of unrefined motion vectors to be used during the derivation of motion vectors for blocks to be decoded later can be reduced.

[0173] The following will refer to Fig.19 The delay problem that occurs when performing decoding based on DMVR technology and the method for solving the delay problem are described in detail.

[0174] The triangular prediction mode will be described below. The triangular prediction mode refers to a mode in which a coding unit is split in a diagonal direction and prediction is performed based on two triangular parts (or triangular prediction units) obtained by dividing the coding unit in the diagonal direction.

[0175] In this case, the diagonal direction may include a first direction from the upper left corner of the coding unit to its lower right corner and a second direction from the upper right corner of the coding unit to its lower left corner. Therefore, based on the diagonal direction, there may be two types of triangular parts. Each of the two triangular parts may have a motion vector. Motion compensation may be performed on the two triangular parts based on their motion vectors, and the two motion compensated triangular parts may be merged into one block. A mask may be used to prevent a sudden transition during the merging of the two motion compensated triangular parts.

[0176] The inter-frame predictor 105 may split the coding unit of the block into two square or rectangular units in the horizontal or vertical direction instead of using the triangular part obtained in the triangular prediction mode, and perform motion compensation using the motion vectors of the two square or rectangular units. The inter-frame predictor 105 may split the coding unit in the horizontal or vertical direction to prevent the memory bandwidth from increasing.

[0177] When the coding unit is divided into two parts in the diagonal direction, the inter-frame predictor 105 can split the coding unit only based on the diagonal direction of ±45 degrees relative to the horizontal direction. That is, the inter-frame predictor 105 can split the coding unit into two parts in the diagonal direction of ±45 degrees relative to the center part of the coding unit. Therefore, when a block that is long in the vertical / horizontal direction is split, it is possible to prevent the block from being split into a direction close to the vertical / horizontal direction.

[0178] The inter-frame predictor 105 can search for motion vectors of neighboring blocks of the current coding unit, and split the current coding unit based on the size of the motion vectors of the searched neighboring blocks. For example, the inter-frame predictor 105 can detect the change in the size of the motion vector of the upper neighboring block while searching for the upper neighboring block in the horizontal direction from the upper left neighboring block to the upper right neighboring block, and when the degree of change in the movement of the upper neighboring block is greater than a predetermined level, the upper neighboring block can be determined as the starting point or end point of the segmentation. In addition, the inter-frame predictor 105 can detect the change in the size of the motion vector of the left neighboring block while searching for the left neighboring block in the vertical direction from the upper left neighboring block to the lower left neighboring block, and when the degree of change in the movement of the left neighboring block is greater than a predetermined level, the left neighboring block can be determined as the starting point or end point of the segmentation. The inter-frame predictor 105 can split the current coding unit based on the starting point or end point of the division.

[0179] The related inverse quantization technique will be described below. The related inverse quantization technique is a technique for performing inverse quantization on all coefficients using one of two inverse quantization units, and inverse quantization can be performed by the two inverse quantization units using different quantization parameters.

[0180] The image decoder 110 can determine one of multiple states based on the parity check of the transform coefficient currently to be decoded or at least one of the parity checks of the transform coefficient previously decoded, and determine the inverse quantization unit (or the quantization parameter used by the inverse quantization unit) to be used for the transform coefficient currently to be decoded based on the determined state.

[0181] The image decoder 110 may adaptively perform correlated inverse quantization based on a scan area within the block currently being decoded. For example, when the current transform coefficient is located in the upper left corner area of ​​the block currently being decoded, decoding based on the correlated inverse quantization technique may be performed on the current transform coefficient, and inverse quantization may be performed on information about the transform coefficients of the remaining area of ​​the block currently being decoded based on a single quantization parameter.

[0182] The image decoder 110 may adaptively perform correlation inverse quantization based on at least one of the size of the block currently being decoded, the position of the current block (or current subblock), or the position of the current transform coefficient. For example, when the size of the current block is greater than a predetermined size, the image decoder 110 may decode the block currently being decoded based on the correlation inverse quantization technique.

[0183] When the currently decoded block is a luminance block, the image decoder 110 may perform relevant inverse quantization, and when the currently decoded block is a chrominance block, may perform inverse quantization on information about a transform coefficient of the currently decoded block based on a single quantization parameter.

[0184] The image decoder 110 may determine that the number of quantization parameters (QPs) to be used for correlated inverse quantization is greater than 2, and that the number of states is greater than 4. For example, the image decoder 110 may determine that the number of QPs to be used for correlated inverse quantization is 3, and that the number of states is 8.

[0185] When the parity flag is not used, the image decoder 110 may adaptively perform decoding based on the level size and the related inverse quantization technique. For example, when the previously decoded level is greater than N, the image decoder 110 may determine not to perform inverse quantization based on the related inverse quantization technique when decoding the level of the current transform coefficient. In this case, N may be determined based on at least one of a quantization parameter, a block size, or a bit depth of a sample.

[0186] The image decoder 110 may determine the structure of the state machine based on previously decoded blocks.

[0187] The image decoder 110 may determine a context model for entropy decoding at least one of the significant coefficient flags, gt1_flag, or gt2_flag of the current transform coefficient based on at least one of the significant coefficient flags, gt1_flag, or gt2_flag of the neighboring coefficients having the same quantization parameter as the current transform coefficient. Alternatively, the image decoder 110 may determine a context model coefficient for entropy decoding at least one of the significant coefficient flags, gt1_flag, or gt2_flag of the current transform coefficient based on at least one of the significant coefficient flags, gt1_flag, or gt2_flag of the neighboring coefficients having the same state as the current transform. The image decoder 110 may perform entropy decoding in consideration of the relationship between coefficients having similar quantization parameters as described above, thereby improving decoding efficiency.

[0188] The image decoder 110 may obtain a parity check flag indicating the parity check of the transform coefficient level in the current luminance / chrominance block from the bitstream. The image decoder 110 may generate a residual block of the current luminance / chrominance block by performing relevant inverse quantization on the information of the transform coefficient of the current luminance / chrominance block based on the parity check flag. In this case, the parity check flag may be obtained from the bitstream by limiting the number of parity check flags to be obtained according to a predetermined scanning order. The image decoder 110 may limit the number of parity check flags to be obtained according to the scanning order by limiting the area where the parity check flag is to be obtained. For example, when the current scanning position is within a predetermined range and the effective coefficient flag at the current scanning position has a value of 1, the image decoder 110 may obtain the parity check flag from the bitstream. Alternatively, when the value of the current scanning position is greater than or less than a predetermined value and the effective coefficient flag at the current scanning position has a value of 1, the image decoder 110 may obtain the parity check flag from the bitstream.

[0189] Optionally, the image decoder 110 may determine a first value, count the number of parity flags obtained each time a parity flag is obtained from a bit stream, compare the counted number of flags with the first value, and when the counted number of flags is greater than the first value, determine that a parity flag is not obtained.

[0190] Optionally, whenever a parity flag is obtained from a bit stream, the image decoder 110 may subtract 1 from the first value, and when the result of subtracting 1 from the first value is zero, it is determined that the parity flag is not obtained. However, it has been described above that only the number of parity flags obtained from the bit stream is counted by the image decoder 110, but the embodiments of the present disclosure are not limited thereto, and the number of significant coefficient flags, gtX_flag, etc., which are non-parity flags, may be counted together. Here, gtX_flag may be a flag indicating whether the absolute value of the level of the transform coefficient at the current scanning position is greater than X.

[0191] The following will refer to FIG. 21A to FIG. 21D An embodiment of the present disclosure in which the image decoder 110 limits the number of parity flags obtained according to a predetermined scanning order is described in detail.

[0192] The image decoder 110 may limit the number of parity flags obtained in a predetermined scanning order based on a context model, thereby limiting the total number of bins of parity flags to be entropy decoded, thereby reducing decoding complexity.

[0193] A method of determining the resolution of the MVD of the current block and the value of the MVD similar to the related inverse quantization technique will be described below.

[0194] The image decoder 110 may determine one of a plurality of states based on at least one of the parity check of the MVD of the current block and the parity check of the MVD of the previous block, and determine the resolution of the MVD of the current block based on the determined state. In this case, the determined resolution of the MVD of the current block may correspond to a quantization parameter of an inverse quantization unit to be used for a related inverse quantization technique, and the MVD of the current block / previous decoded block may correspond to the level of a coefficient currently being decoded or decoded by a related quantization technique.

[0195] The image decoder 110 may generate a reconstructed block of the current luminance block or the current chrominance block based on the prediction block of the current luminance block or the current chrominance block. The image decoder 110 may obtain information about a residual block of the current luminance block or the current chrominance block from a bitstream, decode the information about the residual block, and generate a residual block of the current luminance block or the current chrominance block based on the decoded information about the residual block of the current luminance block or the current chrominance block. The image decoder 110 may generate a reconstructed block of the current luminance block or the current chrominance block based on the residual block of the current luminance block or the current chrominance block and the prediction block of the current luminance block or the current chrominance block.

[0196] Figure 1B is a flowchart of an image decoding method according to various embodiments.

[0197] In operation S105 , the image decoding apparatus 100 may determine a plurality of luminance blocks included in the current luminance image by hierarchically splitting the current luminance image based on a split shape pattern of the current luminance image.

[0198] In operation S110 , the image decoding device 100 may determine a current chrominance block having a rectangular shape and corresponding to a current luminance block included in one of a plurality of luminance blocks.

[0199] In operation S115, the image decoding apparatus 100 may determine motion information segments of the current chroma block and adjacent chroma blocks by using motion information of the current chroma block and chroma blocks adjacent to the current chroma block. The adjacent chroma blocks may be blocks corresponding to adjacent luminance blocks adjacent to the current luminance block.

[0200] In operation S120, the image decoding apparatus 100 may perform inter prediction on the current chroma block and the neighboring chroma blocks by using motion information segments of the current chroma block and the neighboring chroma blocks to generate prediction blocks of the current chroma block and the neighboring chroma blocks.

[0201] In operation S125 , the image decoding device 100 may generate a reconstructed block of the current chroma block and the adjacent chroma block based on the predicted blocks of the current chroma block and the adjacent chroma block.

[0202] Figure 1C is a block diagram of an image decoder 6000 according to various embodiments.

[0203] The image decoder 6000 according to various embodiments performs operations required for the image decoder 110 of the image decoding device 100 to decode image data.

[0204] Reference Figure 1C, the entropy decoder 6150 parses the encoded image data to be decoded and the encoding information required for decoding from the bit stream 6050. The encoded image data is a quantized transform coefficient, and the inverse quantization unit 6200 and the inverse transformer 6250 reconstruct residual data from the quantized transform coefficient.

[0205] The intra predictor 6400 performs intra prediction on each block. The inter predictor 6350 performs inter prediction on each block by using a reference image obtained from the reconstructed picture buffer 6300. The spatial domain data of the block of the current image included in the bitstream 6050 can be reconstructed by adding the residual data and prediction data of each block generated by the intra predictor 6400 or the inter predictor 6350, and the deblocker 6450 and the sample adaptive offset (SAO) executor 6500 can perform loop filtering on the reconstructed data of the spatial domain so that the filtered reconstructed image can be output. The reconstructed image stored in the reconstructed picture buffer 6300 can be output as a reference image. The inter predictor 105 may include the intra predictor 6400. In order for the image decoding device 100 to encode the image data, the image decoder 6000 according to various embodiments may perform the operation of each stage on each block.

[0206] Figure 2A is a block diagram of an image encoding apparatus according to various embodiments.

[0207] According to various embodiments, the image encoding device 200 may include an inter-frame predictor 205 and an image encoder 210 .

[0208] The inter-frame predictor 205 and the image encoder 210 may include at least one processor. In addition, the inter-frame predictor 205 and the image encoder 210 may include a memory storing instructions to be executed by at least one processor. The image encoder 210 may be implemented as hardware separate from the inter-frame prediction unit 205, or may include the inter-frame predictor 205.

[0209] A history-based motion vector prediction technique according to an embodiment will be described below.

[0210] The history-based motion vector prediction technology refers to a technology that stores a history-based motion information list of N previously encoded motion information segments (preferably, the N last encoded motion information segments among the previously encoded motion information) in a buffer, and performs motion vector prediction based on the history-based motion information list.

[0211] The inter predictor 105 may generate an advanced motion vector prediction (AMVP) candidate list or a merge candidate list by using at least some motion information included in the history based motion information list.

[0212] Similar to the above-mentioned history-based motion vector prediction technique, the inter-frame predictor 105 may store a history-based motion information list of motion vector information of N previously encoded affine blocks in a buffer.

[0213] When the same motion information is generated multiple times, the inter predictor 205 may assign a relatively high priority to the same motion information in the history-based motion information list.

[0214] The inter predictor 205 may generate an affine advanced motion vector prediction (AMVP) candidate list or an affine merge candidate list by using at least some affine motion information included in the history-based motion information list. In this case, all candidates included in the affine AMVP candidate list or the affine merge candidate list may be determined based on the motion information included in the history-based motion information list, or the candidates included in the history-based motion information list may be added to the affine AMVP candidate list or the affine merge candidate list with a higher or lower priority than the existing candidates.

[0215] The inter-frame predictor 205 may derive the motion information of the current block from the motion information of one of the candidates included in the history-based motion information list. For example, the motion information of the current block may be derived through an extrapolation process. That is, the inter-frame predictor 205 may derive the motion information of the current block from the motion information of one of the candidates included in the history-based motion information list by performing an extrapolation process similar to that performed by calculating an affine inheritance model using adjacent motion vectors. The inter-frame predictor 205 may derive the motion information of the current block from the motion information of one of the candidates included in the history-based motion information list, and therefore, unlike when an affine candidate is generated according to the prior art, the motion vectors of the adjacent blocks (e.g., the motion vectors of the block TL located on the upper left side of the adjacent block, the block TR located on the upper right side of the adjacent block, and the block BL located on the lower left side of the adjacent block) may not be accessed. Therefore, it is not necessary to determine whether the motion information of the adjacent blocks is available, thereby reducing the hardware implementation cost.

[0216] In this case, the history-based motion information list of the affine model may be managed by a first-in-first-out (FIFO) method.

[0217] In addition, the inter-frame predictor 205 may use the motion vector included in the history-based motion information list for normal merge mode processing or AMVP mode processing. That is, the inter-frame predictor 205 may generate a motion information candidate list for normal merge mode processing or AMVP mode processing by using the motion vector included in the history-based motion information list. In this case, the normal merge mode processing or AMVP mode processing refers to processing that does not basically use motion information generated by an affine model-based motion compensation mode. In this case, it can be understood that the normal merge mode processing or AMVP mode processing refers to the merge mode processing or AMVP mode processing disclosed in a standard such as the HEVC standard or the VVC standard.

[0218] The candidate re-ranking will be described below.

[0219] When there are multiple affine motion information segments available for neighboring blocks of the current block, the inter-frame predictor 205 may generate an affine merge candidate list or an affine AMVP candidate list so that a high priority is assigned to the motion information of a block having a large size (large length, height, or area) in the multiple affine motion information segments. Alternatively, the inter-frame predictor 205 may determine the priority of each neighboring block in the affine merge candidate list or the affine AMVP candidate list based on the width of the upper neighboring block having the affine motion information. The inter-frame predictor 205 may determine the priority of each neighboring block in the affine merge candidate list or the affine AMVP candidate list based on the height of the left neighboring block having the affine motion information.

[0220] The long-distance affine candidates will be described below.

[0221] To derive inherited affine motion information of the current block, the inter predictor 205 may search for neighboring blocks having affine motion information (hereinafter referred to as neighboring affine blocks) and perform an extrapolation technique on the current block based on the affine motion information of the neighboring affine blocks.

[0222] The inter-frame predictor 205 can derive the inherited affine motion information of the current block by using the affine blocks far from the current block and the adjacent affine blocks. For example, the affine blocks located on the upper, left, and upper-left sides of the current block can be scanned, and the affine motion information of one of the scanned affine blocks can be added to the affine AMVP candidate list or the affine merge candidate list. In this case, one of the scanned affine blocks may not be added immediately, but may be added to the affine AMVP candidate list or the affine merge candidate list after performing extrapolation processing on the motion information of the affine block.

[0223] Affine motion compensation based on motion information of a temporal affine candidate block will be described below.

[0224] The inter-frame predictor 105 can use the motion information of three positions on the current block to derive the affine motion information of the current block. In this case, the three positions can be the upper left (TL) corner, the upper right (TR) corner, and the lower left (BL) corner. However, the present disclosure is not limited to this, and the inter-frame predictor 105 can determine the time position as three positions. For example, the inter-frame predictor 105 can determine the TL angle, the TR angle, and the BL angle of the collocated block as three surrounding positions. In this case, the collocated block refers to a block included in an image decoded before the current image and located at the same position as the current block. When the reference index is different, the motion information can be scaled. The inter-frame predictor 105 can derive the affine motion information of the current block based on the motion information of the three positions determined in time.

[0225] In order to determine the motion information for deriving the affine motion information of the current block from the reference frame, the inter-frame predictor 105 may determine the motion information of three positions on the corresponding block as the motion information for deriving the affine motion information of the current block, instead of the motion information of three positions on the collocated block. In this case, the corresponding block refers to a block located at a position away from the current block at an offset defined by the motion vector. The motion vector can be obtained from blocks located around the current block in time and space.

[0226] The inter predictor 105 may temporally determine at least some of the three positions and determine the remaining positions by using inherited candidates or motion information of blocks spatially adjacent to the current block.

[0227] When the collocated block or corresponding block of the reference frame has no motion information, the inter predictor 205 may search for motion information of a neighboring block of the collocated block or corresponding block and determine motion information for deriving affine motion information of the current block by using the searched motion information.

[0228] The inter predictor 205 may perform the following operation to fill the internal area of ​​the current block with the affine motion information by using the inherited affine candidate.

[0229] The inter-frame predictor 205 may determine three points in the neighboring blocks as starting points, and derive a motion vector of the internal area of ​​the current block based on the starting points.

[0230] Optionally, the inter-frame predictor 205 may first derive motion vectors of three points in the current block, and derive motion vectors of the remaining area of ​​the current block based on the motion vectors of the three points.

[0231] The adaptive motion vector resolution technique will be described below.

[0232] The adaptive motion vector resolution technique refers to a technique for representing the resolution of a motion vector difference (hereinafter referred to as MVD) relative to a current coding unit to be encoded. In this case, information on the resolution of the MVD may be transmitted by a bitstream signal.

[0233] The image encoding device 200 is not limited to encoding information about the resolution of the MVD (preferably, index information) and generating a bitstream including the encoded information, and can derive the current resolution based on at least one of the MVD of the previous block or the MVD of the current block.

[0234] For example, when the resolution of the MVD of the current block is 4 or 1 / 4, the image encoder 210 may encode the MVD of the current block so that the MVD of the current block is an odd number.

[0235] The image encoder 210 may encode information for explicit signaling so that the image decoding apparatus 100 may determine the resolution of the MVD of the current block according to a combination of explicit signaling and implicit induction.

[0236] For example, the image encoder 210 may encode a flag based on whether the resolution of the MVD of the current block is 1 / 4. When the flag is a first value, it may indicate that the resolution of the MVD of the current block is 1 / 4, and when the flag is a second value, it may indicate that the resolution of the MVD of the current block is not 1 / 4. When the image encoder 210 derives the resolution of the MVD of the current block based on the MVD, the image encoder 210 may encode the value of the flag as the second value.

[0237] Specifically, when it is determined that the precision of the motion of a quarter pixel is to be used for the MVD of the current block, the image encoder 210 may encode the AMVR flag amvr_flag as 0 and generate a bitstream including the encoded AMVR flag amvp_flag. When it is determined that the precision of the motion of another pixel is to be used for the MVD of the current block, the image encoder 210 may encode the AMVR flag amvr_flag as 1 and generate a bitstream including the encoded AMVR flag amvp_flag.

[0238] When determining the resolution of the motion vector of one pixel accuracy or four pixels accuracy, the image encoder 210 may modify or determine the value of the least significant bit (LSB) of the MVD of the current block. When the resolution of the MVD of the current block is determined to be a resolution of one pixel, the image encoder 210 may modify the value of the LSB of the MVD of the current block to 0 or determine the value of the LSB (parity bit) of the MVD of the current block to 1.

[0239] When the resolution of the MVD of the current block is determined to be a resolution of four pixels, the image encoder 210 may modify the value of the LSB of the MVD of the current block to 1, or determine the value of the LSB (parity bit) of the MVD of the current block to be 1.

[0240] The image encoder 210 may encode the MVD of the current block based on the resolution of the MVD of the current block. That is, the image encoder 210 may encode information about the MVD of the current block based on the MVD of the current block and the resolution of the MVD of the current block.

[0241] For example, when the resolution of the MVD of the current block is determined to be a resolution of one pixel, the image encoder 210 may determine the MVD of the current block based on the following equation 3. In this case, when the MVD is 1, it may mean 1 / 4 pixel. The MVD on the left side of equation 3 may be information about the MVD of the current block to be encoded.

[0242] [Equation 3]

[0243] MVD=((MVD>>2)<<1)

[0244] When the resolution of the MVD of the current block is determined as a resolution of four pixels, the image encoder 210 may determine the MVD of the current block based on the following equation 4. In this case, when the MVD is 1, it may mean 1 / 4 pixel. The MVD on the left side of equation 4 may be information about the MVD of the current block to be encoded.

[0245] [Equation 4]

[0246] MVD=((MVD>>4)<<1)+1

[0247] The history-based technique according to the embodiment will be described below.

[0248] The image encoder 210 may store the most recently encoded N intra prediction modes in a history-based list. When the same intra prediction mode appears in the history-based list, the image encoder 210 may determine the priority of the same intra prediction mode to be high. The image encoder 210 may encode the index or flag information indicating the intra prediction mode in the history-based list. The image encoder 210 may derive the most probable mode (MPM) based on the intra prediction model in the history-based list.

[0249] The image encoder 210 may store the most recently encoded N modes in a history-based list. In this case, the stored N modes may be, but are not limited to, intra mode, inter mode, decoder-side motion vector refinement (DMVR) mode, affine mode, skip mode, etc. The image encoder 210 may encode information in the form of an index indicating the mode of the current block in the history-based list.

[0250] The image encoder 210 may determine the context model based on the history-based list. For example, the image encoder 210 may store the most recently encoded N modes (e.g., prediction modes such as inter mode or intra prediction mode) in the history-based list, and derive a context model for entropy encoding information about the prediction mode of the current block based on the modes included in the history-based list.

[0251] The motion information candidate list reordering technique will be described below.

[0252] The inter-frame predictor 205 may determine the priority of the adjacent blocks in the AMVP candidate list or the merge candidate list based on the size of the adjacent blocks. For example, the inter-frame predictor 205 may determine that the priority of the adjacent candidate blocks in the AMVP candidate list or the merge candidate list is higher as the width, height, or area of ​​the adjacent candidate blocks increases. Specifically, when the width of the adjacent candidate block above the current block is large, the inter-frame predictor 205 may determine the priority of the adjacent candidate block to be high. When the height of the adjacent candidate block on the left side of the current block is large, the inter-frame predictor 205 may determine the priority of the adjacent candidate block to be high.

[0253] Motion compensation of a chroma block according to an embodiment will be described below.

[0254] The image encoder 210 can determine a plurality of brightness blocks in the current brightness image by hierarchically splitting the current brightness image based on the split shape mode of the current brightness image. The split shape mode of the current brightness image can be provided in units of blocks. That is, after the current block is split into a plurality of blocks according to the split shape mode of the current block, the corresponding blocks can be split in addition according to the split shape modes of the plurality of blocks. The split shape mode of the current brightness image can be encoded. The split shape mode can be a mode based on a split shape mode including one of four splits, two splits, and three splits.

[0255] The image encoder 210 may determine a current rectangular chrominance block corresponding to a current luminance block having a square shape included in one of the plurality of luminance blocks. In this case, the current luminance block having a square shape may be a subblock included in a coding unit of a luminance component, in particular, a motion information unit in a motion compensation mode based on an affine model, but the embodiments of the present disclosure are not limited thereto. For example, the current luminance block having a square shape may have a size of N×N (N is an integer). The size of the current luminance block having a square shape may be 4×4, but is not limited thereto. The current luminance block having a square shape has been described above, but the embodiments of the present disclosure are not limited thereto, and the current luminance block may have a rectangular shape. For example, the current luminance block may have a size of 2N×N or N×2N (N is an integer), such as 8×4 or 4×8. The height of the current chrominance block having a rectangular shape may be the same as the height of the current luminance block, and the width of the current chrominance block may be half the width of the current luminance block, but the embodiments of the present disclosure are not limited thereto, and the width of the current chrominance block may be the same as the width of the current luminance block, and the height of the current chrominance block may be half the height of the current luminance block. For example, when the size of the current luminance block is 4 × 4, the size of the chrominance block may be 4 × 2 or 2 × 4. In this case, the chrominance format of the chrominance image including the current chrominance block may be 4:2:2.

[0256] However, the embodiments of the present disclosure are not limited thereto, and the height of the rectangular current chroma block may be half the height of the current luminance block, and its width may be half the width of the current luminance block. For example, the current chroma block corresponding to the current rectangular luminance block of size 8×4 or 4×8 may have a size of 4×2 or 2×4. In this case, the chroma format of the chroma image including the current chroma block may be 4:2:0. The inter-frame predictor 205 may determine the motion information segments of the current chroma block and the adjacent chroma blocks by using the motion information of the current chroma block and the chroma blocks adjacent to the current chroma block. In this case, the motion information of the current chroma block used to determine the motion information segments of the current chroma block and the adjacent chroma blocks may correspond to the motion information of the current luminance block. In addition, the motion information of the adjacent chroma blocks used to determine the motion information segments of the current chroma block and the adjacent chroma blocks may correspond to the motion information of the adjacent luminance blocks corresponding to the adjacent chroma blocks.

[0257] For example, the motion information of the current chroma block may be the same as the motion information of the current luminance block, and the motion information of the adjacent chroma block may be the same as the motion information of the adjacent luminance block.

[0258] In this case, the current chroma block and the adjacent chroma block may be blocks adjacent to each other in the left-right direction. However, the embodiments of the present disclosure are not limited thereto, and the current chroma block and the adjacent chroma block may be blocks adjacent to each other vertically. The block as a combination of the current chroma block and the adjacent chroma block may be a square block and have a size of 4×4, but the embodiments of the present disclosure are not limited thereto.

[0259] The motion information of the current chroma block and blocks adjacent to the current chroma block may include motion vectors of the current chroma block and the adjacent chroma blocks, and the motion information segments of the current chroma block and the adjacent chroma blocks may include motion vectors of the current chroma block and the adjacent chroma blocks.

[0260] The inter predictor 205 may determine an average value of the motion vector of the current chroma block and the motion vectors of the neighboring chroma blocks as the values ​​of the motion vectors of the current chroma block and the neighboring chroma blocks.

[0261] The inter-frame predictor 205 may perform motion compensation on the chrominance block by using different filters in the horizontal direction and the vertical direction. In this case, the filter may vary according to its coefficient and the number of filter taps.

[0262] The inter predictor 205 may determine the motion information of the chroma block by merging the motion information of the two chroma blocks, and thus may have a low memory bandwidth when performing motion compensation.

[0263] The inter-frame predictor 205 may perform interpolation based on the motion information of the rectangular chroma block to determine the motion information of a square chroma block smaller than the rectangular chroma block. For example, the inter-frame predictor 205 may perform interpolation based on the motion information of the 2×4 chroma block to determine the motion information of the 2×2 chroma block.

[0264] The inter predictor 205 may perform inter prediction on the current chroma block and the adjacent chroma blocks by using motion information segments of the current chroma block and the chroma blocks adjacent to the current chroma block to generate prediction blocks of the current chroma block and the adjacent chroma blocks.

[0265] The decoder-side motion vector refinement (DMVR) technique will be described below. The DMVR technique refers to a technique for determining a refined motion vector by determining a reference block of a reference frame based on a motion vector and searching for adjacent regions (e.g., blocks extending by two pixels in the upper, lower, left, and right directions). In this case, when the inter-frame predictor 105 searches the adjacent regions to determine the refined motion vector, the pixel values ​​of the adjacent regions should be additionally acquired. Therefore, the memory bandwidth can be increased.

[0266] The inter-frame predictor 205 may generate a prediction block of the current luminance block or chrominance block by performing motion compensation on the current luminance block or chrominance block using the motion vector of the current luminance block. In this case, the inter-frame predictor 205 may determine the motion vector of the current luminance block or chrominance block refined based on the motion vector refinement search of the reference luminance or chrominance image in the current luminance image or chrominance image by using the motion vector of the current luminance block or chrominance block. Specifically, the inter-frame predictor 205 may perform a motion vector refinement search using the reconstructed pixel values ​​of the reference luminance block or chrominance block in the chrominance image indicated by the motion vector of the current luminance block or chrominance block, without using the reconstructed adjacent pixel values ​​of the reference luminance block or chrominance block in the reference luminance block or chrominance block of the reference luminance or chrominance image. Memory bandwidth may be reduced by performing a motion vector refinement search without using the reconstructed adjacent pixel values.

[0267] When the size of the current block is greater than a predetermined size, the inter-frame predictor 205 may determine not to perform inter-frame prediction based on the DMVR technique on the current block. That is, when inter-frame prediction is performed by the DMVR technique, the smaller the block is compared to the size of the block, the larger the block to be expanded to perform the motion vector refinement search, and therefore, for smaller blocks, the rate of increase of the memory bandwidth in the DMVR is higher. To solve this problem, inter-frame prediction based on the DMVR technique may be performed on the current block having a size greater than a predetermined size to prevent an increase in the memory bandwidth.

[0268] When the inter-frame predictor 205 performs inter-frame prediction based on the DMVR technology, a delay problem may occur. That is, the inter-frame predictor 205 can perform inter-frame prediction on a neighboring block to be encoded after the current block by using motion information refined by the DMVR technology only after performing motion vector refinement based on the DMVR technology on the current block.

[0269] In order to solve the delay problem, the inter-frame predictor 205 may encode the block to be encoded after the current block using the unrefined motion information to be encoded, instead of the refined motion information obtained by the inter-frame prediction process based on the DMVR technology for inter-frame prediction of the current block. However, when the refined motion vector is not used, a loss may occur.

[0270] To prevent loss, during the derivation of the motion vector of the current block based on AMVP or the merge candidate list, the inter-frame prediction unit 205 may determine the priority of the motion vector of the neighboring block for inter-frame prediction based on the DMVR technology to be low, thereby preventing the motion vector of the current block from being derived using the motion vector of the neighboring block.

[0271] Alternatively, when a predetermined number or more of the blocks in the neighboring blocks of the current block are inter-predicted based on the DMVR technique, the inter-predictor 205 may determine not to perform the inter-prediction based on the DMVR technique on the current block. Therefore, the number of unrefined motion vectors to be used during the derivation of the motion vector of the block to be encoded later can be reduced.

[0272] The triangle prediction mode will be described below. The triangle prediction mode refers to a mode in which a coding unit is split in a diagonal direction and prediction is performed based on two triangle parts (or triangle prediction units) obtained by splitting the coding unit in the diagonal direction. In this case, the diagonal direction may include a first direction from the upper left corner of the coding unit to its lower right corner and a second direction from the upper right corner to the lower left corner of the coding unit. Therefore, based on the diagonal direction, there may be two types of triangle parts. Each of the two triangle parts may have a motion vector. Motion compensation may be performed on the two triangle parts based on their motion vectors, and the two motion compensated triangle parts may be merged into one block. A mask may be used to prevent a sudden transition during the merging of two motion compensated triangle parts.

[0273] The inter-frame predictor 205 may split the coding unit of the block into two square or rectangular units in the horizontal or vertical direction instead of using the triangular part obtained in the triangular prediction mode, and perform motion compensation using the motion vectors of the two square or rectangular units. The inter-frame predictor 205 may split the coding unit in the horizontal or vertical direction to prevent the memory bandwidth from increasing.

[0274] When the coding unit is split into two parts in the diagonal direction, the inter-frame predictor 205 can split the coding unit only based on the diagonal direction of ±45 degrees relative to the horizontal direction. That is, the inter-frame predictor 205 can split the coding unit into two parts in the diagonal direction of ±45 degrees relative to the center part of the coding unit. Therefore, when a block that is long in the vertical / horizontal direction is split, it is possible to prevent the block from being split into a direction close to the vertical / horizontal direction.

[0275] The inter-frame predictor 205 can search for motion vectors of the neighboring blocks of the current coding unit, and split the current coding unit based on the size of the motion vectors of the searched neighboring blocks. For example, the inter-frame predictor 205 can detect the change in the size of the motion vector of the upper adjacent block while searching for the upper adjacent block in the horizontal direction from the upper left adjacent block to the upper right adjacent block, and when the degree of change in the movement of the upper adjacent block is greater than a predetermined level, the upper adjacent block can be determined as the starting point or end point of the segmentation. In addition, the inter-frame predictor 205 can detect the change in the size of the motion vector of the left adjacent block while searching for the left adjacent block in the vertical direction from the upper left adjacent block to the lower left adjacent block, and when the degree of change in the movement of the left adjacent block is greater than a predetermined level, the left adjacent block can be determined as the starting point or end point of the segmentation. The inter-frame predictor 205 can split the current coding unit based on the starting point or end point of the segmentation.

[0276] The correlated quantization technique will be described below. The correlated quantization technique is a technique for performing quantization using two available quantization units on all coefficients, and the two available quantization units may perform quantization using different quantization parameters.

[0277] The image encoder 210 may determine the state and quantization unit for the currently encoded coefficient based on at least one of the parity of the previously encoded coefficient and the parity of the currently encoded coefficient, and generate a quantized transform coefficient based on the quantization unit. In this case, the parity of the currently encoded coefficient may be modified. FIG. 20A to FIG. 20C Embodiments of the present disclosure regarding correlation quantization are described in detail.

[0278] The image encoder 210 may perform correlated quantization on the transform coefficients of the current luminance / chrominance block, encode the residual information of the current luminance / chrominance block, and encode the parity check flag indicating the parity check of the coefficient level in the current luminance / chrominance block. In this case, the parity check flag may be encoded by limiting the number of parity check flags to be encoded according to a predetermined scanning order. The image encoder 210 may limit the number of parity check flags to be encoded according to the scanning order by limiting the area where the parity check flag is to be encoded. For example, when the current scanning position is within a predetermined range and the coefficient of the current scanning position is a valid coefficient, the parity check flag may be encoded. Alternatively, when the value of the current scanning position is greater than or less than a predetermined value, the parity check flag may be encoded when the coefficient of the current scanning position is a valid coefficient.

[0279] Optionally, the image encoder 210 may determine a first value, count the number of parity check flags encoded each time a parity check flag is encoded, compare the number of counted flags with the first value, and determine that the parity check flag is not encoded when the number of counted flags is greater than the first value. Optionally, the image encoder 210 may subtract 1 from the first value each time a parity check flag is encoded, and when the result of subtracting 1 from the first value is zero, determine that the parity check flag is not encoded. However, it has been described above that the image encoder 210 only counts the number of encoded parity check flags, but the embodiments of the present disclosure are not limited to this, and the number of encoded significant coefficient flags, gtX_fla, etc. (which are not parity check flags) can be counted together.

[0280] The image encoder 210 may adaptively perform correlation quantization based on a scan area within the block currently being encoded. For example, when the current transform coefficient is located in the upper left corner area of ​​the block currently being encoded, the current transform coefficient may be encoded based on a correlation quantization technique, and the current transform coefficient of the remaining area of ​​the block currently being encoded may be quantized based on a single quantization parameter.

[0281] The image encoder 210 may adaptively perform correlation quantization based on at least one of the size of the block currently being encoded, the position of the current block (or subblock), or the position of the current transform coefficient. For example, when the size of the current block is greater than a predetermined size, encoding based on a correlation quantization technique may be performed on the block currently being encoded.

[0282] The image encoder 210 may perform correlated quantization when the currently encoded block is a luma block, and may perform quantization on a transform coefficient of the currently encoded block based on a single quantization parameter when the currently encoded block is a chroma block.

[0283] The image encoder 210 may determine that the number of QPs to be used for correlated quantization is greater than 2, and that the number of states is greater than 4. For example, the image encoder 210 may determine that the number of QPs to be used for correlated quantization is 3, and that the number of states is 8.

[0284] When the parity flag is not encoded, the image encoder 210 may adaptively perform encoding based on a relevant quantization technique based on the coefficient level size.

[0285] For example, when the previously encoded level is greater than N, the image encoder 310 may determine not to perform quantization based on the relevant quantization technique when the level of the current transform coefficient is encoded. In this case, N may be determined based on at least one of a quantization parameter, a block size, or a bit depth of a sample.

[0286] The image encoder 210 may determine the structure of the state machine based on previously encoded blocks.

[0287] The image encoder 210 may determine a context model for entropy encoding at least one of the significant coefficient flags, gt1_flag, or gt2_flag of the current transform coefficient based on at least one of the significant coefficient flags, gt1_flag, or gt2_flag of the neighboring coefficients having the same quantization parameter as the current transform coefficient. Alternatively, the image encoder 210 may determine a context model coefficient for entropy decoding at least one of the significant coefficient flags, gt1_flag, or gt2_flag of the current transform coefficient based on at least one of the significant coefficient flags, gt1_flag, or gt2_flag of the neighboring coefficients having the same state as the current transform. The image encoder 210 may perform entropy encoding in consideration of the relationship between coefficients having similar quantization parameters as described above, thereby improving encoding efficiency.

[0288] The image encoder 210 may limit the number of parity flags encoded in a predetermined scanning order based on a context model, thereby limiting the total number of bins of parity flags to be entropy encoded, thereby reducing encoding complexity.

[0289] A method of determining the resolution of the MVD of the current block and the value of the MVD similar to the related quantization technique will be described below.

[0290] The image encoder 210 may determine one of a plurality of states based on at least one of the parity check of the MVD of the current block and the parity check of the MVD of the previous block, and determine the resolution of the MVD of the current block based on the determined state. In this case, at least one of the parity check of the MVD of the current block or the parity check of the MVD of the previous block may be modified. In this case, the determined resolution of the MVD of the current block may correspond to a quantization unit (or a quantization parameter to be used for the quantization unit) of a relevant quantization technique, and the MVD of the current block / previously encoded block may correspond to the level of a transform coefficient currently being encoded or encoded by a relevant quantization technique.

[0291] The image encoder 210 may generate a residual block of the current luminance block or chrominance block based on the prediction block of the current luminance block or chrominance block. The image encoder 210 may generate a residual block of the current luminance block or chrominance block based on the original block of the current luminance block or chrominance block, and encode information about the residual block of the current luminance block or chrominance block.

[0292] Figure 2B is a flowchart of an image encoding method according to various embodiments.

[0293] In operation S205 , the image encoding device 200 may determine a plurality of luminance blocks included in the current luminance image by hierarchically splitting the current luminance image based on a split shape pattern of the current luminance image.

[0294] In operation S210, the image encoding device 200 may determine a current chrominance block having a rectangular shape and corresponding to a current luminance block having a square shape and included in one of a plurality of luminance blocks.

[0295] In operation S215 , the image encoding device 200 may determine motion information segments of the current chroma block and the adjacent chroma blocks by using motion information of the current chroma block and the chroma blocks adjacent to the current chroma block.

[0296] In operation S220, the image encoding device 200 may perform inter-frame prediction on the current chroma block and the neighboring chroma blocks by using motion information segments of the current chroma block and the neighboring chroma blocks to generate prediction blocks of the current chroma block and the neighboring chroma blocks.

[0297] In operation S225 , the image encoding device 200 may generate residual blocks of the current chroma block and the adjacent chroma block based on the prediction blocks of the current chroma block and the adjacent chroma block, and encode the residual blocks of the current chroma block and the adjacent chroma block.

[0298] Figure 2C is a block diagram of an image encoder according to various embodiments.

[0299] The image encoder 7000 according to various embodiments performs operations required for the image encoder 210 of the image encoding device 200 to encode image data.

[0300] That is, the intra predictor 7200 performs intra prediction on each block of the current image 7050 , and the inter predictor 7200 performs inter prediction on each block by using the current image 7050 and a reference image obtained from the reconstructed picture buffer 7100 .

[0301] The prediction data is subtracted from the data of the block to be encoded in the current image 7050, wherein the prediction data is associated with each block and output from the intra predictor 7200 or the inter predictor 7200, and the transformer 7250 and the quantizer 7300 can output the quantized transform coefficient of each block by performing transform and quantization on the residual data. The inverse quantization unit 7450 and the inverse transformer 7500 can reconstruct the residual data of the spatial domain by performing inverse quantization and inverse transform on the quantized transform coefficient. The reconstructed residual data of the spatial domain can be added to the prediction data associated with each block and output from the intra predictor 7200 or the inter predictor 7200, and thus can be reconstructed into the spatial domain data of the block of the current image 7050. The deblocker 7550 and the SAO executor generate a filtered reconstructed image by performing loop filtering on the reconstructed data of the spatial domain. The inter predictor 205 may include the inter predictor 7200 of the image encoder 7000. The generated reconstructed image is stored in the reconstructed picture buffer 7100. The reconstructed image stored in the reconstructed picture buffer 7100 may be used as a reference image for inter-frame prediction with respect to another image. The entropy encoder 7350 may entropy encode the quantized transform coefficients, and the entropy-encoded coefficients may be output as a bitstream 7400 .

[0302] In order to apply the image encoder 7000 according to various embodiments to the image encoding device 200, the image encoder 7000 according to various embodiments may perform an operation of each stage on each block.

[0303] Below, the splitting of the coding unit will be described in detail according to the embodiments of the present disclosure.

[0304] The image may be split into maximum coding units. The size of each maximum coding unit may be determined based on information obtained from a bitstream. The shape of each maximum coding unit may be a square shape of the same size. However, the present disclosure is not limited thereto. In addition, the maximum coding unit may be hierarchically split into coding units based on the split shape pattern information obtained from the bitstream. The split shape pattern information may include at least one of information indicating whether the split is to be performed, split direction information, and split type information. The information indicating whether the split is to be performed indicates whether the coding unit is to be split. The split direction information indicates that the split is to be performed in one of the horizontal direction or the vertical direction. The split type information indicates that the coding unit is to be split by using one of two splits, three splits (also called three-part splits), or four splits.

[0305] For ease of description, in the present disclosure, it is assumed that the split shape mode information includes information indicating whether to perform splitting, split direction information, and split type information, but the present disclosure is not limited thereto. The image decoding device 100 may obtain the split shape mode information from the bit stream as a bin string. The image decoding device 100 may determine whether to split the coding unit, the split direction, and the split type based on a bin string.

[0306] The coding unit may be equal to or smaller than the maximum coding unit. For example, when the split shape mode information indicates that splitting is not performed, the coding unit has the same size as the maximum coding unit. When the split shape mode information indicates that splitting is to be performed, the maximum coding unit may be split into lower depth coding units. When the split shape mode information about the lower depth coding unit indicates splitting, the lower depth coding unit may be split into smaller coding units. However, the splitting of the image is not limited thereto, and the maximum coding unit and the coding unit may not be distinguished. Reference will be made to Figures 3 to 16 Describe the splitting of coding units in detail.

[0307] In addition, the coding unit may be split into prediction units for image prediction. Each prediction unit may be equal to or smaller than the coding unit. In addition, the coding unit may be split into transform units for image transformation. Each transform unit may be equal to or smaller than the coding unit. The shapes and sizes of the transform unit and the prediction unit may be independent of each other. The coding unit may be distinguished from the prediction unit and the transform unit, or the coding unit, the prediction unit, and the transform unit may be equal to each other. The splitting of the prediction unit and the transform unit may be performed in the same manner as the splitting of the coding unit. Figures 3 to 16 The splitting of the coding unit is described in detail. The current block and the adjacent block of the present disclosure may indicate one of the maximum coding unit, the coding unit, the prediction unit, and the transformation unit. In addition, the current block of the current coding unit is a block currently being decoded or encoded or a block currently being split. 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, upper left, above, upper right, right, and lower right of the current block.

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

[0309] The block shape may include 4N×4N, 4N×2N, 2N×4N, 4N×N, or N×4N. Here, N may be a positive integer. The block shape information is information indicating at least one of a shape, a direction, an aspect ratio, or a size of a coding unit.

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

[0311] When the lengths of the width and height of the coding unit are different from each other (i.e., when the block shape of the coding unit is 4N×2N, 2N×4N, 4N×N, or N×4N), the image decoding device 100 may determine the block shape information of the coding unit as a non-square shape. When the shape of the coding unit is a non-square shape, the image decoding device 100 may determine the aspect ratio in the block shape information of the coding unit as at least one of 1:2, 2:1, 1:4, 4:1, 1:8, or 8:1. In addition, the image decoding device 100 may determine whether the coding unit is in the horizontal direction or the vertical direction based on the length of the width and the length of the height of the coding unit. In addition, the image decoding device 100 may determine the size of the coding unit based on at least one of the length of the width, the length of the height, or the area of ​​the coding unit.

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

[0313] The image decoding device 100 may obtain the split shape mode information from the bitstream. However, the embodiment is not limited thereto, and the image decoding device 100 and the image encoding device 200 may obtain the pre-agreed split shape mode information based on the block shape information. The image decoding device 100 may obtain the pre-agreed split shape mode information about the maximum coding unit or the minimum coding unit. For example, the image decoding device 100 may determine the split shape mode information about the maximum coding unit to be split into four. In addition, the image decoding device 100 may determine the split shape mode information about the minimum coding unit as "no splitting is performed". Specifically, the image decoding device 100 may determine that the size of the maximum coding unit is 256×256. The image decoding device 100 may determine the pre-agreed split shape mode information as four splits. Four splits are split shape modes in which the width and height of the coding unit are equally divided. The image decoding device 100 may obtain a 128×128 sized coding unit from a 256×256 sized maximum coding unit based on the split shape mode information. In addition, the image decoding device 100 may determine the size of the minimum coding unit to be 4×4. The image decoding device 100 can obtain split shape mode information indicating "do not perform splitting" with respect to the minimum coding unit.

[0314] According to an embodiment, the image decoding device 100 may use block shape information indicating that the current coding unit has a square shape. For example, the image decoding device 100 may determine whether to not split the square coding unit, whether to split the square coding unit vertically, whether to split the square coding unit horizontally, or whether to split the square coding unit into four coding units based on the split shape mode information. Figure 3 When the block shape information of the current coding unit 300 indicates a square shape, the image decoder 110 may not split the coding unit 310a having the same size as the current coding unit 300 based on the split shape mode information indicating that the split is not performed, or may determine the split of the coding unit 310b, 310c or 310d based on the split shape mode information indicating a predetermined splitting method.

[0315] Reference Figure 3According to an embodiment, the image decoding device 100 may determine two coding units 310b obtained by splitting the current coding unit 300 in the vertical direction based on the split shape pattern information indicating that the split is performed in the vertical direction. The image decoding device 100 may determine two coding units 310c obtained by splitting the current coding unit 300 in the horizontal direction based on the split shape pattern information indicating that the split is performed in the horizontal direction. The image decoding device 100 may determine four coding units 310d obtained by splitting the current coding unit 300 in the vertical and horizontal directions based on the split shape pattern information indicating that the split is performed in the vertical and horizontal directions. However, the splitting method of the square coding unit is not limited to the above method, and may include various methods that may be indicated by the split shape pattern information. The predetermined splitting method of splitting the square coding unit will be described in detail below in conjunction with various embodiments.

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

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

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

[0319] According to an embodiment, when the image decoding device 100 splits the non-square current coding unit 400 or 450 based on the split shape mode information, the image decoding device 100 may split the current coding unit in consideration of the position of the long side of the non-square current coding unit 400 or 450. For example, the image decoding device 100 may split the current coding unit 400 or 450 by splitting the long side of the current coding unit 400 or 450 in consideration of the shape of the current coding unit 400 or 450 to determine a plurality of coding units.

[0320] According to an embodiment, when the split shape mode information indicates that the coding unit is split (three-split) into an odd number of blocks, the image decoding device 100 may determine the odd number of coding units included in the current coding unit 400 or 450. For example, when the split shape mode information indicates that the current coding unit 400 or 450 is split into three coding units, the image decoding device 100 may split the current coding unit 400 or 450 into three coding units 430a, 430b, and 430c or 480a, 480b, and 480c.

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

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

[0323] According to an embodiment, when the split shape mode information indicates that the coding unit is split into an odd number of blocks, the image decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and in addition, a predetermined restriction may be imposed on at least one of the odd number of coding units generated by splitting the current coding unit 400 or 450. Figure 4 , the image decoding device 100 may allow a decoding process of a coding unit 430b or 480b to be different from a decoding process of other coding units 430a and 430c, or 480a or 480c, wherein the coding unit 430b or 480b is located at a center position among three coding units 430a, 430b, and 430c, or 480a, 480b, and 480c generated by splitting the current coding unit 400 or 450. For example, unlike other coding units 430a and 430c, or 480a and 480c, the image decoding device 100 may restrict the coding unit 430b or 480b located at the center position from being split again or being split only a predetermined number of times.

[0324] Figure 5 A process of splitting a coding unit based on at least one of block shape information and split shape mode information, performed by the image decoding device 100 according to an embodiment, is illustrated.

[0325] According to an embodiment, the image decoding device 100 may determine to split the square first coding unit 500 into coding units based on at least one of the block shape information and the split shape mode information, or may determine not to split the square first coding unit 500. According to an embodiment, when the split shape mode information indicates to split the first coding unit 500 in the horizontal direction, the image decoding device 100 may determine the second coding unit 510 by splitting the first coding unit 500 in the horizontal direction. The first coding unit, the second coding unit, and the third coding unit used according to the embodiment are terms for understanding the relationship before and after the split coding unit. For example, the second coding unit may be determined by splitting the first coding unit, and the third coding unit may be determined by splitting the second coding unit. It should be understood that the structures of the first coding unit, the second coding unit, and the third coding unit follow the above description.

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

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

[0328] According to an embodiment, the image decoding device 100 may split each of the third coding units 520a or 520b, 520c, and 520d into coding units based on at least one of the block shape information and the split shape mode information. In addition, the image decoding device 100 may determine not to split the second coding unit 510 based on at least one of the block shape information and the split shape mode information. According to an embodiment, the image decoding device 100 may split the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The image decoding device 100 may impose a predetermined restriction on a predetermined third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the image decoding device 100 may limit the third coding unit 520c located at the center position among the odd number of third coding units 520b, 520c, and 520d to no longer be split or to be split a settable number of times.

[0329] Reference Figure 5 , the image decoding device 100 can limit the third coding unit 520c located at the center position among the odd third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to no longer be split, or to be split only a predetermined number of times (for example, only n times (where n>0)) by using a predetermined splitting method (for example, splitting into only four coding units, or splitting by using the splitting method of the second coding unit 510). However, the restrictions on the third coding unit 520c at the center position are not limited to the above examples, and should be interpreted that the restrictions may include various restrictions on decoding the third coding unit 520c at the center position that is different from the other third coding units 520b and 520d.

[0330] According to an embodiment, the image decoding device 100 may obtain at least one of block shape information and split shape mode information for splitting the current coding unit from a predetermined position in the current coding unit.

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

[0332] Reference Figure 6 At least one of the block shape information and the split shape mode information about the current coding unit 600 or 650 can be obtained from a sample at a predetermined position (e.g., a sample 640 or 690 at a center position) among a plurality of samples included in the current coding unit 600 or 650. However, the predetermined position in the current coding unit 600 from which at least one of the block shape information and the split shape mode information can be obtained is not limited to Figure 6 The image decoding device 100 may include a center position in the current coding unit 600, and may include various positions (e.g., top, bottom, left, right, upper left, lower left, lower left, upper right, and lower right positions) included in the current coding unit 600. The image decoding device 100 may obtain at least one of the block shape information and the split shape mode information from a predetermined position, and may determine whether to split the current coding unit into coding units of various shapes and various sizes.

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

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

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

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

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

[0338] According to an embodiment, the image decoding device 100 may split the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c, and may select one of the coding units 620a, 620b, and 620c based on a predetermined criterion. For example, the image decoding device 100 may select a coding unit 620b having a size different from that of other coding units from among the coding units 620a, 620b, and 620c.

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

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

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

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

[0343] According to an embodiment, the image decoding device 100 may select a coding unit at a predetermined position from an odd number of coding units determined by splitting the current coding unit, considering the shape of the current coding unit. For example, when the current coding unit has a non-square shape with a width greater than a height, the image decoding device 100 may determine a coding unit at a predetermined position in the horizontal direction. That is, the image decoding device 100 may determine one of the coding units at different positions in the horizontal direction, and may impose restrictions on the coding unit. When the current coding unit has a non-square shape with a height greater than a width, the image decoding device 100 may determine a coding unit at a predetermined position in the vertical direction. That is, the image decoding device 100 may determine one of the coding units at different positions in the vertical direction, and may impose restrictions on the coding unit.

[0344] According to an embodiment, the image decoding device 100 may use information indicating the corresponding positions of the even-numbered coding units in order to determine the coding unit at a predetermined position among the even-numbered coding units. The image decoding device 100 may determine the even-numbered coding units by splitting (two-split; two-part splitting) the current coding unit, and may determine the coding unit at the predetermined position by using information about the positions of the even-numbered coding units. Operations related thereto may correspond to operations for determining the coding unit at a predetermined position (e.g., a center position) among the odd-numbered coding units, which are described above with reference to Figure 6 A detailed description is therefore not provided here.

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

[0346] Reference Figure 6, the image decoding device 100 may split the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on at least one of the block shape information and the split shape mode information, and may determine the coding unit 620b at the center position among the plurality of coding units 620a, 620b, and 620c. In addition, the image decoding device 100 may determine the coding unit 620b at the center position, considering the position obtained therefrom based on at least one of the block shape information and the split shape mode information. That is, at least one of the block shape information and the split shape mode information about the current coding unit 600 may be obtained from the sample 640 at the center position of the current coding unit 600, and when the current coding unit 600 is split into a plurality of coding units 620a, 620b, and 620c based on at least one of the block shape information and the split shape mode information, the coding unit 620b including the sample 640 may be determined as the coding unit at the center position. However, information for determining the coding unit of the center position is not limited to at least one of the block shape information and the split shape mode information, and various types of information may be used to determine the coding unit of the center position.

[0347] According to an embodiment, predetermined information for identifying a coding unit at a predetermined position may be obtained from a predetermined sample included in a coding unit to be determined. Figure 6 , the image decoding device 100 can use at least one of the block shape information and the split shape mode information obtained from the sample at the predetermined position of the current coding unit 600 (for example, the sample at the center position of the current coding unit 600) to determine the coding unit at the predetermined position (for example, determine the coding unit at the center position of the multiple split coding units) among the multiple coding units 620a, 620b, and 620c determined by splitting the current coding unit 600. That is, the image decoding device 100 can determine the sample at the predetermined position by considering the block shape of the current coding unit 600, can determine the coding unit 620b including the sample from which the predetermined information (for example, at least one of the block shape information and the split shape mode information) can be obtained among the multiple coding units 620a, 620b, and 620c determined by splitting the current coding unit 600, and can impose a predetermined restriction on the coding unit 620b. Refer to Figure 6 According to an embodiment, the image decoding device 100 may determine a sample 640 at a center position of the current coding unit 600 as a sample from which predetermined information can be obtained, and may impose a predetermined restriction on the coding unit 620b including the sample 640 in a decoding operation. However, the position of the sample from which the predetermined information can be obtained is not limited to the above-mentioned position, and may include any position of the samples included in the coding unit 620b, which will be determined for restriction.

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

[0349] According to an embodiment, when the current coding unit is split into multiple coding units, the image decoding device 100 may use at least one of the block shape information and the split shape pattern information in order to determine the coding unit at a predetermined position in the multiple coding units. According to an embodiment, the image decoding device 100 may obtain at least one of the block shape information and the split shape pattern information from a sample at a predetermined position in the coding unit, and may split the multiple coding units generated by splitting the current coding unit by using at least one of the block shape information and the split shape pattern information obtained from the sample at the predetermined position in each of the multiple coding units. That is, the coding unit may be recursively split based on at least one of the block shape information and the split shape pattern information obtained from the sample at the predetermined position in each of the coding units. Referring to the above Figure 5 The operation of recursively splitting the coding unit is described, so a detailed description thereof is not provided here.

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

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

[0352] According to an embodiment, based on at least one of the block shape information and the split shape pattern information, the image decoding device 100 may determine the second coding units 710a and 710b by splitting the first coding unit 700 in a vertical direction, may determine the second coding units 730a and 730b by splitting the first coding unit 700 in a horizontal direction, or may determine the second coding units 750a, 750b, 750c and 750d by splitting the first coding unit 700 in vertical and horizontal directions.

[0353] Reference Figure 7 , the image decoding device 100 may determine to process the second coding units 710a and 710b in a horizontal direction order 710c, the second coding units 710a and 710b being determined by splitting the first coding unit 700 in a vertical direction. The image decoding device 100 may determine to process the second coding units 730a and 730b in a vertical direction order 730c, the second coding units 730a and 730b being determined by splitting the first coding unit 700 in a horizontal direction. The image decoding device 100 may determine the second coding units 750a, 750b, 750c, and 750d determined by splitting the first coding unit 700 in the vertical and horizontal directions according to a predetermined order (for example, in a raster scan order or a Z scan order 750e), by which the coding units in one row are processed, and then the coding units in the next row are processed.

[0354] According to an embodiment, the image decoding apparatus 100 may recursively split the coding unit. Figure 7 , the image decoding device 100 can determine multiple coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d by splitting the first coding unit 700, and can recursively split each of the determined multiple coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d. The splitting method of the multiple coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d can correspond to the splitting method of the first coding unit 700. Therefore, each of the multiple coding units 710a and 710b, 730a and 730b, or 750a, 750b, 750c, and 750d can be independently split into multiple coding units. Refer to Figure 7 , the image decoding device 100 can determine the second coding units 710a and 710b by splitting the first coding unit 700 in the vertical direction, and can determine to independently split each of the second coding units 710a and 710b or not to split the second coding units 710a and 710b.

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

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

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

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

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

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

[0361] Fig. 9 A process of determining at least one coding unit by splitting the first coding unit 900 , performed by the image decoding device 100 according to an embodiment, is illustrated.

[0362] According to an embodiment, the image decoding device 100 may split the first coding unit 900 based on at least one of the block shape information and the split shape mode information obtained by the receiver (not shown). The square first coding unit 900 may be split into four square coding units, or may be split into a plurality of non-square coding units. For example, referring to Fig. 9 , when the block shape information indicates that the first coding unit 900 is a square and the split shape mode information indicates that the first coding unit 900 is split into non-square coding units, the image decoding device 100 may split the first coding unit 900 into a plurality of non-square coding units. Specifically, when the split shape mode information indicates that an odd number of coding units is determined by splitting the first coding unit 900 in the horizontal direction or the vertical direction, the image decoding device 100 may split the square first coding unit 900 into an odd number of coding units, for example, the second coding units 910a, 910b, and 910c are determined by splitting the square first coding unit 900 in the vertical direction, or the second coding units 920a, 920b, and 920c are determined by splitting the square first coding unit 900 in the horizontal direction.

[0363] According to an embodiment, the image decoding device 100 may determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition for being processed in a predetermined order, and the condition is related to whether at least one of the width and height of the first coding unit 900 will be split into two halves along the boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Fig. 9, because the boundaries of the second coding units 910a, 910b, and 910c determined by splitting the square first coding unit 900 in the vertical direction do not split the width of the first coding unit 900 into two halves, it can be determined that the first coding unit 900 does not meet the condition for processing in a predetermined order. In addition, because the boundaries of the second coding units 920a, 920b, and 920c determined by splitting the square first coding unit 900 in the horizontal direction do not split the height of the first coding unit 900 into two halves, it can be determined that the first coding unit 900 does not meet the condition for processing in a predetermined order. When the condition is not satisfied as described above, the image decoding device 100 may determine the disconnection of the scanning order, and may determine that the first coding unit 900 will be split into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is split into an odd number of coding units, the image decoding device 100 may impose a predetermined restriction on the coding unit at a predetermined position in the split coding unit. The restriction or predetermined position is described above with reference to various embodiments, and therefore a detailed description thereof is not provided herein.

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

[0365] Reference Fig. 9 , the image decoding apparatus 100 may split the square first coding unit 900 or the non-square first coding unit 930 or 950 into coding units of various shapes.

[0366] Fig.10 It is shown that shapes into which the second coding unit can be split are restricted when a second coding unit having a non-square shape (determined when the image decoding device 100 splits the first coding unit 1000 ) satisfies a predetermined condition according to an embodiment.

[0367] According to an embodiment, the image decoding device 100 may determine to split the square first coding unit 1000 into non-square second coding units 1010a and 1010b or 1020a and 1020b based on at least one of the block shape information and the split shape mode information obtained by the receiver (not shown). The second coding units 1010a and 1010b or 1020a and 1020b may be split independently. Therefore, the image decoding device 100 may determine whether to split each of the second coding units 1010a and 1010b or 1020a and 1020b into a plurality of coding units based on at least one of the block shape information and the split shape mode information about each of the second coding units 1010a and 1010b or 1020a and 1020b. According to an embodiment, the image decoding device 100 may determine the third coding units 1012a and 1012b by splitting the non-square left second coding unit 1010a determined by splitting the first coding unit 1000 in the vertical direction in the horizontal direction. However, when the left second coding unit 1010a is split in the horizontal direction, the image decoding device 100 may restrict the right second coding unit 1010b from being split in the horizontal direction in which the left second coding unit 1010a is split. When the third coding units 1014a and 1014b are determined by splitting the right second coding unit 1010b in the same direction, since the left second coding unit 1010a and the right second coding unit 1010b are independently split in the horizontal direction, the third coding units 1012a and 1012b or 1014a and 1014b may be determined. However, this case is the same as the case in which the image decoding device 100 splits the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on at least one of the block shape information and the split shape mode information, and may be inefficient in terms of image decoding.

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

[0369] Fig.11 A process of splitting a square coding unit performed by the image decoding device 100 when split shape mode information indicates that the square coding unit is not split into four square coding units according to an embodiment is illustrated.

[0370] According to an embodiment, the image decoding device 100 may determine the second coding units 1110a and 1110b or 1120a and 1120b, etc. by splitting the first coding unit 1100 based on at least one of the block shape information and the split shape mode information. The split shape mode information may include information about various methods of splitting the coding unit, but the information about the various split methods may not include information for splitting the coding unit into four square coding units. Based on the split shape mode information, the image decoding device 100 does not split the square first coding unit 1100 into four square second coding units 1130a, 1130b, 1130c, and 1130d. The image decoding device 100 may determine the non-square second coding units 1110a and 1110b or 1120a and 1120b, etc. based on the split shape mode information.

[0371] According to an embodiment, the image decoding device 100 may independently split the non-square second coding units 1110a and 1110b or 1120a and 1120b, etc. Each of the second coding units 1110a and 1110b or 1120a and 1120b, etc. may be recursively split in a predetermined order, and the splitting method may correspond to a method of splitting the first coding unit 1100 based on at least one of the block shape information and the split shape mode information.

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

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

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

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

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

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

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

[0379] Reference Fig.12, the square third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d can be determined by splitting the second coding units 1210a and 1210b and 1220a and 1220b, respectively. Although the second coding units 1210a and 1210b are determined by splitting the first coding unit 1200 in the vertical direction, unlike the second coding units 1220a and 1220b determined by splitting the first coding unit 1200 in the horizontal direction, the third coding units 1216a, 1216b, 1216c and 1216d and 1226a, 1226b, 1226c and 1226d split therefrom ultimately show the same shape of coding units split from the first coding unit 1200. Therefore, by recursively splitting the coding units in different ways based on at least one of the block shape information and the split shape mode information, the image decoding device 100 can process a plurality of coding units in different orders even if it is finally determined that the coding units have the same shape.

[0380] Fig.13 A process of determining a depth of a coding unit as a shape and a size of a coding unit change when a coding unit is recursively split in order to determine a plurality of coding units according to an embodiment is illustrated.

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

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

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

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

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

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

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

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

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

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

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

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

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

[0394] According to an embodiment, the image decoding device 100 may determine a plurality of second coding units 1412a and 1412b and 1414a, 1414b and 1414c by splitting the first coding unit 1410 having a height greater than a width in a horizontal direction based on the split shape pattern information. According to an embodiment, the image decoding device 100 may determine a plurality of second coding units 1422a and 1422b and 1424a, 1424b and 1424c by splitting the first coding unit 1420 having a width greater than a height in a vertical direction based on the split shape pattern information.

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

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

[0397] According to an embodiment, when the sizes of the odd-numbered split coding units are not equal, the image decoding apparatus 100 may determine a PID for identifying the split coding units based on a size ratio between the coding units. Fig.14 , the coding unit 1414b at the center position among the odd-numbered split coding units 1414a, 1414b, and 1414c may have the same width as the other coding units 1414a and 1414c and twice the height of the other coding units 1414a and 1414c. That is, in this case, the coding unit 1414b at the center position may include two of the other coding units 1414a or 1414c. Therefore, when the PID of the coding unit 1414b at the center position is 1 based on the scanning order, the PID of the coding unit 1414c located next to the coding 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, the image decoding device 100 may determine whether the odd-numbered split coding units have equal sizes based on whether there is discontinuity in the PID used to identify the split coding units.

[0398] According to an embodiment, the image decoding apparatus 100 may determine whether to use a specific splitting method based on a PID value for identifying a plurality of coding units determined by splitting a current coding unit. Fig.14, the image decoding device 100 can determine the even number of coding units 1412a and 1412b or the odd number of coding units 1414a, 1414b and 1414c by splitting the first coding unit 1410 having a rectangular shape with a height greater than a width. The image decoding device 100 can use the PID indicating the corresponding coding unit in order to identify the corresponding coding unit. According to an embodiment, the PID can be obtained from a sample at a predetermined position of each coding unit (for example, an upper left sample).

[0399] According to an embodiment, the image decoding device 100 may determine a coding unit at a predetermined position in the split coding unit by using a PID for distinguishing the coding unit. According to an embodiment, when the split shape mode information of the first coding unit 1410 having a rectangle with a height greater than a width indicates that the coding unit is split into three coding units, the image decoding device 100 may split the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The image decoding device 100 may assign a PID to each of the three coding units 1414a, 1414b, and 1414c. The image decoding device 100 may compare the PIDs of the odd-numbered split coding units to determine a coding unit located at a central position in the coding unit. The image decoding device 100 may determine the coding unit 1414b having a PID corresponding to an intermediate value in the PID of the coding unit as a coding unit at a central position in the coding unit determined by splitting the first coding unit 1410. According to an embodiment, when the split coding units do not have equal sizes, the image decoding device 100 may determine the PID for distinguishing the split coding units based on the size ratio between the coding units. Reference Fig.14, the coding unit 1414b generated by splitting the first coding unit 1410 may have the same width as the other coding units 1414a and 1414c and twice the height of the other coding units 1414a and 1414c. In this case, when the PID of the coding unit 1414b at the center position is 1, the PID of the coding unit 1414c located next to the coding unit 1414b may be increased by 2, and thus may be 3. When the PID does not increase uniformly as described above, the image decoding device 100 may determine that the coding unit is split into a plurality of coding units, the plurality of coding units including coding units having sizes different from other coding units. According to an embodiment, when the split shape mode information indicates that the coding unit is split into an odd number of coding units, the image decoding device 100 may split the current coding unit in such a manner that a coding unit at a predetermined position in the odd number of coding units (e.g., a coding unit at the center position) has a size different from other coding units. In this case, the image decoding device 100 may determine the coding unit at the center position having a different size by using the PID of the coding unit. However, the PID and the size or position of the coding unit of the predetermined position are not limited to the above-mentioned examples, and various PIDs and various positions and sizes of the coding unit may be used.

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

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

[0402] According to an embodiment, a predetermined data unit may be defined as a data unit that starts recursively splitting a coding unit by using at least one of block shape information and split shape mode information. That is, the predetermined data unit may correspond to a coding unit of the highest depth, which is used to determine a plurality of coding units split from a current picture. In the following description, for ease of explanation, the predetermined data unit is referred to as a reference data unit.

[0403] According to an embodiment, the reference data unit may have a predetermined size and a predetermined shape. According to an embodiment, the reference data unit may include M×N samples. Here, M and N may be equal to each other and may be an integer represented as a power of 2. That is, the reference data unit may have a square or non-square shape and may then be split into an integer number of coding units.

[0404] According to an embodiment, the image decoding device 100 may split the current picture into a plurality of reference data units. According to an embodiment, the image decoding device 100 may split the plurality of reference data units split from the current picture by using the split shape pattern information of each reference data unit. The operation of splitting the reference data unit may correspond to a splitting operation using a quadtree structure.

[0405] According to an embodiment, 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 various reference data units whose sizes are equal to or greater than the minimum size, and may determine one or more coding units by referring to the determined reference data unit using block shape information and split shape mode information.

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

[0407] According to an embodiment, a receiver (not shown) of the image decoding device 100 may obtain at least one of reference coding unit shape information and reference coding unit size information about each of the corresponding data units from a bitstream. Figure 3 The operation of splitting the current coding unit 300 described above is to split the square reference coding unit 1500 into one or more coding units, and Figure 4 The operation of splitting the current coding unit 400 or 450 of the non-square reference coding unit 1502 into one or more coding units is described above. Therefore, a detailed description thereof will not be provided herein.

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

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

[0410] Fig.16 A processing block serving as a criterion for determining an order of reference coding units included in the picture 1600 according to an embodiment is shown.

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

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

[0413] According to an embodiment, a receiver (not shown) of the image decoding device 100 may obtain processing block size information from a bitstream according to each specific data unit. For example, the processing block size information may be obtained from a bitstream in data units such as images, sequences, pictures, slices, slice segments, etc. That is, the receiver (not shown) may obtain processing block size information from a bitstream according to each of the various data units, and the image decoding device 100 may determine the size of one or more processing blocks split from a picture by using the obtained processing block size information. The size of a processing block may be an integer multiple of a reference coding unit.

[0414] According to an embodiment, the image decoding device 100 may determine the size of the processing blocks 1602 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, the image decoding device 100 may determine the width of the processing blocks 1602 and 1612 to be four times the width of the reference coding unit, and may determine the height of the processing blocks 1602 and 1612 to be four times the height of the reference coding unit. The image decoding device 100 may determine the determination order of one or more reference coding units in one or more processing blocks.

[0415] According to an embodiment, 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 coding units in the processing blocks 1602 and 1612. According to an embodiment, the determination of the reference coding unit may include determination of the size of the reference coding unit.

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

[0417] According to an embodiment, the image decoding device 100 may obtain the determination order information of the reference coding unit according to each specific data unit from the bitstream. For example, a receiver (not shown) may obtain the determination order information of the reference coding unit from the bitstream according to each data unit (such as an image, a sequence, a picture, a slice, a slice segment, or a processing block). Because the determination order information of the reference coding unit indicates the order of the reference coding unit used to determine the processing block, the determination order information about each specific data unit including an integer number of processing blocks can be obtained.

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

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

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

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

[0422] The following will refer to FIG. 17A to FIG. 21D An image encoding device, an image decoding device, an image encoding method, and an image decoding method for encoding or decoding an image by performing inter-frame prediction or the like on a data unit determined in various shapes according to various embodiments are described.

[0423] FIG. 17A to FIG. 17C is a diagram for describing a process of determining a shape of a chroma block and motion information for motion compensation of the chroma block when the format of a chroma image is 4:2:2 according to an embodiment.

[0424] Fig.17A is a diagram for describing the shape of a chroma block when the format of a chroma image is 4:2:2 according to an embodiment.

[0425] Reference Fig.17A, when the format of the chrominance image is 4:2:2, the image decoding apparatus 100 may determine a 2×4 chrominance block U / V 1710 corresponding to a 4×4 luminance block Y 1705. That is, the image decoding apparatus 100 may determine a rectangular chrominance block with respect to a square luminance block. That is, the image decoding apparatus 100 may determine a chrominance block having the same height as the luminance block and half the width of the luminance block.

[0426] Fig. 17B is a diagram for describing a process of performing motion compensation by merging motion information of chroma blocks adjacent to each other in the left-right direction when the format of a chroma image is 4:2:2 according to an embodiment.

[0427] Reference Fig. 17B , the image decoding device 100 may generate motion vectors 1745 and 1750 of the 4×4 chroma blocks 1735 and 1740 by merging the motion vectors 1725 and 1730 of the 2×4 chroma blocks 1715 and 1720 adjacent to each other in the left-right direction. In this case, the image decoding device 100 may determine the average value of the motion vectors 1725 and 1730 of the 2×4 chroma blocks 1715 and 1720 adjacent to each other in the left-right direction as the value of the motion vectors 1745 and 1750 of the 4×4 chroma blocks 1735 and 1740. The values ​​of the motion vectors 1725 and 1730 may be determined based on the value of the motion vector of the luminance block corresponding to the chroma blocks 1715 and 1720.

[0428] The image decoding device 100 may perform motion compensation on the 4×4 chroma blocks 1735 and 1740 using the motion vectors 1745 and 1750 .

[0429] Fig. 17C is a diagram for describing a process of performing motion compensation by performing interpolation based on motion information of adjacent chroma blocks when the format of a chroma image is 4:2:2 according to an embodiment.

[0430] Reference Fig. 17C , the image decoding device 100 may perform interpolation processing on the motion vector 1760 of the 2×4 chroma block 1755, and determine the motion vector 1770 of the 2×2 chroma block 1765 according to the result of performing the interpolation processing. The image decoding device 100 may perform motion compensation processing on the 2×2 chroma block by using the motion vector 1770.

[0431] FIG. 18A to FIG. 18C is a diagram for describing a problem in which a memory bandwidth increases when decoding is performed based on a DMVR technology and a method of solving the problem according to an embodiment.

[0432] Fig.18Ais a diagram for describing a problem of memory bandwidth increase during decoding based on a DMVR technique according to an embodiment.

[0433] Reference Fig.18A , the image decoding device 100 may determine a reference block 1800 corresponding to the current block based on a motion vector during motion compensation. However, in order to refine the motion vector during inter-frame prediction based on the DMVR technique, the image decoding device 100 may refer to a pixel value of a neighboring area 1810 of the reference block 1800. That is, the image decoding device 100 may additionally obtain the neighboring area 1810 to refine the motion vector. In this case, the memory bandwidth may increase.

[0434] Fig.18B is a diagram for describing a process of refining a motion vector by referring only to an internal value of a reference block during decoding based on a DMVR decoding technique according to an embodiment.

[0435] Reference Fig.18B , in order to solve the above reference Fig.18A To solve the problem, the image decoding device 100 can perform the following processing.

[0436] The image decoding device 100 may perform a motion vector refinement process using only the pixel values ​​of the overlapping portion 1840 between the search area 1830 for motion vector refinement and the reference block 1820 determined based on the motion vector. That is, the image decoding device 100 may determine the pixel values ​​of the non-overlapping portion 1850 by extending the pixel values ​​of the overlapping portion 1840, and perform a motion vector refinement process based on the pixel values ​​of the search area 1830. In this case, the image decoding device 100 may determine the pixel values ​​of the non-overlapping portion 1850 by performing a padding process in the horizontal and vertical directions using the pixel values ​​of the boundary between the non-overlapping portion 1850 and the overlapping portion 1840. The embodiments of the present disclosure are not limited thereto, and the image decoding device 100 may perform a clipping process on the pixel coordinates of the non-overlapping portion 1850 to modify the pixel coordinates to the coordinates inside the overlapping portion 1840, and refer to the pixel values ​​based on the modified coordinates. The image decoding device 100 may perform a motion vector refinement process by referring only to the pixel values ​​of the reference block 1820, thereby preventing the above-mentioned reference from being used. Fig.18A Describes the increase in memory bandwidth.

[0437] Fig.18C is a diagram for describing a process of refining a motion vector by referring to only an internal value of a reference block during decoding based on a DMVR decoding technique according to an embodiment.

[0438] Reference Fig.18C , in order to solve the above reference Fig.18ATo solve the problem, the image decoding device 100 can perform the following processing.

[0439] The image decoding device 100 may limit the search area 1870 for motion vector refinement to the inside of the reference block 1860. That is, the image decoding device 100 may prevent the above reference block 1860 from being searched for by determining an area smaller than the reference block 1860 as the search area 1870 for motion vector refinement. Fig.18A Describes the increase in memory bandwidth.

[0440] Fig.19 is a diagram for describing a delay problem that may occur during decoding based on a DMVR technology and a method of solving the problem according to an embodiment.

[0441] Reference Fig.19 , the image decoding device 100 may perform a process of parsing an initial motion vector of the coding unit CU0 and pre-fetching a reference block based on the parsing result at time T0 (1910). The image decoding device 100 may perform refinement on the first motion vector of time T1 based on the first motion vector of the coding unit CU0 and the reference block (1920).

[0442] The image decoding device 100 may refer to the motion vector of the adjacent block CU0 to perform a process of parsing the initial motion vector of the coding unit CU1 and pre-fetching the reference block based on the parsing result. In this case, the referenced motion vector may be a refined motion vector. Therefore, the image decoding device 100 may perform a process of refining the initial motion vector of the coding unit CU0 (1920), parsing the initial motion vector of the coding unit CU1 by referring to the refined motion vector (1940), and pre-fetching the reference block based on the parsing result (1930) of time T2. Therefore, as long as the motion vector of the current block is determined based on the motion vector of the adjacent block, the image decoding device 100 may decode the motion vector of the currently decoded block just after the motion vector refinement process based on the DMVR technology is performed on the previously decoded block, thereby causing inter-process correlation. Ultimately, due to this correlation, a delay problem occurs.

[0443] To solve this problem, the image decoding device 100 may perform a process of decoding a motion vector of a subsequent block based on an initially decoded unrefined motion vector instead of a motion vector refined based on the DMVR technique. However, in this case, a loss may occur due to the use of an initially decoded unrefined motion vector. When determining a motion vector of a current block based on a motion vector of a previous block initially decoded, the image decoding device 100 may assign a low priority to a motion vector of an inter-frame prediction neighboring block based on DMVR during configuration of an AMVP or a merge candidate list.

[0444] In order to reduce the loss, the image decoding apparatus 100 may not allow some blocks to be subjected to inter-frame prediction processing based on the DMVR technique based on a predetermined condition. In this case, the condition may be a condition that the number of neighboring blocks for inter-frame prediction based on the DMVR technique is N or more.

[0445] FIG. 20A to FIG. 20C is a diagram for describing a correlation quantization process according to an embodiment.

[0446] Fig. 20A is a diagram illustrating a process of quantizing a current transform coefficient based on a correlation quantization process according to an embodiment.

[0447] Reference Fig. 20A , the image encoding device 200 can determine candidates A and B 2010 of the quantization unit Q0 and candidates C and D 2020 of the quantization unit Q1 based on the original transform coefficient 2005 generated by the transform process.

[0448] The image encoding device 200 may calculate a rate-distortion (RD) cost based on the state of the transform coefficient parity and the candidates 2010 and 2020, and determine a quantization unit to be used for the current transform coefficient and a quantization coefficient for the current transform coefficient based on the RD cost. The image encoding device 200 may modify the parity of the current original transform coefficient or the parity of the previous original transform coefficient based on the RD cost, determine the quantization unit to be used for the current transform coefficient, and quantize the current transform coefficient. Fig. 20B and Fig. 20C Describes the status of the parity check based on the transform coefficients.

[0449] The reconstruction level t′ corresponding to the quantization unit Q0 may be determined based on Equation 5 below.

[0450] [Equation 5]

[0451] t'=2*k*△

[0452] In this case, k is the associated transform coefficient level, may be the quantized transform coefficient (quantization index) to be transmitted, and Δ may be the quantization step size.

[0453] The reconstruction level t′ corresponding to the quantization unit Q1 may be determined based on Equation 6 below.

[0454] [Equation 6]

[0455] t'=(2*k-sgn(k))*△

[0456] In this case, sgn(k) can be determined according to the following Equation 7.

[0457] [Equation 7]

[0458] sgn(k)=(k==0?0:(k<0?-1:1))

[0459] Fig. 20B and Fig. 20C is a diagram showing a parity-based state machine and state table for performing a correlation quantization process of coefficients.

[0460] Reference FIG. 20B to FIG. 20C , the image encoding device 200 may determine the initial state as state 0, and when the parity check of the coefficient level k currently encoded is 0 (k&1)==0), the next state is determined to be state 0. When the parity check of the coefficient level k currently encoded is 1 ((k&1)==1), the image encoding device 200 may determine the next state to be state 2.

[0461] When the current state is state 2, when the parity of the currently encoded coefficient level k is 0 ((k&1)==0), the image encoding device 200 may determine the next state to be state 1.

[0462] When the current state is state 2, when the parity check of the currently encoded coefficient level k is 1 ((k&1)==1), the image encoding device 200 can determine the next state to be state 3.

[0463] When the current state is state 1, when the parity of the currently encoded coefficient level k is 0 ((k&1)==0), the image encoding device 200 may determine the next state to be state 2.

[0464] When the current state is state 1, when the parity check of the currently encoded coefficient level k is 1 ((k&1)==1), the image encoding device 200 may determine the next state to be state 0.

[0465] When the current state is state 3, when the parity check of the currently encoded coefficient level k is 0 ((k&1)==0), the image encoding device 200 can determine the next state to be state 3.

[0466] When the current state is state 3, when the parity check of the currently encoded coefficient level k is 1 ((k&1)==1), the image encoding device 200 may determine the next state to be state 1.

[0467] In addition, the image encoding device 200 may determine one of the quantization units Q0 and Q1 based on the next state. When the next state is state 0 or 1, the image encoding device 200 may determine the quantization unit Q0 as the quantization unit of the current transform coefficient. When the state is state 2 or 3, the image encoding device 200 may determine the quantization unit Q1 as the quantization unit of the current transform coefficient.

[0468] Refer to above FIG. 20A to FIG. 20C The relevant quantization processing according to the embodiment is described. However, although it has been described that the image encoding device 200 changes the state based on the parity of the current transform coefficient, the embodiments of the present disclosure are not limited thereto, and it will be easily understood by those skilled in the art that the state can be changed based on the parity of the immediately decoded coefficient.

[0469] Refer to above FIG. 20A to FIG. 20C The related quantization process according to the embodiment is described. However, the embodiments of the present disclosure are not limited thereto, and it will be easily understood by those skilled in the art that the resolution of the MVD and the state machine for determining the MVD may be determined during encoding based on the AVMR technology, similar to the state machine of the related quantization process. That is, the quantization parameters for the quantization units Q0 and Q1 may correspond to the resolution of the MVD, and the MVD of the current block may correspond to the level of the current transform coefficient.

[0470] FIG. 21A to FIG. 21D is a diagram showing a residual encoding syntax structure according to various embodiments.

[0471] Fig.21A is a diagram showing a residual encoding syntax structure according to an embodiment.

[0472] Reference Fig.21A , the image decoding device 100 can parse and decode each syntax element from the bitstream based on the illustrated residual coding syntax structure, and derive information indicated by each syntax element.

[0473] The image decoding apparatus 100 may parse the syntax element sig_coeff_flag 2105 from the bitstream and perform context model-based entropy decoding (ae(v)) on the syntax element sig_coeff_flag 2105. The syntax element sig_coeff_flag 2105 may be a flag indicating whether the absolute value of the transform coefficient of the current scan position (xC, yC) (determined based on n) is greater than 0.

[0474] When the syntax element sig_coeff_flag 2105 is 1, the image decoding device 100 may parse the syntax element par_level_flag 2110 from the bitstream and perform context-dependent entropy decoding (ae(v)) on the syntax element par_level_flag 2110 .

[0475] In this case, the syntax element par_level_flag 2110 may indicate the parity of the transform coefficient at the scan position n, which may be consistent with FIG. 20A to FIG. 20C The same as (k&1).

[0476] When the image decoding apparatus 100 parses flags of parity checks of all transform coefficients from a bitstream and performs context-based entropy decoding thereon, complexity may be significantly increased.

[0477] Therefore, the image decoding device 100 may not parse the flag of the transform coefficient at certain positions from the bitstream, and set the current state to state 0 (initial state) or state 1 regardless of the value of the parity check of the transform coefficient at certain positions, or determine the value of the parity check corresponding to state 0 or state 1. That is, for the transform coefficient at certain positions, the inverse quantization unit Q0 having a quantization parameter lower than the quantization parameter of the inverse quantization unit Q1 can be used for high precision, and the value of the parity check flag can be derived, or its state can be determined without parsing the parity check flag. However, the embodiments of the present disclosure are not limited to this, and the value of the current parity check flag can be derived based on the parity check of the previous coefficient, and the state of the state machine and the inverse quantization unit for the current transform coefficient can be determined based on the value of the current parity check flag.

[0478] Fig.21B is a diagram showing a residual encoding syntax structure according to another embodiment of the present disclosure.

[0479] Reference Fig.21B ,and Fig.21A Differently, only when the conditional sentence 2120 is satisfied, the syntax element par_level_flag 2130 can be parsed from the bitstream and entropy decoded (ae(v)). That is, the image decoding device 100 can parse the syntax element par_level_flag 2130 from the bitstream, and perform entropy decoding (ae(v)) only when the condition that the scanning position n should be greater than A and less than B is satisfied.

[0480] Fig. 21C is a diagram showing a residual coding syntax structure according to another embodiment of the present disclosure.

[0481] Reference Fig. 21C ,and Fig.21A Differently, only when the conditional sentence 2140 is satisfied, the syntax element par_level_flag 2150 can be parsed from the bitstream and entropy decoded (ae(v)). That is, the image decoding device 100 can parse the syntax element par_level_flag 2150 from the bitstream, and perform entropy decoding (ae(v)) only when the condition that the scanning position n should be less than A is satisfied.

[0482] Fig.21D is a diagram showing a residual coding syntax structure according to another embodiment of the present disclosure.

[0483] Reference Fig.21D ,and Fig.21A Differently, only when the conditional statement 2160 is satisfied, the syntax element par_level_flag 2170 can be parsed from the bitstream and entropy decoded (ae(v)). That is, the image decoding device 100 can parse the syntax element par_level_flag 2170 from the bitstream and perform entropy decoding (ae(v)) only when the condition that the scanning position n should be greater than A is satisfied.

[0484] Although the above reference FIG. 21A to FIG. 21D An embodiment of the present disclosure in which the image decoding device 100 limits the number of syntax elements par_level_flag parsed from a bitstream is described, but the embodiment of the present disclosure is not limited thereto, and when the number of syntax elements par_level_flag parsed from a bitstream is counted and the counted number of syntax elements par_level_flag is greater than or equal to a predetermined value, the syntax element par_level_flag can no longer be parsed from the bitstream. In this case, the image decoding device 100 may count not only the syntax element par_level_flag parsed from the bitstream, but also at least one of the syntax elements sig_coeff_flag and rem_abs_gt1_flag parsed from the bitstream.

[0485] Here, the syntax element sig_coeff_flag may be a flag indicating whether a currently scanned coefficient is a significant coefficient (ie, whether the absolute value of the coefficient is greater than 0), and the syntax element rem_abs_gt1_flag may be a flag indicating whether the absolute value of the currently scanned coefficient is greater than 1.

[0486] Although the above reference FIG. 17A to FIG. 19 as well as FIG. 21A to FIG. 21D The operation of the image decoding device 100 is described, but a person of ordinary skill in the art will readily understand that the image encoding device 200 may perform operations similar to those of the image decoding device 100 .

[0487] Similarly, although reference has been made above FIG. 20A to FIG. 20C The operation of the image encoding device 200 has been described, and a person of ordinary skill in the art will readily understand that the image decoding device 100 may perform operations similar to those of the image encoding device 200 .

[0488] Various embodiments have been described above. It will be appreciated by those skilled in the art that the present disclosure may be embodied in many different forms without departing from the basic features of the present disclosure. Therefore, the embodiments of the present disclosure set forth herein should be considered only in a descriptive sense, and not for the purpose of limitation. The scope of the present disclosure is set forth in the claims rather than in the foregoing description, and all differences within the scope equivalent thereto should be interpreted as included in the present disclosure.

[0489] The above-mentioned embodiments of the present disclosure may be written as a computer executable program and implemented by a general-purpose digital computer operating the program through a computer-readable recording medium. The computer-readable recording medium may include storage media such as magnetic storage media (e.g., ROM, floppy disk, hard disk, etc.) and optical recording media (e.g., CD-ROM, DVD, etc.).

Claims

1. An image decoding method, comprising: When the prediction mode of the coding unit is an affine mode, obtaining a first motion vector of a first N×N luminance subblock in the coding unit; Obtaining a second motion vector of a second N×N luminance subblock in the coding unit, wherein the second N×N luminance subblock is to the right of the first N×N luminance subblock; determining a chroma motion vector using an average motion vector determined by averaging the first motion vector and the second motion vector; and A prediction sample of an N×N chroma subblock is obtained using a chroma motion vector and a reference image, wherein the N×N chroma subblock includes a first N / 2×N chroma subblock corresponding to the first N×N luminance subblock and a second N / 2×N chroma subblock corresponding to the second N×N luminance subblock.

2. An image decoding device, comprising at least one processor, wherein the at least one processor is configured to: When the prediction mode of the coding unit is an affine mode, obtaining a first motion vector of a first N×N luminance subblock in the coding unit; Obtaining a second motion vector of a second N×N luminance subblock in the coding unit, wherein the second N×N luminance subblock is to the right of the first N×N luminance subblock; determining a chroma motion vector using an average motion vector determined by averaging the first motion vector and the second motion vector; and A prediction sample of an N×N chroma subblock is obtained using a chroma motion vector and a reference image, wherein the N×N chroma subblock includes a first N / 2×N chroma subblock corresponding to the first N×N luminance subblock and a second N / 2×N chroma subblock corresponding to the second N×N luminance subblock.

3. An image encoding method, comprising: When the prediction mode of the coding unit is an affine mode, obtaining a first motion vector of a first N×N luminance subblock in the coding unit; Obtaining a second motion vector of a second N×N luminance subblock in the coding unit, wherein the second N×N luminance subblock is to the right of the first N×N luminance subblock; determining a chroma motion vector using an average motion vector determined by averaging the first motion vector and the second motion vector; and A prediction sample of an N×N chroma subblock is obtained using a chroma motion vector and a reference image, wherein the N×N chroma subblock includes a first N / 2×N chroma subblock corresponding to the first N×N luminance subblock and a second N / 2×N chroma subblock corresponding to the second N×N luminance subblock.

4. A non-transitory computer-readable storage medium storing a bitstream, the bitstream being encoded by an image encoding method, the image encoding method comprising: When the prediction mode of the coding unit is an affine mode, obtaining a first motion vector of a first N×N luminance subblock in the coding unit; Obtaining a second motion vector of a second N×N luminance subblock in the coding unit, wherein the second N×N luminance subblock is to the right of the first N×N luminance subblock; determining a chroma motion vector using an average motion vector determined by averaging the first motion vector and the second motion vector; and A prediction sample of an N×N chroma subblock is obtained using a chroma motion vector and a reference image, wherein the N×N chroma subblock includes a first N / 2×N chroma subblock corresponding to the first N×N luminance subblock and a second N / 2×N chroma subblock corresponding to the second N×N luminance subblock.