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

Boundary filtering in video encoding and decoding helps reduce information overhead and improve prediction accuracy by determining matching blocks for efficient intra prediction, addressing the limitations of detailed directional modes in existing technologies.

WO2025009773A1PCT designated stage expired Publication Date: 2025-01-09SAMSUNG ELECTRONICS CO LTD

Patent Information

Application Number
PCT/KR2024/008205
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-21
Filing Date
2024-06-14
Publication Date
2025-01-09

AI Technical Summary

Technical Problem

In video encoding and decoding, the addition of detailed directional prediction modes in intra prediction increases information overhead, limiting compression efficiency due to increased data transmission requirements, especially when dealing with discontinuities at block edges during intra prediction.

Method used

The method involves performing boundary filtering on template areas around current blocks to determine a matching block, which is then used for prediction, reducing the need for explicit mode information transmission by deriving prediction modes from the decoding side.

Benefits of technology

This approach enhances compression efficiency by reducing the overhead of intra prediction mode information while effectively handling discontinuities at block edges, improving prediction accuracy without increasing data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2024008205_09012025_PF_FP_ABST
    Figure KR2024008205_09012025_PF_FP_ABST
Patent Text Reader

Abstract

Presented are a method and device for performing image decoding or encoding, the method comprising: performing boundary filtering on a template region located around a current block; identifying a first search template region and a second search template region, which correspond to the template region, in a search region in a current picture including the current block; performing boundary filtering on the first search template region and the second search template region; determining the search template region most similar to the filtered template region among the filtered first search template region and the filtered second search template region; determining a matching block corresponding to the current block on the basis of the most similar search template region; performing the boundary filtering on the matching block; and predicting the current block on the basis of the filtered matching block.
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 that perform boundary filtering on restoration regions used for intra prediction.

[0002] In codecs such as H.264 AVC (Advanced Video Coding), HEVC (High Efficiency Video Coding), and VVC (Versatile Video Coding), an image is divided into blocks, and each block can be predicted and decoded through inter prediction or intra prediction.

[0003] Intra prediction is a method of compressing images by removing spatial redundancy within the image, and inter prediction is a method of compressing images by removing temporal redundancy between images.

[0004] For intra prediction, various prediction modes are used, such as DC mode, planar mode, and directional mode, and when directional mode is used, the directional mode is becoming increasingly finer.

[0005] As directional modes become more refined and prediction modes are added, more accurate prediction values ​​are obtained. However, because more information must be transmitted, there are limitations to adding prediction modes based on rate-distortion performance. In other words, the amount of information transmitted related to intra-prediction modes exceeds the gains obtained by reducing prediction error, reducing compression efficiency. To overcome these limitations, intra-prediction methods that directly derive prediction mode information on the decoding side while reducing the overhead associated with intra-prediction mode-related information are on the rise.

[0006] In particular, as the area of ​​reconstructed samples accessible for intra prediction increases, new techniques have been proposed that allow the decoding side to generate predictors independently without receiving intra prediction mode-related information. These techniques utilize previously reconstructed regions, and discontinuities at the edges of blocks within these reconstructed regions pose challenges in predictor generation. A solution to this problem is needed.

[0007] A video decoding method according to one embodiment of the present disclosure may include: performing boundary filtering on a template region located around a current block; identifying a first search template region and a second search template region corresponding to the template region within a search region within a current picture including the current block; performing boundary filtering on the first search template region and the second search template region; determining a search template region most similar to the filtered template region among the filtered first search template region and the filtered second search template region; determining a matching block corresponding to the current block based on the most similar search template region; performing boundary filtering on the matching block; and predicting the current block based on the filtered matching block.

[0008] 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 one or more instructions. The at least one processor may perform boundary filtering on a template region located around a current block. The at least one processor may identify a first search template region and a second search template region corresponding to the template region within a search region within a current picture including the current block. The at least one processor may perform boundary filtering on the first search template region and the second search template region. The at least one processor may determine a search template region most similar to the filtered template region among the filtered first search template region and the filtered second search template region. The at least one processor may determine a matching block corresponding to the current block based on the most similar search template region. The at least one processor may perform boundary filtering on the matching block. The at least one processor may predict the current block based on the filtered matching block.

[0009] A video encoding method according to one embodiment of the present disclosure may include: performing boundary filtering on a template region located around a current block; identifying a first search template region and a second search template region corresponding to a template region within a search region within a current picture including the current block; performing boundary filtering on the first search template region and the second search template region; determining a search template region most similar to a filtered template region among the filtered first search template region and the filtered second search template region; determining a matching block corresponding to the current block based on the most similar search template region; performing boundary filtering on the matching block; and predicting the current block based on the filtered matching block.

[0010] 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 one or more instructions. The at least one processor may perform boundary filtering on a template region located around a current block. The at least one processor may identify a first search template region and a second search template region corresponding to the template region within a search region within a current picture including the current block. The at least one processor may perform boundary filtering on the first search template region and the second search template region. The at least one processor may determine a search template region most similar to the filtered template region among the filtered first search template region and the filtered second search template region. The at least one processor may determine a matching block corresponding to the current block based on the most similar search template region. The at least one processor may perform boundary filtering on the matching block. The at least one processor may predict the current block based on the filtered matching block.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0027] FIG. 17 is a diagram for explaining an intra template matching prediction (Intra TMP) method according to one embodiment of the present disclosure.

[0028] FIG. 18 is a diagram for explaining a template-based intra mode derivation (TIMD) method according to one embodiment of the present disclosure.

[0029] FIG. 19 is a diagram illustrating a method of using a template-based multiple reference line (TMRL) according to one embodiment of the present disclosure.

[0030] FIG. 20 is a diagram for explaining a decoder-side intra mode derivation (DIMD) method according to one embodiment of the present disclosure.

[0031] FIG. 21 is a diagram for explaining a method of applying boundary filtering according to one embodiment of the present disclosure.

[0032] FIG. 22 is a diagram for explaining a method of applying boundary filtering according to one embodiment of the present disclosure.

[0033] FIG. 23 is a diagram for explaining a decoder-side intra mode derivation (DIMD) method according to one embodiment of the present disclosure.

[0034] Figure 24 illustrates an example of samples located at the boundary between two blocks to which deblocking filtering is applied.

[0035] Figure 25 is a diagram for explaining a method for determining the type of filter for deblocking filtering.

[0036] FIG. 26 is a diagram for explaining deblocking filtering according to one embodiment of the present disclosure.

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

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

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

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

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

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

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

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

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

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

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

[0048] 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."

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

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

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

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

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

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

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

[0056] 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. Referring 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 referring to FIGS. 17 to 20, template-based intra prediction methods and template-based intra prediction methods in which boundary filtering is additionally performed according to an embodiment of the present disclosure are described, and referring to FIGS. 21 to 22, a boundary filtering method according to an embodiment of the present disclosure is described, and referring to FIG. 23, a method for first applying a strong filter to a template region of DIMD (Decoder-side intra mode derivation) to emphasize an edge component and then partially obtaining a gradient to obtain a histogram value is described, and referring to FIGS. 24 to 26, a general deblocking filtering method and a deblocking filtering method in the case where filtering is performed on a restoration region or a template region in intra prediction are described, and referring to FIGS. 27 to 30, an image decoding method, an image decoding device, and an image using an intra TMP to which boundary filtering is applied according to an embodiment of the present disclosure are described. An encoding method and an image encoding device are described.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0093] The image decoding device (100) can obtain the segmentation 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 segmentation shape mode information based on the block shape information. The image decoding device (100) can determine the pre-agreed segmentation shape mode information for the maximum coding unit or the minimum coding unit. For example, the image decoding device (100) can determine the segmentation shape mode information for the maximum coding unit as quad split. In addition, the image decoding device (100) can determine the segmentation 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 segmentation 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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0212] In this specification, a template refers to a surrounding pixel area or surrounding block that has been restored before a current block adjacent to a current block. The surrounding pixel area or surrounding block corresponding to the template may include at least one surrounding pixel (or reference pixel) adjacent to the block. For example, the template may refer to a surrounding pixel area or surrounding block adjacent to the left side of the block. For example, the template may refer to a surrounding pixel area or surrounding block adjacent to the upper side of the block. For example, the template may refer to a surrounding pixel area or surrounding block adjacent to the left and upper sides of the block. For example, the template may refer to a surrounding pixel area or surrounding block adjacent to at least one of the left side, the upper side, or the upper left side of the block.

