Image decoding method, image decoding device, image encoding method and image encoding device

WO2025042162A1PCT designated stage expired Publication Date: 2025-02-27SAMSUNG ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2024/012277
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-30
Filing Date
2024-08-19
Publication Date
2025-02-27

Smart Images

  • Figure KR2024012277_27022025_PF_FP_ABST
    Figure KR2024012277_27022025_PF_FP_ABST
Patent Text Reader

Abstract

Presented are an image decoding method and device comprising: deriving a filter for chroma prediction on the basis of at least one reference luma sample of a reference luma area and first and second reference chroma samples of a reference chroma area; acquiring at least one luma residual sample from a bitstream; acquiring first and second chroma prediction residual samples by applying the luma residual sample to the filter; acquiring enhanced first and second chroma prediction samples by using each of the first and second chroma prediction residual samples and the first and second reference chroma samples; acquiring first and second chroma residual samples from the bitstream; and acquiring first and second chroma reconstruction samples by using each of the first and second chroma residual samples and the enhanced first and second chroma prediction samples, thereby reconstructing the current chroma sample.
Need to check novelty before this filing date? Find Prior Art

Description

Image decoding method, image decoding device, image encoding method, and image encoding device

[0001] The present disclosure relates to an image decoding method, an image decoding device, an image encoding method, and an image encoding device, and more particularly, to image decoding and encoding, which derive a filter from a reference luma sample and a reference chroma sample of a reference area pointed to by a current block, apply a luma residual sample of the current block to the derived filter to obtain a chroma prediction residual sample, and perform chroma prediction of the current block using the chroma prediction residual sample and the reference chroma sample of the reference area.

[0002] Pixels in a video are expressed in color spaces such as RGB, YCbCr, etc., and in codecs such as H.264 AVC (Advanced Video Coding), HEVC (High Efficiency Video Coding), and VVC (Versatile Video Coding), the YCbCr color space, which mainly consists of a luminance component (Y) and two chrominance components (Cb, Cr), is used. There is a correlation between the color space components. For example, there is a correlation between the luminance component Y and the chrominance component Cb, a correlation between the luminance component Y and the chrominance component Cr, and a correlation between the chrominance component Cb and the chrominance component Cr. Through this, other specific components can be predicted using one or more other components.

[0003] In video compression standard technology, various prediction methods that utilize the correlation between color components are proposed to increase compression efficiency.

[0004] According to one embodiment of the present disclosure, a video decoding method comprises: deriving a filter for chroma prediction of a current chroma sample included in a current chroma block based on at least one reference luma sample of a reference luma region indicated by a current luma block corresponding to a current chroma block and a first reference chroma sample and a second reference chroma sample of a reference chroma region corresponding to the reference luma region; obtaining at least one luma residual sample including a current luma residual sample corresponding to the current chroma sample of the current luma block from a bitstream; obtaining a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample by applying the at least one luma residual sample to a filter; obtaining an enhanced first chroma prediction sample using the first chroma prediction residual sample and the first reference chroma sample, and obtaining an enhanced second chroma prediction sample using the second reference chroma residual sample and the second chroma prediction sample; obtaining the first chroma residual sample and the second chroma residual sample for the current chroma sample from the bitstream; The step of restoring the current chroma sample may include obtaining a first chroma reconstruction sample using the first chroma residual sample and the enhanced first chroma prediction sample, and obtaining a second chroma reconstruction sample using the second chroma residual sample and the enhanced second chroma prediction sample.

[0005] An image decoding device according to one embodiment of the present disclosure may include a memory storing one or more instructions; and at least one processor operating according to the one or more instructions. The at least one processor may derive a filter for chroma prediction of a current chroma sample included in a current chroma block based on at least one reference luma sample of a reference luma region indicated by a current luma block corresponding to a current chroma block and a first reference chroma sample and a second reference chroma sample of a reference chroma region corresponding to the reference luma region. The at least one processor may obtain at least one luma residual sample including a current luma residual sample corresponding to a current chroma sample of the current luma block from a bitstream. The at least one processor may apply the at least one luma residual sample to a filter to obtain a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample. At least one processor can obtain an enhanced first chroma prediction sample using a first chroma prediction residual sample and a first reference chroma sample, and obtain an enhanced second chroma prediction sample using a second reference chroma residual sample and a second chroma prediction sample. The at least one processor can obtain a first chroma residual sample and a second chroma residual sample for a current chroma sample from a bitstream. The at least one processor can reconstruct the current chroma sample by obtaining a first chroma reconstruction sample using the first chroma residual sample and the enhanced first chroma prediction sample, and obtaining a second chroma reconstruction sample using the second chroma residual sample and the enhanced second chroma prediction sample.

[0006] According to one embodiment of the present disclosure, a video encoding method comprises: deriving a filter for chroma prediction of a current chroma sample included in a current chroma block based on at least one reference luma sample of a reference luma area indicated by a current luma block corresponding to a current chroma block and a first reference chroma sample and a second reference chroma sample of a reference chroma area corresponding to the reference luma area; generating at least one luma residual sample including a current luma residual sample corresponding to the current chroma sample of the current luma block based on an original block of the reference luma area and the current luma block; applying the at least one luma residual sample to a filter to obtain a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample; obtaining an enhanced first chroma prediction sample using the first chroma prediction residual sample and the first reference chroma sample, and obtaining an enhanced second chroma prediction sample using the second reference chroma residual sample and the second chroma prediction sample; The method may include generating a first chroma residual sample based on a first chroma source sample and an enhanced first chroma prediction sample for a current chroma sample, and generating a second chroma residual sample based on a second chroma source sample and an enhanced second chroma prediction sample for the current chroma sample; and generating a bitstream including at least one luma residual sample, the first chroma residual sample, and the second chroma residual sample.

[0007] An image encoding device according to one embodiment of the present disclosure may include a memory storing one or more instructions; and at least one processor operating according to the one or more instructions. The at least one processor may derive a filter for chroma prediction of a current chroma sample included in a current chroma block based on at least one reference luma sample of a reference luma region indicated by a current luma block corresponding to a current chroma block and a first reference chroma sample and a second reference chroma sample of a reference chroma region corresponding to the reference luma region. The at least one processor may generate at least one luma residual sample including a current luma residual sample corresponding to a current chroma sample of the current luma block based on the reference luma region and an original block of the current luma block. The at least one processor may apply the at least one luma residual sample to a filter to obtain a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample. At least one processor can obtain an enhanced first chroma prediction sample using a first chroma prediction residual sample and a first reference chroma sample, and obtain an enhanced second chroma prediction sample using a second reference chroma residual sample and a second chroma prediction sample. The at least one processor can generate a first chroma residual sample based on the first chroma source sample and the enhanced first chroma prediction sample for a current chroma sample, and generate a second chroma residual sample based on the second chroma source sample and the enhanced second chroma prediction sample for the current chroma sample. The at least one processor can generate a bitstream including at least one luma residual sample, the first chroma residual sample, and the second chroma residual sample.

[0008] FIG. 1 illustrates a schematic block diagram of an image decoding device according to one embodiment of the present disclosure.

[0009] FIG. 2 illustrates a flowchart of an image decoding method according to one embodiment of the present disclosure.

[0010] FIG. 3 illustrates a process in which an image decoding device divides a current encoding unit to determine at least one encoding unit according to one embodiment of the present disclosure.

[0011] FIG. 4 illustrates a process in which an image decoding device determines at least one encoding unit by dividing a non-square encoding unit according to one embodiment of the present disclosure.

[0012] FIG. 5 illustrates a process in which an image decoding device divides an encoding unit based on at least one of block shape information and division shape mode information according to one embodiment of the present disclosure.

[0013] FIG. 6 illustrates a method for a video decoding device to determine a predetermined encoding unit among an odd number of encoding units according to one embodiment of the present disclosure.

[0014] FIG. 7 illustrates the order in which multiple encoding units are processed when an image decoding device determines multiple encoding units by dividing a current encoding unit according to one embodiment of the present disclosure.

[0015] FIG. 8 illustrates a process of determining that a current encoding unit is divided into an odd number of encoding units when the encoding units cannot be processed in a predetermined order, according to one embodiment of the present disclosure.

[0016] FIG. 9 illustrates a process in which an image decoding device divides a first encoding unit to determine at least one encoding unit according to one embodiment of the present disclosure.

[0017] FIG. 10 illustrates that, according to one embodiment of the present disclosure, a video decoding device limits the shapes into which a second encoding unit can be divided when a non-square shape of a second encoding unit determined by dividing a first encoding unit satisfies a predetermined condition.

[0018] FIG. 11 illustrates a process of a video decoding device dividing a square-shaped encoding unit when the split shape mode information cannot indicate that the encoding unit is divided into four square-shaped encoding units according to one embodiment of the present disclosure.

[0019] FIG. 12 illustrates that, according to one embodiment of the present disclosure, the processing order between a plurality of encoding units may vary depending on the process of dividing the encoding units.

[0020] FIG. 13 illustrates a process in which the depth of an encoding unit is determined as the shape and size of the encoding unit change when the encoding unit is recursively divided to determine a plurality of encoding units according to one embodiment of the present disclosure.

[0021] FIG. 14 illustrates an index (part index, hereinafter referred to as PID) for depth and encoding unit distinction that can be determined according to the shape and size of encoding units according to one embodiment of the present disclosure.

[0022] FIG. 15 illustrates that a plurality of coding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment of the present disclosure.

[0023] FIG. 16 illustrates a processing block that serves as a criterion for determining the order of determination of reference coding units included in a picture according to one embodiment of the present disclosure.

[0024] FIG. 17 is a diagram for explaining a method of performing chroma prediction using a cross-component linear model (CCLM) according to one embodiment of the present disclosure.

[0025] FIG. 18 is a diagram for explaining a method of performing chroma prediction using a multi-model linear model (MMLM) according to one embodiment of the present disclosure.

[0026] FIG. 19 is a diagram for explaining a method of performing chroma prediction using regions other than the surrounding regions neighboring the current block according to one embodiment of the present disclosure.

[0027] FIG. 20 is a diagram for explaining a method of performing chroma prediction using a convolutional cross-component model (CCCM) according to one embodiment of the present disclosure.

[0028] FIG. 21 is a diagram for explaining a method of performing chroma prediction using a block vector guided convolution cross component model (BVG-CCCM) according to one embodiment of the present disclosure.

[0029] FIG. 22 is a diagram for explaining a method of performing chroma prediction using a cross component residual model (CCRM) according to one embodiment of the present disclosure.

[0030] FIG. 23 is a diagram illustrating the positions of luma samples to which a CCRM filter is applied, according to one embodiment of the present disclosure.

[0031] FIG. 24 is a diagram illustrating a method for performing chroma prediction using a luma residual sample of a current block and a reference chroma sample of a reference region according to one embodiment of the present disclosure.

[0032] FIG. 25 is a diagram illustrating a method for performing chroma prediction using a luma residual sample of a current block and a reference chroma sample of a reference region in BVG-CCCM according to one embodiment of the present disclosure.

[0033] FIG. 26 is a diagram illustrating a method for performing chroma prediction using a luma residual sample of a current block and a reference chroma sample of a reference region in CCRM according to one embodiment of the present disclosure.

[0034] FIG. 27 is a diagram for explaining an image decoding method according to one embodiment of the present disclosure.

[0035] FIG. 28 illustrates a block diagram of an image decoding device according to one embodiment of the present disclosure.

[0036] FIG. 29 is a drawing for explaining an image encoding method according to one embodiment of the present disclosure.

[0037] FIG. 30 illustrates a block diagram of an image encoding device according to one embodiment of the present disclosure.

[0038] In this disclosure, the expression “at least one of a, b or c” may refer to “a”, “b”, “c”, “a and b”, “a and c”, “b and c”, “all of a, b and c”, or variations thereof.

[0039] The advantages and features of the disclosed embodiments, and the methods for achieving them, will become clearer with reference to the embodiments described below, along with the accompanying drawings. However, the present disclosure is not limited to the embodiments disclosed below and may be implemented in various different forms. These embodiments are provided solely to ensure the completeness of the disclosure and to fully inform those skilled in the art of the present disclosure of the scope of the invention.

[0040] The terms used in this specification will be briefly explained, and the disclosed embodiments will be described in detail.

[0041] The terms used in this specification have been selected from widely used, current terms, taking into account the functions of the present disclosure. However, these terms may vary depending on the intentions of engineers working in the relevant fields, precedents, the emergence of new technologies, etc. Furthermore, in certain cases, terms may be arbitrarily selected by the applicant, and in such cases, their meanings will be described in detail in the relevant description of the invention. Therefore, the terms used in this disclosure should not be defined simply as names, but rather based on the meanings of the terms and the overall content of the present disclosure.

[0042] In this specification, singular expressions include plural expressions unless the context clearly specifies that they are singular.

[0043] When a part of a specification is said to "include" a component, this does not mean that it excludes other components, but rather that it may include other components, unless otherwise stated.

[0044] Additionally, the numbers used in the description of the specification (e.g., 1st, 2nd, etc.) are merely identifiers to distinguish one component from another.

[0045] Also, the term "part" used in the specification means a software or hardware component, and the "part" performs certain functions. However, the "part" is not limited to software or hardware. The "part" may be configured to reside on an addressable storage medium and may be configured to execute one or more processors. Thus, by way of example, the "part" includes components such as software components, object-oriented software components, class components, and task components, as well as processes, functions, attributes, procedures, subroutines, segments of program code, drivers, firmware, microcode, circuits, data, databases, data structures, tables, arrays, and variables. The functionality provided within the components and "parts" may be combined into a smaller number of components and "parts" or further separated into additional components and "parts."

[0046] According to one embodiment of the present disclosure, a "unit" may be implemented as 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, and the like. In some circumstances, a "processor" may also refer to an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a field-programmable gate array (FPGA), and the like. The term "processor" may also refer to a combination of processing devices, such as, for example, a combination of a DSP and a microprocessor, a combination of a plurality of microprocessors, a combination of one or more microprocessors in conjunction with a DSP core, or any other such configuration.

[0047] A processor may include various processing circuits and / or multiple processors. For example, the term “processor” as used herein, including in the claims, may include various processing circuits, including at least one processor. At least one processor, one or more processors may be configured to perform various functions described herein, individually and / or collectively, in a distributed fashion. As used herein, “processor,” “at least one processor,” and “one or more processors” may be configured to perform multiple functions. However, these terms encompass, without limitation, situations where one processor performs some of the functions and other processor(s) perform other parts of the functions, and situations where a single processor may perform all of the functions. Furthermore, the at least one processor may include a combination of processors that perform various of the disclosed functions in a distributed manner. At least one processor may execute program instructions to achieve or perform various functions.

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

[0049] Hereinafter, “image” may refer to a static image such as a still image of a video, or a dynamic image such as a moving image, i.e., the video itself.

[0050] Hereinafter, "sample" refers to data assigned to a sampling location in an image and is the subject of processing. For example, pixel values ​​in a spatial domain image or transformation coefficients in a transformation domain may be samples. A unit containing at least one such sample may be defined as a block.

[0051] Additionally, in this specification, 'current block' may mean a block of the maximum encoding unit, encoding unit, prediction unit, or transformation unit of the current image to be encoded or decoded, or a sub-block of the block.

[0052] Below, with reference to the attached drawings, a detailed description of the embodiments is provided so that those skilled in the art can easily implement the present disclosure. Furthermore, in order to clearly illustrate the present disclosure, portions irrelevant to the description are omitted from the drawings.

[0053] Hereinafter, with reference to FIGS. 1 to 16, an image encoding device and an image decoding device, an image encoding method, and an image decoding method according to an embodiment of the present disclosure are described in detail. With reference to FIGS. 3 to 16, a method for determining a data unit of an image according to an embodiment of the present disclosure is described, and with reference to FIGS. 17 and 18, methods for performing chroma prediction using a linear model according to a correlation between a luma component and a chroma component of a reference region according to an embodiment of the present disclosure are described, and with reference to FIG. 19, a method for performing chroma prediction using a region other than a surrounding region neighboring a current block is described, and with reference to FIGS. 20 to 23, a method for deriving a filter according to a correlation between a luma component and a chroma component of a reference region, and performing chroma prediction by applying a restored current luma sample to the filter is described, and with reference to FIGS. 24 to 30, a method for deriving a filter according to a correlation between a reference luma sample and a reference chroma sample of a reference region indicated by a current block, applying a current luma residual sample to the filter to obtain a current chroma prediction residual sample, obtaining an enhanced current chroma prediction sample using the current chroma prediction residual sample and the reference chroma sample, and obtaining an enhanced current chroma prediction sample using the enhanced current A method for performing chroma prediction based on chroma prediction samples and current chroma residual samples is described.

[0054] Hereinafter, with reference to FIGS. 1 and 2, a method and apparatus for adaptively selecting a context model based on various types of encoding units according to one embodiment of the present disclosure are described.

[0055] FIG. 1 illustrates a schematic block diagram of an image decoding device according to one embodiment of the present disclosure.

[0056] The video decoding device (100) may include a receiving unit (110) and a decoding unit (120). The receiving unit (110) and the decoding unit (120) may include at least one processor. In addition, the receiving unit (110) and the decoding unit (120) may include a memory that stores instructions to be executed by at least one processor.

[0057] The receiving unit (110) can receive a bitstream. The bitstream includes information obtained by encoding an image by an image encoding device (2200) described below. In addition, the bitstream can be transmitted from the image encoding device (2200). The image encoding device (2200) and the image decoding device (100) can be connected by wire or wirelessly, and the receiving unit (110) can receive the bitstream by wire or wirelessly. The receiving unit (110) can receive the bitstream from a storage medium such as an optical medium or a hard disk. The decoding unit (120) can restore the image based on information obtained from the received bitstream. The decoding unit (120) can obtain syntax elements for restoring the image from the bitstream. The decoding unit (120) can restore the image based on the syntax elements.

[0058] The operation of the video decoding device (100) will be described in more detail with reference to FIG. 2.

[0059] FIG. 2 illustrates a flowchart of an image decoding method according to one embodiment of the present disclosure.

[0060] According to one embodiment of the present disclosure, the receiving unit (110) receives a bitstream.

[0061] The image decoding device (100) performs a step (210) of obtaining a binstring corresponding to a splitting shape mode of an encoding unit from a bitstream. The image decoding device (100) performs a step (220) of determining a splitting rule of the encoding unit. In addition, the image decoding device (100) performs a step (230) of splitting the encoding unit into a plurality of encoding units based on at least one of the binstring corresponding to the splitting shape mode and the splitting rule. In order to determine the splitting rule, the image decoding device (100) may determine a first allowable range of the size of the encoding unit according to a ratio of the width and height of the encoding unit. In order to determine the splitting rule, the image decoding device (100) may determine a second allowable range of the size of the encoding unit according to the splitting shape mode of the encoding unit.

[0062] Below, the division of encoding units according to one embodiment of the present disclosure is described in detail.

[0063] First, a picture can be divided into one or more slices or one or more tiles. A slice or a tile can be a sequence of one or more Coding Tree Units (CTUs). The concept that contrasts with a Coding Tree Block (CTB) is a Coding Tree Block (CTB).

[0064] A maximum coding block (CTB) is an NxN block containing NxN samples (where N is an integer). Each color component can be divided into one or more maximum coding blocks.

[0065] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), a maximum coding unit (CTU) is a unit that includes a maximum coding block of luma samples, two maximum coding blocks of corresponding chroma samples, and syntax structures used to encode the luma samples and chroma samples. When a picture is a monochrome picture, a maximum coding unit is a unit that includes a maximum coding block of monochrome samples and syntax structures used to encode the monochrome samples. When a picture is a picture that is encoded with a color plane that is separated by color components, a maximum coding unit is a unit that includes syntax structures used to encode the picture and samples of the picture.

[0066] A single maximum coding block (CTB) can be divided into MxN coding blocks containing MxN samples (M, N are integers).

