Apparatus and method for encoding and decoding image by using intra prediction

By employing gradient information to determine intra prediction modes and generating predictive blocks within the image encoding and decoding process, the method addresses performance and data efficiency challenges in existing technologies, resulting in improved predictive encoding and decoding with reduced bitstream size.

WO2025058213A1PCT designated stage expired Publication Date: 2025-03-20SAMSUNG ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2024/010379
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-04-16
Filing Date
2024-07-18
Publication Date
2025-03-20

AI Technical Summary

Technical Problem

Existing image encoding and decoding technologies face challenges in improving the performance of predictive encoding and decoding, reducing the data required for signaling intra prediction modes, and minimizing the bitstream size.

Method used

The method and device utilize gradient information to determine the intra prediction mode for each block, generating predictive blocks through intra prediction, and restoring the original blocks by combining predictive and residual blocks.

Benefits of technology

This approach enhances the performance of predictive encoding and decoding, reduces the data needed for signaling intra prediction modes, and minimizes the bitstream size, thereby improving overall image processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2024010379_20032025_PF_FP_ABST
    Figure KR2024010379_20032025_PF_FP_ABST
Patent Text Reader

Abstract

A method for decoding an image, according to an embodiment, may comprise the steps of: acquiring gradient information satisfying a predetermined condition from a plurality of previous blocks decoded before the current block; generating gradient information of the current block by using the acquired gradient information; inducing an intra prediction mode of the current block on the basis of the gradient information of the current block; and generating a prediction block of the current block by performing intra prediction on the current block by using the induced intra prediction mode.
Need to check novelty before this filing date? Find Prior Art

Description

Device and method for encoding and decoding images using intra prediction

[0001] The present disclosure relates to the field of image encoding and decoding, and more particularly, to a device and method for encoding and decoding an image using intra prediction.

[0002] In image encoding and decoding, the image is divided into blocks, and each block can be predicted and decoded through inter prediction or intra prediction.

[0003] Inter prediction is a technique for compressing images by removing temporal redundancy between images. Inter prediction allows blocks in the current image to be predicted using a reference image. The reference block most similar to the current block can be searched within a predetermined search range within the reference image. The current block is predicted based on the reference block, and the predicted block generated as a result of the prediction is subtracted from the current block to generate a residual block.

[0004] Standards such as H.264 AVC (Advanced Video Coding) and HEVC (High Efficiency Video Coding) can use the motion vectors of previously encoded blocks adjacent to the current block or blocks included in a previously encoded image as motion vector predictors of the current block to predict the motion vector of the current block. The motion vector difference, which is the difference between the motion vector of the current block and the motion vector predictor, can be signaled to the decoder side through a predetermined method.

[0005] Intra prediction is a technique for compressing images by removing spatial redundancy within the image. Intra prediction generates a predicted block based on the surrounding pixels of the current block, depending on the intra prediction mode. Then, the predicted block is subtracted from the current block to generate a residual block.

[0006] The residual block generated through inter-prediction or intra-prediction can be transformed and quantized and then passed to a decoder. The decoder can dequantize and inversely transform the residual block, and combine the predicted block of the current block with the residual block to reconstruct the current block. In certain cases, the decoder can filter the reconstructed current block to remove artifacts within it.

[0007] A method and device for encoding an image, and a method and device for decoding an image, according to one embodiment, aim to improve the performance of predictive encoding and predictive decoding for a current block.

[0008] A method and device for encoding an image according to one embodiment, and a method and device for decoding an image, aim to reduce the amount of data required for signaling an intra prediction mode.

[0009] A method and device for encoding an image according to one embodiment, and a method and device for decoding an image, have as their object the reduction of the bit rate of a bitstream.

[0010] The technical problems to be achieved through the present disclosure are not limited to the technical problems mentioned above, and other technical problems not mentioned will be clearly understood by a person having ordinary skill in the technical field to which the present disclosure pertains from the description below.

[0011] A method for decoding an image according to one embodiment may include a step of obtaining gradient information satisfying a predetermined condition from a plurality of previous blocks decoded prior to a current block. Here, the gradient information may include a first value corresponding to at least one intra prediction mode and a second value corresponding to the intensity of the first value.

[0012] A method for decoding an image according to one embodiment may include a step of generating gradient information of a current block using acquired gradient information.

[0013] A method of decoding an image according to one embodiment may include a step of deriving an intra prediction mode of a current block based on gradient information of the current block.

[0014] A method of decoding an image according to one embodiment may include a step of generating a prediction block of a current block by performing intra prediction on the current block using an induced intra prediction mode.

[0015] A method of decoding an image according to one embodiment may include a step of restoring a current block using a prediction block.

[0016] An image decryption device according to one embodiment may include at least one memory storing at least one instruction; and at least one processor operating according to at least one instruction.

[0017] In one embodiment, at least one processor may obtain gradient information satisfying a predetermined condition from a plurality of previous blocks decrypted prior to the current block. Here, the gradient information may include a first value corresponding to at least one intra prediction mode and a second value corresponding to the intensity of the first value.

[0018] In one embodiment, at least one processor can generate gradient information of a current block using the acquired gradient information.

[0019] In one embodiment, at least one processor can derive an intra prediction mode of a current block based on gradient information of the current block.

[0020] In one embodiment, at least one processor can generate a predicted block of the current block by performing intra prediction on the current block using the derived intra prediction mode.

[0021] In one embodiment, at least one processor can reconstruct the current block using the predicted block.

[0022] A method for encoding an image according to one embodiment may include a step of obtaining gradient information satisfying a predetermined condition from a plurality of previous blocks encoded prior to a current block. Here, the gradient information may include a first value corresponding to at least one intra prediction mode and a second value corresponding to the intensity of the first value.

[0023] A method of encoding an image according to one embodiment may include a step of generating gradient information of a current block using acquired gradient information.

[0024] A method of encoding an image according to one embodiment may include a step of deriving an intra prediction mode of a current block based on gradient information of the current block.

[0025] A method of encoding an image according to one embodiment may include a step of generating a prediction block of a current block by performing intra prediction on the current block using an derived intra prediction mode.

[0026] A method of encoding an image according to one embodiment may include a step of encoding a current block using a prediction block.

[0027] An image encoding device according to one embodiment may include at least one memory storing at least one instruction; and at least one processor operating according to at least one instruction.

[0028] In one embodiment, at least one processor may obtain gradient information satisfying a predetermined condition from a plurality of previous blocks encoded prior to the current block. Here, the gradient information may include a first value corresponding to at least one intra prediction mode and a second value corresponding to the intensity of the first value.

[0029] In one embodiment, at least one processor can generate gradient information of a current block using the acquired gradient information.

[0030] In one embodiment, at least one processor can derive an intra prediction mode of a current block based on gradient information of the current block.

[0031] In one embodiment, at least one processor can generate a predicted block of the current block by performing intra prediction on the current block using the derived intra prediction mode.

[0032] In one embodiment, at least one processor may encode a current block using a prediction block.

[0033] In a computer-readable recording medium having recorded thereon a bitstream according to one embodiment, the bitstream may include an encoding result of a current block.

[0034] In one embodiment, the encoding result of the current block may be generated by obtaining gradient information satisfying a predetermined condition from a plurality of previous blocks encoded prior to the current block. Here, the gradient information may include a first value corresponding to at least one intra prediction mode and a second value corresponding to the intensity of the first value.

[0035] In one embodiment, the encoding result of the current block can be generated by generating gradient information of the current block using the acquired gradient information.

[0036] In one embodiment, the encoding result of the current block can be generated by deriving an intra prediction mode of the current block based on gradient information of the current block.

[0037] In one embodiment, the encoding result of the current block can be generated by generating a prediction block of the current block by performing intra prediction on the current block using the derived intra prediction mode.

[0038] In one embodiment, the encoding result of the current block can be generated by encoding the current block using a prediction block.

[0039] A method and device for encoding an image, and a method and device for decoding an image, according to one embodiment, can improve the performance of predictive encoding and predictive decoding for a current block.

[0040] A method and device for encoding an image, and a method and device for decoding an image, according to one embodiment, can reduce the amount of data required for signaling an intra prediction mode.

[0041] A method and device for encoding an image according to one embodiment, and a method and device for decoding an image, can reduce the bit rate of a bitstream.

[0042] The effects that can be obtained from the present disclosure are not limited to the effects mentioned above, and other effects that are not mentioned can be clearly understood by a person having ordinary skill in the art to which the present disclosure belongs from the description below.

[0043] FIG. 1 is a block diagram of an image decoding device according to one embodiment.

[0044] FIG. 2 is a block diagram of an image encoding device according to one embodiment.

[0045] FIG. 3 illustrates a process of dividing a current encoding unit to determine at least one encoding unit according to one embodiment.

[0046] FIG. 4 illustrates a process of dividing a non-square coding unit to determine at least one coding unit according to one embodiment.

[0047] FIG. 5 illustrates a process of dividing an encoding unit based on at least one of block shape information and segmentation shape mode information according to one embodiment.

[0048] FIG. 6 illustrates a method for determining a predetermined coding unit among an odd number of coding units according to one embodiment.

[0049] FIG. 7 illustrates the order in which multiple encoding units are processed when a current encoding unit is divided to determine multiple encoding units according to one embodiment.

[0050] FIG. 8 illustrates a process for determining that a current encoding unit is split into an odd number of encoding units when encoding units cannot be processed in a predetermined order according to one embodiment.

[0051] FIG. 9 illustrates a process of dividing a first encoding unit to determine at least one encoding unit according to one embodiment.

[0052] FIG. 10 illustrates that, according to one embodiment, the shapes into which a first encoding unit can be divided are limited when a second encoding unit of a non-square shape determined by splitting the first encoding unit satisfies a predetermined condition.

[0053] FIG. 11 illustrates a process of splitting a square-shaped encoding unit when the split shape mode information cannot represent splitting into four square-shaped encoding units according to one embodiment.

[0054] FIG. 12 illustrates that, according to one embodiment, the processing order between multiple encoding units may vary depending on the process of splitting the encoding units.

[0055] 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 split to determine a plurality of encoding units according to one embodiment.

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

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

[0058] FIG. 16 illustrates encoding units that can be determined for each picture when the combination of forms into which encoding units can be divided is different for each picture according to one embodiment.

[0059] FIG. 17 illustrates various forms of encoding units that can be determined based on segmentation form mode information expressed in binary code according to one embodiment.

[0060] FIG. 18 illustrates another form of a coding unit that can be determined based on segmentation mode information expressed in binary code according to one embodiment.

[0061] FIG. 19 is a block diagram of an image encoding and decoding system that performs loop filtering according to one embodiment.

[0062] Fig. 20 is a block diagram illustrating a configuration of an image decoding device according to one embodiment.

[0063] FIG. 21 is a diagram illustrating an intra prediction mode according to one embodiment.

[0064] Figure 22 is a flowchart of an image decoding method according to one embodiment.

[0065] Figure 23 is a drawing illustrating a gradient calculation method according to one embodiment.

[0066] Fig. 24 is a drawing illustrating a gradient calculation method according to one embodiment.

[0067] FIG. 25 is a diagram illustrating a method for generating gradient information according to one embodiment.

[0068] FIG. 26 is a diagram illustrating a method for deriving an intra prediction mode from a surrounding block according to one embodiment.

[0069] FIG. 27 is a diagram for explaining a process of generating an intra prediction sample according to one embodiment.

[0070] Fig. 28 is a diagram for explaining a method for adaptively determining weights according to one embodiment.

[0071] FIG. 29 is a diagram for explaining a method of storing gradient information according to one embodiment.

[0072] FIG. 30 is a diagram for explaining a method of generating gradient information of a current block using gradient information of a previous block according to one embodiment.

[0073] FIG. 31 is a diagram for explaining a method of generating gradient information of a current block using gradient information of a previous block according to one embodiment.

[0074] FIG. 32 is a diagram for explaining an intra prediction method that refers to gradient information of a previous block according to one embodiment.

[0075] FIG. 33 is a diagram for explaining a method of generating gradient information of a current block using gradient information of a previous block according to one embodiment.

[0076] FIG. 34 is a diagram for explaining a method of generating gradient information of a current block using gradient information of a previous block according to one embodiment.

[0077] FIG. 35 is a diagram illustrating the locations of spatial and temporal surrounding blocks according to one embodiment.

[0078] FIG. 36 is a diagram for explaining a method of referencing gradient information in inter mode according to one embodiment.

[0079] FIG. 37 is a diagram illustrating the locations of surrounding blocks used for intra prediction according to one embodiment.

[0080] FIG. 38 is a diagram illustrating an intra prediction method of a chroma block according to one embodiment.

[0081] Figure 39 is a flowchart of an image decoding method according to one embodiment.

[0082] Fig. 40 is a block diagram illustrating a configuration of an image encoding device according to one embodiment.

[0083] Figure 41 is a flowchart of an image encoding method according to one embodiment.

[0084] A method for decoding an image according to one embodiment may include a step of obtaining gradient information satisfying a predetermined condition from a plurality of previous blocks decoded prior to a current block. Here, the gradient information may include a first value corresponding to at least one intra prediction mode and a second value corresponding to the intensity of the first value.

[0085] A method for decoding an image according to one embodiment may include a step of generating gradient information of a current block using acquired gradient information.

[0086] A method of decoding an image according to one embodiment may include a step of deriving an intra prediction mode of a current block based on gradient information of the current block.

[0087] A method of decoding an image according to one embodiment may include a step of generating a prediction block of a current block by performing intra prediction on the current block using an induced intra prediction mode.

[0088] A method of decoding an image according to one embodiment may include a step of restoring a current block using a prediction block.

[0089] The present disclosure may be subject to various modifications and various embodiments. Examples are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the embodiments of the present disclosure, and the present disclosure may include all modifications, equivalents, and alternatives that fall within the spirit and technical scope of the various embodiments.

[0090] When describing embodiments, detailed descriptions of related known technologies may be omitted if they are deemed to unnecessarily obscure the gist of the present disclosure. Furthermore, numbers (e.g., "first," "second," etc.) used in the description of embodiments may correspond to identification symbols used to distinguish one component from another.

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

[0092] In the present disclosure, when a component is referred to as being “connected” or “connected” to another component, the component may be directly connected or connected to the other component, but unless there is a specific description to the contrary, the component may also be connected or connected via another component in between.

[0093] In the present disclosure, components expressed as "units", "modules", etc. may be two or more components combined into a single component, or a single component may be divided into two or more more detailed components. In addition, each component described below may additionally perform some or all of the functions performed by other components in addition to its own main function, and some of the main functions performed by each component may be exclusively performed by other components.

[0094] In the present disclosure, 'image' may refer to a picture, a still image, a frame, a moving image composed of a plurality of consecutive still images, or a video.

[0095] In this disclosure, "sample" may refer to data assigned to a sampling location in an image and thus to be processed. For example, a pixel within a frame in a spatial domain may correspond to a sample. A unit containing multiple samples may be defined as a block.

[0096] In the present disclosure, entropy decoding for a block or unit may mean a process of obtaining a syntax element of the block or unit from a bitstream (or bits included in the bitstream), or a process of obtaining an empty string corresponding to the syntax element.

[0097] In the present disclosure, entropy encoding for a block or unit may mean a process of generating a bitstream (or bits constituting a bitstream) from a syntax element of a block or unit, or a process of generating a bitstream (or bits constituting a bitstream) from an empty string corresponding to a syntax element.

[0098] Hereinafter, with reference to FIGS. 1 to 19, an image encoding method and device based on a tree-structured encoding unit and a transformation unit according to one embodiment, and an image decoding method and device are disclosed.

[0099] FIG. 1 illustrates a block diagram of an image decoding device (100) according to one embodiment.

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

[0101] The bitstream acquisition unit (110) can receive a bitstream. The bitstream includes information obtained by encoding an image by an image encoding device (200) described below. In addition, the bitstream can be transmitted from the image encoding device (200). The image encoding device (200) and the image decoding device (100) can be connected by wire or wirelessly, and the bitstream acquisition unit (110) can receive the bitstream by wire or wirelessly. The bitstream acquisition unit (110) can receive the bitstream from a storage medium such as an optical medium, a hard disk, etc. 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.

[0102] To describe in detail the operation of the video decoding device (100), the bitstream acquisition unit (110) can receive a bitstream.

[0103] The image decoding device (100) may perform an operation of obtaining a binstring corresponding to a splitting shape mode of an encoding unit from a bitstream. In addition, the image decoding device (100) may perform an operation of determining a splitting rule of the encoding unit. In addition, the image decoding device (100) may perform an operation 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.

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