[0213] In this specification, template matching (TM) refers to a technique for finding a template (or pixel region) that best matches the template of a block (or a surrounding pixel region adjacent to the block). For example, template matching can be used as a prediction method for performing prediction on a block based on a template that best matches the template of a block (e.g., a coding unit (CU)) in a reference picture or a current picture, or as a motion information derivation method on the decoder side for refining motion information of the block. In this specification, intra-template matching can refer to a technique for finding a template that best matches the template of a block in a picture including the block (or the current picture). In this specification, template matching prediction (TMP) can refer to a technique for performing prediction based on template matching.

[0214] In this specification, boundary filtering refers to filtering for removing discontinuities occurring at boundaries between blocks.

[0215] FIGS. 17 to 20 describe template-based intra prediction methods and template-based intra prediction methods in which boundary filtering is additionally performed according to an embodiment of the present disclosure.

[0216] FIG. 17 is a diagram for explaining an intra template matching prediction (Intra TMP) method according to one embodiment of the present disclosure.

[0217] Referring to FIG. 17, for intra prediction of a current block (1710), an L-shaped template (1720) region is determined, which includes reference samples located on the left side of the current block (1710), reference samples located on the upper left side of the current block (1710), and reference samples located on the upper side of the current block (1710). A region including a region reconstructed before a current maximum coding unit (1730) including the current block (1710) and a reconstructed region located on the upper left side of the current block (1710) is used as a search region (1740). Specifically, the degree of distortion is measured by matching a plurality of regions with a size corresponding to the template (1720) region of the current block (1710) and the template (1730) region within the search region (1740). For example, a distortion cost is calculated using SAD (Sum of Absolute Difference) to determine the region with the best match. A matching block corresponding to the current block (1710) is determined based on the region with the best match. Just as the template (1720) region is located around the current block (1710), the region corresponding to the template (1720) region of the current block (1710) and with the best match is located within the search region (1740) around the matching block. For example, the matching block (1760) corresponding to the region with the best match (1750) within the search region (1740) is used. That is, the value of the matching block (1760) is determined as the predicted value of the current block (1710).

[0218] The size of the search area (1740) is proportional to the width (W) and height (H) of the current block (1710). That is, the width of the search area (1740) is α·W, and the height of the search area (1740) is α·H. This is because the larger the current block (1710), the more advantageous it is for prediction to search a wider area. Meanwhile, although FIG. 17 illustrates that the search area (1740) does not include the upper reference area and the left reference area excluding the upper left reference area of ​​the current block (1710) within the current LCU (1730), the present invention is not limited thereto. For example, the search area (1740) may include all reconstructed reference areas within the current LCU (1730).

[0219] In this case, the template (1720) region and the search region (1740) are restoration regions prior to performing in-loop filtering on the current picture including the current block (1710). Therefore, if the template (1720) region and the search region (1740) are used as is, the prediction results may be inefficient due to discontinuities in the block boundaries. Therefore, smoothing or filtering is required to resolve these discontinuities.

[0220] Referring back to FIG. 17, boundary filtering is performed on the block boundaries within the template (1720) region of the current block (1710). Boundary filtering is performed on one of a plurality of regions within a search region (1740) having a size corresponding to the filtered template (1720) region. The filtered template (1720) region and the filtered region are compared to determine the region that best matches the filtered template (1720) region among the plurality of regions. Based on the region (1750) with the best match, a matching block corresponding to the current block (1710) is determined. Boundary filtering is performed on the matching block. The current block (1710) is predicted based on the filtered matching block (1760).

[0221] Boundary filtering for the template region (1720) is filtering to remove discontinuities at boundaries between coding units, boundaries between maximum coding units, slice division boundaries, or block boundaries within the template region (1720).

[0222] Boundary filtering for an area corresponding to a template area (1720) within a search area (1740) is filtering to remove discontinuities at boundaries between coding units, boundaries between maximum coding units, slice division boundaries, or block boundaries within an area corresponding to a template area (1720) within a search area (1740).

[0223] Boundary filtering for a matching block (1760) is filtering to remove discontinuities at boundaries between coding units within a matching block (1760), boundaries between maximum coding units, slice division boundaries, or block boundaries.

[0224] Boundary filtering for the template region (1720), boundary filtering for the region corresponding to the template region (1720) within the search region (1740), and boundary filtering for the matching block (1760) can all operate independently. In addition, boundary filtering for the template region (1720), boundary filtering for the region corresponding to the template region (1720) within the search region (1740), and boundary filtering for the matching block (1760) may be the same filtering or may be different filters. For example, boundary filtering for the template region (1720), boundary filtering for the region corresponding to the template region (1720) within the search region (1740), and boundary filtering for the matching block (1760) may be the filters of

[0121] .

[0225] Based on template matching, a predictor can be generated without transmitting information related to the intra prediction mode, and by using boundary filtering, inefficiency caused by using a restoration area to which in-loop filtering is not applied can be eliminated, and an accurate predictor can be generated.

[0226] FIG. 18 is a diagram for explaining a template-based intra mode derivation (TIMD) method according to one embodiment of the present disclosure.

[0227] Referring to FIG. 18, for intra prediction of the current block (1810), an upper reference region (1820) located above the current block (1810) and a left reference region (1825) located to the left of the current block (1810) are determined as template regions. Reference samples (1830) for the template region are determined. Using the reference samples (1830) for the template region, intra prediction is performed on the template region according to predetermined prediction modes (for example, 1 to 2 intra prediction modes having the smallest value by calculating the distortion cost using SAD from an MPM list including modes with a high probability of being selected), and a prediction value for the template region is determined. The SATD (Sum of Absolute Transformed Difference) is calculated using the difference between the prediction value for the template region and the already restored value of the template region. Among all SATD values ​​of the predetermined prediction modes, one or two minimum SATD costs are selected, and one or two corresponding intra modes are derived. The current block (1810) is predicted based on the derived intra modes.

[0228] The height dH of the upper reference area (1820) is determined as 2 if the height of the current block (1810) is 8 or less, and is determined as 4 if the height of the current block (1810) is greater than 8. The width dW of the left reference area (1825) is determined as 2 if the width of the current block (1810) is 8 or less, and is determined as 4 if the width of the current block (1810) is greater than 8.

[0229] In this case, the template regions (1820, 1825) and the reference samples (1830) are reconstructed regions before in-loop filtering is performed on the current picture including the current block (1810). Therefore, if the template regions (1820, 1825) and the reference samples (1830) are used as is, the prediction results may be inefficient due to discontinuity at the block boundary. Therefore, smoothing or filtering is required to resolve this discontinuity.

[0230] Referring back to FIG. 18, boundary filtering is performed on reference samples (1830) for the template region. Intra prediction is performed on the template region according to each of the predetermined prediction modes using the filtered reference samples (1830), thereby determining a prediction value for the template region. Boundary filtering is performed on the prediction values ​​for the template region. A Sum of Absolute Transformed Difference (SATD) is calculated using the difference between the predicted value of the filtered template region and the already reconstructed value of the template region. Among all SATD values ​​of the predetermined prediction modes, one or two minimum SATD costs are selected, and one or two intra modes corresponding thereto are derived. The current block (1810) is predicted based on the derived intra modes.

[0231] Boundary filtering for reference samples (1830) for the template region is filtering to remove discontinuities at boundaries between coding units, boundaries between maximum coding units, slice division boundaries, or block boundaries within the region of reference samples of the template region.

[0232] Boundary filtering for predicted values ​​for a template region is filtering to remove discontinuities at boundaries between coding units, boundaries between maximum coding units, slice division boundaries, or block boundaries within the region of predicted values ​​for the template region.

[0233] Boundary filtering for reference samples (1830) for the template region and boundary filtering for predicted values ​​for the template region can both operate independently. Furthermore, boundary filtering for reference samples (1830) for the template region and boundary filtering for predicted values ​​for the template region may be the same filter or different filters. For example, boundary filtering for reference samples (1830) for the template region and boundary filtering for predicted values ​​for the template region may be the filter of

[0121] .