[0067] When a picture has a sample array for each Y, Cr, and Cb component, a coding unit (CU) is a unit that includes a coding block for a luma sample and two coding blocks for corresponding chroma samples, and syntax structures used to encode the luma sample and the chroma samples. When a picture is a monochrome picture, a coding unit is a unit that includes a coding block for a monochrome sample and syntax structures used to encode the monochrome samples. When a picture is a picture that is encoded with a color plane that is separated by color component, a coding unit is a unit that includes syntax structures used to encode the picture and samples of the picture.

[0068] As explained above, the maximum coding block and the maximum coding unit are distinct concepts, and the coding block and the coding unit are distinct concepts. That is, the (maximum) coding unit refers to a data structure including a (maximum) coding block including the corresponding sample and a syntax structure corresponding to it. However, since a person skilled in the art can understand that the (maximum) coding unit or the (maximum) coding block refers to a block of a predetermined size including a predetermined number of samples, the following specification will refer to the maximum coding block and the maximum coding unit, or the coding block and the coding unit, without distinction unless there are special circumstances.

[0069] An image can be divided into Coding Tree Units (CTUs). The size of the CTUs can be determined based on information obtained from the bitstream. The shape of the CTUs can be a square of equal size, but is not limited thereto.

[0070] For example, information about the maximum size of a luma coding block can be obtained from the bitstream. For example, the maximum size of the luma coding block indicated by the information about the maximum size of the luma coding block can be one of 4x4, 8x8, 16x16, 32x32, 64x64, 128x128, and 256x256.

[0071] For example, information about the maximum size of a luma coding block capable of being split into two and the luma block size difference can be obtained from the bitstream. The information about the luma block size difference can indicate the size difference between a luma maximum coding unit and a maximum luma coding block capable of being split into two. Therefore, by combining the information about the maximum size of a luma coding block capable of being split into two obtained from the bitstream and the information about the luma block size difference, the size of the luma maximum coding unit can be determined. Using the size of the luma maximum coding unit, the size of the chroma maximum coding unit can also be determined. For example, if the Y: Cb: Cr ratio is 4:2:0 according to the color format, the size of the chroma block can be half the size of the luma block, and similarly, the size of the chroma maximum coding unit can be half the size of the luma maximum coding unit.

[0072] According to one embodiment, since information about the maximum size of a luma coding block capable of binary splitting is obtained from a bitstream, the maximum size of the luma coding block capable of binary splitting can be determined variably. In contrast, the maximum size of a luma coding block capable of ternary splitting can be fixed. For example, the maximum size of a luma coding block capable of ternary splitting in an I picture may be 32x32, and the maximum size of a luma coding block capable of ternary splitting in a P picture or a B picture may be 64x64.

[0073] Additionally, the maximum coding unit can be hierarchically divided into coding units based on the division shape mode information obtained from the bitstream. As the division shape mode information, at least one of information indicating whether quad division is performed, information indicating whether multi-division is performed, division direction information, and division type information can be obtained from the bitstream.

[0074] For example, information indicating whether a quad split is present may indicate whether the current encoding unit is to be quad split (QUAD_SPLIT) or not to be quad split.

[0075] If the current encoding unit is not quad-split, the information indicating whether it is multi-split may indicate whether the current encoding unit will not be split any further (NO_SPLIT) or whether it will be binary / ternary split.

[0076] When the current encoding unit is binary or ternary split, the split direction information indicates that the current encoding unit is split in either the horizontal or vertical direction.

[0077] When the current encoding unit is split in the horizontal or vertical direction, the split type information indicates that the current encoding unit is split into binary split or ternary split.

[0078] Depending on the split direction information and the split type information, the split mode of the current encoding unit can be determined. The split mode when the current encoding unit is split into binaries in the horizontal direction can be determined as binary horizontal split (SPLIT_BT_HOR), the split mode when the current encoding unit is split into ternary horizontal split (SPLIT_TT_HOR), the split mode when the current encoding unit is split into binaries in the vertical direction can be determined as binary vertical split (SPLIT_BT_VER), and the split mode when the current encoding unit is split into ternary vertical split (SPLIT_BT_VER).

[0079] The image decoding device (100) can obtain segmentation shape mode information from a bitstream from a single binstring. The format of the bitstream received by the image decoding device (100) can include a fixed length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The binstring represents information as a series of binary numbers. The binstring can be composed of at least one bit. The image decoding device (100) can obtain segmentation shape mode information corresponding to the binstring based on a segmentation rule. The image decoding device (100) can determine whether to quad-segment an encoding unit, whether not to quad-segment, or the segmentation direction and segmentation type based on a single binstring.

[0080] The coding unit may be smaller than or equal to the maximum coding unit. For example, the maximum coding unit is also a coding unit with the maximum size, so it is a coding unit. If the split shape mode information for the maximum coding unit indicates that it is not split, the coding unit determined from the maximum coding unit has the same size as the maximum coding unit. If the split shape mode information for the maximum coding unit indicates that it is split, the maximum coding unit may be split into coding units. In addition, if the split shape mode information for the coding unit indicates splitting, the coding units may be split into coding units of smaller sizes. However, the splitting of the image is not limited thereto, and the maximum coding unit and the coding units may not be distinguished. The splitting of the coding unit is described in more detail with reference to FIGS. 3 to 16.

[0081] Additionally, one or more prediction blocks for prediction may be determined from the coding unit. The prediction blocks may be equal to or smaller than the coding unit. Additionally, one or more transformation blocks for transformation may be determined from the coding unit. The transformation blocks may be equal to or smaller than the coding unit.

[0082] The shape and size of the transformation block and the prediction block may be unrelated.

[0083] In another embodiment, prediction may be performed using the encoding unit as a prediction block. Transformation may also be performed using the encoding unit as a transform block.

[0084] The division of a coding unit is described in more detail with reference to FIGS. 3 to 16. The current block and neighboring blocks of the present disclosure may represent one of a maximum coding unit, a coding unit, a prediction block, and a transform block. In addition, the current block or the current coding unit is a block currently being decoded or encoded, or a block currently being divided. The neighboring block may be a block reconstructed before the current block. The neighboring block may be spatially or temporally adjacent to the current block. The neighboring block may be located on one of the lower left, left, upper left, upper right, upper right, right, and lower right sides of the current block.

[0085] FIG. 3 illustrates a process in which an image decoding device divides a current encoding unit to determine at least one encoding unit according to one embodiment of the present disclosure.

[0086] The block shape may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN or Nx8N, where N may be a positive integer. The block shape information is information indicating at least one of the shape, direction, width and height ratio or size of the encoding unit.

[0087] The shape of the encoding unit may include square and non-square. When the width and height of the encoding unit are equal (i.e., when the block shape of the encoding unit is 4Nx4N), the image decoding device (100) may determine the block shape information of the encoding unit as square. The image decoding device (100) may determine the shape of the encoding unit as non-square.

[0088] When the width and height of the encoding unit are different (i.e., when the block shape of the encoding unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the image decoding device (100) may determine the block shape information of the encoding unit to be non-square. When the shape of the encoding unit is non-square, the image decoding device (100) may determine the ratio of the width and height among the block shape information of the encoding unit to be at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. Additionally, based on the width length and height length of the encoding unit, the image decoding device (100) can determine whether the encoding unit is in the horizontal or vertical direction. Additionally, based on at least one of the width length, height length, or area of ​​the encoding unit, the image decoding device (100) can determine the size of the encoding unit.

[0089] According to one embodiment, the image decoding device (100) can determine the shape of an encoding unit using block shape information, and can determine the shape into which the encoding unit is divided using segmentation shape mode information. That is, the splitting method of the encoding unit indicated by the segmentation shape mode information can be determined depending on which block shape the block shape information used by the image decoding device (100) indicates.

[0090] The image decoding device (100) can obtain the split shape mode information from the bitstream. However, the present invention is not limited thereto, and the image decoding device (100) and the image encoding device (2200) can determine the pre-agreed split shape mode information based on the block shape information. The image decoding device (100) can determine the pre-agreed split shape mode information for the maximum coding unit or the minimum coding unit. For example, the image decoding device (100) can determine the split shape mode information for the maximum coding unit as quad split. In addition, the image decoding device (100) can determine the split shape mode information for the minimum coding unit as “not split.” Specifically, the image decoding device (100) can determine the size of the maximum coding unit as 256x256. The image decoding device (100) can determine the pre-agreed split shape mode information as quad split. Quad splitting is a splitting mode that divides both the width and height of an encoding unit in half. The image decoding device (100) can obtain a coding unit of size 128x128 from a maximum coding unit of size 256x256 based on the splitting mode information. In addition, the image decoding device (100) can determine the size of the minimum coding unit as 4x4. The image decoding device (100) can obtain splitting mode information indicating "not splitting" for the minimum coding unit.

[0091] According to one embodiment, the image decoding device (100) may use block shape information indicating that the current encoding unit is a square shape. For example, the image decoding device (100) may determine whether to not split a square encoding unit, to split it vertically, to split it horizontally, to split it into four encoding units, etc., according to the split shape mode information. Referring to FIG. 3, when the block shape information of the current encoding unit (300) indicates a square shape, the decoding unit (120) may not split an encoding unit (310a) having the same size as the current encoding unit (300) according to the split shape mode information indicating that it is not split, or may determine a split encoding unit (310b, 310c, 310d, 310e, 310f, etc.) based on the split shape mode information indicating a predetermined splitting method.

[0092] Referring to FIG. 3, the image decoding device (100) may determine two coding units (310b) by vertically dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is vertically divided, according to an embodiment. The image decoding device (100) may determine two coding units (310c) by horizontally dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is horizontally divided, according to an embodiment. The image decoding device (100) may determine four coding units (310d) by vertically and horizontally dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is vertically and horizontally divided, according to an embodiment. The image decoding device (100) may determine three coding units (310e) by vertically dividing the current coding unit (300) based on the split shape mode information indicating that the current coding unit (300) is ternary divided, according to an embodiment. The image decoding device (100) can determine three coding units (310f) into which the current coding unit (300) is horizontally divided based on the division shape mode information indicating that the ternary division is horizontally divided. However, the division shapes into which a square coding unit can be divided should not be interpreted as being limited to the above-described shapes, and may include various shapes that can be indicated by the division shape mode information. Specified division shapes into which a square coding unit is divided will be specifically described below through various embodiments.

[0093] FIG. 4 illustrates a process in which an image decoding device determines at least one encoding unit by dividing a non-square encoding unit according to one embodiment of the present disclosure.

[0094] According to one embodiment, the image decoding device (100) may utilize block shape information indicating that the current encoding unit is non-square. The image decoding device (100) may determine whether to not split the current non-square encoding unit or to split it using a predetermined method based on the split shape mode information. Referring to FIG. 4, when the block shape information of the current encoding unit (400 or 450) indicates a non-square shape, the image decoding device (100) may determine an encoding unit (410 or 460) having the same size as the current encoding unit (400 or 450) according to the split shape mode information indicating that it is not split, or may determine a split encoding unit (420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, 480c) based on the split shape mode information indicating a predetermined splitting method. The predetermined splitting method by which a non-square encoding unit is split will be described in detail through various embodiments below.

[0095] According to one embodiment, the image decoding device (100) may determine a form in which an encoding unit is split using split form mode information, and in this case, the split form mode information may indicate the number of at least one encoding unit generated by splitting the encoding unit. Referring to FIG. 4, when the split form mode information indicates that the current encoding unit (400 or 450) is split into two encoding units, the image decoding device (100) may split the current encoding unit (400 or 450) based on the split form mode information to determine two encoding units (420a, 420b, or 470a, 470b) included in the current encoding unit.

[0096] According to one embodiment, when the image decoding device (100) splits a current encoding unit (400 or 450) having a non-square shape based on split shape mode information, the image decoding device (100) may split the current encoding unit by considering the position of the long side of the non-square current encoding unit (400 or 450). For example, the image decoding device (100) may split the current encoding unit (400 or 450) in a direction that splits the long side of the current encoding unit (400 or 450) by considering the shape of the current encoding unit (400 or 450) to determine a plurality of encoding units.

[0097] According to one embodiment, if the split shape mode information indicates that the coding unit is split into an odd number of blocks (ternary splitting), the image decoding device (100) may determine an odd number of coding units included in the current coding unit (400 or 450). For example, if 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, 430c, 480a, 480b, 480c).

[0098] According to one embodiment, the ratio of the width and height of the current encoding unit (400 or 450) may be 4:1 or 1:4. When the ratio of the width and height is 4:1, the block shape information may be in the horizontal direction because the length of the width is longer than the length of the height. When the ratio of the width and height is 1:4, the block shape information may be in 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 encoding unit into an odd number of blocks based on the split shape mode information. In addition, the image decoding device (100) may determine the splitting direction of the current encoding unit (400 or 450) based on the block shape information of the current encoding unit (400 or 450). For example, if the current encoding unit (400) is in the vertical direction, the image decoding device (100) can divide the current encoding unit (400) in the horizontal direction to determine encoding units (430a, 430b, 430c). Also, if the current encoding unit (450) is in the horizontal direction, the image decoding device (100) can divide the current encoding unit (450) in the vertical direction to determine encoding units (480a, 480b, 480c).

[0099] According to one embodiment, the image decoding device (100) may determine an odd number of coding units included in the current coding unit (400 or 450), and the sizes of the determined coding units may not all be the same. For example, among the determined odd number of coding units (430a, 430b, 430c, 480a, 480b, 480c), the size of a given coding unit (430b or 480b) may have a different size from the other coding units (430a, 430c, 480a, 480c). That is, the encoding units into which the current encoding unit (400 or 450) can be divided and determined can have multiple types of sizes, and in some cases, an odd number of encoding units (430a, 430b, 430c, 480a, 480b, 480c) can each have different sizes.

[0100] According to one 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) can determine an odd number of coding units included in the current coding unit (400 or 450), and further, the image decoding device (100) can place a predetermined restriction on at least one coding unit among the odd number of coding units generated by splitting. Referring to FIG. 4, the image decoding device (100) can perform a decoding process for a coding unit (430b, 480b) located in the center among three coding units (430a, 430b, 430c, 480a, 480b, 480c) generated by splitting the current coding unit (400 or 450) differently from the decoding process for other coding units (430a, 430c, 480a, 480c). For example, the image decoding device (100) can restrict the encoding unit (430b, 480b) located in the center from being split any further, unlike other encoding units (430a, 430c, 480a, 480c), or can restrict it to be split only a predetermined number of times.

[0101] FIG. 5 illustrates a process in which an image decoding device divides an encoding unit based on at least one of block shape information and division shape mode information according to one embodiment of the present disclosure.

[0102] According to one embodiment, the image decoding device (100) may determine whether to split or not to split a first coding unit (500) having a square shape into coding units based on at least one of block shape information and split shape mode information. According to one embodiment, when the split shape mode information indicates splitting the first coding unit (500) in the horizontal direction, the image decoding device (100) may split the first coding unit (500) in the horizontal direction to determine a second coding unit (510). The first coding unit, the second coding unit, and the third coding unit used according to one embodiment are terms used to understand the relationship before and after splitting between coding units. For example, when the first coding unit is split, the second coding unit may be determined, and when the second coding unit is split, the third coding unit may be determined. Hereinafter, the relationship between the first coding unit, the second coding unit, and the third coding unit used may be understood to follow the above-described characteristics.

[0103] According to one embodiment, the image decoding device (100) may determine to split or not split the determined second encoding unit (510) into encoding units based on the split shape mode information. Referring to FIG. 5, the image decoding device (100) may split the first encoding unit (500) based on the split shape mode information to split the determined second encoding unit (510) of a non-square shape into at least one third encoding unit (520a, 520b, 520c, 520d, etc.) or may not split the second encoding unit (510). The image decoding device (100) can obtain split shape mode information, and the image decoding device (100) can split the first encoding unit (500) based on the obtained split shape mode information to split a plurality of second encoding units (e.g., 510) of various shapes, and the second encoding unit (510) can be split according to the way in which the first encoding unit (500) is split based on the split shape mode information. According to one embodiment, when the first encoding unit (500) is split into the second encoding unit (510) based on the split shape mode information for the first encoding unit (500), the second encoding unit (510) can also be split into the third encoding unit (e.g., 520a, 520b, 520c, 520d, etc.) based on the split shape mode information for the second encoding unit (510). That is, the coding unit can be recursively split based on the split shape mode information associated with each coding unit. Accordingly, a square coding unit can be determined from a non-square coding unit, and such a square coding unit can be recursively split to determine a non-square coding unit.

[0104] Referring to FIG. 5, among the odd number of third coding units (520b, 520c, 520d) determined by splitting the second coding unit (510) having a non-square shape, a predetermined coding unit (e.g., a coding unit located in the middle or a coding unit having a square shape) may be split recursively. According to an embodiment, the third coding unit (520b) having a square shape, which is one of the odd number of third coding units (520b, 520c, 520d), may be split horizontally into a plurality of fourth coding units. The fourth coding unit (530b or 530d) having a non-square shape, which is one of the plurality of fourth coding units (530a, 530b, 530c, 530d), may be split again into a plurality of coding units. For example, the fourth coding unit (530b or 530d) having a non-square shape may be further divided into an odd number of coding units. Methods that can be used for recursive division of coding units will be described later through various embodiments.

[0105] According to one embodiment, the image decoding device (100) may split each of the third encoding units (520a, 520b, 520c, 520d, etc.) into encoding units based on the split shape mode information. In addition, the image decoding device (100) may determine not to split the second encoding unit (510) based on the split shape mode information. According to one embodiment, the image decoding device (100) may split the second encoding unit (510) having a non-square shape into an odd number of third encoding units (520b, 520c, 520d). The image decoding device (100) may place a predetermined restriction on a predetermined third encoding unit among the odd number of third encoding units (520b, 520c, 520d). For example, the image decoding device (100) can limit the encoding unit (520c) located in the middle among an odd number of third encoding units (520b, 520c, 520d) to not be divided any further or to be divided a settable number of times.