[0105] First, a picture can be divided into one or more slices or one or more tiles. A slice or a tile can be a sequence of one or more maximum coding tree units (CTUs). Depending on the implementation, a slice may include one or more tiles, and a slice may include one or more maximum coding units. A slice including one or more tiles can be determined within a picture.

[0106] The concept of a maximum coding block (Coding Tree Block; CTB) contrasts with a maximum coding unit (CTU). A maximum coding block (CTB) is an NxN block containing NxN samples (N is an integer). Each color component can be divided into one or more maximum coding blocks.

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

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

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

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

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

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

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

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

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

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

[0117] 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 will be binary / ternary split.

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

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

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

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

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

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

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

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

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

[0127] FIG. 3 illustrates a process in which an image decoding device (100) divides a current encoding unit to determine at least one encoding unit according to one embodiment.

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

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

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

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

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

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

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

[0135] FIG. 4 illustrates a process in which an image decoding device (100) divides a non-square coding unit to determine at least one coding unit according to one embodiment.

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

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

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

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

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

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

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

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

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

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

[0146] 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 non-square third coding unit (520c), 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 non-square fourth coding unit (530b or 530d), 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.

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

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

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

[0150] FIG. 6 illustrates a method for an image decoding device (100) to determine a predetermined encoding unit among an odd number of encoding units according to one embodiment.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0170] FIG. 7 illustrates the order in which multiple encoding units are processed when an image decoding device (100) divides a current encoding unit to determine multiple encoding units according to one embodiment.

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

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

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

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

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

[0176] FIG. 8 illustrates a process for 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 invention.

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

[0178] According to one embodiment, the image decoding device (100) can determine whether there is an odd number of split encoding units by determining whether the third encoding 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 encoding units (820a, 820b, 820c, 820d, 820e) by recursively splitting the first encoding 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.

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

[0180] FIG. 9 illustrates a process in which an image decoding device (100) divides a first encoding unit (900) to determine at least one encoding unit according to one embodiment.

[0181] According to one embodiment, the image decoding device (100) may split the first coding unit (900) based on the split shape mode information acquired through the bitstream acquisition unit (110). The first coding unit (900) having a square shape may be split into four coding units having a square shape or may be split into a plurality of coding units having a non-square shape. For example, referring to FIG. 9, when the first coding unit (900) is square and the split shape mode information indicates that it is split into non-square coding units, the image decoding device (100) may split the first coding unit (900) into a plurality of non-square coding units. Specifically, when the split shape mode information indicates that 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.

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

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

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

[0185] FIG. 10 illustrates that, according to one embodiment, a video decoding device (100) limits the shapes into which a second encoding unit can be divided when a non-square shape of a second encoding unit determined by splitting a first encoding unit (1000) satisfies a predetermined condition.

[0186] 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 acquired through the bitstream acquisition unit (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.

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

[0188] FIG. 11 illustrates a process in which an image decoding device (100) divides 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.

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

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

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

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

[0193] FIG. 12 illustrates that, according to one embodiment, the processing order between multiple encoding units may vary depending on the process of dividing the encoding units.

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

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

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

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

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

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

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

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

[0202] In 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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0220] FIG. 15 illustrates that a plurality of encoding units are determined according to a plurality of predetermined data units included in a picture according to one embodiment.

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

[0222] In one embodiment, the reference data unit may exhibit a predetermined size and shape. In one embodiment, the reference data 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.

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

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

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

[0226] According to one embodiment, the bitstream acquisition unit (110) of the image decoding device (100) can acquire 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.

[0227] 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 bitstream acquisition unit (110) may acquire 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.

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

[0229] 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 and each reference encoding unit.

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

[0231] 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 (200). 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.

[0232] 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 (200) 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 (200).

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

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

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

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

[0237] Determining the splitting rule based on the size of the encoding unit may be a splitting rule predetermined between the image encoding device (200) 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.

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

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

[0240] FIG. 16 illustrates encoding units that can be determined for each picture when the combination of forms into which encoding units can be divided is different for each picture according to one embodiment.

[0241] Referring to FIG. 16, the image decoding device (100) can determine a different combination of partitioning shapes into which encoding units can be partitioned for each picture. For example, the image decoding device (100) can decode an image using a picture (1600) that can be partitioned into four encoding units, a picture (1610) that can be partitioned into two or four encoding units, and a picture (1620) that can be partitioned into two, three, or four encoding units, among at least one picture included in the image. The image decoding device (100) can only use partitioning shape information indicating that the picture (1600) is partitioned into four square encoding units to partition the picture (1600) into a plurality of encoding units. The image decoding device (100) can only use partitioning shape information indicating that the picture (1610) is partitioned into two or four encoding units to partition the picture. The video decoding device (100) can only use the segmentation type information indicating that the picture (1620) is segmented into two, three, or four encoding units. The above-described combination of segmentation types is merely an example for explaining the operation of the video decoding device (100), and therefore the above-described combination of segmentation types should not be interpreted as being limited to the above-described example, but should be interpreted as being capable of using various combinations of segmentation types for each predetermined data unit.

[0242] According to one embodiment, the bitstream acquisition unit (110) of the image decoding device (100) can acquire a bitstream including an index indicating a combination of segmentation type information for each predetermined data unit (e.g., sequence, picture, slice, slice segment, tile, tile group, etc.). For example, the bitstream acquisition unit (110) can acquire an index indicating a combination of segmentation type information from a sequence parameter set, a picture parameter set, a slice header, a tile header, or a tile group header. The image decoding device (100) of the image decoding device (100) can determine a combination of segmentation types by which an encoding unit can be divided for each predetermined data unit using the acquired index, and thus can use different combinations of segmentation types for each predetermined data unit.

[0243] FIG. 17 illustrates various forms of encoding units that can be determined based on segmentation mode information that can be expressed in binary code according to one embodiment.

[0244] According to one embodiment, the image decoding device (100) can split an encoding unit into various shapes using block shape information and split shape mode information acquired through the bitstream acquisition unit (110). The shapes of the encoding unit that can be split may correspond to various shapes including the shapes described through the above-described embodiments.

[0245] Referring to FIG. 17, the image decoding device (100) can split a square-shaped encoding unit in at least one of the horizontal direction and the vertical direction based on the split shape mode information, and can split a non-square-shaped encoding unit in the horizontal direction or the vertical direction.

[0246] According to one embodiment, when the image decoding device (100) can divide a square-shaped encoding unit into four square encoding units by horizontally and vertically splitting the encoding unit, there may be four types of splitting modes that the splitting mode information for the square encoding unit can indicate. According to one embodiment, the splitting mode information may be expressed as a two-digit binary code, and a binary code may be assigned to each splitting mode. For example, when the encoding unit is not split, the splitting mode information may be expressed as (00)b, when the encoding unit is split in the horizontal direction and the vertical direction, the splitting mode information may be expressed as (01)b, when the encoding unit is split in the horizontal direction, the splitting mode information may be expressed as (10)b, and when the encoding unit is split in the vertical direction, the splitting mode information may be expressed as (11)b.

[0247] According to one embodiment, when the image decoding device (100) splits a non-square coding unit in a horizontal direction or a vertical direction, the type of split shape that the split shape mode information can indicate may be determined depending on the number of coding units into which the coding unit is split. Referring to FIG. 17, the image decoding device (100) may split a non-square coding unit into up to three according to one embodiment. The image decoding device (100) may split the coding unit into two coding units, in which case the split shape mode information may be expressed as (10)b. The image decoding device (100) may split the coding unit into three coding units, in which case the split shape mode information may be expressed as (11)b. The image decoding device (100) may determine not to split the coding unit, in which case the split shape mode information may be expressed as (0)b. That is, the image decoding device (100) can use variable length coding (VLC) rather than fixed length coding (FLC) to use a binary code representing segmentation mode information.

[0248] According to one embodiment, referring to FIG. 17, the binary code of the partition shape mode information indicating that the coding unit is not split may be expressed as (0)b. If the binary code of the partition shape mode information indicating that the coding unit is not split is set to (00)b, all binary codes of the 2-bit partition shape mode information must be used even if there is no partition shape mode information set to (01)b. However, as illustrated in FIG. 17, if three partition shapes for a non-square coding unit are used, the image decoding device (100) can determine that the coding unit is not split even if it uses a 1-bit binary code (0)b as the partition shape mode information, and thus can efficiently use the bitstream. However, the partition shapes of the non-square coding unit indicated by the partition shape mode information should not be interpreted as being limited to only the three shapes illustrated in FIG. 17, but should be interpreted as various shapes including the above-described embodiments.

[0249] FIG. 18 illustrates another form of a coding unit that can be determined based on segmentation mode information that can be expressed in binary code according to one embodiment.

[0250] Referring to FIG. 18, the image decoding device (100) can split a square-shaped encoding unit in the horizontal direction or the vertical direction based on the split shape mode information, and can split a non-square-shaped encoding unit in the horizontal direction or the vertical direction. That is, the split shape mode information can indicate that a square-shaped encoding unit is split in one direction. In this case, the binary code of the split shape mode information indicating that a square-shaped encoding unit is not split can be expressed as (0)b. If the binary code of the split shape mode information indicating that the encoding unit is not split is set to (00)b, all binary codes of the 2-bit split shape mode information must be used even though there is no split shape mode information set to (01)b. However, as illustrated in FIG. 18, if three types of division forms for a square-shaped encoding unit are used, the image decoding device (100) can determine that the encoding unit is not divided even if it uses a 1-bit binary code (0)b as the division form mode information, and thus can efficiently use the bitstream. However, the division forms of the square-shaped encoding unit indicated by the division form mode information should not be interpreted as being limited to only the three types illustrated in FIG. 18, but should be interpreted as various types including the embodiments described above.

[0251] In one embodiment, block shape information or segmentation shape mode information may be expressed using binary code, and such information may be directly generated as a bitstream. Furthermore, block shape information or segmentation shape mode information that may be expressed using binary code may not be directly generated as a bitstream, but may instead be used as a binary code input into CABAC (context adaptive binary arithmetic coding).

[0252] According to one embodiment, the image decoding device (100) describes a process of obtaining syntax for block shape information or segmentation shape mode information through CABAC. A bitstream including a binary code for the syntax can be obtained through a bitstream obtaining unit (110). The image decoding device (100) can detect a syntax element indicating block shape information or segmentation shape mode information by de-binarizing a bin string included in the obtained bitstream. According to one embodiment, the image decoding device (100) can obtain a set of binary bin strings corresponding to syntax elements to be decoded, and decode each bin using probability information, and the image decoding device (100) can repeat the process until a bin string composed of the decoded bins becomes equal to one of the previously obtained bin strings. The image decoding device (100) can determine syntax elements by performing inverse binarization of an empty string.

[0253] According to one embodiment, the image decoding device (100) may perform a decoding process of adaptive binary arithmetic coding to determine a syntax for a bin string, and the image decoding device (100) may update a probability model for bins acquired through the bitstream acquisition unit (110). Referring to FIG. 17, the bitstream acquisition unit (110) of the image decoding device (100) may acquire a bitstream representing a binary code representing segmentation mode information according to one embodiment. Using the acquired binary code having a size of 1 or 2 bits, the image decoding device (100) may determine a syntax for the segmentation mode information. In order to determine the syntax for the segmentation mode information, the image decoding device (100) may update a probability for each bit of the 2-bit binary code. That is, the image decoding device (100) can update the probability of having a value of 0 or 1 when decoding the next bin, depending on whether the value of the first bin among the 2-bit binary codes is 0 or 1.

[0254] According to one embodiment, the image decoding device (100) may, in the process of determining the syntax, update the probability for the bins used in the process of decoding the bins of the empty string for the syntax, and the image decoding device (100) may determine that certain bits among the empty strings have the same probability without updating the probability.

[0255] Referring to FIG. 17, in the process of determining a syntax using an empty string indicating split shape mode information for a non-square coding unit, the image decoding device (100) may determine the syntax for the split shape mode information using one bin having a value of 0 when the non-square coding unit is not split. That is, when the block shape information indicates that the current coding unit is a non-square shape, the first bin of the empty string for the split shape mode information may be 0 when the non-square coding unit is not split, and may be 1 when it is split into 2 or 3 coding units. Accordingly, the probability that the first bin of the empty string of the split shape mode information for the non-square coding unit is 0 may be 1 / 3, and the probability that it is 1 may be 2 / 3. As described above, the image decoding device (100) can only express a 1-bit empty string having a value of 0 for the partition shape mode information indicating that a non-square-shaped encoding unit is not partitioned, so the image decoding device (100) can determine the syntax for the partition shape mode information by determining whether the second bin is 0 or 1 only when the first bin of the partition shape mode information is 1. According to one embodiment, the image decoding device (100) can decode the bin by considering that the probability that the second bin is 0 or 1 when the first bin for the partition shape mode information is 1 is the same probability.

[0256] According to one embodiment, the image decoding device (100) may use various probabilities for each bin in the process of determining a bin of a bin string for the partition shape mode information. According to one embodiment, the image decoding device (100) may determine the probability of a bin for the partition shape mode information differently depending on the direction of a non-square block. According to one embodiment, the image decoding device (100) may determine the probability of a bin for the partition shape mode information differently depending on the area or the length of the long side of the current encoding unit. According to one embodiment, the image decoding device (100) may determine the probability of a bin for the partition shape mode information differently depending on at least one of the shape and the length of the long side of the current encoding unit.

[0257] According to one embodiment, the image decoding device (100) may determine that the bin probability for the segmentation shape mode information is the same for encoding units of a predetermined size or larger. For example, the bin probability for the segmentation shape mode information may be determined to be the same for encoding units of a size of 64 samples or larger based on the length of the long side of the encoding unit.

[0258] According to one embodiment, the image decoding device (100) may determine the initial probability for bins constituting the empty string of the segmentation shape mode information based on the slice type (e.g., I slice, P slice, or B slice).

[0259] Figure 19 is a block diagram of an image encoding and decoding system that performs loop filtering.

[0260] The encoding unit (1910) of the image encoding and decoding system (1900) transmits an encoded bitstream of an image, and the decoding unit (1950) receives the bitstream and decodes it to output a restored image. Here, the encoding unit (1910) may have a configuration similar to that of the image encoding device (200) described below, and the decoding unit (1950) may have a configuration similar to that of the image decoding device (100).

[0261] In the encoding unit (1910), the prediction encoding unit (1915) outputs prediction data through inter prediction and intra prediction, and the transformation and quantization unit (1920) outputs quantized transformation coefficients of residual data between the prediction data and the current input image. The entropy encoding unit (1925) encodes and transforms the quantized transformation coefficients and outputs them as a bitstream. The quantized transformation coefficients are restored to spatial domain data through the inverse quantization and inverse transformation unit (1930), and the restored spatial domain data are output as a restored image through the deblocking filtering unit (1935) and the loop filtering unit (1940). The restored image can be used as a reference image of the next input image through the prediction encoding unit (1915).

[0262] The encoded image data among the bitstreams received by the decoding unit (1950) is restored to residual data in the spatial domain through the entropy decoding unit (1955) and the inverse quantization and inverse transformation unit (1960). The prediction data and residual data output from the prediction decoding unit (1975) are combined to form image data in the spatial domain, and the deblocking filtering unit (1965) and the loop filtering unit (1970) can perform filtering on the image data in the spatial domain to output a restored image for the current original image. The restored image can be used as a reference image for the next original image by the prediction decoding unit (1975).

[0263] The loop filtering unit (1940) of the encoding unit (1910) performs loop filtering using filter information input according to user input or system settings. The filter information used by the loop filtering unit (1940) is output to the entropy encoding unit (1925) and transmitted to the decoding unit (1950) together with the encoded image data. The loop filtering unit (1970) of the decoding unit (1950) can perform loop filtering based on the filter information input from the decoding unit (1950).

[0264] The various embodiments described above describe operations related to the image decoding method performed by the image decoding device (100). Hereinafter, the operations of the image encoding device (200), which performs the image encoding method corresponding to the reverse process of the image decoding method, will be described through various embodiments.

[0265] FIG. 2 illustrates a block diagram of an image encoding device (200) capable of encoding an image based on at least one of block shape information and segmentation shape mode information according to one embodiment.

[0266] The video encoding device (200) may include an encoding unit (220) and a bitstream generation unit (210). The encoding unit (220) may receive an input image and encode the input image. The encoding unit (220) may encode the input image to obtain at least one syntax element. The syntax element may include at least one of a skip flag, a prediction mode, a motion vector difference, a motion vector prediction method (or index), a transform quantized coefficient, a coded block pattern, a coded block flag, an intra prediction mode, a direct flag, a merge flag, a delta QP, a reference index, a prediction direction, and a transform index. The encoding unit (220) may determine a context model based on block shape information including at least one of a shape, a direction, a ratio of width and height, or a size of an encoding unit.