[0234] By deriving an intra mode based on a template, a predictor can be generated without transmitting information related to the intra prediction mode, and by using boundary filtering, inefficiency caused by using a restoration area to which in-loop filtering is not applied can be eliminated, and an accurate predictor can be generated.

[0235] FIG. 19 is a diagram illustrating a method of using a template-based multiple reference line (TMRL) according to one embodiment of the present disclosure.

[0236] Referring to FIG. 19, pixels having the same pixel spacing from the current block (1900) are grouped and determined as a template, and prediction is performed using pixels located in the selected template. Specifically, reference samples (1905) adjacent to the current block (1900) are determined as a first reference line, reference samples (1910) at a distance of one pixel from the current block (1900) are determined as a second reference line, reference samples (1915) at a distance of three pixels from the current block are determined as a third reference line, reference samples (1920) at a distance of five pixels from the current block are determined as a fourth reference line, reference samples (1925) at a distance of seven pixels from the current block are determined as a fifth reference line, and reference samples (1930) at a distance of twelve pixels from the current block are determined as a sixth reference line. The reference lines are designated by reference line indexes. For example, a first reference line may have a reference line index of 0, a second reference line may have a reference line index of 1, a third reference line may have a reference line index of 3, a fourth reference line may have a reference line index of 5, a fifth reference line may have a reference line index of 7, and a sixth reference line may have a reference line index of 12. For intra prediction of the current block (1900), prediction may be performed using one of the first to sixth reference lines according to the reference line index, so that the current block may be predicted. The reference line index may be determined through RDO calculation on the encoding side and transmitted to the decoding side.

[0237] In this case, the template areas corresponding to the first to sixth reference lines are restoration areas prior to performing in-loop filtering on the current picture including the current block (1900). Therefore, if one template area is used as is, the prediction result may be inefficient due to discontinuity at the block boundary. Therefore, smoothing or filtering is required to resolve this discontinuity.

[0238] Referring again to FIG. 19, boundary filtering is performed on one of the first to sixth reference lines, and prediction is performed based on the filtered reference line to compare costs, thereby determining the reference line with the lowest cost. The reference line with the lowest cost is selected. The cost can be calculated via SAD or SATD. The current block is predicted based on the filtered reference line with the lowest cost.

[0239] Boundary filtering for one of the first to sixth reference lines is filtering for removing discontinuities at boundaries between coding units, boundaries between maximum coding units, slice division boundaries, or block boundaries within a line area of ​​one of the first to sixth reference lines.

[0240] By selecting one reference line from among multiple reference lines and using boundary filtering, a predictor can be generated without transmitting information related to the intra prediction mode, and inefficiency caused by using a restoration area to which in-loop filtering is not applied can be resolved, and an accurate predictor can be generated.

[0241] FIG. 20 is a diagram for explaining a decoder-side intra mode derivation (DIMD) method according to one embodiment of the present disclosure.

[0242] Referring to Fig. 20, a gradient is obtained by applying two filters of 3x3 size to a restoration area (2010) located around a current block (2000). Specifically, a horizontal gradient Ghor (2035) is obtained by applying a vertical Sobel filter (2030) to the restoration area (2010), and a vertical gradient Gver (2045) is obtained by applying a horizontal Sobel filter (2040) to the restoration area (2010). A prediction direction (2050) is determined using the horizontal gradient (2035) and the vertical gradient (2045).

[0243] Specifically, the angle of the predicted direction is determined as in mathematical expression 1 below, and the strength of the predicted direction is determined as in mathematical expression 2 below.

[0244]

[0245]

[0246] A histogram of gradients (HOG) is determined using the gradients at all locations in the reconstructed region (2010), and two directional intra prediction modes are derived based on the intensity of the gradient histogram. The current block (2000) is predicted based on the two directional intra prediction modes.

[0247] In this case, the restoration area (2010) is the restoration area prior to performing in-loop filtering on the current picture including the current block (2000). Therefore, using the restoration area (2010) as is may result in inefficient prediction results due to discontinuities in the block boundaries. Therefore, smoothing or filtering is required to resolve these discontinuities.

[0248] Referring again to FIG. 20, boundary filtering is performed on the reconstructed region (2010), and a vertical Sobel filter (2030) and a horizontal Sobel filter (2040) are applied to the filtered reconstructed region (2010). As a result of applying the Sobel filter, a horizontal gradient (2035) and a vertical gradient (2045) are obtained, and a prediction direction (2050) is determined using the horizontal gradient (2035) and the vertical gradient (2045). A histogram of gradients (HOG) is determined using the gradients at all positions for the filtered reconstructed region (2010), and two directional intra prediction modes are derived based on the intensity of the gradient histogram. The current block (2000) is predicted based on the two directional intra prediction modes.

[0249] Boundary filtering for the restoration area (2010) is filtering to remove discontinuities at boundaries between coding units within the restoration area (2010), boundaries between maximum coding units, slice division boundaries, or block boundaries.

[0250] By using a restoration region to which boundary filtering is applied, a predictor can be generated without transmitting information related to the intra prediction mode, and the inefficiency caused by using a restoration region to which in-loop filtering is not applied can be resolved, and an accurate predictor can be generated.

[0251] In FIGS. 21 and 22, a boundary filtering method according to one embodiment of the present disclosure is described.

[0252] FIG. 21 is a diagram for explaining a method of applying boundary filtering according to one embodiment of the present disclosure.

[0253] Referring to FIG. 21, when the surrounding blocks located above the current block (2100) are used as a template area, noise values ​​may be caused by the boundary (2105) located on the left side of the first upper surrounding block (2110) and the boundary (2115) located between the first upper surrounding block (2110) and the second upper surrounding block (2120).

[0254] In addition, when using the surrounding blocks located on the left side of the current block (2100) as a template area, noise values ​​may be caused by the boundary (2125) located below the first left surrounding block (2130) and the boundary (2135) located between the first left surrounding block (2130) and the second left surrounding block (2140).

[0255] Before in-loop filtering is applied, the areas of noticeable discontinuity in the reconstructed region are the boundaries between blocks. While blocks may be divided into coding units, maximum coding units, or slices based on objects within the block, they can also be divided based on various other conditions. In this case, if the reconstructed region is directly utilized, error values ​​that may occur at the boundaries between blocks are also used as information, which can reduce the accuracy of deriving an accurate prediction mode or generating a predictor. Therefore, it is necessary to apply a kind of deblocking effect to the reconstructed region before deriving the prediction mode in the decoder itself or generating a predictor using template matching by performing smoothing or filtering at these boundaries.

[0256] Referring again to FIG. 21, when the upper area of ​​the current block (2100) is used as a template, noise values ​​that may be caused by the boundaries of the blocks can be removed by applying smoothing or filtering to the boundary (2105) located on the left side of the first upper peripheral block (2110) and the boundary (2115) located between the first upper peripheral block (2110) and the second upper peripheral block (2120). In addition, noise values ​​can also be removed by removing pixels at the boundary (2105) located on the left side of the first upper peripheral block (2110) and the boundary (2115) located between the first upper peripheral block (2110) and the second upper peripheral block (2120).

[0257] When the left area of ​​the current block (2100) is used as a template, noise values ​​that may be caused by the boundaries of the blocks can be removed by applying smoothing or filtering to the boundary (2125) located below the first left peripheral block (2130) and the boundary (2135) located between the first left peripheral block (2130) and the second left peripheral block (2140). In addition, noise values ​​can also be removed by removing pixels at the boundary (2125) located below the first left peripheral block (2130) and the boundary (2135) located between the first left peripheral block (2130) and the second left peripheral block (2140).