[0106] Referring to FIG. 5, the image decoding device (100) may limit the coding unit (520c) located in the middle among the odd number of third coding units (520b, 520c, 520d) included in the second coding unit (510) having a non-square shape to not be split any further, or to be split in a predetermined split form (for example, to be split only into four coding units or to be split in a form corresponding to the split form of the second coding unit (510), or to be split only a predetermined number of times (for example, to be split only n times, where n>0). However, the above limitations on the coding unit (520c) located in the middle are merely simple embodiments and should not be interpreted as being limited to the above-described embodiments, but should be interpreted as including various limitations in which the coding unit (520c) located in the middle can be decoded differently from the other coding units (520b, 520d).

[0107] According to one embodiment, the image decoding device (100) can obtain the segmentation shape mode information used to segment the current encoding unit from a predetermined location within the current encoding unit.

[0108] FIG. 6 illustrates a method for a video decoding device to determine a predetermined encoding unit among an odd number of encoding units according to one embodiment of the present disclosure.

[0109] Referring to FIG. 6, the split shape mode information of the current encoding unit (600, 650) can be obtained from a sample at a predetermined position among a plurality of samples included in the current encoding unit (600, 650) (for example, a sample (640, 690) located in the center). However, the predetermined position within the current encoding unit (600) from which at least one of the split shape mode information can be obtained should not be interpreted as being limited to the center position illustrated in FIG. 6, but should be interpreted as including various positions (for example, top, bottom, left, right, upper left, lower left, upper right, or lower right, etc.) that can be included within the current encoding unit (600). The image decoding device (100) can obtain the split shape mode information obtained from the predetermined position and determine whether or not to split the current encoding unit into encoding units of various shapes and sizes.

[0110] According to one embodiment, the image decoding device (100) may select one of the coding units when the current coding unit is divided into a predetermined number of coding units. Various methods may be used to select one of the multiple coding units, and descriptions of such methods will be provided later through various embodiments.

[0111] According to one embodiment, the image decoding device (100) can divide the current encoding unit into a plurality of encoding units and determine an encoding unit at a predetermined position.

[0112] According to one embodiment, the image decoding device (100) may use information indicating the positions of each of the odd-numbered coding units to determine an coding unit located in the middle of the odd-numbered coding units. Referring to FIG. 6, the image decoding device (100) may divide the current coding unit (600) or the current coding unit (650) to determine odd-numbered coding units (620a, 620b, 620c) or odd-numbered coding units (660a, 660b, 660c). The image decoding device (100) may use information about the positions of the odd-numbered coding units (620a, 620b, 620c) or odd-numbered coding units (660a, 660b, 660c) to determine the middle coding unit (620b) or the middle coding unit (660b). For example, the image decoding device (100) can determine the coding unit (620b) located in the center by determining the positions of the coding units (620a, 620b, 620c) based on information indicating the positions of predetermined samples included in the coding units (620a, 620b, 620c). Specifically, the image decoding device (100) can determine the coding unit (620b) located in the center by determining the positions of the coding units (620a, 620b, 620c) based on information indicating the positions of samples (630a, 630b, 630c) at the upper left of the coding units (620a, 620b, 620c).

[0113] According to one embodiment, information indicating the positions of the upper left samples (630a, 630b, 630c) included in each of the coding units (620a, 620b, 620c) may include information on the positions or coordinates of the coding units (620a, 620b, 620c) within the picture. According to one embodiment, information indicating the positions of the upper left samples (630a, 630b, 630c) included in each of the coding units (620a, 620b, 620c) may include information indicating the width or height of the coding units (620a, 620b, 620c) included in the current coding unit (600), and this width or height may correspond to information indicating the difference between the coordinates of the coding units (620a, 620b, 620c) within the picture. That is, the image decoding device (100) can determine the encoding unit (620b) located in the center by directly using information about the positions or coordinates of the encoding units (620a, 620b, 620c) within the picture or by using information about the width or height of the encoding unit corresponding to the difference between the coordinates.

[0114] According to one embodiment, information indicating the position of the sample (630a) at the upper left of the upper encoding unit (620a) may represent (xa, ya) coordinates, information indicating the position of the sample (530b) at the upper left of the middle encoding unit (620b) may represent (xb, yb) coordinates, and information indicating the position of the sample (630c) at the upper left of the lower encoding unit (620c) may represent (xc, yc) coordinates. The image decoding device (100) may determine the middle encoding unit (620b) using the coordinates of the upper left samples (630a, 630b, 630c) included in the encoding units (620a, 620b, 620c), respectively. For example, when the coordinates of the samples (630a, 630b, 630c) on the upper left are sorted in ascending or descending order, the encoding unit (620b) including the coordinates (xb, yb) of the sample (630b) located in the center can be determined as the encoding unit located in the center among the encoding units (620a, 620b, 620c) determined by dividing the current encoding unit (600). However, the coordinates indicating the positions of the upper left samples (630a, 630b, 630c) may indicate coordinates indicating the absolute positions within the picture, and further, based on the position of the upper left sample (630a) of the upper left coding unit (620a), the (dxb, dyb) coordinates, which are information indicating the relative position of the sample (630b) of the upper left of the middle coding unit (620b), and the (dxc, dyc) coordinates, which are information indicating the relative position of the sample (630c) of the upper left of the lower coding unit (620c), may be used. In addition, the method of determining the coding unit of a given position by using the coordinates of the corresponding sample as information indicating the position of the sample included in the coding unit should not be interpreted as being limited to the above-described method, but should be interpreted as various arithmetic methods that can utilize the coordinates of the sample.

[0115] According to one embodiment, the image decoding device (100) may divide the current encoding unit (600) into a plurality of encoding units (620a, 620b, 620c), and select an encoding unit from among the encoding units (620a, 620b, 620c) according to a predetermined criterion. For example, the image decoding device (100) may select an encoding unit (620b) having a different size from among the encoding units (620a, 620b, 620c).

[0116] According to one embodiment, the image decoding device (100) may determine the width or height of each of the encoding units (620a, 620b, 620c) by using the (xa, ya) coordinate, which is information indicating the position of the sample (630a) at the upper left of the upper encoding unit (620a), the (xb, yb) coordinate, which is information indicating the position of the sample (630b) at the upper left of the middle encoding unit (620b), and the (xc, yc) coordinate, which is information indicating the position of the sample (630c) at the upper left of the lower encoding unit (620c). The image decoding device (100) can determine the size of each of the encoding units (620a, 620b, 620c) using coordinates (xa, ya), (xb, yb), (xc, yc) indicating the positions of the encoding units (620a, 620b, 620c). According to one embodiment, the image decoding device (100) can determine the width of the upper encoding unit (620a) as the width of the current encoding unit (600). The image decoding device (100) can determine the height of the upper encoding unit (620a) as yb-ya. According to one embodiment, the image decoding device (100) can determine the width of the middle encoding unit (620b) as the width of the current encoding unit (600). The image decoding device (100) may determine the height of the middle encoding unit (620b) as yc-yb. According to one embodiment, the image decoding device (100) may determine the width or height of the lower encoding unit using the width or height of the current encoding unit and the width and height of the upper encoding unit (620a) and the middle encoding unit (620b). The image decoding device (100) may determine an encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (620a, 620b, 620c).Referring to FIG. 6, the image decoding device (100) can determine the middle encoding unit (620b) having a different size from the sizes of the upper encoding unit (620a) and the lower encoding unit (620c) as the encoding unit of a predetermined position. However, the process by which the image decoding device (100) described above determines the encoding unit having a different size from other encoding units is merely an embodiment of determining the encoding unit of a predetermined position using the size of the encoding unit determined based on sample coordinates, and therefore, various processes of determining the encoding unit of a predetermined position by comparing the sizes of the encoding units determined according to predetermined sample coordinates can be used.

[0117] The image decoding device (100) can determine the width or height of each of the encoding units (660a, 660b, 660c) by using the (xd, yd) coordinate, which is information indicating the position of the sample (670a) at the upper left of the left encoding unit (660a), the (xe, ye) coordinate, which is information indicating the position of the sample (670b) at the upper left of the middle encoding unit (660b), and the (xf, yf) coordinate, which is information indicating the position of the sample (670c) at the upper left of the right encoding unit (660c). The image decoding device (100) can determine the size of each of the encoding units (660a, 660b, 660c) by using the (xd, yd), (xe, ye), (xf, yf), which are coordinates indicating the positions of the encoding units (660a, 660b, 660c).

[0118] According to one embodiment, the image decoding device (100) may determine the width of the left encoding unit (660a) as xe-xd. The image decoding device (100) may determine the height of the left encoding unit (660a) as the height of the current encoding unit (650). According to one embodiment, the image decoding device (100) may determine the width of the middle encoding unit (660b) as xf-xe. The image decoding device (100) may determine the height of the middle encoding unit (660b) as the height of the current encoding unit (600). According to one embodiment, the image decoding device (100) may determine the width or height of the right encoding unit (660c) using the width or height of the current encoding unit (650) and the widths and heights of the left encoding unit (660a) and the middle encoding unit (660b). The image decoding device (100) can determine an encoding unit having a different size from other encoding units based on the width and height of the determined encoding units (660a, 660b, 660c). Referring to FIG. 6, the image decoding device (100) can determine a middle encoding unit (660b) having a different size from the sizes of the left encoding unit (660a) and the right encoding unit (660c) as an encoding unit at a predetermined position. However, the process of the image decoding device (100) described above determining an encoding unit having a different size from other encoding units is merely an embodiment of determining an encoding unit at a predetermined position using the size of the encoding unit determined based on sample coordinates, and therefore, various processes of determining an encoding unit at a predetermined position by comparing the sizes of the encoding units determined according to predetermined sample coordinates can be used.

[0119] However, the location of the sample considered for determining the location of the encoding unit should not be interpreted as being limited to the upper left corner described above, and it can be interpreted that information on the location of any sample included in the encoding unit can be used.

[0120] According to one embodiment, the image decoding device (100) may select an encoding unit at a predetermined position from among an odd number of encoding units determined by splitting the current encoding unit, taking into consideration the shape of the current encoding unit. For example, if the current encoding unit has a non-square shape in which the width is longer than the height, the image decoding device (100) may determine an encoding unit at a predetermined position in the horizontal direction. That is, the image decoding device (100) may determine one of the encoding units whose positions vary in the horizontal direction and place a restriction on the corresponding encoding unit. If the current encoding unit has a non-square shape in which the height is longer than the width, the image decoding device (100) may determine an encoding unit at a predetermined position in the vertical direction. That is, the image decoding device (100) may determine one of the encoding units whose positions vary in the vertical direction and place a restriction on the corresponding encoding unit.

[0121] According to one embodiment, the image decoding device (100) may use information indicating the positions of each of the even-numbered coding units 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 dividing the current coding unit (binary dividing) and may determine the coding unit at a predetermined position using information about the positions of the even-numbered coding units. A specific process for this may be a process corresponding to the process of determining the coding unit at a predetermined position (e.g., the center position) among the odd-numbered coding units described above in FIG. 6, and thus will be omitted.

[0122] According to one embodiment, when a current encoding unit having a non-square shape is split into a plurality of encoding units, predetermined information about the encoding unit at a predetermined position may be used during the splitting process to determine an encoding unit at a predetermined position among the plurality of encoding units. For example, the image decoding device (100) may use at least one of block shape information and split shape mode information stored in a sample included in a middle encoding unit during the splitting process to determine an encoding unit located in the middle among the encoding units into which the current encoding unit is split.

[0123] Referring to FIG. 6, the image decoding device (100) can split the current encoding unit (600) into a plurality of encoding units (620a, 620b, 620c) based on the split shape mode information, and can determine the encoding unit (620b) located in the middle among the plurality of encoding units (620a, 620b, 620c). Furthermore, the image decoding device (100) can determine the encoding unit (620b) located in the middle by considering the position where the split shape mode information is acquired. That is, the split shape mode information of the current encoding unit (600) can be obtained from a sample (640) located in the center of the current encoding unit (600), and when the current encoding unit (600) is split into a plurality of encoding units (620a, 620b, 620c) based on the split shape mode information, the encoding unit (620b) including the sample (640) can be determined as the encoding unit located in the center. However, the information used to determine the encoding unit located in the center should not be interpreted as being limited to the split shape mode information, and various types of information can be used in the process of determining the encoding unit located in the center.

[0124] According to one embodiment, predetermined information for identifying a coding unit at a predetermined position may be obtained from a predetermined sample included in the coding unit to be determined. Referring to FIG. 6, the image decoding device (100) may use split shape mode information obtained from a sample at a predetermined position within the current coding unit (600) (e.g., a sample located at the center of the current coding unit (600)) to determine a coding unit at a predetermined position among a plurality of coding units (620a, 620b, 620c) determined by splitting the current coding unit (600) (e.g., a coding unit located at the center of the coding units split into multiple units). That is, the image decoding device (100) can determine the sample at the predetermined position by considering the block shape of the current encoding unit (600), and the image decoding device (100) can determine an encoding unit (620b) that includes a sample from which predetermined information (e.g., division shape mode information) can be obtained among a plurality of encoding units (620a, 620b, 620c) determined by dividing the current encoding unit (600), and can set a predetermined restriction. Referring to FIG. 6, according to one embodiment, the image decoding device (100) can determine a sample (640) located at the center of the current encoding unit (600) as a sample from which predetermined information can be obtained, and the image decoding device (100) can set a predetermined restriction on the encoding unit (620b) that includes such a sample (640) during the decoding process. However, the location of the sample from which certain information can be obtained should not be interpreted as being limited to the above-described location, but may be interpreted as samples at any location included in the encoding unit (620b) to be determined in order to set a limitation.

[0125] According to one embodiment, the position of a sample from which predetermined information can be obtained may be determined according to the shape of the current encoding unit (600). According to one embodiment, the block shape information may determine whether the shape of the current encoding unit is square or non-square, and may determine the position of a sample from which predetermined information can be obtained according to the shape. For example, the image decoding apparatus (100) may determine a sample located on a boundary that divides at least one of the width and height of the current encoding unit in half as a sample from which predetermined information can be obtained, using at least one of information about the width and information about the height of the current encoding unit. As another example, when the block shape information related to the current encoding unit indicates that the shape is non-square, the image decoding apparatus (100) may determine one of the samples adjacent to the boundary that divides the long side of the current encoding unit in half as a sample from which predetermined information can be obtained.

[0126] According to one embodiment, when the image decoding device (100) divides the current encoding unit into a plurality of encoding units, the image decoding device (100) may use the split shape mode information to determine the encoding unit at a predetermined position among the plurality of encoding units. According to one embodiment, the image decoding device (100) may obtain the split shape mode information from a sample at a predetermined position included in the encoding unit, and the image decoding device (100) may divide the plurality of encoding units generated by splitting the current encoding unit using the split shape mode information obtained from the sample at a predetermined position included in each of the plurality of encoding units. That is, the encoding unit may be recursively divided using the split shape mode information obtained from the sample at a predetermined position included in each of the encoding units. Since the recursive division process of the encoding unit has been described above with reference to FIG. 5, a detailed description thereof will be omitted.

[0127] According to one embodiment, the image decoding device (100) can divide a current encoding unit to determine at least one encoding unit, and can determine the order in which the at least one encoding unit is decoded according to a predetermined block (e.g., the current encoding unit).

[0128] FIG. 7 illustrates the order in which multiple encoding units are processed when an image decoding device determines multiple encoding units by dividing a current encoding unit according to one embodiment of the present disclosure.

[0129] According to one embodiment, the image decoding device (100) may determine second encoding units (710a, 710b) by vertically splitting the first encoding unit (700) according to the splitting shape mode information, determine second encoding units (730a, 730b) by horizontally splitting the first encoding unit (700), or determine second encoding units (750a, 750b, 750c, 750d) by vertically and horizontally splitting the first encoding unit (700).

[0130] Referring to FIG. 7, the image decoding device (100) can determine the order in which the second encoding units (710a, 710b) determined by vertically dividing the first encoding unit (700) are processed in the horizontal direction (710c). The image decoding device (100) can determine the order in which the second encoding units (730a, 730b) determined by horizontally dividing the first encoding unit (700) are processed in the vertical direction (730c). The image decoding device (100) can determine the second encoding units (750a, 750b, 750c, 750d) determined by dividing the first encoding unit (700) in the vertical and horizontal directions according to a predetermined order (e.g., raster scan order (750e) or z scan order (z scan order)) in which encoding units located in one row are processed and then encoding units located in the next row are processed.

[0131] According to one embodiment, the image decoding device (100) can recursively split the encoding units. Referring to FIG. 7, the image decoding device (100) can split the first encoding unit (700) to determine a plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d), and can recursively split each of the determined plurality of encoding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d). A method for splitting a plurality of coding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may be a method corresponding to a method for splitting the first coding unit (700). Accordingly, the plurality of coding units (710a, 710b, 730a, 730b, 750a, 750b, 750c, 750d) may each be independently split into a plurality of coding units. Referring to FIG. 7, the image decoding device (100) may split the first coding unit (700) in the vertical direction to determine the second coding units (710a, 710b), and further may determine to independently split or not split each of the second coding units (710a, 710b).

[0132] According to one embodiment, the image decoding device (100) may horizontally divide the second encoding unit (710a) on the left into third encoding units (720a, 720b), and may not divide the second encoding unit (710b) on the right.

[0133] According to one embodiment, the processing order of the coding units may be determined based on the splitting process of the coding units. In other words, the processing order of the split coding units may be determined based on the processing order of the coding units immediately before splitting. The image decoding device (100) may determine the processing order of the third coding units (720a, 720b) ​​determined by splitting the second coding unit (710a) on the left, independently from the second coding unit (710b) on the right. Since the second coding unit (710a) on the left is split horizontally and the third coding units (720a, 720b) ​​are determined, the third coding units (720a, 720b) ​​may be processed in the vertical direction (720c). In addition, since the order in which the second encoding unit (710a) on the left and the second encoding unit (710b) on the right are processed corresponds to the horizontal direction (710c), the right encoding unit (710b) can be processed after the third encoding units (720a, 720b) ​​included in the second encoding unit (710a) on the left are processed in the vertical direction (720c). Since the above-described content is intended to explain the process in which the processing order of the encoding units is determined according to the encoding units before splitting, it should not be interpreted as being limited to the above-described embodiment, but should be interpreted as being used in various ways in which encoding units that are split and determined in various forms can be independently processed according to a predetermined order.

[0134] FIG. 8 illustrates a process of determining that a current encoding unit is divided into an odd number of encoding units when the encoding units cannot be processed in a predetermined order, according to one embodiment of the present disclosure.

[0135] According to one embodiment, the image decoding device (100) may determine that the current encoding unit is split into an odd number of encoding units based on the acquired split shape mode information. Referring to FIG. 8, a first encoding unit (800) having a square shape may be split into second encoding units (810a, 810b) having a non-square shape, and the second encoding units (810a, 810b) may each be independently split into third encoding units (820a, 820b, 820c, 820d, 820e). According to one embodiment, the image decoding device (100) can determine a plurality of third encoding units (820a, 820b) by horizontally dividing the left encoding unit (810a) among the second encoding units, and can divide the right encoding unit (810b) into an odd number of third encoding units (820c, 820d, 820e).

[0136] According to one embodiment, the image decoding device (100) can determine whether there is an odd number of split coding units by determining whether the third coding units (820a, 820b, 820c, 820d, 820e) can be processed in a predetermined order. Referring to FIG. 8, the image decoding device (100) can determine the third coding units (820a, 820b, 820c, 820d, 820e) by recursively splitting the first coding unit (800). The image decoding device (100) can determine whether the first encoding unit (800), the second encoding unit (810a, 810b), or the third encoding unit (820a, 820b, 820c, 820d, 820e) is divided into an odd number of encoding units based on at least one of the block shape information and the split shape mode information. For example, the encoding unit located on the right side of the second encoding unit (810a, 810b) can be divided into an odd number of third encoding units (820c, 820d, 820e). The order in which the plurality of encoding units included in the first encoding unit (800) are processed can be a predetermined order (e.g., z-scan order (830)), and the image decoding device (100) can determine whether the third encoding unit (820c, 820d, 820e) determined by dividing the second encoding unit (810b) on the right into odd numbers satisfies the condition that it can be processed according to the predetermined order.

[0137] According to one embodiment, the image decoding device (100) may determine whether the third encoding units (820a, 820b, 820c, 820d, 820e) included in the first encoding unit (800) satisfy a condition that they can be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the second encoding unit (810a, 810b) is split in half according to the boundary of the third encoding unit (820a, 820b, 820c, 820d, 820e). For example, the third encoding unit (820a, 820b) determined by splitting the height of the left second encoding unit (810a) of a non-square shape in half may satisfy the condition. Since the boundaries of the third encoding units (820c, 820d, 820e) determined by dividing the right second encoding unit (810b) into three encoding units do not divide the width or height of the right second encoding unit (810b) in half, it may be determined that the third encoding units (820c, 820d, 820e) do not satisfy the condition. In the case where this condition is not satisfied, the image decoding device (100) may determine that there is a disconnection in the scanning order, and may determine that the right second encoding unit (810b) is divided into an odd number of encoding units based on the determination result. According to an embodiment, the image decoding device (100) may place a predetermined restriction on an encoding unit at a predetermined position among the divided encoding units when the encoding unit is divided into an odd number of encoding units. Since the contents of such restrictions or predetermined positions have been described above through various embodiments, a detailed description thereof will be omitted.

[0138] FIG. 9 illustrates a process in which an image decoding device divides a first encoding unit to determine at least one encoding unit according to one embodiment of the present disclosure.

[0139] According to one embodiment, the image decoding device (100) may split the first encoding unit (900) based on the split shape mode information obtained through the receiver (110). The first encoding unit (900) having a square shape may be split into four square-shaped encoding units or may be split into a plurality of non-square encoding units. For example, referring to FIG. 9, when the first encoding unit (900) is square and the split shape mode information indicates that it is split into non-square encoding units, the image decoding device (100) may split the first encoding unit (900) into a plurality of non-square encoding units. Specifically, when the split shape mode information indicates that the first encoding unit (900) is split in the horizontal direction or the vertical direction to determine an odd number of encoding units, the image decoding device (100) can split the first encoding unit (900) having a square shape into second encoding units (910a, 910b, 910c) determined by splitting them in the vertical direction into an odd number of encoding units or second encoding units (920a, 920b, 920c) determined by splitting them in the horizontal direction.