[0267] The bitstream generation unit (210) can generate a bitstream based on an encoded input image. For example, the bitstream generation unit (210) can generate a bitstream by entropy encoding syntax elements based on a context model. In addition, the image encoding device (200) can transmit the bitstream to the image decoding device (100).

[0268] According to one embodiment, the encoding unit (220) of the image encoding device (200) can determine the shape of an encoding unit. For example, the encoding unit may be square or have a non-square shape, and information indicating such shape may be included in the block shape information.

[0269] According to one embodiment, the encoding unit (220) can determine the shape into which the encoding unit is to be split. The encoding unit (220) can determine the shape of at least one encoding unit included in the encoding unit, and the bitstream generation unit (210) can generate a bitstream including split shape mode information including information about the shape of such encoding unit.

[0270] According to one embodiment, the encoder (220) may determine whether the encoding unit is split or not. If the encoder (220) determines that the encoding unit includes only one encoding unit or that the encoding unit is not split, the bitstream generation unit (210) may generate a bitstream including split shape mode information indicating that the encoding unit is not split. In addition, the encoder (220) may split the encoding unit into a plurality of encoding units, and the bitstream generation unit (210) may generate a bitstream including split shape mode information indicating that the encoding unit is split into a plurality of encoding units.

[0271] According to one embodiment, information indicating the number of encoding units to be split into or the direction in which the encoding unit is to be split may be included in the splitting mode information. For example, the splitting mode information may indicate splitting in at least one of the vertical and horizontal directions, or may indicate no splitting.

[0272] The video encoding device (200) determines information about the segmentation shape mode based on the segmentation shape mode of the encoding unit. The video encoding device (200) determines a context model based on at least one of the shape, direction, width, and height ratio or size of the encoding unit. Then, the video encoding device (200) generates information about the segmentation shape mode for segmenting the encoding unit based on the context model as a bitstream.

[0273] In order to determine a context model, the video encoding device (200) may obtain an array for matching at least one of the shape, direction, width and height ratio or size of the encoding unit with an index for the context model. The video encoding device (200) may obtain an index for the context model based on at least one of the shape, direction, width and height ratio or size of the encoding unit in the array. The video encoding device (200) may determine the context model based on the index for the context model.

[0274] The video encoding device (200) may further determine the context model based on block shape information including at least one of the shape, direction, width, and height ratio or size of a neighboring encoding unit adjacent to the encoding unit, in order to determine the context model. In addition, the neighboring encoding unit may include at least one of encoding units located on the lower left, left, upper left, upper right, right, or lower right of the encoding unit.

[0275] In addition, the video encoding device (200) may compare the length of the width of the upper peripheral encoding unit with the length of the width of the encoding unit to determine the context model. In addition, the video encoding device (200) may compare the length of the height of the left and right peripheral encoding units with the length of the height of the encoding unit. In addition, the video encoding device (200) may determine the context model based on the comparison results.

[0276] Since the operation of the video encoding device (200) includes similar contents to the operation of the video decoding device (100) described in FIGS. 3 to 19, a detailed description is omitted.

[0277] FIG. 20 is a block diagram illustrating the configuration of an image decoding device (2000) according to one embodiment.

[0278] Referring to FIG. 20, the image decoding device (2000) may include an acquisition unit (2010) and a prediction decoding unit (2030).

[0279] According to one embodiment, the acquisition unit (2010) and the prediction decoding unit (2030) may be implemented with at least one processor. In one embodiment, the acquisition unit (2010) and the prediction decoding unit (2030) may operate according to at least one instruction stored in at least one memory.

[0280] The image decoding device (2000) may include at least one memory for storing input / output data of the acquisition unit (2010) and the prediction decoding unit (2030). In addition, the image decoding device (2000) may include a memory control unit for controlling data input / output of at least one memory.

[0281] In one embodiment, the acquisition unit (2010) may correspond to the entropy decoding unit (1955) illustrated in FIG. 19, and the prediction decoding unit (2030) may correspond to the prediction decoding unit (1975) illustrated in FIG. 19.

[0282] The acquisition unit (2010) can acquire a bitstream generated as a result of encoding a picture. The bitstream can include an encoding result for a current block. The current block can be a maximum coding unit, coding unit, transformation unit, or prediction unit divided from the current picture to be decoded.

[0283] In one embodiment, the acquisition unit (2010) can receive a bitstream from an image encoding device over a network.

[0284] In one embodiment, the acquisition unit (2010) may acquire a bitstream from a data storage medium including a magnetic medium such as a hard disk, a floppy disk, and a magnetic tape, an optical recording medium such as a CD-ROM and a DVD, a magneto-optical medium such as a floptical disk, and the like.

[0285] The acquisition unit (2010) can acquire syntax elements for decoding a picture from a bitstream. Values ​​corresponding to the syntax elements can be included in the bitstream according to the hierarchical structure of the picture.

[0286] The acquisition unit (2010) can obtain syntax elements by entropy decoding the bins included in the bitstream.

[0287] In one embodiment, the bitstream may include information about the prediction mode of a current block within a current picture. The prediction mode of the current block may be any one of a plurality of prediction modes, including an intra mode and an inter mode.

[0288] The prediction decoding unit (2030) can perform intra prediction or inter prediction on the current block according to the prediction mode of the current block to generate a prediction block of the current block, and restore the current block using the prediction block.

[0289] In one embodiment, the acquisition unit (2010) can acquire information about the intra prediction mode of the current block from the bitstream when the prediction mode of the current block is the intra mode.

[0290] In one embodiment, information about the intra prediction mode of the current block may include information indicating a method for determining the intra prediction mode. In one embodiment, the method for determining the intra prediction mode may include a method for deriving the intra prediction mode on the decoder side or a method for determining the intra prediction mode using information obtained from the bitstream.

[0291] In one embodiment, information indicating how to determine the intra prediction mode may be included in a sequence parameter set, a picture parameter set, a slice header, or slice data of a bitstream. As an example, the slice data may include information signaled at the coding tree, coding unit, transform tree, or transform unit level.

[0292] In one embodiment, information indicating how to determine the intra prediction mode may not be included in the bitstream, in which case the prediction decoding unit (2030) may determine the intra prediction mode of the current block according to a predetermined method.

[0293] In one embodiment, if the method of determining the intra prediction mode is a method of using information obtained from a bitstream, the prediction decoding unit (2030) may determine an intra prediction mode indicated by information obtained from the bitstream among a plurality of intra prediction modes as the intra prediction mode of the current block. For example, information indicating the intra prediction mode of the current block may include a flag or index indicating any one of the plurality of intra prediction modes.

[0294] In one embodiment, the prediction decoding unit (2030) may derive the intra prediction mode of the current block based on a gradient derived from a surrounding area, if the intra prediction mode is determined by a decoder-side method. A method for deriving the intra prediction mode based on a gradient will be described in detail later with reference to FIGS. 22 to 38.

[0295] When a prediction block is generated through intra prediction for the current block, the prediction decoding unit (2030) can obtain a restored current block using the prediction block.

[0296] In one embodiment, the prediction decoding unit (2030) can determine the prediction block as the restored current block.

[0297] In one embodiment, the prediction decoding unit (2030) can generate a reconstructed current block by combining the residual data obtained from the bitstream by the acquisition unit (2010) and the prediction block.

[0298] FIG. 21 is a diagram illustrating an intra prediction mode according to one embodiment.

[0299] Referring to FIG. 21, intra prediction modes may be predefined in the video encoding device and video decoding device (2000). In the present disclosure, it is assumed that 67 intra prediction modes are defined. However, this is merely an example, and fewer intra prediction modes may be defined, or more intra prediction modes may be defined.

[0300] The predefined intra prediction modes can consist of two non-directional modes and 65 directional modes. The non-directional modes can include the planar mode and the DC mode. The directional modes can include modes 2 to 66 having predetermined angles.

[0301] In particular, mode 2, mode 34, and mode 66 can be defined as diagonal modes, and the intra prediction mode between mode 2 and mode 34 can be defined as a mode with horizontal directionality, and the intra prediction mode between mode 34 and mode 66 can be defined as a mode with vertical directionality, respectively. In addition, depending on the shape of the block, a mode smaller than mode 2 or a mode larger than mode 66 can be used for intra prediction. For example, depending on the ratio of the width and height of the block, a directional prediction mode smaller than mode 2 or larger than mode 66 can be used for intra prediction.

[0302] The more detailed the directional mode, i.e., the more prediction directions corresponding to the directional mode are added, the more diverse the predictor can be generated, resulting in more accurate predictions. However, this also increases the amount of information that must be transmitted. Therefore, from a rate-distortion performance perspective, there may be limitations to continuously adding intra-prediction modes. That is, the amount of information transmitted for intra-prediction modes may exceed the gains gained from reducing prediction error, reducing compression efficiency.

[0303] To overcome these limitations, a prediction method for directly deriving an intra prediction mode on the decoder side (i.e., an image decoding device (2000)) to reduce the overhead for transmitting intra mode information is described. In the present disclosure, the prediction method for deriving an intra prediction mode on the decoder side may be abbreviated as DIMD (Decoder-side intra mode derivation).

[0304] In recent video compression technology, methods for increasing the size of the accessible area of ​​reconstructed samples are being discussed. As the accessible area of ​​reconstructed samples increases, the video decoding device (2000) can effectively derive an intra-prediction mode based on information derived from the already reconstructed area. By generating a predictor by independently deriving the intra-prediction mode without signaling intra-prediction mode information in the video encoding device, the overhead associated with signaling can be reduced and compression efficiency can be improved.

[0305] Hereinafter, with reference to FIGS. 22 to 38, an intra prediction process for deriving an intra prediction mode on the image decoding device (2000) side will be described.

[0306] Figure 22 is a flowchart of an image decoding method according to one embodiment.

[0307] In step S2210, the image decoding device (2000) can derive an intra prediction mode of the current block based on a gradient between at least two samples belonging to a surrounding area of ​​the current block.

[0308] The image decoding device (2000) can calculate a gradient using at least two samples belonging to the surrounding area of ​​the current block. The image decoding device (2000) can accumulate the calculated gradients to generate gradient information. As an example, the intra prediction mode of the current block can be selected from among the intra prediction modes described above in FIG. 21.

[0309] DIMD is a technology for directly deriving an intra prediction mode in an image decoding device (2000). When the DIMD mode is applied to a current block, the image decoding device (2000) can derive an angular intra prediction mode in a reconstructed area around the current block. The angular intra prediction mode can be derived using gradient information constructed by collecting gradients at predefined locations within the reconstructed area around the current block.

[0310] A gradient may represent a variable calculated using at least two samples belonging to the surrounding area of ​​the current block. As an example, the gradient may include at least one of a horizontal gradient and a vertical gradient. In the present disclosure, the gradient may be referred to as a slope, a change amount, a directionality, a predicted directionality, etc. Furthermore, in the present disclosure, the gradient may also refer to gradient information obtained by accumulating calculated gradients.

[0311] The gradient information may include information about an intra prediction mode mapped to the calculated gradient and / or information about the amplitude (or intensity) of the intra prediction mode. In the present disclosure, the gradient information may be referred to as gradient intensity, gradient size, gradient amplitude, histogram of gradient (HoG), histogram, histogram intensity, histogram size, histogram amplitude, etc.

[0312] In one embodiment, the gradient between at least two samples within a surrounding area of ​​the current block may be obtained using a predefined filter. Additionally, gradient information of the current block may be generated based on the obtained gradient.

[0313] Specific embodiments of generating gradient information will be described with reference to FIGS. 23 to 26 and FIGS. 29 to 38.

[0314] In one embodiment, the image decoding device (2000) may derive an intra prediction mode based on the generated gradient information. As an example, the image decoding device (2000) may derive a plurality of intra prediction modes based on the gradient information. The maximum number of derived intra prediction modes may be predefined. For example, the maximum number may be defined as 2, 3, 4, 5, etc. For example, among the intra prediction modes included in the generated gradient information, a predetermined number of intra prediction modes in ascending order of amplitude may be derived as the intra prediction mode of the current block.

[0315] In step S2220, the image decoding device (2000) can generate a prediction block of the current block by performing intra prediction on the current block using the intra prediction mode.

[0316] The video decoding device (2000) can generate a predictor using the derived intra prediction mode. In the present disclosure, the predictor generated using the derived intra prediction mode in the video decoding device (2000) may be referred to as a prediction sample, a prediction block, a temporary prediction sample, a temporary prediction block, an initial prediction sample, or an initial prediction block.

[0317] The video decoding device (2000) can generate a final prediction block by weighting predictors generated by the derived intra prediction mode. For example, the video decoding device (2000) can generate a final prediction block by weighting predictors generated by the derived intra prediction mode and predictors generated by a predetermined intra prediction mode (e.g., planar mode). A specific embodiment of generating a final prediction block using a weighted sum of predictors is described with reference to FIGS. 27 and 28.

[0318] At step S2230, the image decoding device (2000) can restore the current block using the prediction block.

[0319] As an example, the image decoding device (2000) may determine a prediction block as the reconstructed current block. Alternatively, as an example, the image decoding device (2000) may combine residual data obtained from a bitstream with a prediction block to generate a reconstructed current block.

[0320] Figure 23 is a drawing illustrating a gradient calculation method according to one embodiment.

[0321] Referring to FIG. 23, a gradient can be calculated using pixels belonging to a surrounding area of ​​a current block (2300). In one embodiment, a template (2310) for generating gradient information can be defined within a restored area surrounding the current block (2300).

[0322] The template (2310) may include the left, upper left, and upper regions of the current block (2300). As an example, the template (2310) may be defined as an L-shaped region of three pixel lines adjacent to the current block (2300), as illustrated in FIG. 23. A gradient may be calculated using pixels belonging to the template (2310) in the surrounding region of the current block (2300). In one embodiment, the number of pixel lines that may be used as the template (2310) may vary.

[0323] In one embodiment, a gradient may be derived by filtering pixels belonging to a template (2310). In one embodiment, filtering may be performed on pixels within a 3x3 pixel area belonging to the template (2310). The pixel area to which filtering is applied may be referred to as a window.

[0324] As an example, a 3x3 Sobel filter may be applied to a window (2320). In the present disclosure, the case where the window (2320) is 3x3 is mainly described, but this is only an example and is not limited thereto. For example, the window (2320) may be defined in a size such as 2x2, 4x4, or 5x5.

[0325] In one embodiment, a window (2320) may be determined centered on pixels belonging to a central pixel line within a template (2310) of three pixel lines, and a gradient may be produced by applying filtering to the window (2320).

[0326] The gradient may include at least one of a horizontal gradient and a vertical gradient. An intra prediction mode may be determined based on the calculated gradient. An angle (or prediction direction) may be calculated based on the gradient, and the calculated angle may be mapped to the intra prediction mode having the closest or most similar angle. In other words, an intra prediction mode may be calculated from the gradient. Gradient information may be constructed using the intra prediction mode calculated from the gradient.

[0327] Fig. 24 is a drawing illustrating a gradient calculation method according to one embodiment.

[0328] Referring to Fig. 24, a Sobel filter may be used to obtain a gradient. As described above, the template (2310) of the current block (2300) may be composed of three pixel lines included in the left, upper, and upper-left regions of the current block (2300). That is, the template (2310) may be used as a reference region for deriving a gradient-based intra prediction mode.

[0329] In one embodiment, a Sobel filter may be applied to a 3x3 window (2320) within a template (2310). The Sobel filter may include at least one of a horizontal Sobel filter and a vertical Sobel filter. The Sobel filter may be applied to a 3x3 window (2320) centered on a pixel belonging to the central pixel line of the template (2310).

[0330] As an example, a horizontal Sobel filter and a vertical Sobel filter can be defined as shown in Fig. 24.

[0331] In one embodiment, when a vertical Sobel filter is applied to the template (2310), a horizontal gradient may be output. When a horizontal Sobel filter is applied to the template (2310), a vertical gradient may be output.

[0332] In one embodiment, a vertical Sobel filter may be applied to windows within a template (2310) so that horizontal gradients corresponding to each window may be output. In addition, a horizontal Sobel filter may be applied to windows within a template (2310) so that vertical gradients corresponding to each window may be output.

[0333] FIG. 25 is a diagram illustrating a method for generating gradient information according to one embodiment.

[0334] Referring to FIG. 25, the angle (or prediction direction) derived through filtering for the window (2320) can be mapped (or converted) to one of the predefined intra prediction modes. The angle derived from the gradient can be a texture angle or prediction direction of the window (2320). As an example, the intra prediction mode as described above in FIG. 21 can be derived from the gradient. That is, the angle derived through filtering for the window (2320) can be mapped to one of the 65 directional intra prediction modes.

[0335] In one embodiment, the intra prediction mode corresponding to the current window (2320) can be derived according to the description in the following mathematical expression 1.