[0258] In addition, instead of smoothing or filtering all block boundaries within the used restoration area, smoothing or filtering may be performed by considering the prediction mode of the block and the location of the block within the image. Specifically, if the intra prediction modes of the first upper neighboring block (2110) and the second upper neighboring block (2120) are different, there is a high probability that the features of the picture will be reflected in the restoration area. Therefore, if the intra modes of the first upper neighboring block (2110) and the second upper neighboring block (2120) are different from each other or the intra prediction modes of the first upper neighboring block (2110) and the second upper neighboring block (2120) are directional modes and have opposite directions, it is determined that there is a pixel having a stronger discontinuity at the boundary of the block, and a filter with a stronger filtering strength may be used. If the intra prediction modes of the first upper peripheral block (2110) and the second upper peripheral block (2120) are determined to be similar, a filter with a weaker filtering strength may be used or application of smoothing or filtering may be omitted. In addition, if the intra prediction modes of the first left peripheral block (2130) and the second left peripheral block (2140) are different, there is a high probability that the features of the picture will be reflected in the reconstructed area. Therefore, if the intra modes of the first left peripheral block (2130) and the second left peripheral block (2140) are different from each other or the intra prediction modes of the first left peripheral block (2130) and the second left peripheral block (2140) are directional modes with opposite directions, it is determined that there is a pixel having a stronger discontinuity at the boundary of the block, and thus a filter with a stronger filtering strength may be used. If the intra prediction modes of the first left peripheral block (2130) and the second left peripheral block (2140) are determined to be similar, a filter with a weaker filtering strength may be used or application of smoothing or filtering may be omitted.

[0259] As shown in Table 1 below, the filter type can be determined based on the intra modes of adjacent blocks (CU1, CU2). That is, if the intra modes of CU1 and CU2 are different, the filtering type can be determined as recon smoothing filter 1, and if the intra modes of CU1 and CU2 are the same, the filtering type can be determined as recon smoothing filter 2.

[0260]

[0261] Additionally, when generating predictors independently, such as in Intra Block Copy (IBC) mode or Matrix-based Intra Prediction (MIP) mode, completely different predictors can be generated even if the two modes are identical. Discontinuities can be eliminated by applying filtering to the intra mode that generates the predictor.

[0262] As shown in Table 2 below, in the case of the intra mode that generates a predictor, the filtering type can be determined according to the conditions below.

[0263]

[0264] Additionally, as in Fig. 21, when the restoration area includes a boundary between blocks, the strength or method of smoothing or filtering may vary in consideration of the difference between the two blocks and the characteristics of the blocks.

[0265] The characteristics of a block may be the width (W), height (H), area, or aspect ratio of the block. Specifically, the characteristics of the block may refer to at least one of W, H, log2W, log2H, log2W+log2H, log2WH, WH, log2(W / H), W / H, log2(H / W), H / W. For example, when the area of ​​a block (log2W+log2H) is referred to as the characteristic of the block, the intensity or method of edge filtering of reference pixels on the upper or left side of the current block may be determined differently depending on the area of ​​the current block, as shown in Table 3.

[0266]

[0267] FIG. 22 is a diagram for explaining a method of applying boundary filtering according to one embodiment of the present disclosure.

[0268] Referring to Fig. 22, the first current block (2210) obtained by dividing the first upper block (2200) is relatively large compared to the surrounding blocks of the first current block (2210). In this case, if the surrounding blocks are used as a template region, a large number of edge components may be reflected in the template region. Therefore, strong smoothing or filtering may be required. On the other hand, the second current block (2260) obtained by dividing the second upper block (2250) is relatively small compared to the surrounding blocks of the second current block (2260). In this case, if the surrounding blocks are used as a template region, edges may exist but be negligible. Therefore, weak smoothing or weak filtering may be more effective.

[0269] Additionally, when applying smoothing or filtering to the boundary between two blocks within the restoration area, the strength or method of smoothing or filtering may be determined differently by considering the characteristics of the texture within the two blocks.

[0270] If one of the two blocks has a complex texture, the pixel value difference between the two blocks at the block boundary may be large. To define the texture of the restoration area, texture complexity (TC) can be defined as in Equation 3 below, and the type of filtering can be determined.

[0271]

[0272] Here, height is the height of the block, width is the width of the block, and mean is the average value of the pixels within the block.

[0273] Therefore, if TC is greater than a certain threshold, the boundary between the two blocks is judged to be large, and strong smoothing or strong filtering may be applied. If TC is less than a certain threshold, weaker smoothing or weaker filtering may be applied, or filtering may be omitted. As shown in Table 4 below, the filtering type may be determined based on TC.

[0274]

[0275] Additionally, whether smoothing or filtering is performed may be determined differently depending on the number of blocks within the restoration area. Specifically, when the number of blocks adjacent to the upper and left boundaries of the current block is s (s>=1), whether smoothing or filtering is performed may be determined differently based on information about the s blocks.

[0276] Referring to Fig. 22, when defining the reference samples of the upper region as templates to derive a prediction mode or generate a predictor, in the case of the first current block (2210), if there are N or more blocks (N=3) above the first current block (2210), multiple edge components may be reflected in the template region. Therefore, strong smoothing or strong filtering may be required. On the other hand, in the case of the second current block (2260), if there is only one block above the second current block (2260), the edge may be respected but may be negligible. Therefore, weak smoothing or weak filtering may be more effective.

[0277] As shown in Table 5 below, the type of filtering can be determined differently depending on the number of blocks in the template area.

[0278]

[0279] According to one embodiment of the present disclosure, smoothing or filtering for the template region may be used only when in MPM mode, and when not in MPM mode, smoothing or filtering may not be applied and the determined intra mode may be used as is.

[0280] According to one embodiment of the present disclosure, smoothing or filtering for the template region may be used only in directional mode, and in non-directional mode, smoothing or filtering may not be applied and the existing restoration region may be used as is.

[0281] According to one embodiment of the present disclosure, smoothing or filtering for a template region may be applied only to certain block sizes. For example, smoothing or filtering may be configured to be applied only to blocks having an area greater than MxN. Alternatively, smoothing or filtering may be configured to be applied when M or N is greater than a certain value.

[0282] According to one embodiment of the present disclosure, smoothing or filtering of the template region can be performed separately for each color component. Furthermore, smoothing or filtering of the template region can be performed only on specific color components. Specifically, smoothing or filtering of the template region can be performed only on the luma component.

[0283] Additionally, smoothing or filtering for the template region itself may be performed only on the luma component, and the result of smoothing or filtering performed on the luma component may be used as is for the chroma component. Alternatively, smoothing or filtering of the chroma component may be performed separately based on the restored region where smoothing or filtering was performed on the luma component.

[0284] According to one embodiment of the present disclosure, a flag may be used to determine whether smoothing or filtering is applied to a template region. Specifically, the flag may be defined as recon_smoothing_flag. If the value of the flag is 0, the given restoration region is used as is. If the value of the flag is 1, the restoration region is used after performing smoothing on the edges between blocks. Furthermore, if the recon_smoothing_flag does not exist, the value of the flag may be set to be inferred as 0.

[0285] According to one embodiment of the present disclosure, smoothing or filtering for a template region can be applied by selecting a preset filter. Furthermore, the filter can be adaptively applied depending on whether smoothing or filtering has been applied to a block within the template region. For example, isReconFiltered is defined as a flag indicating whether smoothing or filtering has been applied to a reconstructed region corresponding to a template when a decoding-side intra tool searches based on a template. If the value of isReconFiltered is 1, smoothing or filtering has been applied to the reconstructed region, and if the value of isReconFiltered is 0, smoothing or filtering has not been applied to the reconstructed region. If isReconFiltered is not transmitted, the value of isReconFiltered is inferred to be 0. If the value of isReconFiltered is 1, smoothing or filtering has already been applied to the reconstructed region, and therefore, no additional smoothing or filtering is applied to the reconstructed region and the reconstructed region is used as a template. Conversely, if the value of isReconFiltered is 0, smoothing or filtering is applied to the reconstructed area and the filtered reconstructed area is used as a template.

[0286] According to one embodiment of the present disclosure, when applying smoothing or filtering to a block edge, a filter can be adaptively applied by transmitting an index by presetting in advance which filter to use. Specifically, recon_smoothing_filterType_idx defines an index that presets in advance which filter to use. This can be used to signal the type of filter applied at the block edge. This index is signaled only when recon_smoothing_flag is 1. If recon_smoothing_flag is not signaled or is 0, recon_smoothing_filterType_idx is inferred to be 0.

[0287] According to one embodiment of the present disclosure, when applying smoothing or filtering to a block edge, if two blocks exist with the block boundary between them, the types of smoothing filters may be determined differently or identically, taking into account the texture characteristics or intra modes within the two blocks. In this case, all types of filters may be utilized.

[0288] According to one embodiment of the present disclosure, when applying smoothing or filtering to a block edge, the type of filter to be used in a surrounding block, surrounding coding unit, surrounding maximum coding unit, surrounding slice, or within the same picture may be shared and applied.