[0140] According to one embodiment, the image decoding device (100) can determine whether the second encoding units (910a, 910b, 910c, 920a, 920b, 920c) included in the first encoding unit (900) satisfy a condition that allows them to be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the first encoding unit (900) is split in half according to the boundary of the second encoding units (910a, 910b, 910c, 920a, 920b, 920c). Referring to FIG. 9, since the boundaries of the second coding units (910a, 910b, 910c) determined by vertically dividing the first coding unit (900) in a square shape do not divide the width of the first coding unit (900) in half, it may be determined that the first coding unit (900) does not satisfy the condition that it can be processed in a predetermined order. In addition, since the boundaries of the second coding units (920a, 920b, 920c) determined by horizontally dividing the first coding unit (900) in a square shape do not divide the width of the first coding unit (900) in half, it may be determined that the first coding unit (900) does not satisfy the condition that it can be processed in a predetermined order. If such a condition is not satisfied, the image decoding device (100) may determine that the scan order is disconnected, and based on the determination result, may determine that the first encoding unit (900) is divided into an odd number of encoding units. According to one embodiment, the image decoding device (100) may place a predetermined restriction on an encoding unit at a predetermined position among the divided encoding units when the encoding unit is divided into an odd number of encoding units. Since the contents of such restrictions or predetermined positions, etc. have been described above through various embodiments, a detailed description thereof will be omitted.

[0141] According to one embodiment, the image decoding device (100) can divide the first encoding unit to determine encoding units of various shapes.

[0142] Referring to FIG. 9, the image decoding device (100) can divide the first encoding unit (900) having a square shape and the first encoding unit (930 or 950) having a non-square shape into encoding units of various shapes.

[0143] FIG. 10 illustrates that, according to one embodiment of the present disclosure, a video decoding device limits the shapes into which a second encoding unit can be divided when a non-square shape of a second encoding unit determined by dividing a first encoding unit satisfies a predetermined condition.

[0144] According to one embodiment, the image decoding device (100) may determine to split a first coding unit (1000) having a square shape into second coding units (1010a, 1010b, 1020a, 1020b) having a non-square shape based on the split shape mode information obtained through the receiver (110). The second coding units (1010a, 1010b, 1020a, 1020b) may be split independently. Accordingly, the image decoding device (100) may determine to split or not split into a plurality of coding units based on the split shape mode information related to each of the second coding units (1010a, 1010b, 1020a, 1020b). According to one embodiment, the image decoding device (100) may determine third encoding units (1012a, 1012b) by horizontally dividing the left second encoding unit (1010a) having a non-square shape determined by vertically dividing the first encoding unit (1000). However, when the image decoding device (100) divides the left second encoding unit (1010a) in the horizontal direction, the right second encoding unit (1010b) may be restricted from being horizontally divided in the same direction as the direction in which the left second encoding unit (1010a) is divided. If the second encoding unit on the right (1010b) is split in the same direction to determine the third encoding unit (1014a, 1014b), the second encoding unit on the left (1010a) and the second encoding unit on the right (1010b) may be independently split in the horizontal direction to determine the third encoding unit (1012a, 1012b, 1014a, 1014b). However, this is the same result as the image decoding device (100) splitting the first encoding unit (1000) into four square-shaped second encoding units (1030a, 1030b, 1030c, 1030d) based on the split shape mode information, which may be inefficient in terms of image decoding.

[0145] According to one embodiment, the image decoding device (100) may determine third coding units (1022a, 1022b, 1024a, 1024b) by vertically dividing a second coding unit (1020a or 1020b) having a non-square shape determined by dividing a first coding unit (1000) in a horizontal direction. However, when the image decoding device (100) vertically divides one of the second coding units (e.g., the upper second coding unit (1020a)), the other second coding units (e.g., the lower coding unit (1020b)) may be restricted from being vertically divided in the same direction as the direction in which the upper second coding unit (1020a) is divided, for the reasons described above.

[0146] FIG. 11 illustrates a process of a video decoding device dividing a square-shaped encoding unit when the split shape mode information cannot indicate that the encoding unit is divided into four square-shaped encoding units according to one embodiment of the present disclosure.

[0147] According to one embodiment, the image decoding device (100) may split the first encoding unit (1100) based on the split shape mode information to determine the second encoding units (1110a, 1110b, 1120a, 1120b, etc.). The split shape mode information may include information about various shapes into which the encoding unit may be split, but the information about various shapes may not include information for splitting the encoding unit into four encoding units having a square shape. According to this split shape mode information, the image decoding device (100) cannot split the first encoding unit (1100) having a square shape into four second encoding units having a square shape (1130a, 1130b, 1130c, 1130d). Based on the segmentation shape mode information, the image decoding device (100) can determine a second encoding unit (1110a, 1110b, 1120a, 1120b, etc.) of a non-square shape.

[0148] According to one embodiment, the image decoding device (100) can independently split each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) having a non-square shape. Each of the second encoding units (1110a, 1110b, 1120a, 1120b, etc.) can be split in a predetermined order using a recursive method, which may be a splitting method corresponding to a method in which the first encoding unit (1100) is split based on splitting shape mode information.

[0149] For example, the image decoding device (100) can determine third coding units (1112a, 1112b) having a square shape by splitting the left second coding unit (1110a) in the horizontal direction, and can determine third coding units (1114a, 1114b) having a square shape by splitting the right second coding unit (1110b) in the horizontal direction. Furthermore, the image decoding device (100) can also determine third coding units (1116a, 1116b, 1116c, 1116d) having a square shape by splitting both the left second coding unit (1110a) and the right second coding unit (1110b) in the horizontal direction. In this case, the encoding unit can be determined in the same form as the first encoding unit (1100) being divided into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d).

[0150] As another example, the image decoding device (100) may determine third coding units (1122a, 1122b) having a square shape by vertically splitting the upper second coding unit (1120a), and may determine third coding units (1124a, 1124b) having a square shape by vertically splitting the lower second coding unit (1120b). Furthermore, the image decoding device (100) may determine third coding units (1126a, 1126b, 1126a, 1126b) having a square shape by vertically splitting both the upper second coding unit (1120a) and the lower second coding unit (1120b). In this case, the encoding unit can be determined in the same form as the first encoding unit (1100) being divided into four square-shaped second encoding units (1130a, 1130b, 1130c, 1130d).

[0151] FIG. 12 illustrates that, according to one embodiment of the present disclosure, the processing order between a plurality of encoding units may vary depending on the process of dividing the encoding units.

[0152] According to one embodiment, the image decoding device (100) may split the first encoding unit (1200) based on the split shape mode information. If the block shape is square and the split shape mode information indicates that the first encoding unit (1200) is split in at least one of the horizontal direction and the vertical direction, the image decoding device (100) may split the first encoding unit (1200) to determine second encoding units (e.g., 1210a, 1210b, 1220a, 1220b, etc.). Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) having a non-square shape determined by splitting the first encoding unit 1200 only in the horizontal direction or the vertical direction may be independently split based on the split shape mode information for each. For example, the image decoding device (100) can determine third encoding units (1216a, 1216b, 1216c, 1216d) by horizontally dividing second encoding units (1210a, 1210b) generated by vertically dividing the first encoding unit (1200), and can determine third encoding units (1226a, 1226b, 1226c, 1226d) by horizontally dividing second encoding units (1220a, 1220b) generated by horizontally dividing the first encoding unit (1200). Since the process of dividing the second encoding units (1210a, 1210b, 1220a, 1220b) has been described above with reference to FIG. 11, a detailed description thereof will be omitted.

[0153] According to one embodiment, the image decoding device (100) can process encoding units according to a predetermined order. Since the characteristics of processing encoding units according to a predetermined order have been described above with reference to FIG. 7, a detailed description thereof will be omitted. Referring to FIG. 12, the image decoding device (100) can divide a first encoding unit (1200) having a square shape and determine four third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) having a square shape. According to one embodiment, the image decoding device (100) can determine the processing order of the third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) depending on the form in which the first encoding unit (1200) is divided.

[0154] According to one embodiment, the image decoding device (100) may determine third encoding units (1216a, 1216b, 1216c, 1216d) by horizontally dividing the second encoding units (1210a, 1210b) generated by vertically dividing them, and the image decoding device (100) may process the third encoding units (1216a, 1216b, 1216c, 1216d) according to an order (1217) of first processing the third encoding units (1216a, 1216c) included in the left second encoding unit (1210a) in the vertical direction and then processing the third encoding units (1216b, 1216d) included in the right second encoding unit (1210b) in the vertical direction.

[0155] According to one embodiment, the image decoding device (100) may determine third encoding units (1226a, 1226b, 1226c, 1226d) by vertically dividing the second encoding units (1220a, 1220b) generated by being divided in the horizontal direction, and the image decoding device (100) may process the third encoding units (1226a, 1226b, 1226c, 1226d) according to an order (1227) of first processing the third encoding units (1226a, 1226b) included in the upper second encoding unit (1220a) in the horizontal direction and then processing the third encoding units (1226c, 1226d) included in the lower second encoding unit (1220b) in the horizontal direction.

[0156] Referring to FIG. 12, the second encoding units (1210a, 1210b, 1220a, 1220b) can be divided into third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) having a square shape. The second encoding units (1210a, 1210b) determined by being split in the vertical direction and the second encoding units (1220a, 1220b) determined by being split in the horizontal direction are split into different shapes, but according to the third encoding units (1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, 1226d) determined later, the first encoding unit (1200) is ultimately split into encoding units of the same shape. Accordingly, even if the image decoding device (100) determines encoding units of the same shape as a result by recursively splitting the encoding units through different processes based on the split shape mode information, it can process a plurality of encoding units determined in the same shape in different orders.

[0157] FIG. 13 illustrates a process in which the depth of an encoding unit is determined as the shape and size of the encoding unit change when the encoding unit is recursively divided to determine a plurality of encoding units according to one embodiment of the present disclosure.

[0158] According to one embodiment, the image decoding device (100) may determine the depth of an encoding unit according to a predetermined criterion. For example, the predetermined criterion may be the length of a long side of the encoding unit. If the length of the long side of the current encoding unit is split to be 2n (n>0) times the length of the long side of the encoding unit before splitting, the image decoding device (100) may determine that the depth of the current encoding unit is increased by n compared to the depth of the encoding unit before splitting. Hereinafter, an encoding unit with an increased depth is expressed as an encoding unit of a lower depth.

[0159] Referring to FIG. 13, according to one embodiment, based on block shape information indicating a square shape (for example, the block shape information may indicate '0: SQUARE'), the image decoding device (100) may divide a first coding unit (1300) having a square shape to determine a second coding unit (1302), a third coding unit (1304), etc. of a lower depth. If the size of the first coding unit (1300) having a square shape is 2Nx2N, the second coding unit (1302) determined by dividing the width and height of the first coding unit (1300) by half may have a size of NxN. Furthermore, the third coding unit (1304) determined by dividing the width and height of the second coding unit (1302) by half may have a size of N / 2xN / 2. In this case, the width and height of the third encoding unit (1304) correspond to 1 / 4 of the width and height of the first encoding unit (1300). When the depth of the first encoding unit (1300) is D, the depth of the second encoding unit (1302), which is 1 / 2 of the width and height of the first encoding unit (1300), may be D+1, and the depth of the third encoding unit (1304), which is 1 / 4 of the width and height of the first encoding unit (1300), may be D+2.

[0160] According to one embodiment, based on block shape information indicating a non-square shape (for example, the block shape information may indicate '1: NS_VER' indicating a non-square shape in which the height is longer than the width or '2: NS_HOR' indicating a non-square shape in which the width is longer than the height), the image decoding device (100) may split a first coding unit (1310 or 1320) having a non-square shape to determine a second coding unit (1312 or 1322), a third coding unit (1314 or 1324) of a lower depth, etc.

[0161] The image decoding device (100) can determine a second encoding unit (e.g., 1302, 1312, 1322, etc.) by splitting at least one of the width and height of the first encoding unit (1310) having a size of Nx2N. That is, the image decoding device (100) can split the first encoding unit (1310) in the horizontal direction to determine a second encoding unit (1302) having a size of NxN or a second encoding unit (1322) having a size of NxN / 2, and can also split the first encoding unit (1310) in the horizontal direction and the vertical direction to determine a second encoding unit (1312) having a size of N / 2xN.

[0162] According to one embodiment, the image decoding device (100) may determine a second coding unit (e.g., 1302, 1312, 1322, etc.) by splitting at least one of the width and the height of the first coding unit (1320) having a size of 2NxN. That is, the image decoding device (100) may split the first coding unit (1320) in the vertical direction to determine a second coding unit (1302) having a size of NxN or a second coding unit (1312) having a size of N / 2xN, and may also split the first coding unit (1320) in the horizontal direction and the vertical direction to determine a second coding unit (1322) having a size of NxN / 2.

[0163] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by splitting at least one of the width and the height of the second encoding unit (1302) having a size of NxN. That is, the image decoding device (100) may split the second encoding unit (1302) in the vertical direction and the horizontal direction to determine a third encoding unit (1304) having a size of N / 2xN / 2, a third encoding unit (1314) having a size of N / 4xN / 2, or a third encoding unit (1324) having a size of N / 2xN / 4.

[0164] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by splitting at least one of the width and the height of the second encoding unit (1312) having a size of N / 2xN. That is, the image decoding device (100) may split the second encoding unit (1312) in the horizontal direction to determine a third encoding unit (1304) having a size of N / 2xN / 2 or a third encoding unit (1324) having a size of N / 2xN / 4, or split the second encoding unit (1312) in the vertical direction and the horizontal direction to determine a third encoding unit (1314) having a size of N / 4xN / 2.

[0165] According to one embodiment, the image decoding device (100) may determine a third encoding unit (e.g., 1304, 1314, 1324, etc.) by splitting at least one of the width and the height of the second encoding unit (1322) having a size of NxN / 2. That is, the image decoding device (100) may split the second encoding unit (1322) in the vertical direction to determine a third encoding unit (1304) having a size of N / 2xN / 2 or a third encoding unit (1314) having a size of N / 4xN / 2, or split the second encoding unit (1322) in the vertical direction and the horizontal direction to determine a third encoding unit (1324) having a size of N / 2xN / 4.

[0166] According to one embodiment, the image decoding device (100) may split a square-shaped encoding unit (e.g., 1300, 1302, 1304) in a horizontal direction or a vertical direction. For example, a first encoding unit (1300) having a size of 2Nx2N may be split in the vertical direction to determine a first encoding unit (1310) having a size of Nx2N, or may be split in the horizontal direction to determine a first encoding unit (1320) having a size of 2NxN. According to one embodiment, when the depth is determined based on the length of the longest side of the encoding unit, the depth of the encoding unit determined by splitting the first encoding unit (1300) having a size of 2Nx2N in the horizontal direction or the vertical direction may be the same as the depth of the first encoding unit (1300).

[0167] According to one embodiment, the width and height of the third coding unit (1314 or 1324) may be 1 / 4 times that 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), which is 1 / 2 times the width and height of the first coding unit (1310 or 1320), may be D+1, and the depth of the third coding unit (1314 or 1324), which is 1 / 4 times the width and height of the first coding unit (1310 or 1320), may be D+2.

[0168] FIG. 14 illustrates an index (part index, hereinafter referred to as PID) for depth and encoding unit distinction that can be determined according to the shape and size of encoding units according to one embodiment of the present disclosure.

[0169] According to one embodiment, the image decoding device (100) may split a first encoding unit (1400) having a square shape to determine second encoding units of various shapes. Referring to FIG. 14, the image decoding device (100) may split the first encoding unit (1400) in at least one of a vertical direction and a horizontal direction according to the split shape mode information to determine second encoding units (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d). That is, the image decoding device (100) can determine the second encoding unit (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) based on the split shape mode information for the first encoding unit (1400).

[0170] According to one embodiment, the depth of the second coding units (1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, 1406d) determined according to the split shape mode information for the first coding unit (1400) having a square shape may be determined based on the length of the long side. For example, since the length of one side of the first coding unit (1400) having a square shape and the length of the long side of the second coding unit (1402a, 1402b, 1404a, 1404b) having a non-square shape are the same, the depth of the first coding unit (1400) and the second coding units (1402a, 1402b, 1404a, 1404b) having a non-square shape may be considered to be the same as D. In contrast, when the image decoding device (100) divides the first encoding unit (1400) into four square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) based on the split shape mode information, the length of one side of the square-shaped second encoding units (1406a, 1406b, 1406c, 1406d) is half the length of one side of the first encoding unit (1400), so the depth of the second encoding units (1406a, 1406b, 1406c, 1406d) may be a depth of D+1, which is one depth lower than D, the depth of the first encoding unit (1400).

[0171] According to one embodiment, the image decoding device (100) may split a first encoding unit (1410) having a height greater than its width into a plurality of second encoding units (1412a, 1412b, 1414a, 1414b, 1414c) in a horizontal direction according to the splitting shape mode information. According to one embodiment, the image decoding device (100) may split a first encoding unit (1420) having a width greater than its height into a plurality of second encoding units (1422a, 1422b, 1424a, 1424b, 1424c) in a vertical direction according to the splitting shape mode information.

[0172] According to one embodiment, the depth of the second coding unit (1412a, 1412b, 1414a, 1414b, 1414c. 1422a, 1422b, 1424a, 1424b, 1424c) determined based on the split shape mode information for the first coding unit (1410 or 1420) of a non-square shape may be determined based on the length of the long side. For example, since the length of one side of the second encoding unit (1412a, 1412b) in the shape of a square is half the length of one side of the first encoding unit (1410) in the shape of a non-square having a height longer than a width, the depth of the second encoding unit (1412a, 1412b) in the shape of a square is D+1, which is one depth lower than the depth D of the first encoding unit (1410) in the shape of a non-square.

[0173] Furthermore, the image decoding device (100) can split a non-square first encoding unit (1410) into an odd number of second encoding units (1414a, 1414b, 1414c) based on the split shape mode information. The odd number of second encoding units (1414a, 1414b, 1414c) can include non-square second encoding units (1414a, 1414c) and square second encoding units (1414b). In this case, since the length of the long side of the second encoding unit (1414a, 1414c) of a non-square shape and the length of one side of the second encoding unit (1414b) of a square shape are half the length of one side of the first encoding unit (1410), the depth of the second encoding unit (1414a, 1414b, 1414c) may be a depth of D+1, which is one depth lower than D, which is the depth of the first encoding unit (1410). The image decoding device (100) may determine the depth of the encoding units associated with the first encoding unit (1420) of a non-square shape, in which the width is longer than the height, in a manner corresponding to the above method of determining the depth of the encoding units associated with the first encoding unit (1410).

[0174] According to one embodiment, when determining an index (PID) for distinguishing divided coding units, the image decoding device (100) may determine the index based on a size ratio between the coding units when the coding units divided into an odd number are not of the same size. Referring to FIG. 14, among the coding units (1414a, 1414b, 1414c) divided into an odd number, the coding unit (1414b) located in the middle may have the same width as the other coding units (1414a, 1414c) but may have a height that is twice the height of the coding units (1414a, 1414c) that are different in height. That is, in this case, the coding unit (1414b) located in the middle may include two of the other coding units (1414a, 1414c). Accordingly, if the index (PID) of the encoding unit (1414b) located in the middle according to the scanning order is 1, the index of the encoding unit (1414c) located in the next order may be 3, which is an increase of 2. In other words, there may be a discontinuity in the index value. According to one embodiment, the image decoding device (100) may determine whether the encoding units divided into an odd number are not of the same size based on the presence or absence of discontinuity in the index for distinguishing between the divided encoding units.