[0336]

[0337] In mathematical expression 1, G hor represents the horizontal gradient of the current window (2320), and G ver represents the vertical gradient of the current window (2320). According to mathematical expression 1, the angle of the current window (2320) can be calculated using the horizontal gradient and the vertical gradient.

[0338] In one embodiment, an intra prediction mode corresponding to an angle adjacent to an angle calculated using Equation 1 may be derived (or mapped) to an intra prediction mode of the current window (2320).

[0339] In one embodiment, the intensity (or amplitude) for the intra prediction mode corresponding to the current window (2320) can be calculated based on the following mathematical expression 2.

[0340]

[0341] Referring to mathematical expression 2, the strength of the intra prediction mode can be calculated as the sum of the absolute values ​​for the horizontal gradient of the current window (2320) and the vertical gradient of the current window (2320).

[0342] In one embodiment, gradient information (2500) may be generated (or updated) based on an intra prediction mode and the intensity of the intra prediction mode. The gradient information (2500) may be generated by accumulating the intra prediction mode derived from the gradient and the amplitude (or intensity) corresponding to the intra prediction mode. In other words, the gradient information (2500) may be generated by summing the amplitudes for each intra prediction mode collected from the template (2310) based on the intra prediction mode.

[0343] In one embodiment, the gradient information may include at least one intra prediction mode and an amplitude corresponding to the at least one intra prediction mode.

[0344] Additionally, in one embodiment, the gradient information may include a first value corresponding to at least one intra prediction mode and a second value corresponding to a strength of the first value. Here, the first value may represent an angle (θ) or an intra prediction mode. The angle may be a prediction angle, a prediction direction, a texture angle, or a texture direction. The intra prediction mode may be mapped to the calculated angle (θ). The second value may represent a strength, an amplitude, or a size. The first value and the second value may be referred to as a first variable and a second variable, respectively.

[0345] Fig. 25 shows the gradient in the horizontal direction (G hor ) and vertical gradient (G ver ) induced by the angle (θ) (or predicted direction) and intensity (I θ ) is shown as an example, and the angle (θ) and intensity (I θ ) is an example of accumulated gradient information (2500).

[0346] In one embodiment, the x-axis of the gradient information (2500) may represent an angle (θ) or an intra prediction mode. Here, the angle may be a prediction angle, a prediction direction, a texture angle, or a texture direction. The intra prediction mode may be mapped to the calculated angle (θ). As an example, the angle (θ) may be calculated using the mathematical expression 1 described above.

[0347] The y-axis of the gradient information (2500) represents the angle (θ) or amplitude of the intra prediction mode. I of Fig. 25 θ can be a variable representing amplitude, intensity, or size.

[0348] As an example, angles (or intra prediction modes) at all pixel locations (pixel locations belonging to the central pixel line) within the template (2310) can be derived, and the intensity values ​​of the derived angles can be summed to obtain angle-specific amplitudes of the current block (2300).

[0349] In one embodiment, the angle derived from the window (2320) can be mapped to the intra prediction mode in the following manner. That is, the angle derived from the window (2320) can be mapped to the intra prediction mode according to the following mathematical expression 3 using θ derived based on the mathematical expression 1 described above.

[0350]

[0351] Referring to mathematical expression 3, it is assumed that the tanθ value is 41 / 32 according to the angle calculated from the window (2320). The tanθ value can be expressed as an integer as the variable intraPredAngle. Thereafter, the calculated intraPredAngle value can be mapped to the nearest value in the following Table 1. The intra prediction mode having the corresponding value can be determined as the intra prediction mode mapped to the angle calculated from the window (2320).

[0352]

[0353] Specifically, referring to Table 1, assuming that the intraPredAngle calculated in Equation 3 is 41, mode 68 having the intraPredAngle value closest to 41 can be determined as the intra prediction mode mapped to the angle of the current window (2320). That is, the intraPredAngle value calculated through Equation 3 can be matched to an adjacent intraPredAngle value, and the intra prediction mode having the corresponding intraPredAngle can be determined as the intra prediction mode mapped to the angle of the current window (2320).

[0354] A corresponding intra prediction mode for the entire window (2320) can be determined based on pixels belonging to the central pixel line in the template (2310), and the intensity of the corresponding intra prediction mode can be accumulated to generate / update gradient information.

[0355] FIG. 26 is a diagram illustrating a method for deriving an intra prediction mode from a surrounding block according to one embodiment.

[0356] Referring to FIG. 26, an intra prediction mode can be derived from the image decoding device (2000) using prediction information of surrounding blocks of the current block (2600). In other words, according to the DIMD process for the current block (2600), the intra prediction mode of the current block (2600) can be derived using prediction information of surrounding blocks. Here, the prediction information can include gradient information and / or DIMD mode information. Here, the DIMD mode can represent an intra prediction mode derived by DIMD.

[0357] In one embodiment, a method of performing a DIMD process using prediction information of surrounding blocks may be referred to as DIMD merge mode.

[0358] In one embodiment, when the DIMD merge mode is applied to the current block (2600), the intra prediction mode of the current block (2600) can be derived using prediction information stored in surrounding blocks. For example, the merged gradient information for the current block (2600) can be derived by combining (or averaging) gradient information obtained from surrounding blocks.

[0359] Alternatively, in one embodiment, when the DIMD merge mode is applied to the current block (2600), the image decoding device (2000) can derive the DIMD mode of the surrounding block as the intra prediction mode for the current block (2600).

[0360] In one embodiment, the DIMD merge mode may be allowed only when there is at least one DIMD block (or DIMD merge block) among the neighboring blocks adjacent to the current block (2600). As an example, the neighboring blocks adjacent to the current block (2600) may be defined as the left and upper blocks. However, the present invention is not limited thereto, and blocks in other locations may also be defined as neighboring blocks. In the present disclosure, a DIMD block represents a block encoded with DIMD, and a DIMD merge block represents a block encoded with the DIMD merge mode.

[0361] In one embodiment, if DIMD merge mode is available, a flag or index indicating whether DIMD merge mode should be applied may be signaled. If DIMD merge is applied, the process of obtaining gradient information from the template (2310) described above in FIGS. 23 to 25 may be omitted.

[0362] FIG. 27 is a diagram for explaining a process of generating an intra prediction sample according to one embodiment.

[0363] Referring to FIG. 27, the image decoding device (2000) can derive the intra prediction mode of the current block (2700) using the method described above in FIGS. 22 to 26. In FIG. 27, it is assumed that the current block (2700) has a size of 4x4.

[0364] In one embodiment, the maximum number of derived intra prediction modes may be predefined. For example, the maximum number may be defined as 2, 3, 4, 5, etc. For example, among the intra prediction modes included in the generated gradient information, a predetermined number of intra prediction modes in ascending order of amplitude may be derived as the intra prediction mode of the current block. In other words, the image decoding device (2000) may derive intra prediction modes corresponding to a predetermined number of amplitudes having the largest size among the amplitudes corresponding to the intra prediction modes included in the gradient information of the current block as the intra prediction mode of the current block.

[0365] In Fig. 27, it is assumed that two directional intra prediction modes are derived for intra prediction of the current block (2700). Among the two derived intra prediction modes, the first intra prediction mode is referred to as M1, and the second intra prediction mode is referred to as M2. As an example, the order of the intra prediction modes may be determined according to the amplitude size of the intra prediction modes included in the gradient information. For example, the intra prediction mode corresponding to the largest amplitude among the amplitudes of the intra prediction modes included in the gradient information may be determined as M1. The intra prediction mode corresponding to the second largest amplitude among the amplitudes of the intra prediction modes included in the gradient information may be determined as M2.

[0366] In one embodiment, the image decoding device (2000) may configure a reference pixel (2710) of a current block (2700) for intra prediction. The reference pixel (2710) of the current block (2700) may be configured to include a left sample line, an upper sample line, and an upper left sample of the current block (2700).

[0367] The video decoding device (2000) can generate a first prediction block (2720) of the current block (2700) by performing intra prediction using M1. In addition, the video decoding device (2000) can generate a second prediction block (2730) of the current block (2700) by performing intra prediction using M2. The video decoding device (2000) can generate a third prediction block (2740) of the current block (2700) by performing intra prediction using planar mode.

[0368] The video decoding device (2000) can generate a final prediction block (2780) of the current block (2700) by weighting the first prediction block (2720), the second prediction block (2730), and the third prediction block (2740). In one embodiment, the weights used in the weighted sum may be predefined fixed values ​​or values ​​calculated according to a predefined method.

[0369] In one embodiment, the first weight (2750), the second weight (2760), and the third weight (2770) used in the weighted sum of the first prediction block (2720), the second prediction block (2730), and the third prediction block (2740) can be derived using the following mathematical expression 4. The first weight (2750), the second weight (2760), and the third weight (2770) represent weights applied to the first prediction block (2720), the second prediction block (2730), and the third prediction block (2740), respectively.

[0370]

[0371] In Equation 4, w1, w2, and w3 represent the first weight (2750), the second weight (2760), and the third weight (2770), respectively. ampl(M1) may represent an amplitude corresponding to the M1 intra prediction mode, and ampl(M2) may represent an amplitude corresponding to the M2 intra prediction mode. As an example, a, b, and c may be predefined constant values. For example, a:b:c may be 2:2:1. Alternatively, for example, a may be 43 / 64, b may be 43 / 64, and c may be 21 / 64.

[0372] Additionally, in one embodiment, the weights used in the weighted sum of the prediction block may be determined based on gradient information of the surrounding area. This is described with reference to FIG. 28 below.

[0373] Fig. 28 is a diagram for explaining a method for adaptively determining weights according to one embodiment.

[0374] Referring to FIG. 28, sample-based blending may be performed based on gradient information obtained from at least one of the left region (2810), the upper region (2820), or the upper left region (2830) of the current block (2800). Here, sample-based blending refers to a weighted sum method that adaptively determines weights through region division. In other words, the weights used in the weighted sum of the DIMD process may be adaptively determined based on gradient information obtained from at least one of the left region (2810), the upper region (2820), or the upper left region (2830) of the current block (2800).

[0375] In one embodiment, when sample-based blending is not used, weighted summation for the predictors may be performed in the same manner as in the embodiment described above in FIG. 27 and Equation 4.

[0376] For sample-based blending, the surrounding area of ​​the current block (2800) can be divided into a left area (2810), an upper area (2820), and an upper left area (2830). Local gradient information can be obtained from the three divided areas. Here, the local gradient information represents gradient information derived from the gradients between pixels belonging to each divided area.

[0377] In one embodiment, local gradient information of at least one of the left region (2810), the upper region (2820), or the upper left region (2830) can be used to determine weights for generating the final prediction block of the current block (2800).

[0378] In one embodiment, amplitudes corresponding to the DIMD mode in the local gradient information of the left region (2810), the upper region (2820), and the upper left region (2830) can be identified. Here, the DIMD mode represents the intra prediction mode of the current block (2800) derived through the DIMD process. In this case, the embodiments described above in FIGS. 22 to 26 can be applied.

[0379] In one embodiment, local gradient information used for determining weights may be selected through a size comparison between the identified amplitudes. For example, local gradient information of an area having the largest amplitude among the amplitudes corresponding to the DIMD mode among the local gradient information of the left area (2810), the upper area (2820), and the upper left area (2830) may be selected. In this case, the weight applied to the predictor generated by the DIMD mode may be determined using the gradient information of the selected area. In this case, the gradient information of the remaining areas excluding the selected area may not be considered in determining the weight applied to the predictor generated by the corresponding DIMD mode.

[0380] Alternatively, in one embodiment, a comparison may be performed between the local gradient information of the left region (2810) and the upper region (2820). For example, if the amplitude corresponding to the DIMD mode in the local gradient information of the upper region (2820) is greater than the amplitude corresponding to the DIMD mode in the local gradient information of the left region (2810), the weight applied to the predictor generated by the DIMD mode may be determined based on the gradient information of the upper region (2820). Alternatively, as one example, if the amplitude corresponding to the DIMD mode in the local gradient information of either the upper region (2820) or the left region (2810) is greater than the amplitude corresponding to the DIMD mode in the other local gradient information by a predefined amount or more, the weight may be determined using the local gradient information (i.e., having an amplitude greater than the predefined amount or more). As one example, the predefined amount may be twice the size.

[0381] In one embodiment, when sample-based blending is used, weights can be derived without additional signaling. This may eliminate the need for a new rate distortion (RD) check on the encoder side.

[0382] According to an embodiment of the present disclosure, gradient information of a block decrypted prior to the current block may be referenced to generate gradient information of the current block. In the present disclosure, the block decrypted prior to the current block may be referred to as a previous block. For example, when the aforementioned DIMD merge mode is applied, gradient information of a previous block may be referenced to generate gradient information of the current block.

[0383] When decrypting the current block, the gradient information of the previous block must be stored in order to reference the gradient information of the previous block. Below, an effective method for storing the gradient information of the previous block and various methods for using the stored gradient information of the previous block to predict the current block are described in detail with reference to FIGS. 29 to 38.

[0384] FIG. 29 is a diagram for explaining a method of storing gradient information according to one embodiment.

[0385] Figure 29 illustrates an example of gradient information of a previous block of the current block. The previous block of the current block may be a block included in a previously encoded / decoded area of ​​the current block.

[0386] In one embodiment, the gradient information of the previous block may be generated from the gradients of samples contained in the previous block or samples reconstructed before the previous block. The gradient information of the previous block may include intra prediction modes and amplitudes of the intra prediction modes.

[0387] As mentioned above, in order to derive the intra prediction mode of the current block using the gradient information of the previous block, the gradient information of the previous block must be stored when the current block is restored. However, storing the gradient information of the previous block as is can increase the memory load, so it may be desirable to reduce the amount of information contained in the gradient information of the previous block and store it.

[0388] In one embodiment, when storing gradient information of a previous block, the image decoding device (2000) may selectively store only information about an intra prediction mode (or angle) whose amplitude (or intensity) exceeds a predetermined threshold (2900) instead of storing the gradient information of the corresponding block as is. Alternatively, in one embodiment, the image decoding device (2000) may selectively store only information about an intra prediction mode whose amplitude is greater than or equal to the predetermined threshold (2900).

[0389] The gradient information of the previous block that can be used for decoding the current block may include an amplitude exceeding a predefined threshold (2900) among the amplitudes corresponding to intra prediction modes derived from the gradient between at least two samples belonging to the previous block or at least two neighboring samples of the previous block, and an intra prediction mode corresponding to the amplitude exceeding the threshold (2900).

[0390] As illustrated in FIG. 29, when gradient information is derived from the gradient between at least two samples belonging to the previous block or at least two neighboring samples of the previous block, amplitudes exceeding a threshold (2900) and three intra prediction modes (2910, 2920, 2930) corresponding to the amplitudes can be stored as gradient information of the previous block.

[0391] In one embodiment, the gradient information of the previous block may include a representative intra prediction mode whose amplitude exceeds a threshold (2900) and information about the amplitude of the representative intra prediction mode. That is, in the present disclosure, the representative intra prediction mode may indicate an intra prediction mode exceeding the threshold (2900). There may be one or more representative intra prediction modes.

[0392] In one embodiment, the image decoding device (2000) may store an intra prediction mode whose amplitude exceeds a threshold (2900) and the amplitude of the intra prediction mode as a representative value of the corresponding block. In FIG. 29, three intra prediction modes (2910, 2920, 2930) exceeding the threshold (2900) and the amplitude for each intra prediction mode may be included in gradient information as a representative value, and gradient information including the representative value may be stored.

[0393] Additionally, in one embodiment, the unit storing the gradient information may be a coding unit (CU), a prediction unit (PU), or a transform unit (TU). Alternatively, the unit storing the gradient information may be a unit of a predefined fixed size. That is, intra prediction modes exceeding a predefined threshold (2900) and their corresponding amplitudes may be stored for each predefined unit.

[0394] In one embodiment, the threshold (2900) may be determined in a variety of ways. For example, the threshold (2900) may be a preset value. For example, the threshold (2900) may be a fixed value. For example, the preset value may be a value such as 1, 2, 3, or 4. Furthermore, for example, the threshold (2900) may be adaptively determined based on the bit depth of the image. For example, the threshold (2900) may be defined as in the following mathematical expression (5).

[0395]

[0396] Additionally, as an example, the threshold (2900) may be adaptively determined based on a channel (or color component). The channel may indicate whether it is a luma component or a chroma component. When adaptively determined based on a channel, the preset value of the above-described method or the N value of mathematical expression 5 may be set differently based on the channel.

[0397] The image decoding device (2000) can accumulate gradient information of stored surrounding blocks to obtain gradient information of the current block that reflects the tendencies of the surrounding blocks, and can derive an intra prediction mode based on the obtained gradient information. This will be described in detail with reference to FIG. 30 below.