[0289] According to one embodiment of the present disclosure, when applying smoothing or filtering to a block edge, conventional in-loop filter techniques may be first applied to the restoration area so that discontinuities that may occur at the boundary between blocks can be first removed.

[0290] Any type of filter can be used for smoothing or filtering. Image filtering or smoothing is an operation that defines a square matrix in the form of a kernel, moves this kernel over the image, performs an operation on the area of ​​the image that overlaps with the kernel, and then creates a new image by replacing the pixels in the area of ​​the image where the operation was performed with the resulting value. Examples of this filtering method include Average Filter, Gaussian Filter, Median Filtering, Bilateral Filtering, low-pass filtering, high-pass filtering, convolution filtering, linear filtering, non-linear filtering, and strong filter.

[0291] Additionally, to further emphasize the edge region of a block, a strong filter can be applied before the smoothing filter. A strong filter can be used to amplify existing noise or edge components. Applying a smoothing filter after the strong filter can further clarify important edge components and remove unnecessary noise or block partition boundaries, thereby filtering out unnecessary information.

[0292] In the following, Fig. 23 describes a method of first applying a strong filter to the template area of ​​DIMD to emphasize edge components and then partially obtaining the gradient to obtain the histogram value.

[0293] FIG. 23 is a diagram for explaining a decoder-side intra mode derivation (DIMD) method according to one embodiment of the present disclosure.

[0294] Referring to Fig. 23, a strong filter is first applied to pixels within the template area (2310) of the current block (2300). The strong filter is a 3x3 filter (2320) centered on the target pixel (2325). The filter coefficient of the strong filter (2320) is as shown in Mathematical Expression 4 below. Among the filter coefficients, the filter coefficient 10 corresponding to the position of the 2nd row and 2nd column is applied to the target pixel (2325), and a filter coefficient of -1 is applied to the surrounding pixels.

[0295]

[0296] A strong filter (2320) is applied to the entire template area (2310), and a template area (2310) with edge components emphasized by applying the strong filter is obtained.

[0297] Unlike the DIMD of Fig. 20, a gradient histogram is obtained by using 3x2 and 2x3 gradient operators on the left template and the upper template of the template area (2310) where the edge component is emphasized.

[0298] The 3x2 gradient operator, i.e., filter, used in the left template is as shown in mathematical expression 5 below. My is a filter for obtaining a horizontal gradient, and Mx is a filter for obtaining a vertical gradient.

[0299]

[0300] The 2x3 gradient operator, i.e., filter, used in the upper template is as shown in mathematical expression 6 below. My is a filter for obtaining a horizontal gradient, and Mx is a filter for obtaining a vertical gradient.

[0301]

[0302] In the 3x2 gradient operator used in the left template, the location corresponding to the target pixel is row 2, column 2. In addition, in the 2x3 gradient operator used in the upper template, the location corresponding to the target pixel is row 2, column 2.

[0303] For example, as illustrated in FIG. 23, a 2x3 gradient operator (2330) is applied to the target pixel (2335) in the upper template in the template area (2310).

[0304] A prediction mode is derived based on the gradient histogram obtained for the template area (2310), and the current block (2300) is predicted based on the derived prediction mode.

[0305] In intra prediction, when using a restoration region, there is in-loop filtering that filters the restored image on a frame-by-frame basis, separate from the method of performing filtering on the boundary of the block.

[0306] In-loop filtering techniques may include a deblocking filter to remove blocking artifacts, as well as SAO (Sample Adaptive Offset) and ALF (Adaptive Loop Filter) to compensate for information loss caused by lossy compression such as quantization. By utilizing these filters, not only subjective image quality but also compression efficiency can be improved. Deblocking filtering can improve both subjective and objective image quality by reducing errors that occur between block boundaries within a reconstructed image and preventing error propagation between frames. In particular, deblocking filtering techniques effectively remove block boundary distortion caused by prediction and quantization, thereby improving subjective image quality. Furthermore, deblocking filtering techniques perform adaptive filtering that applies differential filtering depending on the degree of distortion occurring at the block boundary. That is, by distinguishing between areas where distortion is likely to occur at the block boundary and areas where distortion is unlikely to occur, different filtering is performed, thereby minimizing new distortion that may be caused by unnecessary or excessive filtering. However, these adaptive deblocking filtering techniques require significant computational effort to measure distortion information and apply different filters.

[0307] These in-loop filtering techniques are applied frame by frame, after all predictions have been performed. Furthermore, in-loop filtering techniques can be applied on a transform-by-transform basis.

[0308] In FIGS. 24 to 26, a general deblocking filtering method and a deblocking filtering method for cases where filtering is performed on a restoration area or template area in intra prediction are described below.

[0309] Figure 24 illustrates an example of samples located at the boundary between two blocks to which deblocking filtering is applied.

[0310] Referring to Fig. 24, a block boundary (2420) is located between blocks P (2400) and Q (2410). Specifically, samples within block P (2400) whose boundary (2420) is closest to the block boundary (2420) are p 0,0 , p 0,1 , p 0,2 , p 0,3 , and the samples 1 pixel away from the boundary (2420) are p 1,0 , p 1,1 , p 1,2 , p 1,3 , and the samples 2 pixels away from the boundary (2420) are p 2,0 , p 2,1 , p 2,2 , p 2,3 , and the samples 3 pixels away from the boundary (2420) are p 3,0 , p 3,1 , p 3,2 , p 3,3 Likewise, the samples closest to the boundary (2420) within block Q (2410) based on the boundary (2420) of the block are q 0,0 , q 0,1 , q 0,2 , q 0,3 , and the samples 1 pixel away from the boundary (2420) are q 1,0 , q 1,1 , q 1,2 , q 1,3 , and the samples 2 pixels away from the boundary (2420) are q 2,0 , q 2,1 , q 2,2 , q 2,3 , and the samples 3 pixels away from the boundary (2420) are q 3,0 , q 3,1 , q 3,2 , q 3,3 am.

[0311] Figure 25 is a diagram for explaining a method for determining the type of filter for deblocking filtering.

[0312] Referring to FIG. 25, in step 2510, a filtering parameter Bs indicating the strength of a block boundary is first determined. The value of the filtering parameter Bs is determined to be one of 0, 1, and 2. Specifically, if at least one of the two adjacent blocks is an intra-predicted block, the value of Bs is determined to be 2. If at least one of the two blocks has a non-zero coded residual coefficient and the boundary of the blocks is a transform boundary, the value of Bs is determined to be 1. If the absolute difference between the corresponding spatial motion vector components of the two blocks is 1 or greater in integer pixel units, the value of Bs is determined to be 1. If the motion compensated prediction for the two blocks refers to different reference pictures or the number of motion vectors for the two blocks is different, the value of Bs is determined to be 1. In all other cases except the above conditions, the value of Bs is determined to be 0.

[0313] Referring again to FIG. 25, if the value of Bs is 0 in step 2510, it is determined that filtering is not applied, and if the value of Bs is greater than 0, condition (1) is determined in step 2530. β and tc described in conditions (1) to (4) represent threshold values ​​applied when determining the strength of the filter or performing filtering. β and tc are determined as predefined values ​​based on quantization parameters.

[0314] If condition (1) is not satisfied in step 2530, filtering is not applied.

[0315] If condition (1) is satisfied at step 2530, conditions (2), (3), and (4) are determined at step 2550.

[0316] If conditions (2), (3), and (4) are all satisfied in step 2550, the type of deblocking filter is determined to be a strong filter with a large filtering strength. If any of conditions (2), (3), and (4) are not satisfied, the type of deblocking filter is determined to be a normal filter.

[0317] For a normal filter, one of the filters [3, 7, 9, -3]>>4 or [8 19 -1 9 -3]>>5 is used, and for a strong filter, one of the filters [1 2 2 2 1]>>3, [1 1 1 1]>>2, or [2 3 1 1 1]>>3 is used. However, this is not limited thereto.

[0318] FIG. 26 is a diagram for explaining deblocking filtering according to one embodiment of the present disclosure.

[0319] Referring to FIG. 26, if Bs is 0 in step 2610, it is determined that filtering is not applied. If Bs is greater than 0 in step 2610, the value of isReconFiltered, which indicates whether filtering was applied to the block boundary during the intra prediction process, is determined in step 2630.