[0175] According to one embodiment, the image decoding device (100) may determine whether the image is divided into a specific split shape based on the value of an index for distinguishing a plurality of coding units that are divided from the current coding unit. Referring to FIG. 14, the image decoding device (100) may divide a first coding unit (1410) having a rectangular shape in which the height is longer than the width, to determine an even number of coding units (1412a, 1412b) or an odd number of coding units (1414a, 1414b, 1414c). The image decoding device (100) may use an index (PID) indicating each coding unit to distinguish each of the plurality of coding units. According to one embodiment, the PID may be obtained from a sample (for example, an upper left sample) at a predetermined position of each coding unit.

[0176] According to one embodiment, the image decoding device (100) may determine an coding unit at a predetermined position among the coding units that are divided and determined using an index for distinguishing the coding units. According to one embodiment, when the split shape mode information for the first coding unit (1410) having a rectangular shape with a height longer than the width indicates that the first coding unit (1410) is divided into three coding units, the image decoding device (100) may divide the first coding unit (1410) into three coding units (1414a, 1414b, 1414c). The image decoding device (100) may assign an index to each of the three coding units (1414a, 1414b, 1414c). The image decoding device (100) may compare the indexes for each coding unit to determine the middle coding unit among the coding units divided into an odd number of coding units. The image decoding device (100) may determine a coding unit (1414b) having an index corresponding to a middle value among the indices of the coding units as a coding unit at a middle position among the coding units determined by splitting the first coding unit (1410). According to an embodiment, when determining an index for distinguishing the split coding units, the image decoding device (100) may determine the index based on a size ratio between the coding units when the coding units do not have the same size. Referring to FIG. 14, the coding unit (1414b) generated by splitting the first coding unit (1410) may have the same width as other coding units (1414a, 1414c) but may be twice the height of the coding units (1414a, 1414c) that are different in height. In this case, if the index (PID) of the encoding unit (1414b) located in the middle is 1, the index of the encoding unit (1414c) located in the next order may be 3, which is an increase of 2.In cases like this where the index increases uniformly and then the increase amount changes, the image decoding device (100) may determine that the current encoding unit is divided into a plurality of encoding units including encoding units having different sizes from other encoding units. According to one embodiment, when the split shape mode information indicates that the current encoding unit is divided into an odd number of encoding units, the image decoding device (100) may divide the current encoding unit into a form in which an encoding unit at a predetermined position among the odd number of encoding units (for example, a middle encoding unit) has a different size from the other encoding units. In this case, the image decoding device (100) may determine a middle encoding unit having a different size using an index (PID) for the encoding unit. However, the above-described index, the size or position of the encoding unit at the predetermined position to be determined are specific for explaining one embodiment and should not be interpreted as being limited thereto, and it should be interpreted that various indexes, positions and sizes of encoding units can be used.

[0177] According to one embodiment, the image decoding device (100) may utilize a predetermined data unit from which recursive division of the encoding unit begins.

[0178] FIG. 15 illustrates that a plurality of coding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment of the present disclosure.

[0179] According to one embodiment, a predetermined data unit may be defined as a data unit from which a coding unit begins to be recursively split using split shape mode information. That is, it may correspond to a coding unit of the highest depth used in the process of determining multiple coding units for splitting the current picture. For convenience of explanation, this predetermined data unit will be referred to as a reference data unit hereinafter.

[0180] In one embodiment, the reference data unit may exhibit a predetermined size and shape. In one embodiment, the reference coding unit may include MxN samples, where M and N may be the same and may be integers expressed as powers of 2. That is, the reference data unit may exhibit a square or non-square shape, and may be subsequently divided into an integer number of coding units.

[0181] According to one embodiment, the video decoding device (100) can divide the current picture into a plurality of reference data units. According to one embodiment, the video decoding device (100) can divide the plurality of reference data units into which the current picture is divided using division type mode information for each reference data unit. This division process of the reference data units can correspond to a division process using a quad-tree structure.

[0182] According to one embodiment, the image decoding device (100) may predetermine the minimum size that a reference data unit included in the current picture may have. Accordingly, the image decoding device (100) may determine reference data units of various sizes having a size greater than or equal to the minimum size, and may determine at least one encoding unit using segmentation mode information based on the determined reference data unit.

[0183] Referring to FIG. 15, the image decoding device (100) may use a reference coding unit (1500) having a square shape, or may use a reference coding unit (1502) having a non-square shape. According to one embodiment, the shape and size of the reference coding unit may be determined according to various data units (e.g., sequence, picture, slice, slice segment, tile, tile group, maximum coding unit, etc.) that may include at least one reference coding unit.

[0184] According to one embodiment, the receiving unit (110) of the image decoding device (100) can obtain at least one of information on the shape of the reference coding unit and information on the size of the reference coding unit from the bitstream for each of the various data units. The process of determining at least one coding unit included in the square-shaped reference coding unit (1500) has been described above through the process of splitting the current coding unit (300) of FIG. 3, and the process of determining at least one coding unit included in the non-square-shaped reference coding unit (1502) has been described above through the process of splitting the current coding unit (400 or 450) of FIG. 4, so a detailed description thereof will be omitted.

[0185] According to one embodiment, the image decoding device (100) may use an index for identifying the size and shape of the reference coding unit to determine the size and shape of the reference coding unit according to some data units that are predetermined based on a predetermined condition. That is, the receiving unit (110) may obtain only an index for identifying the size and shape of the reference coding unit for each slice, slice segment, tile, tile group, maximum coding unit, etc., among the various data units (e.g., sequences, pictures, slices, slice segments, tiles, tile groups, maximum coding units, etc.) that satisfy a predetermined condition (e.g., data units having a size smaller than a slice) from the bitstream. The image decoding device (100) may determine the size and shape of the reference data unit for each data unit that satisfies the predetermined condition by using the index. When information about the shape of the reference coding unit and information about the size of the reference coding unit are obtained from the bitstream for each relatively small-sized data unit and used, the efficiency of the bitstream may not be good. Therefore, instead of directly obtaining information about the shape of the reference coding unit and information about the size of the reference coding unit, only the index may be obtained and used. In this case, at least one of the size and shape of the reference coding unit corresponding to the index indicating the size and shape of the reference coding unit may be determined in advance. That is, the image decoding device (100) can determine at least one of the size and shape of the reference coding unit included in the data unit that serves as the basis for obtaining the index by selecting at least one of the sizes and shapes of the predetermined reference coding units according to the index.

[0186] According to one embodiment, the image decoding device (100) may use at least one reference coding unit included in one maximum coding unit. That is, a maximum coding unit for dividing an image may include at least one reference coding unit, and a coding unit may be determined through a recursive splitting process of each reference coding unit. According to one embodiment, at least one of the width and the height of the maximum coding unit may correspond to an integer multiple of at least one of the width and the height of the reference coding unit. According to one embodiment, the size of the reference coding unit may be a size obtained by splitting the maximum coding unit n times according to a quad tree structure. That is, the image decoding device (100) may split the maximum coding unit n times according to the quad tree structure to determine the reference coding unit, and may split the reference coding unit based on at least one of block shape information and split shape mode information according to various embodiments.

[0187] FIG. 16 illustrates a processing block that serves as a criterion for determining the order of determination of reference coding units included in a picture according to one embodiment of the present disclosure.

[0188] According to one embodiment, the image decoding apparatus (100) may determine at least one processing block for dividing a picture. The processing block is a data unit including at least one reference coding unit for dividing an image, and at least one reference coding unit included in the processing block may be determined in a specific order. That is, the determination order of at least one reference coding unit determined in each processing block may correspond to one of various types of orders in which the reference coding unit may be determined, and the determination order of the reference coding unit determined in each processing block may be different for each processing block. The determination order of the reference coding unit determined for each processing block may be one of various orders such as raster scan, Z-scan, N-scan, up-right diagonal scan, horizontal scan, and vertical scan, but the order in which it may be determined should not be interpreted as being limited to the above scan orders.

[0189] According to one embodiment, the image decoding device (100) can obtain information about the size of a processing block to determine the size of at least one processing block included in an image. The image decoding device (100) can obtain information about the size of a processing block from a bitstream to determine the size of at least one processing block included in an image. The size of the processing block may be a predetermined size of a data unit indicated by the information about the size of the processing block.

[0190] According to one embodiment, the receiving unit (110) of the image decoding device (100) can obtain information about the size of a processing block from a bitstream for each specific data unit. For example, the information about the size of a processing block can be obtained from the bitstream for each data unit such as an image, a sequence, a picture, a slice, a slice segment, a tile, a tile group, etc. That is, the receiving unit (110) can obtain information about the size of a processing block from the bitstream for each of the above-described multiple data units, and the image decoding device (100) can determine the size of at least one processing block for dividing a picture using the obtained information about the size of the processing block, and the size of the processing block can be an integer multiple of a reference coding unit.

[0191] According to one embodiment, the image decoding device (100) may determine the size of the processing block (1602, 1612) included in the picture (1600). For example, the image decoding device (100) may determine the size of the processing block based on information about the size of the processing block obtained from the bitstream. Referring to FIG. 16, the image decoding device (100) may determine the horizontal size of the processing block (1602, 1612) to be four times the horizontal size of the reference coding unit, and the vertical size of the processing block (1602, 1612) to be four times the vertical size of the reference coding unit, according to one embodiment. The image decoding device (100) may determine the order in which at least one reference coding unit is determined within at least one processing block.

[0192] According to one embodiment, the video decoding device (100) may determine each processing block (1602, 1612) included in the picture (1600) based on the size of the processing block, and may determine the determination order of at least one reference coding unit included in the processing block (1602, 1612). According to one embodiment, the determination of the reference coding unit may include determining the size of the reference coding unit.

[0193] According to one embodiment, the image decoding device (100) can obtain information about a determination order of at least one reference coding unit included in at least one processing block from a bitstream, and can determine an order in which at least one reference coding unit is determined based on the obtained information about the determination order. The information about the determination order can be defined as an order or direction in which the reference coding units are determined within the processing block. That is, the order in which the reference coding units are determined can be independently determined for each processing block.

[0194] According to one embodiment, the image decoding device (100) can obtain information about the determination order of the reference coding unit for each specific data unit from the bitstream. For example, the receiving unit (110) can obtain information about the determination order of the reference coding unit for each data unit such as an image, sequence, picture, slice, slice segment, tile, tile group, processing block, etc. from the bitstream. Since the information about the determination order of the reference coding unit indicates the determination order of the reference coding unit within the processing block, the information about the determination order can be obtained for each specific data unit including an integer number of processing blocks.

[0195] The image decoding device (100) can determine at least one reference encoding unit based on an order determined according to one embodiment.

[0196] According to one embodiment, the receiver (110) may obtain information about the reference coding unit determination order as information related to the processing blocks (1602, 1612) from the bitstream, and the image decoding device (100) may determine the order in which at least one reference coding unit included in the processing blocks (1602, 1612) is determined and determine at least one reference coding unit included in the picture (1600) according to the determination order of the coding units. Referring to FIG. 16, the image decoding device (100) may determine the determination order (1604, 1614) of at least one reference coding unit related to each processing block (1602, 1612). For example, when information about the determination order of the reference coding unit is obtained for each processing block, the determination order of the reference coding unit related to each processing block (1602, 1612) may be different for each processing block. If the reference encoding unit determination order (1604) related to the processing block (1602) is a raster scan order, the reference encoding unit included in the processing block (1602) can be determined according to the raster scan order. In contrast, if the reference encoding unit determination order (1614) related to another processing block (1612) is a reverse order of the raster scan order, the reference encoding unit included in the processing block (1612) can be determined according to the reverse order of the raster scan order.

[0197] According to one embodiment, the image decoding device (100) can decode at least one determined reference coding unit. The image decoding device (100) can decode an image based on the determined reference coding unit through the above-described embodiment. The method of decoding the reference coding unit may include various methods of decoding an image.

[0198] According to one embodiment, the video decoding device (100) may obtain and use block shape information indicating the shape of the current encoding unit or split shape mode information indicating a method of splitting the current encoding unit from the bitstream. The split shape mode information may be included in a bitstream related to various data units. For example, the video decoding device (100) may use 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 tile header, and a tile group header. Furthermore, the video decoding device (100) may obtain and use a syntax element corresponding to block shape information or split shape mode information from the bitstream for each maximum encoding unit, each reference encoding unit, and each processing block.

[0199] Hereinafter, a method for determining a partitioning rule according to one embodiment of the present disclosure will be described in detail.

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

[0201] The image decoding device (100) can determine a segmentation rule based on the block shape of the encoding unit. The block shape can include the size, shape, width and height ratio, and direction of the encoding unit. The image encoding device (2200) and the image decoding device (100) can determine in advance that the segmentation rule will be determined based on the block shape of the encoding unit. However, the present invention is not limited thereto. The image decoding device (100) can determine the segmentation rule based on information obtained from the bitstream received from the image encoding device (2200).

[0202] The shape of the encoding unit may include a square and a non-square. If the width and height of the encoding unit are equal, the image decoding device (100) may determine the shape of the encoding unit as a square. In addition, if the width and height of the encoding unit are not equal, the image decoding device (100) may determine the shape of the encoding unit as a non-square.

[0203] The size of the coding unit may include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ..., 256x256. The size of the coding unit may be classified according to the length of the long side, the length of the short side, or the area of ​​the coding unit. The image decoding device (100) may apply the same splitting rule to the coding units classified into the same group. For example, the image decoding device (100) may classify the coding units having the same long side length into the same size. In addition, the image decoding device (100) may apply the same splitting rule to the coding units having the same long side length.

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

[0205] The image decoding device (100) can adaptively determine a splitting rule based on the size of the encoding unit. The image decoding device (100) can determine a different allowable splitting mode based on the size of the encoding unit. For example, the image decoding device (100) can determine whether splitting is allowed based on the size of the encoding unit. The image decoding device (100) can determine a splitting direction based on the size of the encoding unit. The image decoding device (100) can determine an allowable splitting type based on the size of the encoding unit.

[0206] Determining the splitting rule based on the size of the encoding unit may be a splitting rule predetermined between the image encoding device (2200) and the image decoding device (100). In addition, the image decoding device (100) may determine the splitting rule based on information obtained from the bitstream.

[0207] The image decoding device (100) can adaptively determine a segmentation rule based on the position of the encoding unit. The image decoding device (100) can adaptively determine a segmentation rule based on the position that the encoding unit occupies in the image.

[0208] Additionally, the image decoding device (100) can determine a splitting rule so that encoding units generated through different splitting paths do not have the same block shape. However, this is not limited thereto, and encoding units generated through different splitting paths may have the same block shape. Encoding units generated through different splitting paths may have different decoding processing orders. Since the decoding processing order has been described together with FIG. 12, a detailed description thereof will be omitted.

[0209] FIG. 17 is a diagram for explaining a method of performing chroma prediction using a cross-component linear model (CCLM) according to one embodiment of the present disclosure.

[0210] CCLM is a method for predicting chroma samples by utilizing the linear relationship between luma samples and chroma samples. Referring to Fig. 17, neighboring regions of the current block are used to predict chroma samples of the current block from luma samples at collocated locations of the chroma samples. A linear parameter is derived through the relationship between reference luma samples of the neighboring region (1740) of the current luma block (1720) and reference chroma samples of the neighboring region (1730) of the current chroma block (1710) corresponding to the current luma block (1720). , is derived. As shown in Mathematical Expression 1 below, the derived parameter values ​​are applied to the current luma sample of the restored current luma block (1720) to predict the current chroma sample value of the current chroma block (1710).

[0211] [Mathematical Formula 1]

[0212]

[0213] Here, Pred c [x, y] is the predicted sample value of the current chroma sample at the x, y coordinate location, and Rec L '[x, y] is the restored sample value of the current luma sample corresponding to the current chroma sample at the x, y coordinate location, is the multiplication parameter, is an addition parameter.

[0214] FIG. 18 is a diagram for explaining a method of performing chroma prediction using a multi-model linear model (MMLM) according to one embodiment of the present disclosure.

[0215] Unlike CCLM, MMLM derives and uses two models from the neighboring regions of the current block. Referring to Figure 18, the average value of the reference luma samples of the neighboring regions of the current luma block is used as a threshold, and the samples are classified into two groups based on the threshold. Two linear models (1810, 1820) are derived from the two groups through the least mean squared method. As shown in Mathematical Expression 2 below, the restored current luma sample of the current luma block is applied to the two derived linear models to predict the current chroma sample of the current chroma block.

[0216] [Equation 2]

[0217]

[0218] In the aforementioned Figures 17 and 18, the linear models of CCLM and MMLM are derived using the neighboring regions of the current block. In Figure 19, described below, a method of utilizing regions other than the neighboring regions of the current block when performing chroma prediction using the correlation between the luma component and the chroma component is described.

[0219] FIG. 19 is a diagram for explaining a method of performing chroma prediction using regions other than the surrounding regions neighboring the current block according to one embodiment of the present disclosure.

[0220] Referring to FIG. 19, a reference block pointed to by a block vector or motion vector of a current luma block (1920) corresponding to a current chroma block (1910), or a reference block most similar to the current luma block in an intra template matching prediction (IntraTMP) of the current luma block (1920), or a reference surrounding region neighboring the reference block is used. In order to derive a more accurate linear model, a linear model can be derived using a region different from the surrounding region.

[0221] For example, the reference luma block (1940) and the corresponding reference chroma block (1930) pointed to by the current luma block (1920) can be used as regions for deriving a linear model of CCLM or MMLM. The entirety or a portion of the regions of the reference luma block (1940) and the reference chroma block (1930) can be used for deriving a linear model.

[0222] Additionally, a reference luma surrounding region (1945) adjacent to a reference luma block (1940) and a reference chroma surrounding region (1935) adjacent to a reference chroma block (1930) can be used as regions for deriving a linear model of CCLM or MMLM. The entirety or a portion of the reference luma surrounding region (1945) and the reference chroma surrounding region (1935) can be used for deriving a linear model.

[0223] Additionally, the current luma block (1920) and the reference chroma block (1930) can be used as regions for deriving a linear model of CCLM or MMLM. The entirety or a portion of the current luma block (1920) and the reference chroma block (1930) can be used for deriving a linear model.

[0224] Additionally, the reference luma surrounding region (1945) adjacent to the reference luma block (1940) and the current chroma surrounding region (1915) adjacent to the current chroma block (1910) can be used as regions for deriving a linear model of CCLM or MMLM. The entirety or a portion of the reference luma surrounding region (1945) adjacent to the reference luma block (1940) and the current chroma surrounding region (1915) adjacent to the current chroma block (1910) can be used for deriving a linear model.

[0225] Additionally, the current luma surrounding region (1925) and the reference chroma surrounding region (1935) adjacent to the current luma block (1920) can be used as regions for deriving a linear model of CCLM or MMLM. The entirety or a portion of the current luma surrounding region (1925) and the reference chroma surrounding region (1935) can be used for deriving a linear model.

[0226] Additionally, to derive a linear model of CCLM or MMLM, neighboring blocks (prediction units or coding units) reconstructed before the current block can be utilized. For example, neighboring blocks may include spatially adjacent blocks, non-adjacent blocks, or history candidates (candidates included in a history-based motion vector list). Non-adjacent blocks may be, for example, temporal candidate blocks that are not spatially adjacent. A history-based motion vector list is a list that includes blocks reconstructed before the current block.

[0227] FIG. 20 is a diagram for explaining a method of performing chroma prediction using a convolutional cross-component model (CCCM) according to one embodiment of the present disclosure.

[0228] CCCM applies a 7-tap filter to restored luma samples to predict chroma samples (Cb, Cr). Referring to Fig. 20, CCCM uses a current luma sample (2000) corresponding to a current chroma sample to be predicted, an upper luma sample (2001) located above or north of the current luma sample (2000), a right luma sample (2002) located to the right or east of the current luma sample (2000), a lower luma sample (2003) located below or south of the current luma sample (2000), and a left luma sample (2004) located to the left or west of the current luma sample (2000).

[0229] Additionally, a nonlinear term is utilized. The nonlinear term is expressed as a power of the current luma sample (2000) as shown in Equation 3 below and is scaled to the sample value range of the content.

[0230] [Equation 3]

[0231]