[0398] FIG. 30 is a diagram for explaining a method of generating gradient information of a current block using gradient information of a previous block according to one embodiment.

[0399] Referring to FIG. 30, the image decoding device (2000) may utilize prediction information of a previous block to derive an intra prediction mode of a current block (3000). The prediction information may include gradient information, or may include intra prediction mode information derived based on the gradient information. In other words, the prediction information may be all or part of the gradient information obtained according to the embodiments described above with reference to FIGS. 23 to 25, or may be intra prediction mode information derived based on the obtained gradient information.

[0400] Referring to Fig. 30, the gradient information of the current block (3000) can be generated using the gradient information of the previous block. In Fig. 30, it is assumed that the previous block used to generate the gradient information of the current block (3000) is a neighboring block adjacent to the left, upper, and upper left of the current block (3000), but is not limited thereto.

[0401] For example, a previous block that can be used to generate gradient information of the current block (3000) may be a surrounding block adjacent to at least one of the left, upper, or upper left side of the current block (3000), as illustrated in FIG. 30.

[0402] In one embodiment, a previous block that can be used to generate gradient information of the current block (3000) may be a block that is spatially or temporally neighboring to the current block (3000).

[0403] In one embodiment, a previous block that can be used to generate gradient information of a current block (3000) may be a non-adjacent neighboring block that is not adjacent to the current block (3000). For example, the previous block may be a reference block specified within the current picture or a reference picture by motion information.

[0404] Gradient information as illustrated in FIG. 30 may be stored for the left peripheral blocks (3011, 3012), upper peripheral blocks (3021, 3022), and upper left peripheral block (3030) of the current block (3000), respectively. At this time, the embodiment described above in FIG. 29 may be applied. That is, gradient information including an amplitude exceeding a threshold among the amplitudes corresponding to intra prediction modes derived from the gradient between at least two samples inside / outside the previous block, and an intra prediction mode corresponding to the amplitude exceeding the threshold, may be stored for each of the peripheral blocks.

[0405] In one embodiment, among the intra prediction modes (3041, 3042) derived from the first left peripheral block (3012), only the intra prediction modes (3041) whose amplitude exceeds a threshold (3040) and the amplitudes corresponding thereto may be stored as gradient information of the first left peripheral block (3012).

[0406] In one embodiment, the gradient information of the current block (3000) may be generated by summing the amplitudes of each intra prediction mode included in the gradient information of the left peripheral blocks (3011, 3012), the upper peripheral blocks (3021, 3022), and the upper left peripheral block (3030) based on the intra prediction mode. In other words, the gradient information of the current block (3000) may be generated by accumulating the intra prediction modes included in the gradient information of the peripheral blocks and the amplitudes of the corresponding intra prediction modes. The amplitudes may be summed for each intra prediction mode. The process of generating the gradient information of the current block (3000) will be described in more detail with reference to the drawings below.

[0407] FIG. 31 is a diagram for explaining a method of generating gradient information of a current block using gradient information of a previous block according to one embodiment.

[0408] Referring to FIG. 31, gradient information as shown in FIG. 31 can be stored for the first left peripheral block (3011), the second left peripheral block (3012), the first upper peripheral block (3021), the second upper peripheral block (3022), and the upper left peripheral block (3030) of the current block (3000).

[0409] In one embodiment, the gradient information of the first left peripheral block (3011) may include directional modes of number 8 and corresponding amplitudes a, directional modes of number 16 and corresponding amplitudes b. The gradient information of the second left peripheral block (3012) may include directional modes of number 11 and corresponding amplitudes c, directional modes of number 16 and corresponding amplitudes d. The gradient information of the first upper peripheral block (3021) may include directional modes of number 4 and corresponding amplitudes e, directional modes of number 42 and corresponding amplitudes f. The gradient information of the second upper peripheral block (3022) may include directional modes of number 28 and corresponding amplitudes g. The gradient information of the upper left peripheral block (3030) may include directional modes of number 42 and corresponding amplitudes h.

[0410] As described above, the gradient information of the current block (3000) can be generated by accumulating the intra prediction modes and amplitudes of the intra prediction modes included in the gradient information of the left surrounding blocks (3011, 3012), the upper surrounding blocks (3021, 3022), and the upper left surrounding block (3030). The amplitudes can be added for each intra prediction mode.

[0411] For example, if the amplitude corresponding to the 16th directional mode is confirmed to be b from the gradient information of the first left peripheral block (3011), and the amplitude corresponding to the 16th directional mode is confirmed to be d from the gradient information of the second left peripheral block (3012), the amplitude corresponding to the 16th directional mode in the gradient information of the current block (3000) may be b+d.

[0412] Similarly, if the amplitude corresponding to the directional mode number 42 is confirmed to be f from the gradient information of the first upper peripheral block (3021), and the amplitude corresponding to the directional mode number 42 is confirmed to be h from the gradient information of the upper left peripheral block (3030), the amplitude corresponding to the directional mode number 42 in the gradient information of the current block (3000) may be f+h.

[0413] In one embodiment, the gradient information of the current block (3000) may include intra prediction modes included in the gradient information of the left peripheral blocks (3011, 3012), the upper peripheral blocks (3021, 3022), and the upper left peripheral block (3030), and an intra prediction mode that is not overlapped in a plurality of peripheral blocks may be included in the gradient information of the current block (3000) without summing the amplitudes. In one embodiment, the image decoding device (2000) may derive the intra prediction mode based on the acquired gradient information.

[0414] The image decoding device (2000) can derive multiple intra prediction modes based on the generated gradient information. The maximum number of derived intra prediction modes can be predefined. For example, the maximum number can be defined as 2, 3, 4, 5, etc. For example, among the intra prediction modes included in the generated gradient information, a predetermined number of intra prediction modes in descending order of amplitude can be derived as the intra prediction mode of the current block.

[0415] In one embodiment, the image decoding device (2000) can generate a final prediction block by combining predictors generated by the derived intra prediction mode.

[0416] FIG. 32 is a diagram for explaining an intra prediction method that refers to gradient information of a previous block according to one embodiment.

[0417] Referring to Fig. 32, the image decoding device (2000) can store the amplitude obtained by adding up the gradients calculated from all pixel areas belonging to the previous block as a representative value. In Fig. 32, it is assumed that the previous block used to generate gradient information of the current block (3200) is a neighboring block adjacent to the left, upper, and upper left of the current block (3200), but is not limited thereto. In Fig. 32, the previous block can be expressed as a sub-block. The sub-block can be a unit in which gradient information is stored.

[0418] In one embodiment, the amplitude stored for the previous block may be calculated by summing the horizontal gradient and the vertical gradient calculated from all pixel areas belonging to the previous block, and then finally summing the results. All pixel areas belonging to the previous block may correspond to all windows to which filtering can be applied within the previous block. In the present disclosure, the pixel areas belonging to the previous block may be referred to as a sample set belonging to the previous block.

[0419] In one embodiment, the image decoding device (2000) can obtain the amplitude of a specific angle (or intra prediction mode) by summing the gradients of all pixels within a block, as in the following mathematical expression 6. In one embodiment, the specific angle (or intra prediction mode) may be a representative intra prediction mode.

[0420]

[0421] Referring to mathematical expression 6, the amplitude stored in the previous block can be obtained by adding the first result of summing the horizontal gradients produced from all sample sets belonging to the previous block and the second result of summing the vertical gradients produced from all sample sets belonging to the previous block.

[0422] In one embodiment, the gradient information of the previous block is an amplitude (ampl) corresponding to a third result that is the sum of the first result and the second result. SB ) and the corresponding amplitude (ampl SB ) may include one intra prediction mode corresponding to the corresponding input.

[0423] In one embodiment, when the block sizes are different, a normalization process may be performed. For example, the normalization process may be performed by dividing the value calculated by Equation 6 by the total number of pixels. Alternatively, in one embodiment, the normalization process may be performed based on the value calculated by Equation 6 based on the number of samples included in all sample sets belonging to the previous block or the number of sample sets. For example, the normalization process may be performed by dividing the value calculated by Equation 5 by the number of samples included in all sample sets or the number of sample sets. By storing the normalized value, accurate comparison between blocks is possible and the accuracy of prediction can be increased.

[0424] In one embodiment, a block, which is a unit for storing gradient information, may be a CU, PU, ​​or TU. Alternatively, a block may be a unit of a predefined fixed size. As an example, among each block, an amplitude (ampl SBK ) can be inferred as a representative intra prediction mode and stored as a representative amplitude for the representative intra prediction mode.

[0425] FIG. 33 is a diagram for explaining a method of generating gradient information of a current block using gradient information of a previous block according to one embodiment.

[0426] Referring to Fig. 33, the gradient information of the current block (3300) can be generated using the gradient information of the previous block. In Fig. 33, it is assumed that the previous block used to generate the gradient information of the current block (3300) is a neighboring block adjacent to the left, upper, and upper left of the current block (3300), but is not limited thereto.

[0427] For example, the previous block to which the present embodiment can be applied may be a neighboring block adjacent to at least one of the left, upper, and upper left sides of the current block (3300), as illustrated in FIG. 33, or may be a spatially or temporally neighboring block, may be a non-adjacent neighboring block not adjacent to the current block (3300), or may be a reference block specified within the current picture or reference picture by motion information.

[0428] Gradient information as illustrated in FIG. 33 may be stored in the left peripheral blocks (3311, 3312), upper peripheral blocks (3321, 3322, 3323, 3324), and upper left peripheral block (3330) of the current block (3300). At this time, the embodiment described above in FIG. 32 may be applied. That is, the amplitude and one intra prediction mode that are the sum of the horizontal and vertical gradients produced from all sample sets belonging to the corresponding peripheral block may be stored as gradient information in the corresponding peripheral block.

[0429] In one embodiment, the amplitude of the sum of horizontal and vertical gradients produced from all sample sets belonging to the first left peripheral block (3312) and the intra prediction mode (3340) corresponding to the amplitude may be stored as gradient information of the first left peripheral block (3312).

[0430] In one embodiment, the gradient information of the current block (3300) may be generated by adding the amplitudes of each intra prediction mode to the gradient information of the left surrounding blocks (3311, 3312), the upper surrounding blocks (3321, 3322, 3323, 3324), and the upper left surrounding block (3330) based on the intra prediction mode. In other words, the gradient information of the current block (3300) may be generated by accumulating the intra prediction modes included in the gradient information of the surrounding blocks and the amplitudes of the corresponding intra prediction modes. The amplitudes may be added for each intra prediction mode. The process of generating the gradient information of the current block (3300) will be described in more detail with reference to the drawings below.

[0431] FIG. 34 is a diagram for explaining a method of generating gradient information of a current block using gradient information of a previous block according to one embodiment.

[0432] Referring to FIG. 34, gradient information as shown in FIG. 31 can be stored for the first left peripheral block (3311), the second left peripheral block (3312), the first upper peripheral block (3321), the second upper peripheral block (3322), the third upper peripheral block (3323), the fourth upper peripheral block (3324), and the upper left peripheral block (3330) of the current block (3300).

[0433] In one embodiment, the gradient information of the first left peripheral block (3311) may include 8 directional modes and corresponding amplitudes a. The gradient information of the second left peripheral block (3312) may include 11 directional modes and corresponding amplitudes b. The gradient information of the first upper peripheral block (3321) may include 4 directional modes and corresponding amplitudes c. The gradient information of the second upper peripheral block (3322) may include 28 directional modes and corresponding amplitudes d. The gradient information of the third upper peripheral block (3323) may include 16 directional modes and corresponding amplitudes e. The gradient information of the fourth upper peripheral block (3324) may include 11 directional modes and corresponding amplitudes f. The gradient information of the upper left peripheral block (3330) may include 42 directional modes and their corresponding amplitudes g.

[0434] As described above, the gradient information of the current block (3300) can be generated by accumulating the intra prediction modes and amplitudes of the intra prediction modes included in the gradient information of the left surrounding blocks (3311, 3312), the upper surrounding blocks (3321, 3322, 3323, 3324), and the upper left surrounding block (3330). The amplitudes can be added for each intra prediction mode.

[0435] For example, if the amplitude corresponding to the 11th directional mode is confirmed to be b from the gradient information of the second left peripheral block (3012), and the amplitude corresponding to the 11th directional mode is confirmed to be f from the gradient information of the second left peripheral block (3012), the amplitude corresponding to the 11th directional mode in the gradient information of the current block (3000) may be b+f.

[0436] In one embodiment, the gradient information of the current block (3300) may include intra prediction modes included in the gradient information of the left peripheral blocks (3311, 3312), the upper peripheral blocks (3321, 3322, 3323, 3324), and the upper left peripheral block (3330), and an intra prediction mode that is not overlapped in multiple peripheral blocks may be included in the gradient information of the current block (3000) without summing the amplitudes.

[0437] In one embodiment, the image decoding device (2000) can derive an intra prediction mode based on the acquired gradient information. The image decoding device (2000) can derive a plurality of intra prediction modes based on the generated gradient information. The maximum number of derived intra prediction modes can be defined in advance. For example, the maximum number can be defined as 2, 3, 4, 5, etc. For example, among the intra prediction modes included in the generated gradient information, a predetermined number of intra prediction modes in order of increasing amplitude can be derived as the intra prediction mode of the current block.

[0438] In one embodiment, the image decoding device (2000) can generate a final prediction block by combining predictors generated by the derived intra prediction mode.

[0439] Below, we describe previous blocks that can be used to generate gradient information for the current block.

[0440] In one embodiment, when configuring gradient information of a current block, the image decoding device (2000) may refer to gradient information of a reference block belonging to the current picture or a reference picture. That is, the image decoding device (2000) may generate / update gradient information of the current block by referring to gradient information stored in a reference block specified by a block vector (BV) within the current picture. As an example, the reference block may be specified by a block vector of the current block within the current picture to which the current block belongs.

[0441] Alternatively, the video decoding device (2000) may generate / update gradient information of the current block by referring to gradient information stored in a reference block specified by a motion vector within a reference picture. As an example, the reference block may be specified by a motion vector of a spatial or temporal neighboring block of the current block within the reference picture of the current block.

[0442] In one embodiment, when configuring gradient information of a current block according to the embodiment described above in FIGS. 23 to 25, the image decoding device (2000) may refer to gradient information of a reference block. Alternatively, when configuring gradient information of a current block according to the DIMD merge mode according to the embodiment described above in FIG. 26, the image decoding device (2000) may refer to gradient information of a reference block.

[0443] In one embodiment, the gradient information referenced from a reference block specified by a motion vector or a block vector may be gradient information stored according to the embodiments described above in FIGS. 29 to 34.

[0444] Additionally, in one embodiment, when configuring gradient information of a current block, the image decoding device (2000) may refer to gradient information of spatial and / or temporal surrounding blocks of the current block. As an example, the image decoding device (2000) may configure gradient information of the current block by referring to gradient information of spatial and / or temporal surrounding blocks for motion vector derivation. This will be described with reference to the following FIG. 35.

[0445] FIG. 35 is a diagram illustrating the locations of spatial and temporal surrounding blocks according to one embodiment.

[0446] Referring to FIG. 35, the spatial and temporal surrounding blocks of the current block (3500) may be defined as blocks at various locations. As an example, the spatial and temporal surrounding blocks may be merge candidates.

[0447] In one embodiment, the spatial surrounding blocks of the current block (3500) may be defined as blocks at positions A0, A1, A2, B0, B1, B2, and B3 as illustrated in FIG. 35. At this time, blocks at some positions may be omitted, or blocks at positions other than those illustrated in FIG. 35 may additionally be used as spatial surrounding blocks.

[0448] Additionally, the temporal surrounding block of the current block (3500) may be defined as a block at the T position as shown in FIG. 32. The temporal surrounding block may be a block belonging to a reference picture or a collocated picture. As an example, a block at a different position instead of the T position may be defined as a temporal surrounding block of the current block (3500), or a block at a different position in addition to the T position may be defined as a temporal surrounding block of the current block (3500).

[0449] In one embodiment, when configuring gradient information of a current block (3500), the image decoding device (2000) may refer to gradient information of spatial and / or temporal surrounding blocks of the current block at the location illustrated in FIG. 35. The image decoding device (2000) may generate / update gradient information of the current block by referring to gradient information stored in spatial and / or temporal surrounding blocks of the current block at the location illustrated in FIG. 35.

[0450] Additionally, in one embodiment, the image decoding device (2000) may reference gradient information of a block at a non-adjacent location. In this case, the non-adjacent location may be the location of a non-adjacent merge candidate. The location of the non-adjacent merge candidate may be defined as a specific location within a grid having a predefined size.