[0320] If the value of isReconFiltered is 0 in step 2630, that is, no filtering is applied to the block boundary during the intra prediction process, the type of deblocking filter is determined to be a weak filter.

[0321] If the value of isReconFiltered is 1 in step 2630, i.e., filtering is applied to the block boundary during the intra prediction process, conditions (1), (2), (3), and (4) are determined in step 2650. Conditions (1), (2), (3), and (4) refer to conditions (1), (2), (3), and (4) illustrated in Fig. 25.

[0322] If conditions (1), (2), (3), and (4) are all satisfied in step 2650, the type of filtering is determined to be a strong filter.

[0323] If any of conditions (1), (2), (3), and (4) are not satisfied in step 2650, the type of filtering may be determined to be a weak filter or a normal filter, or it may be determined that no filtering is applied.

[0324] The deblocking filtering method of Fig. 26 applies a strong filter to an area where smoothing or filtering has already been applied based on a value indicating whether smoothing or filtering has been applied to the boundary of a block when intra prediction is performed, and when deblocking filtering is applied on an actual frame basis, it means that there is no significant difference in an area where smoothing or filtering has not been applied even though there is a boundary of a block, so unnecessary additional smoothing or filtering can be eliminated by applying a weak filter. Instead of a weak filter, filtering can be performed by adjusting an existing normal filter.

[0325] Additionally, Bs can be adjusted or the type of filter can be determined implicitly by additionally considering isReconFiltered on a per-block basis.

[0326] For weak filters, one of the filters [1 2 2 2 1]>>3, [1 3 8 3 1]>>4, or [0 0.5 1 0.5 0]>>1 is used, but is not limited thereto.

[0327] FIGS. 27 to 30 describe an image decoding method, an image decoding device, an image encoding method, and an image encoding device using an intra TMP with boundary filtering applied according to one embodiment of the present disclosure.

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

[0329] Referring to FIG. 27, in step S2710, the image decoding device (2800) can perform boundary filtering on a template area located around the current block.

[0330] According to one embodiment of the present disclosure, the template region may be an L-shaped region including at least one left reference sample located to the left of the current block, at least one upper-left reference sample located to the upper-left of the current block, and at least one upper reference sample located to the upper-left of the current block.

[0331] In step S2720, the image decoding device (2800) can identify a first search template area and a second search template area corresponding to the template area within the search area within the current picture including the current block.

[0332] According to one embodiment of the present disclosure, the search area may include a restored area within the current picture.

[0333] In step S2730, the image decoding device (2800) can perform boundary filtering on the first search template area and the second search template area.

[0334] In step S2740, the image decoding device (2800) can determine a search template region that is most similar to the filtered template region among the filtered first search template region and the filtered second search template region.

[0335] At step S2750, the image decoding device (2800) can determine a matching block corresponding to the current block based on the most similar search template region.

[0336] At step S2760, the image decoding device (2800) can perform boundary filtering on the matching block.

[0337] According to one embodiment of the present disclosure, the strength of the boundary filtering may be determined based on the size of the current block.

[0338] According to one embodiment of the present disclosure, the strength of the boundary filtering can be determined based on the intra prediction mode of blocks within the search region.

[0339] According to one embodiment of the present disclosure, the strength of the boundary filtering may be determined based on the number of blocks within the search area.

[0340] According to one embodiment of the present disclosure, whether to perform the boundary filtering may be determined based on a flag for whether to perform boundary filtering obtained from a bitstream.

[0341] According to one embodiment of the present disclosure, the type of boundary filtering may be determined based on an index indicating the type of filter obtained from a bitstream.

[0342] According to one embodiment of the present disclosure, the strength of the boundary filtering for the template region, the strength of the boundary filtering for the first search template region, the strength of the boundary filtering for the second search template region, and the strength of the boundary filtering for the matching block can each be independently determined.

[0343] At step S2770, the image decoding device (2800) can predict the current block based on the filtered matching block.

[0344] According to one embodiment of the present disclosure, the filtering strength of deblocking filtering for the current picture can be determined depending on whether the boundary filtering is performed.

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

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

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

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

[0349] Referring to FIG. 29, in step S2910, the image encoding device (3000) can perform boundary filtering on a template area located around the current block.

[0350] According to one embodiment of the present disclosure, the template region may be an L-shaped region including at least one left reference sample located to the left of the current block, at least one upper-left reference sample located to the upper-left of the current block, and at least one upper reference sample located to the upper-left of the current block.

[0351] In step S2920, the image encoding device (3000) can identify a first search template area and a second search template area corresponding to a template area within a search area within a current picture including a current block.

[0352] According to one embodiment of the present disclosure, the search area may include an encoded area within the current picture.

[0353] In step S2930, the image encoding device (3000) can perform boundary filtering on the first search template area and the second search template area.

[0354] In step S2940, the image encoding device (3000) can determine a search template region that is most similar to the filtered template region among the filtered first search template region and the filtered second search template region.

[0355] In step S2950, ​​the video encoding device (3000) can determine a matching block corresponding to the current block based on the most similar search template region.

[0356] At step S2960, the image encoding device (3000) can perform boundary filtering on the matching block.

[0357] According to one embodiment of the present disclosure, the strength of the boundary filtering may be determined based on the size of the current block.

[0358] According to one embodiment of the present disclosure, the strength of the boundary filtering can be determined based on the intra prediction mode of blocks within the search region.

[0359] According to one embodiment of the present disclosure, the strength of the boundary filtering may be determined based on the number of blocks within the search area.

[0360] According to one embodiment of the present disclosure, whether to perform boundary filtering may be determined based on a generated flag indicating whether boundary filtering is performed. The flag indicating whether boundary filtering is performed may be signaled based on a Rate Distortion Optimization (RDO) calculation.

[0361] According to one embodiment of the present disclosure, the type of boundary filtering may be determined based on an index indicating the type of filter generated. The index indicating the type of filter may be signaled according to the RDO calculation.

[0362] According to one embodiment of the present disclosure, the strength of the boundary filtering for the template region, the strength of the boundary filtering for the first search template region, the strength of the boundary filtering for the second search template region, and the strength of the boundary filtering for the matching block can each be independently determined.

[0363] At step S2970, the image encoding device (3000) can predict the current block based on the filtered matching block.

[0364] According to one embodiment of the present disclosure, the filtering strength of deblocking filtering for the current picture can be determined depending on whether the boundary filtering is performed.

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

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

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

[0368] A video decoding method according to one embodiment of the present disclosure may include the steps of performing boundary filtering on a template region located around a current block; identifying a first search template region and a second search template region corresponding to a template region within a search region within a current picture including the current block; performing boundary filtering on the first search template region and the second search template region; determining a search template region most similar to a filtered template region among the filtered first search template region and the filtered second search template region; determining a matching block corresponding to the current block based on the most similar search template region; performing boundary filtering on the matching block; and predicting the current block based on the filtered matching block.

[0369] A video decoding method according to one embodiment of the present disclosure can reduce overhead for information transmission by performing prediction without transmitting information about an intra prediction mode, and improve efficiency of prediction by removing discontinuity at boundaries between blocks within an area used for intra prediction.

[0370] According to one embodiment of the present disclosure, the template region may be an L-shaped region including at least one left reference sample located to the left of a current block, at least one upper-left reference sample located to the upper-left of the current block, and at least one upper reference sample located to the upper-left of the current block.

[0371] An image decoding method according to one embodiment of the present disclosure can perform intra prediction without transmitting information about an intra prediction mode by using surrounding reference samples close to a current block as a template region.

[0372] According to one embodiment of the present disclosure, the search area may include a restored area within the current picture.

[0373] A video decoding method according to one embodiment of the present disclosure can improve the efficiency of intra prediction without transmitting information about the intra prediction mode by searching for an area most similar to a template area in a restored area within a current picture including a current block.

[0374] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the size of the current block.

[0375] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the intra prediction mode of blocks within the search region.

[0376] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the number of blocks within the search area.

[0377] A video decoding method according to one embodiment of the present disclosure determines the strength of filtering according to the characteristics of a block by considering the size of a current block, the intra prediction mode of blocks within a search area, or the number of blocks within a search area, thereby effectively removing discontinuities at boundaries between blocks and improving the efficiency of intra prediction.