[0232] Here, P is a nonlinear term, C is the current luma sample, midVal is the middle chroma value, and bitDepth is the bit depth of the content.

[0233] Additionally, a bias term is used, which represents a scalar offset between input and output and is set to an intermediate chroma value (e.g., 512 for 10 bits).

[0234] The output of the CCCM filter is the filter coefficient c as shown in the mathematical expression 4 below. i It is computed as a convolution between the input values ​​and clipped to the valid chroma sample range.

[0235] [Equation 4]

[0236]

[0237] Here, C is the current luma sample, N is the upper luma sample, S is the lower luma sample, E is the right luma sample, W is the left luma sample, P is the nonlinear term, and B is the bias term.

[0238] Filter coefficient c used in mathematical expression 4 i The values ​​are derived from the relationship between reference luma samples in the surrounding area (2020) adjacent to the current luma block (2010) and the chroma samples corresponding to the reference luma samples. In addition, separate coefficient values ​​are calculated for each chrominance component (Cb, Cr).

[0239] In Fig. 20, the surrounding area of ​​the current luma block is used for CCCM, but other areas may be used if the current luma block has a block vector obtained by intra-block copy or intra-template matching prediction. This is described later in Fig. 21.

[0240] Intra-block copying refers to a method of predicting blocks using blocks of sample values ​​within the current image (e.g., the current picture, the current frame, the current slice, etc.). The information indicating these blocks is called a block vector to distinguish it from the motion vector used for motion compensation in conventional inter prediction.

[0241] Intra-template matching prediction is a method that matches multiple regions of a size corresponding to template regions neighboring the current block within the reconstructed search region of the current image (current frame) that includes the current block, calculates a distortion cost to determine the region with the best match, determines a matching block that is neighboring the region with the best match and corresponds to the current block, and predicts the current block using the matching block. In this case, the matching block is a block within the current image that includes the current block, so the information indicating this matching block can be referred to as a block vector.

[0242] FIG. 21 is a diagram for explaining a method of performing chroma prediction using a block vector guided convolution cross component model (BVG-CCCM) according to one embodiment of the present disclosure.

[0243] Referring to FIG. 21, when the current luma block (2115) corresponding to the current chroma block (2105) has a block vector, the reference luma area (2120) pointed to by the block vector and the reference chroma area (2110) corresponding to the reference luma area (2120) are used to derive the coefficients of the filter.

[0244] BVG-CCCM predicts the current chroma sample by applying an 11-tap filter to the restored current luma sample, as shown in Equation 5 below.

[0245] [Equation 5]

[0246]

[0247] Here, C is the current luma sample, N is the upper luma sample, S is the lower luma sample, E is the right luma sample, W is the left luma sample, P(-) is a nonlinear term obtained by squaring the corresponding luma sample, and B is a bias term determined by the intermediate chroma value.

[0248] Additionally, in deriving the filter coefficients of the filter, a reference luma surrounding area adjacent to the reference luma area (2120) and a reference chroma surrounding area adjacent to the reference chroma area (2110) can be used.

[0249] FIG. 22 is a diagram for explaining a method of performing chroma prediction using a cross component residual model (CCRM) according to one embodiment of the present disclosure.

[0250] CCRM uses restored luma sample values ​​to predict chroma samples. If the current block (2250) is predicted using inter-prediction or intra-block copy, the current block (2250) has a motion vector or block vector. In this case, the reference block pointed to by the motion vector or block vector is used as the prediction block. This is because the reference block pointed to by the motion vector or block vector is a block similar to the current block.

[0251] Referring to FIG. 22, the reference block (2200) pointed to by the motion vector or block vector of the current block (2250) has prediction values ​​for each component, i.e., a luma prediction value (2201, predY), a first chroma prediction value (2202, predCb), and a second chroma prediction value (2203, predCr). These correspond to the reconstructed luma sample, the reconstructed first chroma sample, and the reconstructed second chroma sample of the reference block (2200). Since the reference block pointed to by the motion vector or block vector is a block similar to the current block, the reconstructed luma and chroma sample values ​​of the reference block (2200) can be used as the luma and chroma prediction values ​​of the current block (2250). An 8-tap filter is derived (2205) through these component-specific prediction values ​​(2201, 2202, 2203). The derived filter is applied (2220) to the luma reconstruction sample (2245, reconY) in which the luma residual sample (2210, resY) is added to the luma prediction value (2201). Since the derived filter is obtained through the correlation of cross components, applying the filter to the luma reconstruction sample (2245) results in the first chroma prediction value (2225) and the second chroma prediction value (2230) of the current chroma block being more accurate than the first chroma prediction value (2202) and the first chroma prediction value (2203) of the reference block (2220). The first chroma residual sample (2235, resCb) is added to the first chroma prediction value (2225) to obtain a first chroma reconstruction sample (2255, reconCb), and the second chroma residual sample (2240, resCr) is added to the second chroma prediction value (2230) to obtain a second chroma reconstruction sample (2260, reconCr), thereby restoring the current chroma block.

[0252] The filter derivation process, filter application process, and luma and chroma sample restoration process described above in Fig. 22 can be applied to BVG-CCCM in the same manner, except for the difference in the filter applied in BVG-CCCM of Fig. 21.

[0253] Below, in Fig. 23, the locations of luma samples to which the CCRM filter is applied are described.

[0254] FIG. 23 is a diagram illustrating the positions of luma samples to which a CCRM filter is applied, according to one embodiment of the present disclosure.

[0255] Referring to FIG. 23, the luma samples to which a filter is applied in CCRM are a current luma sample (2310) corresponding to a current chroma sample (2300) to be predicted, a left luma sample (2305) located to the left of the current luma sample (2310), a right luma sample (2315) located to the right of the current luma sample (2310), a lower left luma sample (2320) located to the lower left of the current luma sample (2310), a lower luma sample (2325) located below the current luma sample (2310), and a lower right luma sample (2330) located to the lower right of the current luma sample (2310). This represents luma samples to which a filter is applied for the current chroma sample (2300) in a color format of 4:2:0.

[0256] If the coordinates of the current chroma sample (2300) are expressed as (x, y), the coordinates of the current luma sample (2310) are (2x, 2y), the coordinates of the left luma sample (2305) are (2x-1, 2y), the coordinates of the right luma sample (2315) are (2x+1, 2y), the coordinates of the lower left luma sample (2320) are (2x-1, 2y+1), the coordinates of the lower luma sample (2325) are (2x, 2y+1), and the coordinates of the lower right luma sample (2330) are (2x+1, 2y+1).

[0257] The filter applied in CCRM is an 8-tap filter, and as shown in Equation 6 below, terms for 6 restored luma samples, 1 nonlinear term, and 1 bias term are used.

[0258] [Equation 6]

[0259]

[0260] Here, c i is a filter coefficient value, L0 is the current luma sample corresponding to the current chroma sample, L1 is the left luma sample, L2 is the right luma sample, L3 is the lower left luma sample, L4 is the lower luma sample, L5 is the lower right luma sample, and B is a bias term and is determined by the middle chroma value.

[0261] The BVG-CCCM and CCRM of FIGS. 21 to 23 described above derive a filter through the correlation between reference luma sample values ​​and reference chroma sample values ​​in a reference area pointed to by the block vector or motion vector of the current block, and apply the derived filter to the reconstructed current luma sample of the current block to predict the current chroma sample value of the current block. However, even if the correlation between the reference luma sample values ​​and the reference chroma sample values ​​in the reference area is properly inferred, there may be some difference between the correlation between the reconstructed current luma sample and the current chroma sample of the current block. Therefore, applying the derived filter to the reconstructed current luma sample of the current block to predict the current chroma sample value may result in low accuracy.

[0262] To overcome this, a method of performing chroma prediction for the current block by considering the reference chroma sample values ​​of the reference area together is described later in Fig. 24.

[0263] FIG. 24 is a diagram illustrating a method for performing chroma prediction using a luma residual sample of a current block and a reference chroma sample of a reference region according to one embodiment of the present disclosure.

[0264] Unlike the methods of FIGS. 21 to 23 (BCG-CCCM and CCRM) described above that directly predict the current chroma sample through the restored current luma sample, the method of FIG. 24 derives the residual value of the current chroma sample through the residual value of the current luma sample, and adds the derived residual value to the reference chroma sample value to predict the chroma sample value for the current block.

[0265] Compared to the methods of FIGS. 21 to 23, which do not directly use the reference chroma samples even though there is a high correlation between the chroma samples of the current block and the reference chroma samples of the reference area of ​​the current block, the method of FIG. 24 can improve the performance of chroma prediction by directly using the reference chroma samples.

[0266] Referring to FIG. 24, the reference block (2400) pointed to by the motion vector or block vector of the current block (2450) has prediction values ​​for each component, i.e., a luma prediction value (2401, predY), a first chroma prediction value (2402, predCb), and a second chroma prediction value (2403, predCr). These correspond to the reconstructed luma sample, the reconstructed first chroma sample, and the reconstructed second chroma sample of the reference block (2400). Since the reference block pointed to by the motion vector or block vector is a block similar to the current block, the reconstructed luma and chroma sample values ​​of the reference block (2400) can be used as the luma and chroma prediction values ​​of the current block (2450). A filter is derived (2405) through these component-specific prediction values ​​(2401, 2402, 2403). The derived filter is applied (2420) to the luma residual sample (2410, resY) for the current block (2450). A first chroma prediction residual value (2421, predicted resCb) and a second chroma prediction residual value (2422, predicted resCr) are obtained through the filter. An enhanced first chroma prediction value (2425, enhanced predCb) is obtained by adding the first chroma prediction value (2402) to the first chroma prediction residual value (2421), and an enhanced second chroma prediction value (2430, enhanced predCr) is obtained by adding the second chroma prediction value (2403) to the second chroma prediction residual value (2422). A first chroma reconstruction sample (2455, reconCb) for the current block (2450) is obtained by adding a first chroma residual sample (2435, resCb) to the enhanced first chroma prediction value (2425), and a second chroma reconstruction sample (2460, reconCr) for the current block (2450) is obtained by adding a second chroma residual sample (2440, resCr) to the enhanced second chroma prediction value (2430), thereby reconstructing the current chroma block.

[0267] Additionally, a luma reconstruction sample (2445, reconY) for the current block (2450) is obtained by adding the current luma residual sample (2410) to the luma prediction value (2401).

[0268] In order to improve the performance of chroma prediction, the luma residual sample (2410) for the current block (2450) is applied to the filter to infer residual values ​​(2421, 2422) for chroma prediction samples (2402, 2403), and by adding each residual value (2421, 2422) to each of the chroma prediction samples (2402, 2403), more accurate chroma prediction values, i.e., enhanced chroma prediction values ​​(2425, 2430), are obtained. Since the method of Fig. 24 uses a reference chroma value with a high correlation, higher compression efficiency can be expected than directly predicting the current chroma sample using the restored current luma sample value.

[0269] Additionally, to derive a filter, the residual values ​​of the reference luma sample and reference chroma sample of the reference block (2400) may be used instead of the reference luma sample and reference chroma sample of the reference block (2400). That is, the reference luma residual sample and reference chroma residual sample used in the process of restoring the reference block (2400) are used to derive the filter. In this case, a filter that more precisely predicts the residual value in the current block (2450) may be derived.

[0270] In the following FIG. 25, a method of performing chroma prediction using BVG-CCCM using the method of FIG. 24 described above is described, and in the following FIG. 26, a method of performing chroma prediction using CCRM using the method of FIG. 24 described above is described.

[0271] FIG. 25 is a diagram illustrating a method for performing chroma prediction using a luma residual sample of a current block and a reference chroma sample of a reference region in BVG-CCCM according to one embodiment of the present disclosure.

[0272] Referring to Fig. 25, in order to derive a filter, reference luma samples (2531, 2532, 2533, 2534, 2535) of a reference luma block (2530) indicated by a block vector of a current luma block (2510) corresponding to a current chroma block (2500) and a reference chroma sample (2525) of a reference chroma block (2520) corresponding to the reference luma block (2530) are used. Specifically, the reference chroma samples (2525, ), reference luma sample (2535, ), upper reference luma sample (2531, ), left reference luma sample (2532, ), lower reference luma sample (2533, ), right reference luma sample (2534, ) is used. The reference chroma sample (2525) is the current chroma sample (2505, C) of the current chroma block (2500). ch ) is a chroma sample of a reference chroma block (2520). The reference luma sample (2535) is a luma sample of a reference luma block (2530) corresponding to the current luma sample (2515, C) of the current luma block (2510). The upper reference luma sample (2532) is a luma sample located above the reference luma sample (2535). The left reference luma sample (2532) is a luma sample located to the left of the reference luma sample (2535). The lower reference luma sample (2533) is a luma sample located below the reference luma sample (2535). The right reference luma sample (2534) is a luma sample located to the right of the reference luma sample (2535). The reference chroma sample (2525, ), reference luma sample (2535, ), upper reference luma sample (2531, ), left reference luma sample (2532, ), lower reference luma sample (2533, ), right reference luma sample (2534, ) is used to derive a filter for BVG-CCCM. The residual values ​​of luma samples of the current luma block (2510), i.e., the current luma sample (2515, C), the upper luma sample (2511, N) located above the current luma sample (2515), the left luma sample (2512, W) located to the left of the current luma sample (2515), the lower luma sample (2513, S) located below the current luma sample (2515), and the right luma sample (2514, E) located to the right of the current luma sample, are applied to the derived filter. The residual values ​​of the luma samples applied to the filter are determined as shown in the following mathematical expression 7.

[0273] [Equation 7]

[0274]

[0275] By applying the residual values ​​of the luma samples to the filter, the chroma prediction residual values ​​for the current chroma sample are obtained as in Equation 8 below.

[0276] [Equation 8]

[0277]

[0278] As shown in mathematical expression 9 below, the predicted value (predChromaVal) of the current chroma sample (2505) is obtained by adding the reference chroma sample (2525) to the chroma prediction residual value (predChromaResidualVal) obtained through the filter.

[0279] [Equation 9]

[0280]

[0281] In one embodiment, reference luma samples of a surrounding area of ​​a reference luma block (2530) or reference chroma samples of a surrounding area of ​​a reference chroma block (2520) may be used to derive a filter.

[0282] FIG. 26 is a diagram illustrating a method for performing chroma prediction using a luma residual sample of a current block and a reference chroma sample of a reference region in CCRM according to one embodiment of the present disclosure.

[0283] Referring to FIG. 26, in order to derive a filter, reference luma samples (2631, 2632, 2633, 2634, 2635, 2636) of a reference luma block (2630) indicated by a block vector or motion vector of a current luma block (2610) corresponding to a current chroma block (2600) and a reference chroma sample (2625) of a reference chroma block (2620) corresponding to the reference luma block (2630) are used. Specifically, the reference chroma samples (2625, ), left reference luma sample (2631, ), reference luma sample (2632, ), right reference luma sample (2633, ), lower left reference luma sample (2634, ), lower reference luma sample (2635, ), lower right reference luma sample (2636, ) is used. The reference chroma sample (2625) is the current chroma sample (2605, C) of the current chroma block (2600). ch) is a chroma sample of a reference chroma block (2620). The reference luma sample (2632) is a luma sample of a reference luma block (2630) corresponding to the current luma sample (2612, L0) of the current luma block (2610). The left reference luma sample (2631) is a luma sample located to the left of the reference luma sample (2632). The right reference luma sample (2633) is a luma sample located to the right of the reference luma sample (2632). The lower left reference luma sample (2634) is a luma sample located to the lower left of the reference luma sample (2632). The lower reference luma sample (2635) is a luma sample located to the lower side of the reference luma sample (2632), and the lower right reference luma sample (2636) is a luma sample located to the lower right of the reference luma sample (2632). Reference chroma sample (2625, ), left reference luma sample (2631, ), reference luma sample (2632, ), right reference luma sample (2633, ), lower left reference luma sample (2634, ), lower reference luma sample (2635, ), lower right reference luma sample (2636, ) is used to derive a filter for CCRM. The residual values ​​of luma samples of the reference luma block (2630), i.e., the current luma sample (2612), the left luma sample (2611, L1) located to the left of the current luma sample (2612), the right luma sample (2613, L2) located to the right of the current luma sample (2612), the lower left luma sample (2614, L4) located to the lower left of the current luma sample (2612), the lower luma sample (2615, L3) located below the current luma sample, and the lower right luma sample (2616, L5) located to the lower right of the current luma sample (2612) are applied to the derived filter. The residual luma sample values ​​applied to the filter are determined as shown in the following mathematical expression 10.

[0284] [Equation 10]

[0285]

[0286] By applying the residual values ​​of the luma samples to the filter, the chroma prediction residual values ​​for the current chroma sample are obtained as in Equation 11 below.

[0287] [Equation 11]

[0288]

[0289] As shown in mathematical expression 12 below, the predicted value (predChromaVal) of the current chroma sample (2605) is obtained by adding the reference chroma sample (2625) to the chroma prediction residual value (predChromaResidualVal) obtained through the filter.

[0290] [Equation 12]

[0291]

[0292] In one embodiment, reference luma samples of a surrounding area of ​​a reference luma block (2630) or reference chroma samples of a surrounding area of ​​a reference chroma block (2620) may be used to derive a filter.

[0293] FIGS. 27 to 30 describe an image decoding method, an image decoding device, an image encoding method, and an image encoding device that perform chroma prediction using a luma residual sample of a current block and a reference chroma sample of a reference region according to one embodiment of the present disclosure.

[0294] FIG. 27 is a diagram for explaining an image decoding method according to one embodiment of the present disclosure.

[0295] Referring to FIG. 27, in step S2710, the video decoding device (2800) can derive a filter for chroma prediction of the current chroma sample included in the current chroma block based on at least one reference luma sample of a reference luma area indicated by a current luma block corresponding to the current chroma block and a first reference chroma sample and a second reference chroma sample of a reference chroma area corresponding to the reference luma area.

[0296] According to one embodiment of the present disclosure, when the current luma block is restored in an intra-copy copy mode, the current luma block has a block vector, and a reference luma region can be determined by the block vector.

[0297] According to one embodiment of the present disclosure, when the current luma block is reconstructed by intra template matching prediction, the reference luma region can be determined by a block vector representing the region determined as the most similar matching region determined by intra template matching prediction.

[0298] According to one embodiment of the present disclosure, if the current luma block is reconstructed by inter prediction, the current luma block has a motion vector, and a reference luma region can be determined by the motion vector.

[0299] In step S2720, the video decoding device (2800) can obtain at least one luma residual sample including a current luma residual sample corresponding to a current chroma sample of a current luma block from the bitstream.

[0300] According to one embodiment of the present disclosure, the at least one luma residual sample may include a current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, an upper luma residual sample adjacent to the upper side of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, and a lower luma residual sample adjacent to the lower side of the current luma residual sample.

[0301] According to one embodiment of the present disclosure, the filter is an 11-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a right luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a nonlinear term based on a square of the current luma residual sample, a filter coefficient for a nonlinear term based on a square of the left luma residual sample, a filter coefficient for a nonlinear term based on a square of the upper luma residual sample, a filter coefficient for a nonlinear term based on a square of the right luma residual sample, a filter coefficient for a nonlinear term based on a square of the lower luma residual sample, and a filter coefficient for a bias term.

[0302] According to one embodiment of the present disclosure, the color format of the current chroma block is 4:2:0, and the at least one luma residual sample may include the current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, a lower left luma residual sample adjacent to the lower left of the current luma residual sample, a lower luma residual sample adjacent to the lower side of the current luma residual sample, and a lower right luma residual sample adjacent to the lower right of the current luma residual sample.

[0303] According to one embodiment of the present disclosure, the filter is an 8-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a lower left luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a lower right luma residual sample, a filter coefficient for a nonlinear term based on a sum of the current luma residual sample and the lower luma residual sample, and a filter coefficient for a bias term.