[0451] According to the present embodiment, the accuracy of DIMD-based intra prediction can be improved by updating the gradient information of the current block based on the gradient information of the surrounding blocks used for motion prediction.

[0452] Additionally, in configuring gradient information of the current block, the image decoding device (2000) may refer to gradient information of a reference block within the current picture. Here, the reference block within the current picture may be specified by a block vector derived by intra template matching prediction or intra block copy.

[0453] Reference blocks identified by motion vectors used for inter-frame prediction or block vectors used for intra-frame prediction may have a high degree of similarity to the current block. Therefore, the accuracy of DIMD-based intra prediction can be improved by combining the gradient information of the reference block identified by the motion vector and block vector with the gradient information of the current block.

[0454] Meanwhile, in conventional image compression techniques, gradient information is only used to find prediction directionality in intra mode. According to one embodiment of the present disclosure, gradient information can be utilized in various other prediction methods. This will be described with reference to FIG. 36 below.

[0455] FIG. 36 is a diagram for explaining a method of referencing gradient information in inter mode according to one embodiment.

[0456] Referring to Figure 36, gradient information can be stored during the inter prediction process. The gradient information can be stored in units of coding units (CU), prediction units (PU), and transform units (TU). Alternatively, the gradient information can be stored in units of blocks of a predefined, fixed size.

[0457] In one embodiment, when performing a weighted sum for a reference block derived from a bidirectional reference picture, the gradient information of the reference block may be referred to. Fig. 36(a) illustrates bidirectional prediction in which a current picture (3600) is located between a first reference picture (3610) and a second reference picture (3620) in time order. Fig. 36(b) illustrates bidirectional prediction in which the first reference picture (3610) and the second reference picture (3620) are located in the same direction with respect to the current picture (3600). Fig. 36(c) illustrates bidirectional prediction in which two reference blocks are derived from the same reference picture, the first reference picture (3610).

[0458] Referring to Fig. 36(d), a reference image (3640) of the current block (3630) can be generated by weighting the first reference block (3650) and the second reference block (3660) derived through bidirectional prediction as in Figs. 36(a) to (c). The reference image (3640) can be a predicted block of the current block (3630).

[0459] In one embodiment, the weights used in the weighted sum of the first reference block (3650) and the second reference block (3660) may be determined based on the gradient information of the first reference block (3650) and the second reference block (3660). For example, by comparing the gradient information of the first reference block (3650) and the second reference block (3660) with the gradient information of the current block (3630), a relatively larger weight may be applied to a reference block with a high degree of similarity.

[0460] Additionally, in one embodiment, in intra-template matching prediction or intra-block copy mode, prediction can be performed by referring to stored gradient information. For example, when multiple block vectors are searched, a reference block having a tendency to be relatively more similar to the gradient information of the current block can be defined as the most similar block within the frame. In other words, when there are multiple reference blocks specified by block vectors, a reference block having gradient information that is relatively similar to the gradient information of the current block can be selected.

[0461] That is, templates with similar gradient information can be added to the search candidate list, and the ranking of candidates within the search candidate list can be determined based on the similarity of the gradient information. Determining the similarity of gradient information can be performed by comparing amplitude values ​​according to the intra prediction mode, or by comparing mapped representative intra prediction modes.

[0462] Additionally, in one embodiment, when constructing a merge candidate list using spatial / temporal merge candidates, the merge candidates included in the merge candidate list may be reordered based on gradient information. As an example, the merge candidate list may include non-adjacent merge candidates.

[0463] FIG. 37 is a diagram illustrating the locations of surrounding blocks used for intra prediction according to one embodiment.

[0464] Referring to Fig. 37, the locations of surrounding blocks of the current block (3700) used as MPM (most probable mode) candidates are illustrated. In conventional image compression technology, intra prediction mode information is signaled using MPM for efficient encoding / decoding of 67 intra prediction modes. The surrounding blocks of the current block (3700) may include blocks at locations A, B, C, D, and E. In this case, blocks at some locations may be omitted, or blocks at locations other than those shown in Fig. 37 may be additionally used as MPM candidates.

[0465] When encoding / decoding blocks using intra prediction, six MPM candidates can be constructed based on the intra prediction modes of surrounding blocks of the current block (3700), taking advantage of the characteristic that the intra prediction modes of neighboring blocks are determined similarly. The six MPM candidates constructed in this way can be included in an MPM list. As an example, the MPM list can also be constructed by excluding specific candidates from all MPM candidates. For example, the specific candidate can be a planar mode or a DC mode.

[0466] If the intra prediction mode of the current block (3700) is included in the MPM list, i.e., if the MPM is used for intra prediction of the current block (3700), an MPM index may be signaled. The MPM index may indicate a candidate used for intra prediction of the current block (3700) among MPM candidates included in the MPM list. If the intra prediction mode of the current block (3700) is not included in the MPM list, i.e., if the MPM is not used for intra prediction of the current block (3700), intra prediction mode encoding for the current block (3700) may be performed within the remaining intra prediction mode groups configured excluding the six MPM candidates.

[0467] In one embodiment, when configuring gradient information of a current block (3700), the image decoding device (2000) may refer to gradient information of an MPM candidate block. That is, the gradient information of the current block (3700) may be generated / updated based on gradient information stored in surrounding blocks of the current block (3700) used as an MPM candidate. The gradient information of blocks at surrounding MPM candidate locations of the current block (3700) may be combined with the gradient information of the current block (3700) to increase the accuracy of DIMD prediction for the current block (3700).

[0468] In addition, in one embodiment, when constructing an MPM list for a current block (3700), the video decoding device (2000) may add the DIMD mode of the current block (3700) as an MPM candidate to the MPM list. Here, the DIMD mode represents an intra prediction mode induced at the decoder side by the DIMD process. The DIMD mode may be one intra prediction mode or multiple intra prediction modes. In the present disclosure, the DIMD mode may be referred to as a representative intra prediction mode. The number of DIMD modes added to the MPM list may be predefined. Alternatively, when there are multiple DIMD modes, the DIMD modes may be added to the MPM list until the maximum number of the MPM list is satisfied.

[0469] Additionally, in one embodiment, the image decoding device (2000) may add the DIMD mode of the MPM candidate block of the current block (3700) to the MPM list as an MPM candidate.

[0470] FIG. 38 is a diagram illustrating an intra prediction method of a chroma block according to one embodiment.

[0471] Referring to FIG. 38, a DIMD process can be performed on a chroma block. When DIMD is applied to a current chroma block (3800), the image decoding device (2000) can refer to the gradient information of the corresponding luma block (3810) of the current chroma block (3800). That is, the gradient information of the current chroma block (3800) can be generated / updated using the gradient information of the corresponding luma block (3810) of the current chroma block (3800).

[0472] In one embodiment, the location of the corresponding luma block (3810) referenced in the DIMD process for the current chroma block (3800) may be defined as various different locations within the corresponding luma block (3810). For example, the location of the corresponding luma block (3810) referenced in the DIMD process for the current chroma block (3800) may be defined as a central location within the corresponding luma block (3810). In this case, the central location may be defined as a luma block including a central lower right pixel, as illustrated in FIG. 38, or may be defined as a luma block including central lower left, upper right, and upper left pixels. As an example, a central location block within the corresponding luma block (3810) may be referred to as the corresponding luma block (3810).

[0473] In addition, in one embodiment, the position of the corresponding luma block (3810) referenced in the DIMD process for the current chroma block (3800) of the current chroma block (3800) may be defined as the upper left, upper right, lower left, and lower right positions within the corresponding luma block (3810). In addition, surrounding blocks of the central position block within the corresponding luma block (3810) may also be referenced in the DIMD process for the current chroma block (3800). As an example, gradient information for the current chroma block (3800) may be generated / updated by referencing gradient information of all luma blocks within the corresponding luma block (3810).

[0474] In the case of I-slice, luma component blocks and chroma component blocks can have independent coding trees (i.e., a dual-tree structure). In this case, there may be one or more luma component blocks corresponding to a chroma component block. Accordingly, not only the corresponding luma block but also the surrounding blocks of the corresponding block can be referenced during DIMD prediction. In other words, by referencing DIMD prediction information for one or more luma blocks corresponding to a chroma component block, the accuracy of DIMD prediction for the chroma component block can be improved.

[0475] Figure 39 is a flowchart of an image decoding method according to one embodiment.

[0476] In step S3910, the image decoding device (2000) may obtain gradient information from a plurality of previous blocks decoded prior to the current block. Here, the gradient information may include a first value corresponding to at least one intra prediction mode, and a second value corresponding to the first value.

[0477] In one embodiment, gradient information satisfying a predetermined condition may be obtained from a first previous block among a plurality of previous blocks. The gradient information satisfying a predetermined condition obtained from the first previous block may include a second value exceeding a predefined threshold among second values ​​calculated from a gradient between at least two samples belonging to the first previous block or at least two samples neighboring the first previous block, and a first value corresponding to the second value exceeding the threshold.

[0478] In one embodiment, the threshold may be predefined as a fixed value or a value determined based on the bit depth.

[0479] In one embodiment, gradient information satisfying a predetermined condition may be obtained from a second previous block among a plurality of previous blocks. The gradient information satisfying a predetermined condition obtained from the second previous block may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the second previous block, a second value corresponding to a third result obtained by summing the second result obtained by summing vertical gradients calculated from all sample sets belonging to the second previous block, and a first value corresponding to the second value. As an example, as described above with reference to FIGS. 32 to 34, the gradient information of the second previous block may include one first value.

[0480] Alternatively, in one embodiment, gradient information satisfying a predetermined condition may be obtained from a third previous block among a plurality of previous blocks. The gradient information satisfying a predetermined condition obtained from the third previous block may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the third previous block, a second value corresponding to a third result obtained by summing a second result obtained by summing vertical gradients calculated from all sample sets belonging to the third previous block, a value obtained by performing normalization based on the number of samples included in all sample sets, and a first value corresponding to the value. As an example, as described above with reference to FIGS. 32 to 34, the gradient information of the third previous block may include one first value.

[0481] In one embodiment, the previous block may include a reference block that is specified within the reference picture of the current block by motion information of spatial or temporal surrounding blocks of the current block.

[0482] In one embodiment, the previous block may include a reference block specified by a block vector of the current block within the current picture to which the current block belongs.

[0483] At step S3920, the image decoding device (2000) can generate gradient information of the current block using the acquired gradient information.

[0484] In one embodiment, the image decoding device (2000) can generate gradient information of a current block by summing the amplitudes for each intra prediction mode included in the gradient information of a plurality of previous blocks based on the intra prediction mode. In other words, the image decoding device (2000) can generate gradient information of a current block by summing the second values ​​included in the gradient information of a plurality of previous blocks based on the corresponding intra prediction mode.

[0485] At step S3930, the image decoding device (2000) can derive an intra prediction mode of the current block based on gradient information of the current block.

[0486] In one embodiment, the image decoding device (2000) can derive intra prediction modes corresponding to a predetermined number of amplitudes having the largest size among the amplitudes corresponding to intra prediction modes included in the gradient information of the current block as the intra prediction mode of the current block. In other words, the image decoding device (2000) can derive intra prediction modes corresponding to a predetermined number of second values ​​having the largest size among the second values ​​included in the gradient information of a plurality of previous blocks as the intra prediction mode of the current block.

[0487] At step S3940, the image decoding device (2000) can generate a prediction block of the current block by performing intra prediction on the current block using the derived intra prediction mode.

[0488] In one embodiment, the image decoding device (2000) may generate temporary prediction blocks based on each of the derived multiple intra prediction modes and the planar mode when multiple intra prediction modes are derived using gradient information of the current block. The image decoding device (2000) may generate a prediction block of the current block by weighting the temporary prediction blocks.

[0489] In one embodiment, the image decoding device (2000) can reconstruct the current block using the prediction block.

[0490] In one embodiment, the video decoding device (2000) can determine a prediction block as a reconstructed current block.

[0491] In one embodiment, the image decoding device (2000) can generate a reconstructed current block by combining residual data obtained from a bitstream and a prediction block.

[0492] Fig. 40 is a block diagram illustrating a configuration of an image encoding device according to one embodiment.

[0493] Referring to FIG. 40, the image encoding device (4000) may include a prediction encoding unit (4010) and a generation unit (4020).

[0494] According to one embodiment, the prediction encoding unit (4010) and the generation unit (4020) may be implemented with at least one processor. In one embodiment, the prediction encoding unit (4010) and the generation unit (4020) may operate according to at least one instruction stored in at least one memory.

[0495] The video encoding device (4000) may include at least one memory that stores input / output data of the prediction encoding unit (4010) and the generation unit (4020). In addition, the video encoding device (4000) may include a memory control unit that controls data input / output of the memory.

[0496] In one embodiment, the prediction encoding unit (4010) may correspond to the prediction encoding unit (1915) illustrated in FIG. 19, and the generation unit (4020) may correspond to the entropy encoding unit (1925) illustrated in FIG. 19.

[0497] The prediction encoding unit (4010) can determine the prediction mode of the current block. The current block may be a maximum coding unit, coding unit, transformation unit, or prediction unit divided from the current picture to be encoded.

[0498] In one embodiment, the prediction mode of the current block may be determined as one of a plurality of prediction modes including an intra mode and an inter mode.

[0499] In one embodiment, the prediction encoder (4010) can determine the intra prediction mode of the current block when the prediction mode of the current block is intra mode.

[0500] The intra prediction mode of the current block may be any one of a plurality of intra prediction modes. As described with reference to FIG. 21, the plurality of intra prediction modes may include a non-directional intra mode and a directional intra mode.

[0501] In one embodiment, the prediction encoding unit (4010) may perform intra prediction or inter prediction on the current block according to the prediction mode of the current block, and may encode the current block using a prediction block generated as a result of performing intra prediction or inter prediction.

[0502] In one embodiment, encoding of a current block may refer to a process of generating information that enables the image decoding device (2000) to restore the current block. The information generated through encoding may be included in a bitstream.

[0503] In one embodiment, the prediction encoding unit (4010) may generate residual data corresponding to the difference between the predicted block and the current block. If the predicted block is determined to be the current block, residual data may not be generated.

[0504] According to one embodiment, the prediction encoding unit (4010) may determine a determination method for the intra prediction mode when the prediction mode of the current block is the intra mode. Information indicating the determination method for the intra mode may be included in the bitstream via the generation unit (4020).

[0505] In one embodiment, the method for determining the intra prediction mode may include a method of deriving the intra prediction mode based on a gradient or a method of selecting one of the intra prediction modes from among a plurality of intra prediction modes based on a cost. From a rate-distortion perspective, the prediction encoding unit (4010) may select one of the methods of deriving the intra prediction mode based on a gradient or a method of selecting one of the intra prediction modes from among a plurality of intra prediction modes based on a cost.

[0506] In one embodiment, information indicating how to determine the intra prediction mode may be included in a sequence parameter set, a picture parameter set, a slice header, or slice data of a bitstream. As an example, the slice data may include information signaled at the coding tree, coding unit, transform tree, or transform unit level.

[0507] In one embodiment, the prediction encoder (4010) may determine the intra prediction mode of the current block according to any one of the predetermined methods.

[0508] In one embodiment, the prediction encoding unit (4010) may select an intra prediction mode that causes the least cost in encoding the current block among the plurality of intra prediction modes, if the method for determining the intra prediction mode is a method for selecting one of the plurality of intra prediction modes based on cost. Information indicating the selected intra prediction mode may be included in the bitstream. For example, the information indicating the intra prediction mode of the current block may include a flag or index indicating one of the plurality of intra prediction modes.

[0509] The prediction encoding unit (4010) can derive the intra prediction mode in the same manner as the image decoding device (2000) when the intra prediction mode is determined by a method of deriving the intra prediction mode based on a gradient.

[0510] When a prediction block is generated through intra prediction for the current block, the prediction encoding unit (4010) can encode the current block using the prediction block.

[0511] In one embodiment, the prediction encoder (4010) may generate residual data corresponding to the difference between the predicted block and the current block. The residual data may be included in the bitstream.

[0512] In one embodiment, the prediction encoding unit (4010) may derive the intra prediction mode of the current block based on the gradient between at least two samples belonging to the surrounding area of ​​the current block. The prediction encoding unit (4010) may calculate the gradient using at least two samples belonging to the surrounding area of ​​the current block. The prediction encoding unit (4010) may accumulate the calculated gradients to generate gradient information.

[0513] In one embodiment, the predictive encoding unit (4010) may obtain the gradient between at least two samples belonging to the surrounding area of ​​the current block using a predefined filter. In addition, the predictive encoding unit (4010) may generate gradient information of the current block based on the obtained gradient.