[0378] According to one embodiment of the present disclosure, whether to perform boundary filtering may be determined based on a flag for whether to perform boundary filtering obtained from a bitstream.

[0379] A video decoding method according to one embodiment of the present disclosure removes discontinuities at the boundaries of blocks by performing filtering based on a flag indicating whether boundary filtering is performed, and overhead can also be reduced by transmitting a flag indicating whether boundary filtering of a small number of bits is performed without transmitting information about an intra prediction mode.

[0380] According to one embodiment of the present disclosure, the type of boundary filtering can be determined based on an index indicating the type of filter obtained from a bitstream.

[0381] In an image decoding method according to one embodiment of the present disclosure, a filter type is determined based on an index, so that an appropriate filter is applied to effectively remove discontinuity, and overhead can also be reduced by transmitting an index indicating a filter type of a small number of bits without transmitting information about an intra prediction mode.

[0382] According to one embodiment of the present disclosure, the strength of boundary filtering for the template region, the strength of boundary filtering for the first search template region, the strength of boundary filtering for the second search template region, and the strength of boundary filtering for the matching block can each be independently determined.

[0383] In an image decoding method according to one embodiment of the present disclosure, the strength of filtering is independently determined according to the characteristics of each region to which boundary filtering is applied, so that discontinuity in each region can be effectively removed.

[0384] According to one embodiment of the present disclosure, the filtering strength of deblocking filtering for a current picture can be determined depending on whether boundary filtering is performed.

[0385] In an image decoding method according to one embodiment of the present disclosure, the filtering strength of the deblocking filtering is determined by considering the characteristics at the boundaries of blocks (i.e., whether there is a discontinuity at the boundaries of blocks) depending on whether boundary filtering is performed, so that the deblocking filtering can be performed more efficiently.

[0386] An image decoding device according to one embodiment 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 perform boundary filtering on a template region located around a current block. The at least one processor may identify a first search template region and a second search template region corresponding to the template region within a search region within a current picture including the current block. The at least one processor may perform boundary filtering on the first search template region and the second search template region. The at least one processor may determine a search template region most similar to the filtered template region among the filtered first search template region and the filtered second search template region. The at least one processor may determine a matching block corresponding to the current block based on the most similar search template region. The at least one processor may perform boundary filtering on the matching block. The at least one processor may predict the current block based on the filtered matching block.

[0387] An image decoding device according to one embodiment of the present disclosure can reduce overhead for information transmission by performing prediction without transmitting information about an intra prediction mode, and improve efficiency of prediction by removing discontinuity at boundaries between blocks within an area used for intra prediction.

[0388] According to one embodiment of the present disclosure, the template region may be an L-shaped region including at least one left reference sample located to the left of a current block, at least one upper-left reference sample located to the upper-left of the current block, and at least one upper reference sample located to the upper-left of the current block.

[0389] An image decoding device according to one embodiment of the present disclosure can perform intra prediction without transmitting information about an intra prediction mode by using surrounding reference samples close to a current block as a template area.

[0390] According to one embodiment of the present disclosure, the search area may include a restored area within the current picture.

[0391] An image decoding device according to one embodiment of the present disclosure can improve the efficiency of intra prediction without transmitting information about an intra prediction mode by searching for an area most similar to a template area in a restored area within a current picture including a current block.

[0392] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the size of the current block.

[0393] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the intra prediction mode of blocks within the search region.

[0394] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the number of blocks within the search area.

[0395] An image decoding device according to one embodiment of the present disclosure determines the strength of filtering according to the characteristics of a block by considering the size of a current block, the intra prediction mode of blocks within a search area, or the number of blocks within a search area, thereby effectively removing discontinuities at boundaries between blocks and improving the efficiency of intra prediction.

[0396] According to one embodiment of the present disclosure, whether to perform boundary filtering may be determined based on a flag for whether to perform boundary filtering obtained from a bitstream.

[0397] An image decoding device according to one embodiment of the present disclosure performs filtering by a flag indicating whether boundary filtering is performed, thereby removing discontinuities at the boundaries of blocks, and overhead can also be reduced by transmitting a flag indicating whether boundary filtering of a small number of bits is performed without transmitting information about an intra prediction mode.

[0398] According to one embodiment of the present disclosure, the type of boundary filtering can be determined based on an index indicating the type of filter obtained from a bitstream.

[0399] An image decoding device according to one embodiment of the present disclosure effectively removes discontinuity by applying an appropriate filter by determining the filter type based on an index, and overhead can also be reduced by transmitting an index indicating a filter type of a small number of bits without transmitting information about an intra prediction mode.

[0400] According to one embodiment of the present disclosure, the strength of boundary filtering for the template region, the strength of boundary filtering for the first search template region, the strength of boundary filtering for the second search template region, and the strength of boundary filtering for the matching block can each be independently determined.

[0401] An image decoding device according to one embodiment of the present disclosure can effectively remove discontinuity in each region by independently determining the strength of filtering according to the characteristics of each region to which boundary filtering is applied.

[0402] According to one embodiment of the present disclosure, the filtering strength of deblocking filtering for a current picture can be determined depending on whether boundary filtering is performed.

[0403] According to one embodiment of the present disclosure, a video decoding device determines the filtering strength of deblocking filtering by considering the characteristics at the boundaries of blocks (i.e., whether there is discontinuity at the boundaries of blocks) depending on whether boundary filtering is performed, thereby performing deblocking filtering more efficiently.

[0404] A video encoding method according to one embodiment of the present disclosure may include the steps of performing boundary filtering on a template region located around a current block; identifying a first search template region and a second search template region corresponding to a template region within a search region within a current picture including the current block; performing boundary filtering on the first search template region and the second search template region; determining a search template region most similar to a filtered template region among the filtered first search template region and the filtered second search template region; determining a matching block corresponding to the current block based on the most similar search template region; performing boundary filtering on the matching block; and predicting the current block based on the filtered matching block.

[0405] A video encoding method according to one embodiment of the present disclosure can reduce overhead for information transmission by performing prediction without transmitting information about an intra prediction mode, and improve efficiency of prediction by removing discontinuity at boundaries between blocks within an area used for intra prediction.

[0406] According to one embodiment of the present disclosure, the template region may be an L-shaped region including at least one left reference sample located to the left of a current block, at least one upper-left reference sample located to the upper-left of the current block, and at least one upper reference sample located to the upper-left of the current block.

[0407] An image encoding method according to one embodiment of the present disclosure can perform intra prediction without transmitting information about an intra prediction mode by using surrounding reference samples close to a current block as a template region.

[0408] According to one embodiment of the present disclosure, the search area may include an encoded area within the current picture.

[0409] A video encoding method according to one embodiment of the present disclosure can improve the efficiency of intra prediction without transmitting information about an intra prediction mode by searching for an area most similar to a template area in an encoded area within a current picture including a current block.

[0410] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the size of the current block.

[0411] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the intra prediction mode of blocks within the search region.

[0412] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the number of blocks within the search area.

[0413] A video encoding method according to one embodiment of the present disclosure determines the strength of filtering according to the characteristics of a block by considering the size of a current block, the intra prediction mode of blocks within a search area, or the number of blocks within a search area, thereby effectively removing discontinuities at boundaries between blocks and improving the efficiency of intra prediction.

[0414] According to one embodiment of the present disclosure, a flag for whether boundary filtering is performed is generated, and whether boundary filtering is performed can be determined based on the generated flag for whether boundary filtering is performed.

[0415] A video encoding method according to one embodiment of the present disclosure removes discontinuities at the boundaries of blocks by performing filtering based on a flag indicating whether boundary filtering is performed, and overhead can also be reduced by transmitting a flag indicating whether boundary filtering of a small number of bits is performed without transmitting information about an intra prediction mode.

[0416] According to one embodiment of the present disclosure, an index indicating a filter type is generated, and the type of boundary filtering can be determined based on the generated index.

[0417] In an image encoding method according to one embodiment of the present disclosure, a filter type is determined based on an index, so that an appropriate filter is applied to effectively remove discontinuity, and overhead can also be reduced by transmitting an index indicating a filter type of a small number of bits without transmitting information about an intra prediction mode.

[0418] According to one embodiment of the present disclosure, the strength of boundary filtering for the template region, the strength of boundary filtering for the first search template region, the strength of boundary filtering for the second search template region, and the strength of boundary filtering for the matching block can each be independently determined.