[0304] According to one embodiment of the present disclosure, if the coordinate of the current chroma sample is (x, y), the coordinate of the current luma residual sample may be (2x, 2y), the coordinate of the left luma residual sample may be (2x-1, 2y), the coordinate of the right luma residual sample may be (2x+1, 2y), the coordinate of the lower luma residual sample may be (2x, 2y+1), the coordinate of the lower left luma residual sample may be (2x-1, 2y+1), and the coordinate of the lower right luma residual sample may be (2x+1, 2y+1).

[0305] At step S2730, the video decoding device (2800) can apply at least one luma residual sample to a filter to obtain a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample.

[0306] In step S2740, the video decoding device (2800) can obtain a first chroma prediction sample enhanced by using the first chroma prediction residual sample and the first reference chroma sample, and can obtain a second chroma prediction sample enhanced by using the second reference chroma residual sample and the second chroma prediction sample.

[0307] At step S2750, the video decoding device (2800) can obtain a first chroma residual sample and a second chroma residual sample for the current chroma sample from the bitstream.

[0308] In step S2760, the video decoding device (2800) can restore the current chroma sample by obtaining a first chroma restoration sample using the first chroma residual sample and the enhanced first chroma prediction sample, and obtaining a second chroma restoration sample using the second chroma residual sample and the enhanced second chroma prediction sample.

[0309] According to one embodiment of the present disclosure, the at least one reference luma sample may be at least one reference luma reconstruction sample, the first reference chroma sample may be a first reference chroma reconstruction sample, and the second reference chroma sample may be a second reference chroma reconstruction sample.

[0310] According to one embodiment of the present disclosure, at least one reference luma sample may be at least one reference luma residual sample, the first reference chroma sample may be a first reference chroma residual sample, and the second reference chroma sample may be a second reference chroma residual sample.

[0311] According to one embodiment of the present disclosure, the image decoding device (2800) can obtain at least one luma reconstruction sample using at least one reference luma sample and at least one luma residual sample.

[0312] FIG. 28 illustrates a block diagram of an image decoding device according to one embodiment of the present disclosure.

[0313] An image decoding device (2800) according to one embodiment may include at least one memory (2810) and at least one processor (2820) connected to the at least one memory (2810). The at least one memory (2810) may include instructions for implementing an embodiment of the present disclosure. The at least one processor (2820) may be operably connected to the at least one memory (2810) and configured to execute instructions contained in the at least one memory (2810) to implement an embodiment of the present disclosure. Operations of the image decoding device (2800) according to one embodiment of the present disclosure may operate as individual processors or may be operated under the control of a central processor.

[0314] The image decoding method of FIG. 27 described above can be implemented by an image decoding device (2800) according to one embodiment of the present disclosure.

[0315] FIG. 29 is a drawing for explaining an image encoding method according to one embodiment of the present disclosure.

[0316] Referring to FIG. 29, in step S2910, the video encoding device (3000) can derive a filter for chroma prediction of the current chroma sample included in the current chroma block based on at least one reference luma sample of a reference luma area indicated by the current luma block corresponding to the current chroma block and a first reference chroma sample and a second reference chroma sample of the reference chroma area corresponding to the reference luma area.

[0317] According to one embodiment of the present disclosure, if the current luma block is encoded in an intra-copy copy mode, the current luma block has a block vector, and a reference luma region can be determined by the block vector.

[0318] According to one embodiment of the present disclosure, when the current luma block is encoded by intra template matching prediction, the reference luma region can be determined by a block vector representing the region determined as the most similar matching region determined by intra template matching prediction.

[0319] According to one embodiment of the present disclosure, if the current luma block is encoded with inter prediction, the current luma block has a motion vector, and the reference luma region can be determined by the motion vector.

[0320] In step S2920, the video encoding device (3000) can generate at least one luma residual sample including a current luma residual sample corresponding to a current chroma sample of the current luma block based on the reference luma region and the original block of the current luma block.

[0321] According to one embodiment of the present disclosure, the at least one luma residual sample may include a current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, an upper luma residual sample adjacent to the upper side of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, and a lower luma residual sample adjacent to the lower side of the current luma residual sample.

[0322] According to one embodiment of the present disclosure, the filter is an 11-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a right luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a nonlinear term based on a square of the current luma residual sample, a filter coefficient for a nonlinear term based on a square of the left luma residual sample, a filter coefficient for a nonlinear term based on a square of the upper luma residual sample, a filter coefficient for a nonlinear term based on a square of the right luma residual sample, a filter coefficient for a nonlinear term based on a square of the lower luma residual sample, and a filter coefficient for a bias term.

[0323] According to one embodiment of the present disclosure, the color format of the current chroma block is 4:2:0, and the at least one luma residual sample may include the current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, a lower left luma residual sample adjacent to the lower left of the current luma residual sample, a lower luma residual sample adjacent to the lower side of the current luma residual sample, and a lower right luma residual sample adjacent to the lower right of the current luma residual sample.

[0324] According to one embodiment of the present disclosure, the filter is an 8-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a lower left luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a lower right luma residual sample, a filter coefficient for a nonlinear term based on a sum of the current luma residual sample and the lower luma residual sample, and a filter coefficient for a bias term.

[0325] According to one embodiment of the present disclosure, if the coordinate of the current chroma sample is (x, y), the coordinate of the current luma residual sample may be (2x, 2y), the coordinate of the left luma residual sample may be (2x-1, 2y), the coordinate of the right luma residual sample may be (2x+1, 2y), the coordinate of the lower luma residual sample may be (2x, 2y+1), the coordinate of the lower left luma residual sample may be (2x-1, 2y+1), and the coordinate of the lower right luma residual sample may be (2x+1, 2y+1).

[0326] In step S2930, the video encoding device (3000) can apply at least one luma residual sample to a filter to obtain a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample.

[0327] In step S2940, the video encoding device (3000) can obtain a first chroma prediction sample enhanced by using a first chroma prediction residual sample and a first reference chroma sample, and can obtain a second chroma prediction sample enhanced by using a second reference chroma residual sample and a second chroma prediction sample.

[0328] In step S2950, ​​the video encoding device (3000) can generate a first chroma residual sample based on a first chroma original sample and an enhanced first chroma prediction sample for the current chroma sample, and can generate a second chroma residual sample based on a second chroma original sample and an enhanced second chroma prediction sample for the current chroma sample.

[0329] In step S2960, the video encoding device (3000) can generate a bitstream including at least one luma residual sample, a first chroma residual sample, and a second chroma residual sample.

[0330] According to one embodiment of the present disclosure, the at least one reference luma sample may be at least one reference luma reconstruction sample, the first reference chroma sample may be a first reference chroma reconstruction sample, and the second reference chroma sample may be a second reference chroma reconstruction sample.

[0331] According to one embodiment of the present disclosure, at least one reference luma sample may be at least one reference luma residual sample, the first reference chroma sample may be a first reference chroma residual sample, and the second reference chroma sample may be a second reference chroma residual sample.

[0332] FIG. 30 illustrates a block diagram of an image encoding device according to one embodiment of the present disclosure.

[0333] An image encoding device (3000) according to one embodiment may include at least one memory (2810) and at least one processor (2820) connected to the at least one memory (2810). The at least one memory (2810) may include instructions for implementing an embodiment of the present disclosure. The at least one processor (2820) may be operably connected to the at least one memory (2810) and configured to execute instructions included in the at least one memory (2810) to implement an embodiment of the present disclosure. Operations of the image encoding device (3000) according to one embodiment of the present disclosure may operate as individual processors or may be operated under the control of a central processor.

[0334] The image encoding method of FIG. 29 described above can be implemented by an image encoding device (3000) according to one embodiment of the present disclosure.

[0335] According to one embodiment of the present disclosure, a video decoding method comprises: deriving a filter for chroma prediction of a current chroma sample included in a current chroma block based on at least one reference luma sample of a reference luma region indicated by a current luma block corresponding to a current chroma block and a first reference chroma sample and a second reference chroma sample of a reference chroma region corresponding to the reference luma region; obtaining at least one luma residual sample including a current luma residual sample corresponding to the current chroma sample of the current luma block from a bitstream; obtaining a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample by applying the at least one luma residual sample to a filter; obtaining an enhanced first chroma prediction sample using the first chroma prediction residual sample and the first reference chroma sample, and obtaining an enhanced second chroma prediction sample using the second reference chroma residual sample and the second chroma prediction sample; obtaining the first chroma residual sample and the second chroma residual sample for the current chroma sample from the bitstream; The step of restoring the current chroma sample may include obtaining a first chroma reconstruction sample using the first chroma residual sample and the enhanced first chroma prediction sample, and obtaining a second chroma reconstruction sample using the second chroma residual sample and the enhanced second chroma prediction sample.

[0336] A video decoding method according to one embodiment of the present disclosure uses a reference chroma sample of a reference chroma area that has a high correlation with chroma samples of a current chroma block, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and performs chroma prediction using the enhanced current chroma prediction sample and the current chroma residual sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction using a luma reconstruction sample compared to directly using a chroma sample.

[0337] According to one embodiment of the present disclosure, when the current luma block is restored in an intra-copy copy mode, the current luma block has a block vector, and a reference luma region can be determined by the block vector.

[0338] In an image decoding method according to one embodiment of the present disclosure, the accuracy of chroma prediction can be improved by using a reference luma region and a reference chroma region that are highly related to the current luma block and the current chroma block by a block vector.

[0339] According to one embodiment of the present disclosure, when the current luma block is reconstructed by intra template matching prediction, the reference luma region can be determined by a block vector representing the region determined as the most similar matching region determined by intra template matching prediction.

[0340] In a video decoding method according to one embodiment of the present disclosure, a matching region most similar to a current luma block is determined as a reference luma region and a reference chroma region based on intra template matching prediction, and the accuracy of chroma prediction can be improved by using a reference luma region and a reference chroma region that are highly related to the current chroma block.

[0341] According to one embodiment of the present disclosure, if the current luma block is reconstructed by inter prediction, the current luma block has a motion vector, and a reference luma region can be determined by the motion vector.

[0342] According to an embodiment of the present disclosure, a video decoding method can improve the accuracy of chroma prediction by using a reference luma region and a reference chroma region that are highly related to the current luma block and the current chroma block by a motion vector.

[0343] According to one embodiment of the present disclosure, the at least one luma residual sample may include a current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, an upper luma residual sample adjacent to the upper side of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, and a lower luma residual sample adjacent to the lower side of the current luma residual sample.

[0344] According to one embodiment of the present disclosure, the filter is an 11-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a right luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a nonlinear term based on a square of the current luma residual sample, a filter coefficient for a nonlinear term based on a square of the left luma residual sample, a filter coefficient for a nonlinear term based on a square of the upper luma residual sample, a filter coefficient for a nonlinear term based on a square of the right luma residual sample, a filter coefficient for a nonlinear term based on a square of the lower luma residual sample, and a filter coefficient for a bias term.

[0345] A video decoding method according to one embodiment of the present disclosure uses a reference luma region and a reference chroma region having a high correlation with a current chroma block in a BVG CCCM method, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and performs chroma prediction using the enhanced current chroma prediction sample and the current chroma residual sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction using a luma reconstruction sample compared to directly using a chroma sample.

[0346] According to one embodiment of the present disclosure, the color format of the current chroma block is 4:2:0, and the at least one luma residual sample may include the current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, a lower left luma residual sample adjacent to the lower left of the current luma residual sample, a lower luma residual sample adjacent to the lower side of the current luma residual sample, and a lower right luma residual sample adjacent to the lower right of the current luma residual sample.

[0347] According to one embodiment of the present disclosure, the filter is an 8-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a lower left luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a lower right luma residual sample, a filter coefficient for a nonlinear term based on a sum of the current luma residual sample and the lower luma residual sample, and a filter coefficient for a bias term.

[0348] According to one embodiment of the present disclosure, if the coordinate of the current chroma sample is (x, y), the coordinate of the current luma residual sample may be (2x, 2y), the coordinate of the left luma residual sample may be (2x-1, 2y), the coordinate of the right luma residual sample may be (2x+1, 2y), the coordinate of the lower luma residual sample may be (2x, 2y+1), the coordinate of the lower left luma residual sample may be (2x-1, 2y+1), and the coordinate of the lower right luma residual sample may be (2x+1, 2y+1).

[0349] A video decoding method according to one embodiment of the present disclosure uses a reference luma region and a reference chroma region that are highly related to a current chroma block in a CCRM method, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and performs chroma prediction using the enhanced current chroma prediction sample and the current chroma residual sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction using a luma reconstruction sample compared to directly using a chroma sample.

[0350] According to one embodiment of the present disclosure, the at least one reference luma sample may be at least one reference luma reconstruction sample, the first reference chroma sample may be a first reference chroma reconstruction sample, and the second reference chroma sample may be a second reference chroma reconstruction sample.

[0351] According to an embodiment of the present disclosure, a video decoding method can improve the accuracy of chroma prediction by using restoration samples of a reference luma region and a reference chroma region that are highly related to a current luma block and a current chroma block.

[0352] According to one embodiment of the present disclosure, at least one reference luma sample may be at least one reference luma residual sample, the first reference chroma sample may be a first reference chroma residual sample, and the second reference chroma sample may be a second reference chroma residual sample.

[0353] In an image decoding method according to one embodiment of the present disclosure, a filter that more precisely predicts the value of a residual sample is obtained by using residual samples of a reference luma region and a reference chroma region that are highly related to a current luma block and a current chroma block, and the accuracy of chroma prediction can be improved.

[0354] A method for decoding an image according to one embodiment of the present disclosure may further include a step of obtaining at least one luma reconstruction sample using at least one reference luma sample and at least one luma residual sample.

[0355] In an image decoding method according to one embodiment of the present disclosure, the accuracy of prediction of a current luma sample can be improved by using a reference luma sample of a reference luma area having a high correlation with a current luma block as a prediction sample of the current luma sample.

[0356] An image decoding device according to one embodiment of the present disclosure may include a memory storing one or more instructions; and at least one processor operating according to the one or more instructions. The at least one processor may derive a filter for chroma prediction of a current chroma sample included in a current chroma block based on at least one reference luma sample of a reference luma region indicated by a current luma block corresponding to a current chroma block and a first reference chroma sample and a second reference chroma sample of a reference chroma region corresponding to the reference luma region. The at least one processor may obtain at least one luma residual sample including a current luma residual sample corresponding to a current chroma sample of the current luma block from a bitstream. The at least one processor may apply the at least one luma residual sample to a filter to obtain a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample. At least one processor can obtain an enhanced first chroma prediction sample using a first chroma prediction residual sample and a first reference chroma sample, and obtain an enhanced second chroma prediction sample using a second reference chroma residual sample and a second chroma prediction sample. The at least one processor can obtain a first chroma residual sample and a second chroma residual sample for a current chroma sample from a bitstream. The at least one processor can reconstruct the current chroma sample by obtaining a first chroma reconstruction sample using the first chroma residual sample and the enhanced first chroma prediction sample, and obtaining a second chroma reconstruction sample using the second chroma residual sample and the enhanced second chroma prediction sample.

[0357] According to one embodiment of the present disclosure, a video decoding device uses a reference chroma sample of a reference chroma area having a high correlation with chroma samples of a current chroma block, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and performs chroma prediction using the enhanced current chroma prediction sample and the current chroma residual sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction using a luma reconstruction sample compared to directly using a chroma sample.

[0358] According to one embodiment of the present disclosure, when the current luma block is restored in an intra-copy copy mode, the current luma block has a block vector, and a reference luma region can be determined by the block vector.

[0359] According to one embodiment of the present disclosure, an image decoding device can improve the accuracy of chroma prediction by using a reference luma region and a reference chroma region that are highly related to the current luma block and the current chroma block by a block vector.

[0360] According to one embodiment of the present disclosure, when the current luma block is reconstructed by intra template matching prediction, the reference luma region can be determined by a block vector representing the region determined as the most similar matching region determined by intra template matching prediction.

[0361] According to an embodiment of the present disclosure, a video decoding device determines a matching region most similar to a current luma block as a reference luma region and a reference chroma region based on intra template matching prediction, and the accuracy of chroma prediction can be improved by using a reference luma region and a reference chroma region that are highly related to the current chroma block.

[0362] According to one embodiment of the present disclosure, if the current luma block is reconstructed by inter prediction, the current luma block has a motion vector, and a reference luma region can be determined by the motion vector.

[0363] According to one embodiment of the present disclosure, an image decoding device can improve the accuracy of chroma prediction by using a reference luma region and a reference chroma region that are highly related to the current luma block and the current chroma block by a motion vector.

[0364] According to one embodiment of the present disclosure, the at least one luma residual sample may include a current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, an upper luma residual sample adjacent to the upper side of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, and a lower luma residual sample adjacent to the lower side of the current luma residual sample.

[0365] According to one embodiment of the present disclosure, the filter is an 11-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a right luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a nonlinear term based on a square of the current luma residual sample, a filter coefficient for a nonlinear term based on a square of the left luma residual sample, a filter coefficient for a nonlinear term based on a square of the upper luma residual sample, a filter coefficient for a nonlinear term based on a square of the right luma residual sample, a filter coefficient for a nonlinear term based on a square of the lower luma residual sample, and a filter coefficient for a bias term.

[0366] According to one embodiment of the present disclosure, a video decoding device uses a reference luma region and a reference chroma region having a high correlation with a current chroma block in a BVG CCCM method, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and performs chroma prediction using the enhanced current chroma prediction sample and the current chroma residual sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction using a luma reconstruction sample compared to directly using a chroma sample.

[0367] According to one embodiment of the present disclosure, the color format of the current chroma block is 4:2:0, and the at least one luma residual sample may include the current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, a lower left luma residual sample adjacent to the lower left of the current luma residual sample, a lower luma residual sample adjacent to the lower side of the current luma residual sample, and a lower right luma residual sample adjacent to the lower right of the current luma residual sample.

[0368] According to one embodiment of the present disclosure, the filter is an 8-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a lower left luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a lower right luma residual sample, a filter coefficient for a nonlinear term based on a sum of the current luma residual sample and the lower luma residual sample, and a filter coefficient for a bias term.

[0369] According to one embodiment of the present disclosure, if the coordinate of the current chroma sample is (x, y), the coordinate of the current luma residual sample may be (2x, 2y), the coordinate of the left luma residual sample may be (2x-1, 2y), the coordinate of the right luma residual sample may be (2x+1, 2y), the coordinate of the lower luma residual sample may be (2x, 2y+1), the coordinate of the lower left luma residual sample may be (2x-1, 2y+1), and the coordinate of the lower right luma residual sample may be (2x+1, 2y+1).

[0370] An image decoding device according to one embodiment of the present disclosure uses a reference luma region and a reference chroma region having a high correlation with a current chroma block in a CCRM method, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and performs chroma prediction using the enhanced current chroma prediction sample and the current chroma residual sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction using a luma reconstruction sample compared to directly using a chroma sample.

[0371] According to one embodiment of the present disclosure, the at least one reference luma sample may be at least one reference luma reconstruction sample, the first reference chroma sample may be a first reference chroma reconstruction sample, and the second reference chroma sample may be a second reference chroma reconstruction sample.

[0372] According to one embodiment of the present disclosure, an image decoding device can improve the accuracy of chroma prediction by using restoration samples of a reference luma area and a reference chroma area that are highly related to a current luma block and a current chroma block.

[0373] According to one embodiment of the present disclosure, at least one reference luma sample may be at least one reference luma residual sample, the first reference chroma sample may be a first reference chroma residual sample, and the second reference chroma sample may be a second reference chroma residual sample.

[0374] According to one embodiment of the present disclosure, a video decoding device obtains a filter that more precisely predicts the value of a residual sample by using residual samples of a reference luma region and a reference chroma region that are highly related to a current luma block and a current chroma block, and the accuracy of chroma prediction can be improved.

[0375] According to one embodiment of the present disclosure, at least one processor can obtain at least one luma reconstruction sample using at least one reference luma sample and at least one luma residual sample.

[0376] According to one embodiment of the present disclosure, an image decoding device can improve the accuracy of prediction of a current luma sample by using a reference luma sample of a reference luma area having a high correlation with a current luma block as a prediction sample of the current luma sample.