[0514] Additionally, in one embodiment, the prediction encoding unit (4010) may obtain gradient information of a previous block encoded before the current block, and generate gradient information of the current block using the obtained gradient information.

[0515] The specific embodiments of configuring gradient information described with reference to FIGS. 23 to 26 and FIGS. 29 to 38 above can be applied in substantially the same manner in the prediction encoding unit (4010). Any duplicate descriptions in this regard will be omitted.

[0516] In one embodiment, the prediction encoding unit (4010) may obtain gradient information of a previous block including a second value exceeding a predefined threshold among second values ​​corresponding to intra prediction modes derived from gradients between at least two samples belonging to a previous block or at least two neighboring samples of the previous block, and a first value corresponding to the second value exceeding the threshold.

[0517] In one embodiment, the threshold may be predefined as a fixed value or a value determined based on the bit depth.

[0518] In one embodiment, the prediction encoding unit (4010) may obtain gradient information of a previous block including a first result obtained by summing horizontal gradients produced from all sample sets belonging to the previous block, a second value corresponding to a third result obtained by summing a second result obtained by summing vertical gradients produced from all sample sets belonging to the previous block, and one first value corresponding to the second value.

[0519] Alternatively, in one embodiment, the prediction encoding unit (4010) may obtain gradient information of the previous block including a first result of summing horizontal gradients produced from all sample sets belonging to the previous block, a second value corresponding to a third result of summing the second result of summing vertical gradients produced from all sample sets belonging to the previous block, and a value obtained by performing normalization based on the number of samples included in all sample sets, and one first value corresponding to the value.

[0520] In one embodiment, the previous block may include a reference block that is specified within the reference picture of the current block by motion information of spatial or temporal surrounding blocks of the current block.

[0521] In one embodiment, the previous block may include a reference block specified by a block vector of the current block within the current picture to which the current block belongs.

[0522] In one embodiment, the prediction encoding unit (4010) can generate gradient information of the current block using the acquired gradient information.

[0523] In one embodiment, the prediction encoding unit (4010) can generate gradient information of the current block by summing the amplitudes of each intra prediction mode included in the gradient information of a plurality of previous blocks based on the intra prediction mode. In other words, the prediction encoding unit (4010) can generate gradient information of the current block by summing the second values ​​included in the gradient information of a plurality of previous blocks based on the corresponding intra prediction mode.

[0524] In one embodiment, the prediction encoding unit (4010) may derive an intra prediction mode based on the generated gradient information. As an example, the prediction encoding unit (4010) may derive a plurality of intra prediction modes based on the gradient information. The maximum number of derived intra prediction modes may be defined in advance. For example, the maximum number may be defined as 2, 3, 4, 5, etc. For example, among the intra prediction modes included in the generated gradient information, a predetermined number of intra prediction modes in order of increasing amplitude may be derived as the intra prediction mode of the current block.

[0525] In one embodiment, the prediction encoder (4010) can generate a prediction block of the current block by performing intra prediction on the current block using an intra prediction mode. The prediction encoder (4010) can generate a predictor using the derived intra prediction mode.

[0526] In one embodiment, the prediction encoding unit (4010) can generate a final prediction block by weighting the predictors generated by the derived intra prediction mode. For example, the prediction encoding unit (4010) can generate a final prediction block by weighting the predictors generated by the derived intra prediction mode and the predictors generated by the planar mode. The embodiment of generating a final prediction block using the weighted sum of predictors described in FIGS. 27 and 28 can be substantially equally applied to the present embodiment, and any redundant descriptions related thereto will be omitted.

[0527] In one embodiment, the prediction encoding unit (4010) may encode the current block using the prediction block. A bitstream may be generated as a result of encoding the current block. In one embodiment, the image encoding device (4000) may obtain residual data corresponding to the difference between the prediction block and the original block, and information about the residual data may be included in the bitstream.

[0528] In one embodiment, the operation of the prediction encoding unit (4010) of the image encoding device (4000) may be the same as the operation of the prediction decoding unit (2030) of the image decoding device (2000), so the description of the operation of the prediction decoding unit (2030) described above may be equally applied to the prediction encoding unit (4010).

[0529] The generation unit (4020) can generate a bitstream including the encoding result of the picture. The bitstream can include the encoding result for the current block.

[0530] In one embodiment, the generation unit (4020) can transmit the bitstream to the image decoding device (2000) over a network.

[0531] In one embodiment, the generation unit (4020) may store the bitstream on a data storage medium including a magnetic medium such as a hard disk, a floppy disk, and a magnetic tape, an optical recording medium such as a CD-ROM and a DVD, a magneto-optical medium such as a floptical disk, and the like.

[0532] The generation unit (4020) can generate a bitstream including syntax elements generated through encoding of a picture. Values ​​corresponding to the syntax elements can be included in the bitstream according to the hierarchical structure of the picture.

[0533] The generation unit (4020) can obtain bins included in the bitstream by entropy encoding syntax elements.

[0534] In one embodiment, the bitstream may include information about the prediction mode of the current block within the current picture.

[0535] Figure 41 is a flowchart of an image encoding method according to one embodiment.

[0536] In step S4110, the video encoding device (4000) may obtain gradient information from a plurality of previous blocks encoded prior to the current block. Here, the gradient information may include a first value corresponding to at least one intra prediction mode, and a second value corresponding to the first value.

[0537] In one embodiment, gradient information satisfying a predetermined condition may be obtained from a first previous block among a plurality of previous blocks. The gradient information satisfying a predetermined condition obtained from the first previous block may include a second value exceeding a predefined threshold among amplitudes corresponding to intra prediction modes calculated from gradients between at least two samples belonging to the first previous block or at least two samples neighboring the first previous block, and a first value corresponding to the second value exceeding the threshold.

[0538] In one embodiment, the threshold may be predefined as a fixed value or a value determined based on the bit depth.

[0539] In one embodiment, gradient information satisfying a predetermined condition may be obtained from a second previous block among a plurality of previous blocks. The gradient information satisfying a predetermined condition obtained from the second previous block may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the second previous block, a second value corresponding to a third result obtained by summing the second result obtained by summing vertical gradients calculated from all sample sets belonging to the second previous block, and a first value corresponding to the second value. As an example, as described above with reference to FIGS. 32 to 34, the gradient information of the second previous block may include one first value.

[0540] Alternatively, in one embodiment, gradient information satisfying a predetermined condition may be obtained from a third previous block among a plurality of previous blocks. The gradient information satisfying a predetermined condition obtained from the third previous block may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the third previous block, a second value corresponding to a third result obtained by summing a second result obtained by summing vertical gradients calculated from all sample sets belonging to the third previous block, a value obtained by performing normalization based on the number of samples included in all sample sets, and a first value corresponding to the value. As an example, as described above with reference to FIGS. 32 to 34, the gradient information of the third previous block may include one first value.

[0541] In one embodiment, the previous block may include a reference block that is specified within the reference picture of the current block by motion information of spatial or temporal surrounding blocks of the current block.

[0542] In one embodiment, the previous block may include a reference block specified by a block vector of the current block within the current picture to which the current block belongs.

[0543] In step S4120, the image encoding device (4000) can generate gradient information of the current block using the acquired gradient information.

[0544] The specific embodiments of configuring gradient information described with reference to FIGS. 23 to 26 and FIGS. 29 to 38 above can be applied in substantially the same manner to the image encoding device (4000). Any duplicate descriptions in this regard will be omitted.

[0545] In one embodiment, the video encoding device (4000) can generate gradient information of a current block by summing the amplitudes of each intra prediction mode included in the gradient information of a plurality of previous blocks based on the intra prediction mode. In other words, the video encoding device (4000) can generate gradient information of a current block by summing the second values ​​included in the gradient information of a plurality of previous blocks based on the corresponding intra prediction mode.

[0546] At step S4130, the image encoding device (4000) can derive an intra prediction mode of the current block based on gradient information of the current block.

[0547] In one embodiment, the video encoding device (4000) can induce intra prediction modes corresponding to a predetermined number of amplitudes having the largest size among the amplitudes corresponding to intra prediction modes included in the gradient information of the current block as the intra prediction mode of the current block. In other words, the video encoding device (4000) can induce intra prediction modes corresponding to a predetermined number of second values ​​having the largest size among the second values ​​included in the gradient information of a plurality of previous blocks as the intra prediction mode of the current block.

[0548] In step S4140, the image encoding device (4000) can generate a prediction block of the current block by performing intra prediction on the current block using the derived intra prediction mode.

[0549] In one embodiment, when a plurality of intra prediction modes are derived using gradient information of a current block, the video encoding device (4000) may generate temporary prediction blocks based on each of the derived plurality of intra prediction modes and the planar mode. The video encoding device (4000) may generate a prediction block of the current block by weighting the temporary prediction blocks.

[0550] In one embodiment, the video encoding device (4000) can encode a current block using a prediction block. A bitstream can be generated as a result of encoding the current block.

[0551] In one embodiment, the video encoding device (4000) can determine a prediction block as a reconstructed current block.

[0552] In one embodiment, the video encoding device (4000) can obtain residual data corresponding to the difference between the predicted block and the original block, and information about the residual data can be included in the bitstream.

[0553] A method and device for encoding an image (4000) and a method and device for decoding an image (2000) according to one embodiment have the task of improving the performance of predictive encoding and predictive decoding for a current block.

[0554] A method and device (4000) for encoding an image according to one embodiment, and a method and device (2000) for decoding an image, aim to reduce the amount of data required for signaling an intra prediction mode.

[0555] A method and device (4000) for encoding an image according to one embodiment, and a method and device (2000) for decoding an image, have as their object the reduction of the bit rate of a bitstream.

[0556] The technical problems to be achieved through the present disclosure are not limited to the technical problems mentioned above, and other technical problems not mentioned will be clearly understood by a person having ordinary skill in the technical field to which the present disclosure pertains from the description below.

[0557] A method of decoding an image according to one embodiment may include a step of obtaining gradient information from a plurality of previous blocks that were decoded prior to a current block.

[0558] According to one embodiment, the gradient information may include at least one intra prediction mode and an amplitude corresponding to the at least one intra prediction mode.

[0559] According to one embodiment, the gradient information may include a first value corresponding to at least one intra prediction mode, and a second value corresponding to a strength of the first value.

[0560] A method for decoding an image according to one embodiment may include a step of generating gradient information of the current block using the acquired gradient information.

[0561] A method of decoding an image according to one embodiment may include a step of deriving an intra prediction mode of a current block based on at least one amplitude corresponding to at least one intra prediction mode included in gradient information of the current block.

[0562] A method of decoding an image according to one embodiment may include a step of generating a prediction block of a current block by performing intra prediction on the current block using an induced intra prediction mode.

[0563] According to one embodiment, gradient information satisfying a predetermined condition obtained from a first previous block among a plurality of previous blocks may include a second value exceeding a predefined threshold among second values ​​calculated from a gradient between at least two samples belonging to the first previous block or at least two samples neighboring the first previous block, and a first value corresponding to the second value exceeding the threshold.

[0564] In one embodiment, the threshold may be predefined as a fixed value or a value determined based on the bit depth.

[0565] In one embodiment, the number of previous blocks may be multiple.

[0566] A method for decoding an image according to one embodiment may include a step of generating gradient information of a current block by adding amplitudes for each intra prediction mode included in gradient information of a plurality of previous blocks based on the intra prediction mode.

[0567] A method for decoding an image according to one embodiment may include a step of generating gradient information of a current block by summing second values ​​included in gradient information of a plurality of previous blocks based on a corresponding intra prediction mode.

[0568] A method for decoding an image according to one embodiment may include a step of deriving intra prediction modes corresponding to a predetermined number of second values ​​having the largest size among second values ​​included in gradient information of a current block as intra prediction modes of the current block.

[0569] According to one embodiment, the gradient information satisfying the predetermined condition obtained from a second previous block among a plurality of previous blocks may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the second previous block, a second value corresponding to a third result obtained by summing the second result obtained by summing vertical gradients calculated from all sample sets belonging to the second previous block, and a first value corresponding to the second value.

[0570] According to one embodiment, the gradient information satisfying the predetermined condition obtained from a third previous block among a plurality of previous blocks may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the third previous block, a second value corresponding to a third result obtained by summing a second result obtained by summing vertical gradients calculated from all sample sets belonging to the third previous block, a value obtained by performing normalization based on the number of samples included in all sample sets, and a first value corresponding to the value.

[0571] According to one embodiment, the previous block may include a reference block specified within the reference picture of the current block by motion information of spatial or temporal surrounding blocks of the current block.

[0572] According to one embodiment, the previous block may include a reference block specified by a block vector of the current block within the current picture to which the current block belongs.

[0573] According to one embodiment, the block vector can be derived based on an intra block copy mode or an intra template matching mode.

[0574] A method for decoding an image according to one embodiment may include, when a plurality of intra prediction modes are derived using gradient information of a current block, a step of generating temporary prediction blocks based on each of the derived plurality of intra prediction modes and a planar mode.

[0575] A method of decoding an image according to one embodiment may include a step of generating a prediction block of a current block by weighting temporary prediction blocks.

[0576] An image decryption device according to one embodiment may include at least one memory storing at least one instruction; and at least one processor operating according to at least one instruction.

[0577] In one embodiment, at least one processor may obtain gradient information from a plurality of previous blocks that were decrypted prior to the current block.

[0578] According to one embodiment, the gradient information may include at least one intra prediction mode and an amplitude corresponding to the at least one intra prediction mode.

[0579] According to one embodiment, the gradient information may include a first value corresponding to at least one intra prediction mode, and a second value corresponding to a strength of the first value.

[0580] In one embodiment, at least one processor can generate gradient information of the current block from the acquired gradient information.

[0581] In one embodiment, at least one processor can derive an intra prediction mode of the current block based on at least one amplitude corresponding to at least one intra prediction mode included in gradient information of the current block.

[0582] In one embodiment, at least one processor can generate a predicted block of the current block by performing intra prediction on the current block using the derived intra prediction mode.

[0583] According to one embodiment, gradient information satisfying a predetermined condition obtained from a first previous block among a plurality of previous blocks may include a second value exceeding a predefined threshold among second values ​​calculated from a gradient between at least two samples belonging to the first previous block or at least two samples neighboring the first previous block, and a first value corresponding to the second value exceeding the threshold.

[0584] In one embodiment, the threshold may be predefined as a fixed value or a value determined based on the bit depth.

[0585] In one embodiment, the number of previous blocks may be multiple.

[0586] In one embodiment, at least one processor can generate gradient information of a current block by summing amplitudes for each intra prediction mode included in gradient information of a plurality of previous blocks based on the intra prediction mode.

[0587] In one embodiment, at least one processor can generate gradient information of a current block by summing second values ​​included in gradient information of a plurality of previous blocks based on a corresponding intra prediction mode.

[0588] In one embodiment, at least one processor can derive intra prediction modes corresponding to a predetermined number of second values ​​having the largest size among the second values ​​included in the gradient information of the current block as intra prediction modes of the current block.

[0589] According to one embodiment, the gradient information satisfying the predetermined condition obtained from a second previous block among a plurality of previous blocks may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the second previous block, a second value corresponding to a third result obtained by summing the second result obtained by summing vertical gradients calculated from all sample sets belonging to the second previous block, and a first value corresponding to the second value.

[0590] According to one embodiment, the gradient information satisfying the predetermined condition obtained from a third previous block among a plurality of previous blocks may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the third previous block, a second value corresponding to a third result obtained by summing a second result obtained by summing vertical gradients calculated from all sample sets belonging to the third previous block, a value obtained by performing normalization based on the number of samples included in all sample sets, and a first value corresponding to the value.

[0591] According to one embodiment, the previous block may include a reference block that is specified within the reference picture of the current block by motion information of spatial or temporal surrounding blocks of the current block.

[0592] According to one embodiment, the previous block may include a reference block specified by a block vector of the current block within the current picture to which the current block belongs.

[0593] According to one embodiment, the block vector can be derived based on an intra block copy mode or an intra template matching mode.

[0594] In one embodiment, at least one processor may generate temporary prediction blocks based on each of the derived multiple intra prediction modes and the planar mode, when the multiple intra prediction modes are derived using gradient information of the current block.

[0595] In one embodiment, at least one processor can generate a prediction block of a current block by weighting the temporary prediction blocks.

[0596] A method of encoding an image according to one embodiment may include a step of obtaining gradient information from a plurality of previous blocks encoded prior to a current block.

[0597] According to one embodiment, the gradient information may include at least one intra prediction mode and an amplitude corresponding to the at least one intra prediction mode.

[0598] According to one embodiment, the gradient information may include a first value corresponding to at least one intra prediction mode, and a second value corresponding to a strength of the first value.

[0599] A method for encoding an image according to one embodiment may include a step of generating gradient information of the current block using the acquired gradient information.