[0419] In an image encoding method according to one embodiment of the present disclosure, the strength of filtering is independently determined according to the characteristics of each region to which boundary filtering is applied, so that discontinuity in each region can be effectively removed.

[0420] According to one embodiment of the present disclosure, the filtering strength of deblocking filtering for a current picture can be determined depending on whether boundary filtering is performed.

[0421] In an image encoding method according to one embodiment of the present disclosure, the filtering strength of the deblocking filtering is determined by considering the characteristics at the boundaries of blocks (i.e., whether there is a discontinuity at the boundaries of blocks) depending on whether boundary filtering is performed, so that the deblocking filtering can be performed more efficiently.

[0422] According to one embodiment, a video encoding device 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 perform boundary filtering on a template region located around a current block. The at least one processor may identify a first search template region and a second search template region corresponding to the template region within a search region within a current picture including the current block. The at least one processor may perform boundary filtering on the first search template region and the second search template region. The at least one processor may determine a search template region most similar to the filtered template region among the filtered first search template region and the filtered second search template region. The at least one processor may determine a matching block corresponding to the current block based on the most similar search template region. The at least one processor may perform boundary filtering on the matching block. The at least one processor may predict the current block based on the filtered matching block.

[0423] An image encoding device according to one embodiment of the present disclosure can reduce overhead for information transmission by performing prediction without transmitting information about an intra prediction mode, and improve efficiency of prediction by removing discontinuity at boundaries between blocks within an area used for intra prediction.

[0424] According to one embodiment of the present disclosure, the template region may be an L-shaped region including at least one left reference sample located to the left of a current block, at least one upper-left reference sample located to the upper-left of the current block, and at least one upper reference sample located to the upper-left of the current block.

[0425] An image encoding device according to one embodiment of the present disclosure can perform intra prediction without transmitting information about an intra prediction mode by using surrounding reference samples close to a current block as a template area.

[0426] According to one embodiment of the present disclosure, the search area may include an encoded area within the current picture.

[0427] An image encoding device according to one embodiment of the present disclosure can improve the efficiency of intra prediction without transmitting information about an intra prediction mode by searching for an area most similar to a template area in an encoded area within a current picture including a current block.

[0428] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the size of the current block.

[0429] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the intra prediction mode of blocks within the search region.

[0430] According to one embodiment of the present disclosure, the strength of boundary filtering can be determined based on the number of blocks within the search area.

[0431] An image encoding device according to one embodiment of the present disclosure determines the strength of filtering according to the characteristics of a block by considering the size of a current block, the intra prediction mode of blocks within a search area, or the number of blocks within a search area, thereby effectively removing discontinuities at boundaries between blocks and improving the efficiency of intra prediction.

[0432] According to one embodiment of the present disclosure, a flag for whether boundary filtering is performed is generated, and whether boundary filtering is performed can be determined based on the generated flag for whether boundary filtering is performed.

[0433] An image encoding device according to one embodiment of the present disclosure performs filtering by a flag indicating whether boundary filtering is performed, thereby removing discontinuities at the boundaries of blocks, and overhead can also be reduced by transmitting a flag indicating whether boundary filtering of a small number of bits is performed without transmitting information about an intra prediction mode.

[0434] According to one embodiment of the present disclosure, an index indicating a filter type is generated, and the type of boundary filtering can be determined based on the generated index.

[0435] An image encoding device according to one embodiment of the present disclosure effectively removes discontinuity by applying an appropriate filter by determining the filter type based on an index, and overhead can also be reduced by transmitting an index indicating a filter type of a small number of bits without transmitting information about an intra prediction mode.

[0436] According to one embodiment of the present disclosure, the strength of boundary filtering for the template region, the strength of boundary filtering for the first search template region, the strength of boundary filtering for the second search template region, and the strength of boundary filtering for the matching block can each be independently determined.

[0437] According to one embodiment of the present disclosure, a video encoding device can effectively remove discontinuity in each region by independently determining the strength of filtering according to the characteristics of each region to which boundary filtering is applied.

[0438] According to one embodiment of the present disclosure, the filtering strength of deblocking filtering for a current picture can be determined depending on whether boundary filtering is performed.

[0439] According to one embodiment of the present disclosure, a video encoding device determines the filtering strength of deblocking filtering by considering the characteristics at the boundaries of blocks (i.e., whether there is discontinuity at the boundaries of blocks) depending on whether boundary filtering is performed, thereby performing deblocking filtering more efficiently.

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

[0441] 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 of performing boundary filtering on a template area located around the current block (S2710); A step of checking a first search template area and a second search template area corresponding to the template area within a search area within the current picture including the current block (S2720); A step of performing boundary filtering on the first search template area and the second search template area (S2730); A step of determining a search template area most similar to the filtered template area among the filtered first search template area and the filtered second search template area (S2740); A step of determining a matching block corresponding to the current block based on the most similar search template area (S2750); A step of performing boundary filtering on the above matching block (S2760); and An image decoding method, comprising a step of predicting (S2770) the current block based on the filtered matching block.

2. In paragraph 1, A method for decoding an image, wherein the template region is an L-shaped region including at least one left reference sample located to the left of the current block, at least one upper left reference sample located to the upper left of the current block, and at least one upper reference sample located to the upper side of the current block.

3. In paragraph 1 or 2, A method for decoding an image, wherein the search area includes a restored area within the current picture.

4. In any one of paragraphs 1 to 3, A method for decoding an image, wherein the strength of the boundary filtering is determined based on the size of the current block.

5. In any one of paragraphs 1 to 3, A method for decoding an image, wherein the strength of the boundary filtering is determined based on the intra prediction mode of blocks within the search area.

6. In any one of paragraphs 1 to 3, A method for decoding an image, wherein the strength of the boundary filtering is determined based on the number of blocks within the search area.

7. In any one of paragraphs 1 to 6, A method for decoding an image, wherein whether to perform the above boundary filtering is determined based on a flag for whether to perform boundary filtering obtained from a bitstream.

8. In any one of paragraphs 1 to 7, A method for decoding an image, wherein the type of the above boundary filtering is determined based on an index indicating the type of filter obtained from a bitstream.

9. In any one of paragraphs 1 to 8, A method for decoding an image, wherein the strength of the boundary filtering for the template region, the strength of the boundary filtering for the first search template region, the strength of the boundary filtering for the second search template region, and the strength of the boundary filtering for the matching block are each independently determined.

10. In any one of paragraphs 1 to 9, A video decoding method, wherein the filtering strength of deblocking filtering for the current picture is determined depending on whether the boundary filtering is performed.

11. A step of performing boundary filtering on a template area located around the current block (S2910); A step of checking a first search template area and a second search template area corresponding to the template area within a search area within the current picture including the current block (S2920); A step of performing boundary filtering on the first search template area and the second search template area (S2930); A step of determining a search template area most similar to the filtered template area among the filtered first search template area and the filtered second search template area (S2940); A step of determining a matching block corresponding to the current block based on the most similar search template area (S2950); A step of performing boundary filtering on the above matching block (S2960); and An image encoding method, comprising a step of predicting (S2970) the current block based on the filtered matching block.

12. In paragraph 11, A method for encoding an image, wherein the template region is an L-shaped region including at least one left reference sample located on the left side of the current block, at least one upper left reference sample located on the upper left side of the current block, and at least one upper reference sample located on the upper side of the current block.

13. In paragraph 11 or 12, A method for encoding an image, wherein the search area includes an encoded area within the current picture.

14. In any one of paragraphs 11 to 13, A method for encoding an image, wherein the strength of the boundary filtering is determined based on the size of the current block.

15. In any one of paragraphs 11 to 13, A method of encoding an image, wherein the strength of the boundary filtering is determined based on the intra prediction mode of blocks within the search area.

Citation Information

Patent Citations

  • Methods and apparatus for reduced complexity template matching prediction for video encoding and decoding

    KR1020120118457A

  • Video encoding method and apparatus, and decoding method and apparatus therefor

    KR1020180107082A

  • Camera module

    KR102323623B1

  • Method, device, and medium for video processing

    WO2022242645A1

Cited By

  • Adaptive filter for decoder-side intra mode derivation

    US20250024031A1