[0377] According to one embodiment of the present disclosure, a video encoding method comprises: deriving a filter for chroma prediction of a current chroma sample included in a current chroma block based on at least one reference luma sample of a reference luma area indicated by a current luma block corresponding to a current chroma block and a first reference chroma sample and a second reference chroma sample of a reference chroma area corresponding to the reference luma area; generating at least one luma residual sample including a current luma residual sample corresponding to the current chroma sample of the current luma block based on an original block of the reference luma area and the current luma block; applying the at least one luma residual sample to a filter to obtain a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample; obtaining an enhanced first chroma prediction sample using the first chroma prediction residual sample and the first reference chroma sample, and obtaining an enhanced second chroma prediction sample using the second reference chroma residual sample and the second chroma prediction sample; The method may include generating a first chroma residual sample based on a first chroma source sample and an enhanced first chroma prediction sample for a current chroma sample, and generating a second chroma residual sample based on a second chroma source sample and an enhanced second chroma prediction sample for the current chroma sample; and generating a bitstream including at least one luma residual sample, the first chroma residual sample, and the second chroma residual sample.

[0378] A video encoding method according to one embodiment of the present disclosure uses a reference chroma sample of a reference chroma area having a high correlation with chroma samples of a current chroma block, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and generates a current chroma residual sample using the enhanced current chroma prediction sample and the current chroma original sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction by using a luma reconstruction sample compared to directly using a chroma sample.

[0379] According to one embodiment of the present disclosure, if the current luma block is encoded in an intra-copy copy mode, the current luma block has a block vector, and a reference luma region can be determined by the block vector.

[0380] According to an embodiment of the present disclosure, a video encoding method can improve the accuracy of chroma prediction by using a reference luma region and a reference chroma region that are highly related to the current luma block and the current chroma block by a block vector.

[0381] According to one embodiment of the present disclosure, when the current luma block is encoded by intra template matching prediction, the reference luma region can be determined by a block vector representing the region determined as the most similar matching region determined by intra template matching prediction.

[0382] In a video encoding method according to one embodiment of the present disclosure, a matching region most similar to a current luma block is determined as a reference luma region and a reference chroma region based on intra template matching prediction, and the accuracy of chroma prediction can be improved by using a reference luma region and a reference chroma region that are highly related to the current chroma block.

[0383] According to one embodiment of the present disclosure, if the current luma block is encoded with inter prediction, the current luma block has a motion vector, and the reference luma region can be determined by the motion vector.

[0384] According to an embodiment of the present disclosure, a video encoding method can improve the accuracy of chroma prediction by using a reference luma region and a reference chroma region that are highly related to the current luma block and the current chroma block by a motion vector.

[0385] According to one embodiment of the present disclosure, the at least one luma residual sample may include a current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, an upper luma residual sample adjacent to the upper side of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, and a lower luma residual sample adjacent to the lower side of the current luma residual sample.

[0386] According to one embodiment of the present disclosure, the filter is an 11-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a right luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a nonlinear term based on a square of the current luma residual sample, a filter coefficient for a nonlinear term based on a square of the left luma residual sample, a filter coefficient for a nonlinear term based on a square of the upper luma residual sample, a filter coefficient for a nonlinear term based on a square of the right luma residual sample, a filter coefficient for a nonlinear term based on a square of the lower luma residual sample, and a filter coefficient for a bias term.

[0387] A video encoding method according to an embodiment of the present disclosure uses a reference luma region and a reference chroma region having a high correlation with a current chroma block in a BVG CCCM method, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and generates a current chroma residual sample using the enhanced current chroma prediction sample and the current chroma original sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction by using a luma reconstruction sample compared to directly using a chroma sample.

[0388] According to one embodiment of the present disclosure, the color format of the current chroma block is 4:2:0, and the at least one luma residual sample may include the current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, a lower left luma residual sample adjacent to the lower left of the current luma residual sample, a lower luma residual sample adjacent to the lower side of the current luma residual sample, and a lower right luma residual sample adjacent to the lower right of the current luma residual sample.

[0389] According to one embodiment of the present disclosure, the filter is an 8-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a lower left luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a lower right luma residual sample, a filter coefficient for a nonlinear term based on a sum of the current luma residual sample and the lower luma residual sample, and a filter coefficient for a bias term.

[0390] According to one embodiment of the present disclosure, if the coordinate of the current chroma sample is (x, y), the coordinate of the current luma residual sample may be (2x, 2y), the coordinate of the left luma residual sample may be (2x-1, 2y), the coordinate of the right luma residual sample may be (2x+1, 2y), the coordinate of the lower luma residual sample may be (2x, 2y+1), the coordinate of the lower left luma residual sample may be (2x-1, 2y+1), and the coordinate of the lower right luma residual sample may be (2x+1, 2y+1).

[0391] A video encoding method according to one embodiment of the present disclosure uses a reference luma region and a reference chroma region having a high correlation with a current chroma block in a CCRM method, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and generates a current chroma residual sample using the enhanced current chroma prediction sample and the current chroma original sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction by using a luma reconstruction sample compared to directly using a chroma sample.

[0392] According to one embodiment of the present disclosure, at least one reference luma sample may be at least one reference luma encoded sample, the first reference chroma sample may be a first reference chroma encoded sample, and the second reference chroma sample may be a second reference chroma encoded sample.

[0393] According to an embodiment of the present disclosure, a video encoding method can improve the accuracy of chroma prediction by using encoding samples of a reference luma region and a reference chroma region that are highly related to a current luma block and a current chroma block.

[0394] According to one embodiment of the present disclosure, at least one reference luma sample may be at least one reference luma residual sample, the first reference chroma sample may be a first reference chroma residual sample, and the second reference chroma sample may be a second reference chroma residual sample.

[0395] In an image encoding method according to one embodiment of the present disclosure, a filter that more precisely predicts the value of a residual sample is obtained by using residual samples of a reference luma region and a reference chroma region that are highly related to a current luma block and a current chroma block, and the accuracy of chroma prediction can be improved.

[0396] An image encoding device according to one embodiment of the present disclosure may include a memory storing one or more instructions; and at least one processor operating according to the one or more instructions. The at least one processor may derive a filter for chroma prediction of a current chroma sample included in a current chroma block based on at least one reference luma sample of a reference luma region indicated by a current luma block corresponding to a current chroma block and a first reference chroma sample and a second reference chroma sample of a reference chroma region corresponding to the reference luma region. The at least one processor may generate at least one luma residual sample including a current luma residual sample corresponding to a current chroma sample of the current luma block based on the reference luma region and an original block of the current luma block. The at least one processor may apply the at least one luma residual sample to a filter to obtain a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample. At least one processor can obtain an enhanced first chroma prediction sample using a first chroma prediction residual sample and a first reference chroma sample, and obtain an enhanced second chroma prediction sample using a second reference chroma residual sample and a second chroma prediction sample. The at least one processor can generate a first chroma residual sample based on the first chroma source sample and the enhanced first chroma prediction sample for a current chroma sample, and generate a second chroma residual sample based on the second chroma source sample and the enhanced second chroma prediction sample for the current chroma sample. The at least one processor can generate a bitstream including at least one luma residual sample, the first chroma residual sample, and the second chroma residual sample.

[0397] According to an embodiment of the present disclosure, a video encoding device uses a reference chroma sample of a reference chroma area having a high correlation with chroma samples of a current chroma block, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and generates a current chroma residual sample using the enhanced current chroma prediction sample and the current chroma original sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction by using a luma reconstruction sample compared to directly using a chroma sample.

[0398] According to one embodiment of the present disclosure, if the current luma block is encoded in an intra-copy copy mode, the current luma block has a block vector, and a reference luma region can be determined by the block vector.

[0399] According to one embodiment of the present disclosure, an image encoding device can improve the accuracy of chroma prediction by using a reference luma region and a reference chroma region that are highly related to the current luma block and the current chroma block by a block vector.

[0400] According to one embodiment of the present disclosure, when the current luma block is encoded by intra template matching prediction, the reference luma region can be determined by a block vector representing the region determined as the most similar matching region determined by intra template matching prediction.

[0401] According to one embodiment of the present disclosure, a video encoding device determines a matching region most similar to a current luma block as a reference luma region and a reference chroma region based on intra template matching prediction, and the accuracy of chroma prediction can be improved by using a reference luma region and a reference chroma region that are highly related to the current chroma block.

[0402] According to one embodiment of the present disclosure, if the current luma block is encoded with inter prediction, the current luma block has a motion vector, and the reference luma region can be determined by the motion vector.

[0403] According to one embodiment of the present disclosure, an image encoding device can improve the accuracy of chroma prediction by using a reference luma region and a reference chroma region that are highly related to the current luma block and the current chroma block by a motion vector.

[0404] According to one embodiment of the present disclosure, the at least one luma residual sample may include a current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, an upper luma residual sample adjacent to the upper side of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, and a lower luma residual sample adjacent to the lower side of the current luma residual sample.

[0405] According to one embodiment of the present disclosure, the filter is an 11-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a right luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a nonlinear term based on a square of the current luma residual sample, a filter coefficient for a nonlinear term based on a square of the left luma residual sample, a filter coefficient for a nonlinear term based on a square of the upper luma residual sample, a filter coefficient for a nonlinear term based on a square of the right luma residual sample, a filter coefficient for a nonlinear term based on a square of the lower luma residual sample, and a filter coefficient for a bias term.

[0406] According to one embodiment of the present disclosure, a video encoding device uses a reference luma region and a reference chroma region having a high correlation with a current chroma block in a BVG CCCM method, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and generates a current chroma residual sample using the enhanced current chroma prediction sample and the current chroma original sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction by using a luma reconstruction sample compared to directly using a chroma sample.

[0407] According to one embodiment of the present disclosure, the color format of the current chroma block is 4:2:0, and the at least one luma residual sample may include the current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, a lower left luma residual sample adjacent to the lower left of the current luma residual sample, a lower luma residual sample adjacent to the lower side of the current luma residual sample, and a lower right luma residual sample adjacent to the lower right of the current luma residual sample.

[0408] According to one embodiment of the present disclosure, the filter is an 8-tap filter, and the filter coefficients of the filter may include a filter coefficient for a current luma residual sample, a filter coefficient for a left luma residual sample, a filter coefficient for an upper luma residual sample, a filter coefficient for a lower left luma residual sample, a filter coefficient for a lower luma residual sample, a filter coefficient for a lower right luma residual sample, a filter coefficient for a nonlinear term based on a sum of the current luma residual sample and the lower luma residual sample, and a filter coefficient for a bias term.

[0409] According to one embodiment of the present disclosure, if the coordinate of the current chroma sample is (x, y), the coordinate of the current luma residual sample may be (2x, 2y), the coordinate of the left luma residual sample may be (2x-1, 2y), the coordinate of the right luma residual sample may be (2x+1, 2y), the coordinate of the lower luma residual sample may be (2x, 2y+1), the coordinate of the lower left luma residual sample may be (2x-1, 2y+1), and the coordinate of the lower right luma residual sample may be (2x+1, 2y+1).

[0410] According to one embodiment of the present disclosure, a video encoding device uses a reference luma region and a reference chroma region having a high correlation with a current chroma block in a CCRM method, derives a current chroma prediction residual sample through a current luma residual sample, obtains an enhanced current chroma prediction sample using the reference chroma sample and the current chroma prediction residual sample, and generates a current chroma residual sample using the enhanced current chroma prediction sample and the current chroma original sample, thereby achieving high compression efficiency and improving the accuracy of chroma prediction by using a luma reconstruction sample compared to directly using a chroma sample.

[0411] According to one embodiment of the present disclosure, at least one reference luma sample may be at least one reference luma encoded sample, the first reference chroma sample may be a first reference chroma encoded sample, and the second reference chroma sample may be a second reference chroma encoded sample.

[0412] According to one embodiment of the present disclosure, an image encoding device can improve the accuracy of chroma prediction by using encoding samples of a reference luma region and a reference chroma region that are highly related to a current luma block and a current chroma block.

[0413] According to one embodiment of the present disclosure, at least one reference luma sample may be at least one reference luma residual sample, the first reference chroma sample may be a first reference chroma residual sample, and the second reference chroma sample may be a second reference chroma residual sample.

[0414] According to one embodiment of the present disclosure, a video encoding device obtains a filter that more precisely predicts the value of a residual sample by using residual samples of a reference luma region and a reference chroma region that are highly related to a current luma block and a current chroma block, and the accuracy of chroma prediction can be improved.

[0415] A device-readable storage medium may be provided in the form of a non-transitory storage medium. Here, the term "non-transitory storage medium" simply means a tangible device that does not contain signals (e.g., electromagnetic waves). This term does not distinguish between cases where data is permanently stored in the storage medium and cases where data is temporarily stored. For example, a "non-transitory storage medium" may include a buffer in which data is temporarily stored.

[0416] According to one embodiment, the method according to various embodiments disclosed in the present document may be provided as included in a computer program product. The computer program product may be traded as a product between a seller and a buyer. The computer program product may be distributed in the form of a machine-readable storage medium (e.g., compact disc read-only memory (CD-ROM)), or may be distributed online (e.g., downloaded or uploaded) through an application store or directly between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product (e.g., a downloadable app) may be temporarily stored or temporarily generated in a machine-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or an intermediary server.

Claims

1. A step (S2710) of deriving a filter for chroma prediction of a current chroma sample included in the current chroma block based on at least one reference luma sample of a reference luma area indicated by a current luma block corresponding to the current chroma block and a first reference chroma sample and a second reference chroma sample of a reference chroma area corresponding to the reference luma area; A step of obtaining at least one luma residual sample including a current luma residual sample corresponding to the current chroma sample of the current luma block from the bitstream (S2720); A step of applying at least one luma residual sample to the filter to obtain a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample (S2730); A step of obtaining an enhanced first chroma prediction sample using the first chroma prediction residual sample and the first reference chroma sample, and obtaining an enhanced second chroma prediction sample using the second reference chroma residual sample and the second chroma prediction sample (S2740); A step of obtaining a first chroma residual sample and a second chroma residual sample for the current chroma sample from the bitstream (S2750); A method for decoding an image, comprising the step of restoring (S2760) the current chroma sample by obtaining a first chroma reconstruction sample using the first chroma residual sample and the enhanced first chroma prediction sample, and obtaining a second chroma reconstruction sample using the second chroma residual sample and the enhanced second chroma prediction sample.

2. In paragraph 1, If the current luma block above is restored in intra-copy copy mode, the current luma block has a block vector, A method for decoding an image, wherein the above reference luma area is determined by the above block vector.

3. In paragraph 1, A method for decoding an image, wherein, if the current luma block is restored by intra template matching prediction, the reference luma region is determined by a block vector representing a region determined as the most similar matching region determined by the intra template matching prediction.

4. In paragraph 1, If the current luma block above is reconstructed by inter prediction, the current luma block has a motion vector, A method for decoding an image, wherein the above reference luma area is determined by the above motion vector.

5. In paragraph 2 or 3, A method of decoding an image, wherein at least one luma residual sample comprises the current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, an upper luma residual sample adjacent to an upper side of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, and a lower luma residual sample adjacent to a lower side of the current luma residual sample.

6. In paragraph 5, The above filter is an 11 tap filter, A method for decoding an image, wherein the filter coefficients of the filter include a filter coefficient for the current luma residual sample, a filter coefficient for the left luma residual sample, a filter coefficient for the upper luma residual sample, a filter coefficient for the right luma residual sample, a filter coefficient for the lower luma residual sample, a filter coefficient for a nonlinear term based on a square of the current luma residual sample, a filter coefficient for a nonlinear term based on a square of the left luma residual sample, a filter coefficient for a nonlinear term based on a square of the upper luma residual sample, a filter coefficient for a nonlinear term based on a square of the right luma residual sample, a filter coefficient for a nonlinear term based on a square of the lower luma residual sample, and a filter coefficient for a bias term.

7. In paragraph 4, The current color format of the chroma block is 4:2:0, A method for decoding an image, wherein at least one luma residual sample comprises the current luma residual sample, a left luma residual sample adjacent to the left of the current luma residual sample, a right luma residual sample adjacent to the right of the current luma residual sample, a lower left luma residual sample adjacent to the lower left of the current luma residual sample, a lower luma residual sample adjacent to the lower side of the current luma residual sample, and a lower right luma residual sample adjacent to the lower right of the current luma residual sample.

8. In paragraph 7, The above filter is an 8-tap filter, A method for decoding an image, wherein the filter coefficients of the filter include a filter coefficient for the current luma residual sample, a filter coefficient for the left luma residual sample, a filter coefficient for the upper luma residual sample, a filter coefficient for the lower left luma residual sample, a filter coefficient for the lower luma residual sample, a filter coefficient for the lower right luma residual sample, a filter coefficient for a nonlinear term based on a sum of the current luma residual sample and the lower luma residual sample, and a filter coefficient for a bias term.

9. In paragraph 6 or 7, A method for decoding an image, wherein if the coordinate of the current chroma sample is (x, y), the coordinate of the current luma residual sample is (2x, 2y), the coordinate of the left luma residual sample is (2x-1, 2y), the coordinate of the right luma residual sample is (2x+1, 2y), the coordinate of the lower luma residual sample is (2x, 2y+1), the coordinate of the lower left luma residual sample is (2x-1, 2y+1), and the coordinate of the lower right luma residual sample is (2x+1, 2y+1).

10. In any one of paragraphs 1 to 9, wherein said at least one reference luma sample is at least one reference luma restoration sample, The above first reference chroma sample is a first reference chroma restoration sample, A method for decoding an image, wherein the second reference chroma sample is a second reference chroma restoration sample.

11. In any one of paragraphs 1 to 9, wherein said at least one reference luma sample is at least one reference luma residual sample, The above first reference chroma sample is a first reference chroma residual sample, A method for decoding an image, wherein the second reference chroma sample is a second reference chroma residual sample.

12. In any one of paragraphs 1 to 11, A method for decoding an image, further comprising the step of obtaining at least one luma reconstruction sample using at least one reference luma sample and at least one luma residual sample.

13. A step (S2910) of deriving a filter for chroma prediction of a current chroma sample included in the current chroma block based on at least one reference luma sample of a reference luma area indicated by a current luma block corresponding to the current chroma block and a first reference chroma sample and a second reference chroma sample of a reference chroma area corresponding to the reference luma area; A step (S2920) of generating at least one luma residual sample including a current luma residual sample corresponding to the current chroma sample of the current luma block based on the reference luma region and the original block of the current luma block; A step of applying at least one luma residual sample to the filter to obtain a first chroma prediction residual sample and a second chroma prediction residual sample for the current chroma sample (S2930); A step of obtaining an enhanced first chroma prediction sample using the first chroma prediction residual sample and the first reference chroma sample, and obtaining an enhanced second chroma prediction sample using the second reference chroma residual sample and the second chroma prediction sample (S2940); A step of generating a first chroma residual sample based on a first chroma original sample and the enhanced first chroma prediction sample for the current chroma sample, and generating a second chroma residual sample based on a second chroma original sample and the enhanced second chroma prediction sample for the current chroma sample (S2950); A video encoding method, comprising: a step of generating a bitstream including at least one luma residual sample, the first chroma residual sample, and the second chroma residual sample (S2960).

14. In paragraph 13, If the current luma block is encoded in intra copy mode, the current luma block has a block vector, A method of encoding an image, wherein the above reference luma area is determined by the above block vector.

15. In paragraph 13, A method for encoding an image, wherein, if the current luma block is encoded by intra template matching prediction, the reference luma region is determined by a block vector representing an region determined as the most similar matching region determined by the intra template matching prediction.

Citation Information

Patent Citations

  • A ice box having multi function

    KR1020220063754A

  • Method for image encoding / decoding and apparatus thereof

    KR102277121B1

  • High voltage connector

    KR102284391B1

  • Method and apparatus for encoding / decoding image and recording medium for storing bitstream

    KR102409443B1

  • Downsampling process for linear model prediction mode

    KR102520295B1