[0600] A method of encoding an image according to one embodiment may include a step of deriving an intra prediction mode of a current block based on at least one amplitude corresponding to at least one intra prediction mode included in gradient information of the current block.

[0601] A method of encoding an image according to one embodiment may include a step of generating a prediction block of a current block by performing intra prediction on the current block using an derived intra prediction mode.

[0602] According to one embodiment, gradient information satisfying a predetermined condition obtained from a first previous block among a plurality of previous blocks may include a second value exceeding a predefined threshold among second values ​​calculated from a gradient between at least two samples belonging to the first previous block or at least two samples neighboring the first previous block, and a first value corresponding to the second value exceeding the threshold.

[0603] In one embodiment, the threshold may be predefined as a fixed value or a value determined based on the bit depth.

[0604] In one embodiment, the number of previous blocks may be multiple.

[0605] A method for encoding an image according to one embodiment may include a step of generating gradient information of a current block by adding amplitudes for each intra prediction mode included in gradient information of a plurality of previous blocks based on the intra prediction mode.

[0606] A method of encoding an image according to one embodiment may include a step of generating gradient information of a current block by summing second values ​​included in gradient information of a plurality of previous blocks based on a corresponding intra prediction mode.

[0607] A method of encoding an image according to one embodiment may include a step of deriving second values ​​corresponding to a predetermined number of amplitudes having the largest size among second values ​​included in gradient information of a current block into an intra prediction mode of the current block.

[0608] According to one embodiment, the gradient information satisfying the predetermined condition obtained from a second previous block among a plurality of previous blocks may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the second previous block, a second value corresponding to a third result obtained by summing the second result obtained by summing vertical gradients calculated from all sample sets belonging to the second previous block, and a first value corresponding to the second value.

[0609] According to one embodiment, the gradient information satisfying the predetermined condition obtained from a third previous block among a plurality of previous blocks may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the third previous block, a second value corresponding to a third result obtained by summing a second result obtained by summing vertical gradients calculated from all sample sets belonging to the third previous block, a value obtained by performing normalization based on the number of samples included in all sample sets, and a first value corresponding to the value.

[0610] According to one embodiment, the previous block may include a reference block that is specified within the reference picture of the current block by motion information of spatial or temporal surrounding blocks of the current block.

[0611] According to one embodiment, the previous block may include a reference block specified by a block vector of the current block within the current picture to which the current block belongs.

[0612] According to one embodiment, the block vector can be derived based on an intra block copy mode or an intra template matching mode.

[0613] A method for encoding an image according to one embodiment may include, when a plurality of intra prediction modes are derived using gradient information of a current block, a step of generating temporary prediction blocks based on each of the derived plurality of intra prediction modes and the planar mode.

[0614] A method of encoding an image according to one embodiment may include a step of generating a prediction block of a current block by weighting temporary prediction blocks.

[0615] A method of encoding an image according to one embodiment may include a step of encoding a current block using a prediction block.

[0616] According to one embodiment, the bitrate of the bitstream can be reduced since the intra prediction mode can be derived from the surrounding area.

[0617] An image encoding device according to one embodiment may include at least one memory storing at least one instruction; and at least one processor operating according to at least one instruction.

[0618] In one embodiment, at least one processor may obtain gradient information from a plurality of previous blocks encoded prior to the current block.

[0619] According to one embodiment, the gradient information may include at least one intra prediction mode and an amplitude corresponding to the at least one intra prediction mode.

[0620] According to one embodiment, the gradient information may include a first value corresponding to at least one intra prediction mode, and a second value corresponding to a strength of the first value.

[0621] In one embodiment, at least one processor can generate gradient information of the current block from the acquired gradient information.

[0622] In one embodiment, at least one processor can derive an intra prediction mode of the current block based on at least one amplitude corresponding to at least one intra prediction mode included in gradient information of the current block.

[0623] In one embodiment, at least one processor can generate a predicted block of the current block by performing intra prediction on the current block using the derived intra prediction mode.

[0624] According to one embodiment, gradient information satisfying a predetermined condition obtained from a first previous block among a plurality of previous blocks may include a second value exceeding a predefined threshold among second values ​​calculated from a gradient between at least two samples belonging to the first previous block or at least two samples neighboring the first previous block, and a first value corresponding to the second value exceeding the threshold.

[0625] In one embodiment, the threshold may be predefined as a fixed value or a value determined based on the bit depth.

[0626] In one embodiment, the number of previous blocks may be multiple.

[0627] In one embodiment, at least one processor can generate gradient information of a current block by summing amplitudes for each intra prediction mode included in gradient information of a plurality of previous blocks based on the intra prediction mode.

[0628] In one embodiment, at least one processor can generate gradient information of a current block by summing second values ​​included in gradient information of a plurality of previous blocks based on a corresponding intra prediction mode.

[0629] In one embodiment, at least one processor can derive intra prediction modes corresponding to a predetermined number of second values ​​having a largest size among the second values ​​corresponding to intra prediction modes included in the gradient information of the current block as intra prediction modes of the current block.

[0630] According to one embodiment, the gradient information satisfying the predetermined condition obtained from a second previous block among a plurality of previous blocks may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the second previous block, a second value corresponding to a third result obtained by summing the second result obtained by summing vertical gradients calculated from all sample sets belonging to the second previous block, and a first value corresponding to the second value.

[0631] According to one embodiment, the gradient information satisfying the predetermined condition obtained from a third previous block among a plurality of previous blocks may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the third previous block, a second value corresponding to a third result obtained by summing a second result obtained by summing vertical gradients calculated from all sample sets belonging to the third previous block, a value obtained by performing normalization based on the number of samples included in all sample sets, and a first value corresponding to the value.

[0632] According to one embodiment, the previous block may include a reference block that is specified within the reference picture of the current block by motion information of spatial or temporal surrounding blocks of the current block.

[0633] According to one embodiment, the previous block may include a reference block specified by a block vector of the current block within the current picture to which the current block belongs.

[0634] According to one embodiment, the block vector can be derived based on an intra block copy mode or an intra template matching mode.

[0635] In one embodiment, at least one processor may generate temporary prediction blocks based on each of the derived multiple intra prediction modes and the planar mode, when the multiple intra prediction modes are derived using gradient information of the current block.

[0636] In one embodiment, at least one processor can generate a prediction block of a current block by weighting the temporary prediction blocks.

[0637] In one embodiment, at least one processor may encode a current block using a prediction block.

[0638] In a computer-readable recording medium having recorded thereon a bitstream according to one embodiment, the bitstream may include an encoding result of a current block.

[0639] In one embodiment, the encoding result of the current block can be generated by obtaining gradient information from a plurality of previous blocks encoded before the current block.

[0640] According to one embodiment, the gradient information may include at least one intra prediction mode and an amplitude corresponding to the at least one intra prediction mode.

[0641] According to one embodiment, the gradient information may include a first value corresponding to at least one intra prediction mode, and a second value corresponding to a strength of the first value.

[0642] In one embodiment, the encoding result of the current block can be generated by generating gradient information of the current block using the acquired gradient information.

[0643] In one embodiment, the encoding result of the current block can be generated by deriving the intra prediction mode of the current block based on at least one amplitude corresponding to at least one intra prediction mode included in gradient information of the current block.

[0644] In one embodiment, the encoding result of the current block can be generated by generating a prediction block of the current block by performing intra prediction on the current block using the derived intra prediction mode.

[0645] According to one embodiment, gradient information satisfying a predetermined condition obtained from a first previous block among a plurality of previous blocks may include a second value exceeding a predefined threshold among second values ​​calculated from a gradient between at least two samples belonging to the first previous block or at least two samples neighboring the first previous block, and a first value corresponding to the second value exceeding the threshold.

[0646] In one embodiment, the threshold may be predefined as a fixed value or a value determined based on the bit depth.

[0647] In one embodiment, the number of previous blocks may be multiple.

[0648] In one embodiment, the encoding result of the current block can be generated by generating the gradient information of the current block by adding the amplitudes for each intra prediction mode included in the gradient information of a plurality of previous blocks based on the intra prediction mode.

[0649] In one embodiment, the encoding result of the current block can be generated by generating the gradient information of the current block by adding the second values ​​included in the gradient information of a plurality of previous blocks based on the corresponding intra prediction mode.

[0650] In one embodiment, the encoding result of the current block can be generated by deriving intra prediction modes corresponding to a predetermined number of second values ​​having the largest size among second values ​​corresponding to intra prediction modes included in gradient information of the current block as intra prediction modes of the current block.

[0651] According to one embodiment, the gradient information satisfying the predetermined condition obtained from a second previous block among a plurality of previous blocks may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the second previous block, a second value corresponding to a third result obtained by summing the second result obtained by summing vertical gradients calculated from all sample sets belonging to the second previous block, and a first value corresponding to the second value.

[0652] According to one embodiment, the gradient information satisfying the predetermined condition obtained from a second previous block among a plurality of previous blocks may include a first result obtained by summing horizontal gradients calculated from all sample sets belonging to a third previous block, a second value corresponding to a third result obtained by summing the second result obtained by summing vertical gradients calculated from all sample sets belonging to the third previous block, a value obtained by performing normalization based on the number of samples included in all sample sets, and a first value corresponding to the value.

[0653] According to one embodiment, the previous block may include a reference block that is specified within the reference picture of the current block by motion information of spatial or temporal surrounding blocks of the current block.

[0654] According to one embodiment, the previous block may include a reference block specified by a block vector of the current block within the current picture to which the current block belongs.

[0655] According to one embodiment, the block vector can be derived based on an intra block copy mode or an intra template matching mode.

[0656] In one embodiment, the encoding result of the current block can be generated by generating temporary prediction blocks based on each of the derived multiple intra prediction modes and the planar mode when multiple intra prediction modes are derived using gradient information of the current block.

[0657] In one embodiment, the encoding result of the current block can be generated by generating a prediction block of the current block by weighting temporary prediction blocks.

[0658] In one embodiment, the encoding result of the current block can be generated by encoding the current block using a prediction block.

[0659] A method and device for encoding an image (3800) and a method and device for decoding an image (2000) according to one embodiment can improve the performance of predictive encoding and predictive decoding for a current block.

[0660] A method and device for encoding an image (3800) and a method and device for decoding an image (2000) according to one embodiment can reduce the amount of data required for signaling an intra prediction mode.

[0661] A method and device for encoding an image (3800) and a method and device for decoding an image (2000) according to one embodiment can reduce the bit rate of a bitstream.

[0662] The effects that can be obtained from the present disclosure are not limited to the effects mentioned above, and other effects that are not mentioned can be clearly understood by a person having ordinary skill in the art to which the present disclosure belongs from the description below.

[0663] Meanwhile, the embodiments of the present disclosure described above can be written as a program that can be executed on a computer, and the written program can be stored in a storage medium that can be read by a device.

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

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

[0666] Above, the technical idea of ​​the present disclosure has been described in detail with reference to preferred embodiments, but the technical idea of ​​the present disclosure is not limited to the above embodiments, and various modifications and changes are possible by a person having ordinary knowledge in the art within the scope of the technical idea of ​​the present disclosure.

Claims

1. In the method of decrypting a video, A step of obtaining gradient information satisfying a predetermined condition from a plurality of previous blocks decrypted before the current block; A step of generating gradient information of the current block using the acquired gradient information; A step of deriving an intra prediction mode of the current block based on gradient information of the current block; and A step of generating a prediction block of the current block by performing intra prediction on the current block using the derived intra prediction mode, A method for decoding an image, wherein the gradient information includes a first value corresponding to at least one intra prediction mode and a second value corresponding to an intensity of the first value.

2. In paragraph 1, A method for decoding an image, wherein the gradient information satisfying the predetermined condition obtained from a first previous block among the plurality of previous blocks includes a second value exceeding a predefined threshold among second values ​​calculated from a gradient between at least two samples belonging to the first previous block or at least two samples neighboring the first previous block, and a first value corresponding to the second value exceeding the threshold.

3. In paragraph 2, A method of decoding an image, wherein the threshold is predefined as a fixed value or a value determined according to bit depth.

4. In paragraph 2, The step of generating gradient information of the current block above is: A method for decoding an image, comprising the step of generating gradient information of the current block by summing second values ​​included in gradient information of the plurality of previous blocks based on a corresponding intra prediction mode.

5. In paragraph 4, The step of deriving the intra prediction mode of the current block is: A method for decoding an image, comprising the step of deriving intra prediction modes corresponding to a predetermined number of second values ​​having the largest size among second values ​​included in gradient information of the current block as intra prediction modes of the current block.

6. In paragraph 1, A method for decoding an image, wherein the gradient information satisfying the predetermined condition obtained from a second previous block among the plurality of previous blocks includes a first result of summing horizontal gradients calculated from all sample sets belonging to the second previous block, a second value corresponding to a third result of summing the second results of summing vertical gradients calculated from all sample sets belonging to the second previous block, and a first value corresponding to the second value.

7. In paragraph 1, A method for decoding an image, wherein the gradient information satisfying the predetermined condition obtained from a third previous block among the plurality of previous blocks includes a value obtained by performing normalization on a first result obtained by summing horizontal gradients calculated from all sample sets belonging to the third previous block, a second value corresponding to a third result obtained by summing the second results obtained by summing vertical gradients calculated from all sample sets belonging to the third previous block, based on the number of samples included in all sample sets, and a first value corresponding to the corresponding value.

8. In paragraph 1, A method for decoding an image, wherein the plurality of previous blocks include reference blocks specified within a reference picture of the current block by motion information of spatial or temporal surrounding blocks of the current block.

9. In any one of paragraphs 1 to 8, A method for decoding an image, wherein the plurality of previous blocks include a reference block specified by a block vector of the current block within the current picture to which the current block belongs.

10. In paragraph 1, The step of generating a prediction block of the current block is: In a case where multiple intra prediction modes are derived using the gradient information of the current block, a step of generating temporary prediction blocks based on each of the derived multiple intra prediction modes and the planar mode; and A method for decoding an image, comprising the step of generating a prediction block of the current block by weighting the temporary prediction blocks.

11. In a video decryption device, At least one memory storing at least one instruction; and comprising at least one processor operating in accordance with at least one instruction; At least one processor of the above, Obtain gradient information satisfying a given condition from multiple previous blocks decrypted before the current block, Using the gradient information obtained above, the gradient information of the current block is generated, Inducing an intra prediction mode of the current block based on the gradient information of the current block, Generate a prediction block of the current block by performing intra prediction on the current block using the intra prediction mode. An image decoding device, wherein the gradient information includes a first value corresponding to at least one intra prediction mode and a second value corresponding to the intensity of the first value.

12. In the method of encoding an image, A step of obtaining gradient information satisfying a predetermined condition from a plurality of previous blocks encoded before the current block; A step of generating gradient information of the current block using the acquired gradient information; A step of determining an intra prediction mode of the current block based on gradient information of the current block; and A step of generating a prediction block of the current block by performing intra prediction on the current block using the intra prediction mode, A method for encoding an image, wherein the gradient information includes a first value corresponding to at least one intra prediction mode and a second value corresponding to the intensity of the first value.

13. In a video encoding device, At least one memory storing at least one instruction; and comprising at least one processor operating in accordance with at least one instruction; At least one processor of the above, Obtain gradient information satisfying a predetermined condition from multiple previous blocks encoded before the current block, Using the gradient information obtained above, the gradient information of the current block is generated, Determine the intra prediction mode of the current block based on the gradient information of the current block, Generate a prediction block of the current block by performing intra prediction on the current block using the intra prediction mode. An image encoding device, wherein the gradient information includes a first value corresponding to at least one intra prediction mode and a second value corresponding to the intensity of the first value.

14. In a computer-readable recording medium that records a bitstream, The above bitstream contains the encoding result of the current block, The encoding result of the current block above is, Obtain gradient information satisfying a predetermined condition from a plurality of previous blocks encoded before the current block, Using the gradient information obtained above, the gradient information of the current block is generated, Determine the intra prediction mode of the current block based on the gradient information of the current block, By performing intra prediction on the current block using the above intra prediction mode, a prediction block of the current block is generated, is generated by encoding the current block using the above prediction block, A recording medium, wherein the gradient information includes a first value corresponding to at least one intra prediction mode and a second value corresponding to the intensity of the first value.

Citation Information

Patent Citations

  • Semiconductor package

    KR1020230113020A

  • Energy saving system and method for Cargo Hold within ventilation system

    KR1020240045630A

  • Reactive flavor-induced anchovy fish sauce seasoning material and its manufacturing method

    KR1020240118585A

  • Image sensor and manufacturing method of image sensor

    KR1020250008220A

  • Semiconductor devices including substrate structure

    KR1020250042997A