Image encoding method, image encoding device, image decoding method and image decoding device, which use temporal reference sample and spatial reference sample

WO2024248319A3PCT designated stage expired Publication Date: 2025-08-14SAMSUNG ELECTRONICS CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2024/005017
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-08-11
Filing Date
2024-04-15
Publication Date
2025-08-14

AI Technical Summary

Technical Problem

Current video encoding and decoding methods face challenges in efficiently utilizing temporal and spatial reference samples for inter and intra prediction, leading to suboptimal compression and artifact removal in image processing.

Method used

The method involves using a combination of first and second sample sets, where the first set includes reconstructed samples adjacent to the current block and the second set includes unreconstructed samples, for intra prediction, allowing for improved prediction and decoding of image blocks by selecting appropriate reference samples from these sets.

Benefits of technology

This approach enhances the efficiency of inter and intra prediction, leading to better compression and reduced artifacts in image processing by leveraging both reconstructed and unreconstructed samples for more accurate prediction and decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2024005017_14082025_PF_FP_ABST
    Figure KR2024005017_14082025_PF_FP_ABST
Patent Text Reader

Abstract

The disclosed image decoding method according to one embodiment comprises the steps of: determining, from samples reconstructed earlier than the current block in the current picture or in a previous picture, a first sample set corresponding to a first neighboring sample set adjacent to the current block and / or a second sample set corresponding to a second neighboring sample set adjacent to the current block, the first neighboring sample set including samples reconstructed earlier than the current block and the second neighboring sample set including samples that have not been reconstructed; performing intra prediction on the current block by using, as a reference sample of the current block, a sample included in the first sample set and / or the second sample set; and reconstructing the current block from a prediction block generated through the intra prediction result.
Need to check novelty before this filing date? Find Prior Art

Description

A method for encoding an image using temporal reference samples and spatial reference samples, an encoding device, a decoding method, and a decoding device

[0001] The present disclosure relates to the field of video encoding and decoding, and more particularly, to a device and method for encoding and decoding a video using temporal reference samples and spatial reference samples.

[0002] In image encoding and decoding, the image is divided into blocks, and each block is 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 uses a reference image to predict blocks in the current 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] Codecs such as H.264 AVC (Advanced Video Coding) and HEVC (High Efficiency Video Coding) 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 difference between the motion vector of the current block and the motion vector predictor, called the motion vector difference, is signaled to the decoder 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 prediction mode. The predicted block is then subtracted from the current block to create a residual block.

[0006] The residual block generated through inter-prediction or intra-prediction undergoes transformation and quantization and is then passed to the decoder. The decoder dequantizes and inversely transforms the residual block, and combines 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 of decoding an image according to one embodiment includes determining at least one of a first set of samples corresponding to a first set of neighboring samples adjacent to a current block or a second set of samples corresponding to a second set of neighboring samples adjacent to the current block from samples reconstructed before a current block in a current picture or a previous picture, wherein the first set of neighboring samples may include samples reconstructed before the current block, and the second set of neighboring samples may include samples that have not been reconstructed.

[0008] A method for decoding an image according to one embodiment may include a step of performing intra prediction on a current block by using a sample included in at least one of a first sample set or a second sample set as a reference sample of the current block.

[0009] A method of decoding an image according to one embodiment may include a step of restoring a current block from a prediction block generated as a result of performing intra prediction.

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

[0011] In one embodiment, at least one processor can determine at least one of a first set of samples corresponding to a first set of neighboring samples adjacent to the current block or a second set of samples corresponding to a second set of neighboring samples adjacent to the current block from samples reconstructed before the current block within the current picture or a previous picture.

[0012] In one embodiment, the first set of surrounding samples may include samples that were reconstructed before the current block, and the second set of surrounding samples may include samples that were not reconstructed.

[0013] In one embodiment, at least one processor can perform intra prediction on the current block using a sample included in at least one of the first sample set or the second sample set as a reference sample of the current block.

[0014] In one embodiment, at least one processor can reconstruct a current block from a predicted block generated as a result of performing intra prediction.

[0015] A method of encoding an image according to one embodiment may include determining at least one of a first sample set corresponding to a first set of neighboring samples adjacent to a current block or a second sample set corresponding to a second set of neighboring samples adjacent to the current block from samples encoded before the current block in a current picture or a previous picture.

[0016] In one embodiment, the first set of surrounding samples may include samples encoded prior to the current block, and the second set of surrounding samples may include unencoded samples.

[0017] A method of encoding an image according to one embodiment may include a step of performing intra prediction on a current block by using a sample included in at least one of a first sample set or a second sample set as a reference sample of the current block.

[0018] A method of encoding an image according to one embodiment may include a step of encoding a current block from a prediction block generated as a result of performing intra prediction.

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

[0020] In one embodiment, at least one processor can determine at least one of a first set of samples corresponding to a first set of neighboring samples adjacent to the current block or a second set of samples corresponding to a second set of neighboring samples adjacent to the current block from samples encoded prior to the current block within the current picture or a previous picture.

[0021] In one embodiment, the first set of surrounding samples may include samples encoded prior to the current block, and the second set of surrounding samples may include unencoded samples.

[0022] In one embodiment, at least one processor can perform intra prediction on the current block using a sample included in at least one of the first sample set or the second sample set as a reference sample of the current block.

[0023] In one embodiment, at least one processor can encode a current block from a predicted block generated as a result of performing intra prediction.

[0024] A computer-readable recording medium according to one embodiment can record a bitstream, and the bitstream can include an encoding result for a current block.

[0025] In one embodiment, the encoding result for the current block can be generated by determining at least one of a first sample set corresponding to a first set of neighboring samples adjacent to the current block or a second sample set corresponding to a second set of neighboring samples adjacent to the current block from samples encoded before the current block in the current picture or a previous picture.

[0026] In one embodiment, the first set of surrounding samples may include samples encoded prior to the current block, and the second set of surrounding samples may include unencoded samples.

[0027] In one embodiment, the encoding result for the current block can be generated by performing intra prediction on the current block using samples included in at least one of the first sample set or the second sample set as reference samples of the current block.

[0028] In one embodiment, the encoding result for the current block can be generated by encoding the current block from a predicted block generated as a result of performing intra prediction.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0049] FIG. 21 is a diagram showing types of intra prediction modes according to one embodiment.

[0050] FIG. 22 is a diagram illustrating surrounding samples that can be used for intra prediction for a current block according to one embodiment.

[0051] FIG. 23 is a diagram for explaining a process in which a current block is predicted using a first set of surrounding samples according to an intra prediction mode according to one embodiment.

[0052] FIG. 24 is a diagram illustrating a temporal reference block and a spatial reference block according to one embodiment.

[0053] FIG. 25 is a diagram showing the locations of surrounding blocks related to a current block according to one embodiment.

[0054] FIG. 26 is a diagram showing a first sample set and a second sample set determined around a reference block according to one embodiment.

[0055] FIG. 27 is a diagram illustrating a method for determining a first sample set and a second sample set through template matching according to one embodiment.

[0056] FIG. 28 is a diagram illustrating a method for performing intra prediction for a current block using a first sample set according to one embodiment.

[0057] FIG. 29 is a diagram illustrating a method for performing intra prediction for a current block using a second sample set according to one embodiment.

[0058] FIG. 30 is a diagram illustrating a method for performing intra prediction for a current block using a second sample set according to one embodiment.

[0059] FIG. 31 is a diagram for explaining a method for performing intra prediction for a current block using a first set of surrounding samples and a second set of samples of the current block according to one embodiment.

[0060] FIG. 32 is a diagram illustrating a method for performing intra prediction for a current block using a first sample set and a second sample set according to one embodiment.

[0061] FIG. 33 is a diagram for explaining a process of performing inter prediction on a current block using a temporal reference block and a spatial reference block according to one embodiment.

[0062] FIG. 34 is a diagram for explaining a process of performing inter prediction on a current block using a temporal reference block and a spatial reference block according to one embodiment.

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

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

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

[0066] A method of decoding an image according to one embodiment includes determining at least one of a first set of samples corresponding to a first set of neighboring samples adjacent to a current block or a second set of samples corresponding to a second set of neighboring samples adjacent to the current block from samples reconstructed before a current block in a current picture or a previous picture, wherein the first set of neighboring samples may include samples reconstructed before the current block, and the second set of neighboring samples may include samples that have not been reconstructed.

[0067] A method for decoding an image according to one embodiment may include a step of performing intra prediction on a current block by using a sample included in at least one of a first sample set or a second sample set as a reference sample of the current block.

[0068] A method of decoding an image according to one embodiment may include a step of restoring a current block from a prediction block generated as a result of performing intra prediction.

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

[0070] In describing the embodiments, detailed descriptions of related known technologies are 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 the embodiments correspond to identification symbols used to distinguish one component from another.

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

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

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

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

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

[0076] In the present disclosure, a 'first set of neighboring samples' may represent a set of neighboring samples adjacent to a current block, which are reconstructed or encoded before the current block, and a 'second set of neighboring samples' may represent a set of neighboring samples adjacent to the current block, which are to be reconstructed or encoded later than the current block. In one embodiment, when the 'first set of neighboring samples' is used for predictive encoding and predictive decoding of the current block, some samples in the first set of neighboring samples may not have been reconstructed or encoded before the current block. In this case, samples that have not been reconstructed or encoded may be generated through a predetermined method.

[0077] In the present disclosure, a 'first sample set' may represent a set of samples determined or selected within a current picture or a previous picture for predictive encoding and predictive decoding of a current block, and a 'second sample set' may represent a set of samples determined or selected within a current picture or a previous picture for predictive encoding and predictive decoding of a current block. The 'first sample set' may correspond to a 'first surrounding sample set', and the 'second sample set' may correspond to a 'second surrounding sample set'.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0195] Furthermore, the image decoding device (100) may 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) may include a non-square second encoding unit (1414a, 1414c) and a square second encoding unit (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).

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0259] 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 instructions stored in a memory.

[0260] The image decoding device (2000) may include a memory that stores 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 that controls data input / output of the memory.

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

[0262] The acquisition unit (2010) can acquire a bitstream generated as a result of encoding a picture. The bitstream can include an encoding result for the current block.

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

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

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

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

[0267] In one embodiment, the bitstream may include information about the prediction mode of a current block within a current picture. The current block may be a largest coding unit, a coding unit, a transform unit, or a prediction unit partitioned from the current picture to be decoded.

[0268] In one embodiment, the prediction mode of the current block can be intra mode or inter mode.

[0269] The prediction decoding unit (2030) can restore the current block by performing intra prediction or inter prediction on the current block according to the prediction mode of the current block.

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

[0271] In one embodiment, the acquisition unit (2010) can acquire information from the bitstream indicating whether a temporal reference sample or a spatial reference sample, described later, is used for intra prediction of the current block when the prediction mode of the current block is intra mode.

[0272] When a temporal reference sample is used for intra prediction, the acquisition unit (2010) can acquire information indicating the index of a previous picture including the temporal reference sample from the bitstream. In one embodiment, the previous picture may mean a picture reconstructed before the current picture.

[0273] In intra mode, a prediction block of the current block can be generated based on surrounding samples of the current block according to the intra prediction mode, under the assumption that there will be continuity between surrounding samples of the current block and samples within the current block.

[0274] In inter mode, a prediction block of the current block can be generated based on a block in the previous picture, under the assumption that there will be similarity between the current block in the current picture and the block in the previous picture.

[0275] According to one embodiment, when the prediction mode of the current block is an intra mode, the prediction decoding unit (2030) can use not only the surrounding samples of the current block included in the current picture, but also the spatial reference samples included in the current picture or the temporal reference samples included in the previous picture for intra prediction.

[0276] The size of the residual data can be reduced if samples of the current block are predicted using not only samples immediately adjacent to the current block, but also samples far from the current block.

[0277] For example, even if there is continuity between the samples of the current block and the surrounding samples located at the lower right of the current block, the surrounding samples located at the lower right of the current block cannot be used for intra prediction of the current block because they have not yet been restored according to the raster scan method. However, if samples corresponding to the lower right surrounding samples of the current block among the samples restored before the current block are used for intra prediction, the continuity between the samples of the current block and the lower right surrounding samples of the current block can be considered, and thus the efficiency of prediction can be increased.

[0278] A method for performing intra prediction on the current block using spatial reference samples or temporal reference samples is described below.

[0279] When a prediction block corresponding to the current block is generated, the prediction decoding unit (2030) can generate a restored current block using the prediction block.

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

[0281] 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) with the prediction block.

[0282] The restored current block can be used as a reference block for the next block.

[0283] Hereinafter, intra prediction performed by the prediction decoding unit (2030) will be described with reference to FIGS. 21 to 32.

[0284] FIG. 21 is a diagram showing types of intra prediction modes according to one embodiment.

[0285] An intra prediction mode of the current block can be determined to perform intra prediction on the current block.

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

[0287] The intra prediction mode of the current block can be any one of multiple intra prediction modes.

[0288] In one embodiment, the plurality of intra prediction modes may include directional intra prediction modes and non-directional intra prediction modes.

[0289] Referring to FIG. 21, in one embodiment, the plurality of intra prediction modes may include 0 non-directional Intra_Planar modes, 1 non-directional Intra_DC mode, and 2 to 34 directional Intra_Angular modes.

[0290] In Intra_Angular modes, the locations of reference samples for generating prediction samples for samples within the current block can be identified based on the direction or angle indicated by the Intra_Angular modes. For example, in mode 18, reference samples located at a direction of -32 degrees relative to the samples within the current block can be identified.

[0291] The intra prediction modes illustrated in FIG. 21 are examples, and the number and types of intra prediction modes available in the intra mode according to one embodiment may be set in various ways.

[0292] FIG. 22 is a diagram illustrating surrounding samples that can be used for intra prediction for a current block according to one embodiment.

[0293] In one embodiment, the prediction decoding unit (2030) can identify a first set of neighboring samples (2210) adjacent to the current block (2250) to perform intra prediction for the current block (2250).

[0294] The prediction decoding unit (2030) can generate a prediction block according to the intra prediction mode of the current block (2250) using the identified first peripheral sample set (2210) as a reference sample.

[0295] In one embodiment, once a first set of peripheral samples (2210) is identified, filtering according to an intra prediction mode can be applied to the identified first set of peripheral samples (2210), and a prediction block of the current block (2250) can be generated based on the filtered set of samples.

[0296] Referring to FIG. 22, in one embodiment, the first set of peripheral samples (2210) may be identified for intra prediction, including peripheral samples (2211) located to the left of the current block (2250) (hereinafter, left samples (2211) within the first set of peripheral samples (2210)) and peripheral samples (2212) located above the current block (2250) (hereinafter, upper samples (2212) within the first set of peripheral samples (2210)).

[0297] FIG. 22 illustrates a current block (2250) of 4x4 size and a first set of surrounding samples (2210) including five left samples (2211) and five upper samples (2212). The number of left samples (2211) and the number of upper samples (2212) used for intra prediction of the current block (2250) can be set in various ways.

[0298] For example, for intra prediction of the current block (2250), the prediction decoding unit (2030) can identify 2n+1 left samples (2211) (where n is the height of the current block (2250)) and 2m upper samples (2212) (where m is the width of the current block (2250)).

[0299] In one embodiment, the left samples (2211) within the first peripheral sample set (2210) are shown in FIG. 22 as being arranged in one column, but in another embodiment, the left samples (2211) within the first peripheral sample set (2210) may be arranged in two or more columns. Additionally, the upper samples (2212) within the first peripheral sample set (2210) may also be arranged in two or more rows.

[0300] In one embodiment, if some of the peripheral samples of the first peripheral sample set (2210) required for intra prediction have not been restored, the prediction decoding unit (2030) may generate the unrestored peripheral samples through padding.

[0301] In one embodiment, when a first set of surrounding samples (2210) of a current block (2250) is identified, the prediction decoding unit (2030) can generate a prediction block of the current block (2250) using the first set of surrounding samples (2210).

[0302] For example, the prediction decoding unit (2030) can generate prediction samples of samples within the current block (2250) using surrounding samples identified based on the intra prediction mode of the current block (2250). A set of prediction samples can be defined as a prediction block.

[0303] In one embodiment, the prediction decoding unit (2030) may filter the first set of surrounding samples (2210) according to an intra prediction mode to generate a prediction block, and identify surrounding samples corresponding to each of the samples in the current block (2250) among the filtered set of surrounding samples according to the intra prediction mode. Then, the prediction decoding unit (2030) may apply the identified surrounding samples to a predetermined operation formula to generate prediction samples of the samples in the current block (2250).

[0304] As described above, when the current picture (2200) or the current slice is restored according to the raster scan order, most of the samples included in the first peripheral sample set (2210) are restored, so there may be no major problem in performing intra prediction on the current block (2250) using the first peripheral sample set (2210). However, since the second peripheral sample set (2230) of the current block (2250) is not restored before the current block (2250), it is difficult to use the second peripheral sample set (2230) for intra prediction of the current block (2250).

[0305] In one embodiment, the second peripheral sample set (2230) may include samples located to the right of the current block (2250) (hereinafter, right samples (2231) within the second peripheral sample set (2230)) and samples located below the current block (2250) (hereinafter, bottom samples (2232) within the second peripheral sample set (2230)).

[0306] Since the second set of neighboring samples (2230) is not restored before the current block (2250), in one embodiment, the prediction decoding unit (2030) can determine a temporal reference sample or a spatial reference sample corresponding to the second set of neighboring samples (2230) and intra-predict the current block (2250) using the temporal reference sample or the spatial reference sample.

[0307] In FIG. 22, the first peripheral sample set (2210) is illustrated as being located at the upper left side of the current block (2250), and the second peripheral sample set (2230) is illustrated as being located at the lower right side of the current block (2250), assuming that restoration of the upper block and the left block of the current block (2250) is completed before restoration of the current block (2250). Therefore, in one embodiment, if restoration of the upper block and the right block of the current block (2250) is completed before restoration of the current block (2250), the first peripheral sample set (2210) may be located at the upper right side of the current block (2250), and the second peripheral sample set (2230) may be located at the lower left side of the current block (2250). Accordingly, the first sample set (2480) described below is considered to be located on the upper right side of the current block (2250) and can be used for intra prediction of the current block (2250), and the second sample set (2490) is considered to be located on the lower left side of the current block (2250) and can be used for intra prediction of the current block (2250).

[0308] A process of performing intra prediction on the current block (2250) using the first surrounding sample set (2210) is described with reference to FIG. 23.

[0309] FIG. 23 is a diagram for explaining a process in which a current block is predicted using a first set of surrounding samples according to an intra prediction mode according to one embodiment.

[0310] As described above, when the first peripheral sample set (2210) of the current block (2250) is confirmed, the prediction decoding unit (2030) can generate prediction samples of the samples of the current block (2250) based on the first peripheral sample set (2210).

[0311] Some of the Intra_Angular modes may require only the left samples (2211) within the first peripheral sample set (2210), other modes may require only the upper samples (2212) within the first peripheral sample set (2210), and yet other modes may require both the left samples (2211) within the first peripheral sample set (2210) and the upper samples (2212) within the first peripheral sample set (2210).

[0312] In the 18th intra prediction mode, both the left samples (2211) within the first set of surrounding samples (2210) and the upper samples (2212) within the first set of surrounding samples (2210) can be used to generate prediction samples of the samples within the current block (2250), as illustrated in FIG. 23.

[0313] FIG. 23 illustrates that the left samples (2211) within the first peripheral sample set (2210) are arranged to the left of the upper samples (2212) within the first peripheral sample set (2210), which may mean that the sample values ​​of the left samples (2211) and the sample values ​​of the upper samples (2212) are stored consecutively in memory.

[0314] In one embodiment, the prediction decoding unit (2030) can identify surrounding samples corresponding to each of the samples in the current block (2250) among the surrounding samples (2211, 2212) in the first surrounding sample set (2210), and apply the sample values ​​of the identified surrounding samples to a predetermined calculation formula to produce sample values ​​of the prediction samples.

[0315] For example, in order to obtain a prediction sample of a sample (2301) located at (3, 1) within a current block (2250), a surrounding sample (2303) among left samples (2211) within a first surrounding sample set (2210) can be identified along a direction (2300) indicated by an intra prediction mode. By applying the sample value of the identified surrounding sample (2303) to a predetermined calculation formula, a prediction sample value of a sample (2301) located at (3, 1) within the current block (2250) can be obtained.

[0316] Additionally, a peripheral sample (2304) among upper samples (2212) within a first peripheral sample set (2210) can be identified along a direction (2300) indicated by the intra prediction mode to obtain a prediction sample of a sample (2302) located at (1, 3) within the current block (2250). By applying the sample value of the identified peripheral sample (2304) to a predetermined calculation formula, a prediction sample value of a sample (2302) located at (1, 3) within the current block (2250) can be obtained.

[0317] When the prediction sample values ​​of the samples in the current block (2250) are obtained based on the first peripheral sample set (2210), the prediction decoding unit (2030) can restore the current block (2250) using the obtained prediction sample values.

[0318] As described above, in one embodiment, in addition to the first set of surrounding samples (2210) of the current block (2250), spatial reference samples or temporal reference samples may be used for intra prediction of the current block (2250). A method for determining spatial reference samples and temporal reference samples will be described with reference to FIGS. 24 to 27.

[0319] FIG. 24 is a diagram illustrating a temporal reference block and a spatial reference block according to one embodiment.

[0320] In one embodiment, the prediction decoding unit (2030) can determine a reference block within the current picture (2200) or the previous picture (2400) for intra prediction of the current block (2250).

[0321] If the reference block is included in the current picture (2200), the reference block may correspond to a spatial reference block (2270), and if the reference block is included in the previous picture (2400), the reference block may correspond to a temporal reference block (2470).

[0322] In one embodiment, the prediction decoding unit (2030) may determine that the temporal reference block (2470) (or temporal reference sample) is available when the slice including the current block (2250) is an inter-slice. For example, the prediction decoding unit (2030) may determine that the temporal reference block (2470) (or temporal reference sample) is unavailable when the slice including the current block (2250) is an intra-slice.

[0323] In one embodiment, the prediction decoding unit (2030) can determine a spatial reference block (2270) or a temporal reference block (2470) within the current picture (2200) or the previous picture (2400) based on information indicating the location of the reference block.

[0324] In one embodiment, information indicating the location of a reference block may include a block vector (2252) indicating the location of a spatial reference block (2270) or a motion vector (2254) indicating the location of a temporal reference block (2470).

[0325] In one embodiment, the prediction decoding unit (2030) can determine a spatial reference block (2270) pointed to by a block vector (2252) among previous blocks reconstructed before the current block (2250) in the current picture (2200).

[0326] In one embodiment, the prediction decoding unit (2030) can determine a temporal reference block (2470) pointed to by a motion vector (2254) within a previous picture (2400) that was reconstructed before the current picture (2200).

[0327] The vector (2252) pointing to the spatial reference block (2270) is expressed as a block vector, and the vector (2254) pointing to the temporal reference block (2470) is expressed as a motion vector. Hereinafter, the block vector (2252) and the motion vector (2254) are integrated and referred to as a motion vector. Therefore, the motion vector described below may mean the block vector (2252) pointing to the spatial reference block (2270) and / or the motion vector (2254) pointing to the temporal reference block (2470).

[0328] In one embodiment, the prediction decoding unit (2030) can obtain motion vector related information from the bitstream to determine the motion vector.

[0329] In one embodiment, the motion vector related information may include information (e.g., a flag or index) pointing to any one of the motion vector candidates included in a pre-built set of motion vector candidates.

[0330] In one embodiment, the prediction decoding unit (2030) may build a motion vector candidate set using motion vectors of surrounding blocks temporally or spatially related to the current block (2250), and determine a motion vector for pointing to a reference block (2270, 2470) based on information obtained from the bitstream.

[0331] In one embodiment, the prediction decoding unit (2030) may determine a motion vector pointing to a reference block (2270, 2470) by combining a motion vector indicated by information obtained from a bitstream among motion vector candidates in a motion vector candidate set and a motion vector difference obtained from the bitstream.

[0332] The surrounding blocks temporally or spatially related to the current block (2250) are described with reference to FIG. 25.

[0333] FIG. 25 is a diagram showing the locations of surrounding blocks related to a current block according to one embodiment.

[0334] Referring to FIG. 25, a temporal neighboring block may include at least one of a block (Col) located at the same point as the current block (2250) within a picture having a different POC (e.g., POC A) than the POC (Picture Order Count) of the current picture including the current block (2250) (e.g., POC B) or a block (Br) spatially adjacent to the block (Col) at the same position. The POC may mean a value assigned to the picture according to the output order.

[0335] The block (Br) may be located at the lower right of the block (Col) located at the same point as the current block (2250). The block (Col) located at the same point as the current block (2250) may be a block that includes a sample corresponding to the central sample in the current block (2250) among the samples in the picture of POC A.

[0336] The spatial surrounding blocks may include at least one of a lower left corner block (A0), a lower left block (A1), an upper right corner block (B0), an upper right block (B1), or an upper left corner block (B2).

[0337] The locations of the temporal peripheral blocks and spatial peripheral blocks illustrated in Figure 25 are an example, and the locations and number of the temporal peripheral blocks and spatial peripheral blocks may be changed in various ways.

[0338] In one embodiment, when constructing a motion vector candidate set, the prediction decoding unit (2030) may determine each motion vector candidate included in the motion vector candidate set through template matching based on the motion vectors of temporal neighboring blocks and / or spatial neighboring blocks. The motion vectors of the temporal neighboring blocks and / or spatial neighboring blocks may be adjusted through template matching based on the motion vectors of the temporal neighboring blocks and / or spatial neighboring blocks.

[0339] In one embodiment, the prediction decoding unit (2030) may determine a first sample set and / or a second sample set around the reference block (2270, 2470) when the reference block (2270, 2470) is determined within the current picture (2200) or the previous picture (2400).

[0340] If the reference block (2270, 2470) is included in the current picture (2200), the first sample set and / or the second sample set may correspond to spatial reference samples, and if the reference block (2270, 2470) is included in the previous picture (2400), the first sample set and / or the second sample set may correspond to temporal reference samples.

[0341] FIG. 26 is a diagram showing a first sample set and a second sample set determined around a reference block according to one embodiment.

[0342] FIG. 26 illustrates a reference block (2470) included in a previous picture (2400), but the reference block may also be included in the current picture (2200).

[0343] The prediction decoding unit (2030) can determine a first sample set (2480) including samples (2481) adjacent to the left side of the reference block (2470) and samples (2842) adjacent to the top side of the reference block (2470). Hereinafter, the samples (2481) adjacent to the left side of the reference block (2470) are referred to as left samples (2481) within the first sample set (2480), and the samples (2842) adjacent to the top side of the reference block (2470) are referred to as upper samples (2482) within the first sample set (2480).

[0344] The first sample set (2480) is located on the upper left side of the reference block (2470), so it can correspond to the first peripheral sample set (2210) of the current block (2450).

[0345] In FIG. 26, when the size of the current block (2250) is 4x4, the number of left samples (2481) in the first sample set (2480) and the number of upper samples (2482) in the first sample set (2480) are each 5, but the number of left samples (2481) in the first sample set (2480) and the number of upper samples (2482) in the first sample set (2480) can be set in various ways.

[0346] For example, for intra prediction of the current block (2250), the prediction decoding unit (2030) can determine 2n+1 left samples (2481) (where n is the height of the current block (2250)) and 2m upper samples (2482) (where m is the width of the current block (2250)).

[0347] In one embodiment, the prediction decoding unit (2030) may determine a second sample set (2490) including samples (2491) adjacent to the right side of the reference block (2470) and samples (2492) adjacent to the bottom side of the reference block (2470). Hereinafter, the samples (2491) adjacent to the right side of the reference block (2470) are referred to as right samples (2491) within the second sample set (2490), and the samples (2492) adjacent to the bottom side of the reference block (2470) are referred to as bottom samples (2492) within the second sample set (2490).

[0348] The second sample set (2490) is located on the lower right side of the reference block (2470), so it can correspond to the second peripheral sample set (2230) of the current block (2450).

[0349] In FIG. 26, when the size of the current block (2250) is 4x4, the number of right samples (2491) in the second sample set (2490) and the number of lower samples (2492) in the second sample set (2490) are each 5, but the number of right samples (2491) in the second sample set (2490) and the number of lower samples (2492) in the second sample set (2490) can be set in various ways.

[0350] For example, for intra prediction of the current block (2250), the prediction decoding unit (2030) can identify 2n+1 right samples (2491) (where n is the height of the current block (2250)) and determine 2m lower samples (2492) (where m is the width of the current block (2250)).

[0351] In one embodiment, the prediction decoding unit (2030) may determine the first sample set (2480) and / or the second sample set (2490) according to a template matching method, which is described with reference to FIG. 27.

[0352] Fig. 27 is a drawing for explaining a template matching method according to one embodiment.

[0353] In one embodiment, the prediction decoding unit (2030) may use the first surrounding sample set (2210) of the current block (2250) as a template to search for a template most similar to the template within the previous picture (2400) or the current picture (2200), and determine the searched template as the first sample set (2480).

[0354] To search for a similar template, the prediction decoding unit (2030) may determine a base motion vector. For example, a predetermined motion vector (e.g., a zero vector) or a motion vector of a block at a predetermined location may be determined as the base motion vector.

[0355] The prediction decoding unit (2030) can search for a template most similar to the template within a predetermined range centered on the point indicated by the basic motion vector, and determine the similar template as the first sample set (2480).

[0356] Although Figure 27 illustrates that a similar template is searched in the previous picture (2400), the similar template may also be searched in the current picture (2200).

[0357] In one embodiment, when the first sample set (2480) is identified, the prediction decoding unit (2030) can determine the second sample set (2490) by considering the location of the first sample set (2480) and the size of the current block (2250).

[0358] As illustrated in FIG. 26, the left samples (2481) in the first sample set (2480) and the right samples (2491) in the second sample set (2490) are spaced apart from each other by the width of the reference block (2470). If the width of the reference block (2470) is the same as the width of the current block (2250), the prediction decoding unit (2030) can determine the right samples (2491) in the second sample set (2490) located at a point spaced apart from the left samples (2481) in the first sample set (2480) by the width of the current block (2250) when the left samples (2481) in the first sample set (2480) are determined through template matching.

[0359] In addition, as illustrated in FIG. 26, the upper samples (2482) in the first sample set (2480) and the lower samples (2492) in the second sample set (2490) are spaced apart from each other by the height of the reference block (2470). If the height of the reference block (2470) is the same as the height of the current block (2250), the prediction decoding unit (2030) can determine the lower samples (2492) in the second sample set (2490) located at a point spaced apart from the upper samples (2482) in the first sample set (2480) by the height of the current block (2250) when the upper samples (2482) in the first sample set (2480) are determined through template matching.

[0360] In one embodiment, the prediction decoding unit (2030) may obtain information indicating a method for determining the first sample set (2480) and / or the second sample set (2490) from the bitstream, and determine the first sample set (2480) and / or the second sample set (2490) according to the method indicated by the information obtained from the bitstream.

[0361] For example, if the method of determining the first sample set (2480) and / or the second sample set (2490) is a method using a reference block, the prediction decoding unit (2030) may determine a reference block within the current picture (2200) or the previous picture (2400) based on information indicating the reference block, and may determine the first sample set (2480) and / or the second sample set (2490) from among surrounding samples of the reference block.

[0362] Additionally, for example, if the method for determining the first sample set (2480) and / or the second sample set (2490) is a template matching method, the prediction decoding unit (2030) may use the first surrounding sample set (2210) as a template to determine the first sample set (2480) and / or the second sample set (2490) within the current picture (2200) or the previous picture (2400).

[0363] In one embodiment, the prediction decoding unit (2030) may use the first sample set (2480) and / or the second sample set (2490) for intra prediction for the current block (2250) when the first sample set (2480) and / or the second sample set (2490) are determined within the current picture (2200) or the previous picture (2400).

[0364] As described above, the efficiency of intra prediction can be increased by utilizing not only the surrounding samples adjacent to the current block (2250) but also the temporal reference samples and / or spatial reference samples within the current picture (2200) or the previous picture (2400) for intra prediction of the current block (2250).

[0365] For example, if the previous picture (2400) is encoded / decoded with a higher quality than the current picture (2200), the prediction accuracy can be improved by using the temporal reference sample included in the previous picture (2400) for intra prediction of the current block (2250). If the previous picture (2400) is encoded / decoded with a higher quality than the current picture (2200), for example, the quantization parameter used for encoding and decoding the previous picture (2400) may be smaller than the quantization parameter used for encoding and decoding the current picture (2200).

[0366] FIG. 28 is a diagram illustrating a method for performing intra prediction for a current block using a first sample set according to one embodiment.

[0367] FIG. 28 illustrates that the first sample set (2480) is included in the previous picture (2400), but the first sample set (2480) may also be included in the current picture (2200).

[0368] As described with reference to FIG. 26, the first sample set (2480) may include left samples (2481) and upper samples (2482).

[0369] For example, when the size of the current block (2250) is 4x4, the number of left samples (2481) in the first sample set (2480) may be 9, and the number of upper samples (2482) in the first sample set (2480) may be 8.

[0370] In one embodiment, the prediction decoding unit (2030) can generate a prediction block of the current block (2250) through intra prediction using the first sample set (2480) as reference samples of the current block (2250).

[0371] Using the first sample set (2480) as reference samples of the current block (2250) can be understood as borrowing the first sample set (2480) to the upper left of the current block (2250) and using it for intra prediction of the current block (2250).

[0372] In general, since the first peripheral sample set (2210) illustrated in FIG. 22 is used for intra prediction of the current block (2250), when the first sample set (2480) is to be used, the first sample set (2480) can be seen as replacing the first peripheral sample set (2210).

[0373] For example, the prediction decoding unit (2030) can change the location of the first sample set (2480) to the upper left side of the current block (2250) and perform intra prediction for the current block (2250) using the changed location of the first sample set (2480).

[0374] When the first sample set (2480) replaces the first surrounding sample set (2210), since the first sample set (2480) is located on the upper left side of the current block (2250) like the first surrounding sample set (2210), the prediction decoding unit (2030) can generate a prediction block using the first sample set (2480) according to the intra prediction process described with reference to FIG. 23.

[0375] In one embodiment, the prediction decoding unit (2030) may filter the first sample set (2480) according to an intra prediction mode before using the first sample set (2480) for intra prediction.

[0376] In one embodiment, the prediction decoding unit (2030) can generate a first prediction block of the current block (2250) based on the first set of surrounding samples (2210) and can generate a second prediction block of the current block (2250) based on the first set of samples (2480).

[0377] The prediction decoding unit (2030) can generate a third prediction block by weighting and adding the first prediction block and the second prediction block, and can generate a restored current block based on the third prediction block.

[0378] In one embodiment, the weight applied to the first prediction block and the weight applied to the second prediction block may be determined based on at least one of a distance (e.g., POC difference) between a current picture (2200) and a previous picture (2400), a distance between a first surrounding sample set (2210) in the current picture (2200) and a first sample set (2480) in the current picture (2200) or a previous picture (2400), a size of the current block (2250), or an intra prediction mode. For example, as the distance between the first surrounding sample set (2210) and the first sample set (2480) increases, a weight applied to the second prediction block may be determined smaller, and a weight applied to the first prediction block may be determined larger. The distance between the first peripheral sample set (2210) and the first sample set (2480) can be calculated based on a predetermined sample in the first peripheral sample set (2210) and a predetermined sample in the first sample set (2480).

[0379] In one embodiment, the weights applied to the first prediction block and the weights applied to the second prediction block may be predetermined. For example, the weights applied to the first prediction block and the weights applied to the second prediction block may both be predetermined as 1 / 2.

[0380] In one embodiment, the acquisition unit (2010) acquires information from the bitstream indicating which sample set among the first surrounding sample set (2210) and the first sample set (2480) is used for intra prediction of the current block (2250), and the prediction decoding unit (2030) can generate a prediction block of the current block (2250) using the sample set indicated by the information acquired from the bitstream.

[0381] For example, if the information obtained from the bitstream indicates the first peripheral sample set (2210), the prediction decoding unit (2030) can generate a current block reconstructed from a prediction block generated based on the first peripheral sample set (2210). In addition, if the information obtained from the bitstream indicates the first sample set (2480), the prediction decoding unit (2030) can generate a current block reconstructed from a prediction block generated based on the first sample set (2480).

[0382] The video encoding device described below can select a sample set that causes residual data of a smaller size among the first peripheral sample set (2210) and the first sample set (2480), and include information indicating the selected sample set in the bitstream. A cost can be used to select either the first peripheral sample set (2210) or the first sample set (2480).

[0383] FIG. 29 is a diagram illustrating a method for performing intra prediction for a current block using a second sample set according to one embodiment.

[0384] FIG. 29 illustrates that the second sample set (2490) is included in the current picture (2200), but the second sample set (2490) may also be included in the previous picture (2400).

[0385] As described with reference to FIG. 26, the second sample set (2490) may include right samples (2491) and lower samples (2492).

[0386] For example, when the size of the current block (2250) is 4x4, the number of right samples (2491) in the second sample set (2490) may be 9, and the number of lower samples (2492) in the second sample set (2490) may be 8.

[0387] In one embodiment, the prediction decoding unit (2030) can generate a prediction block of the current block (2250) through intra prediction using the second sample set (2490) as a reference sample of the current block (2250).

[0388] Using the second sample set (2490) as a reference sample of the current block (2250) can be understood as borrowing the second sample set (2490) from the lower right side of the current block (2250) and using it for intra prediction of the current block (2250).

[0389] Since the second surrounding sample set (2230) of the current block (2250) cannot be used for intra prediction because restoration is not complete, the second sample set (2490) can be used for intra prediction instead of the second surrounding sample set (2230).

[0390] For example, the prediction decoding unit (2030) can change the location of the second sample set (2490) to the lower right of the current block (2250) and perform intra prediction for the current block (2250) using the changed location of the second sample set (2490).

[0391] In one embodiment, the prediction decoding unit (2030) can perform intra prediction using the second sample set (2490) to generate a prediction block of the current block (2250).

[0392] In one embodiment, the prediction decoding unit (2030) may filter the second sample set (2490) according to an intra prediction mode before using the second sample set (2490) for intra prediction.

[0393] In one embodiment, the prediction decoding unit (2030) can generate a first prediction block of the current block (2250) based on a first set of surrounding samples (2210) and can generate a second prediction block of the current block (2250) based on a second set of samples (2490).

[0394] The prediction decoding unit (2030) can generate a third prediction block by weighting and adding the first prediction block and the second prediction block, and can generate a restored current block based on the third prediction block.

[0395] In one embodiment, the weight applied to the first prediction block and the weight applied to the second prediction block may be determined based on at least one of a distance (e.g., POC difference) between a current picture (2200) and a previous picture (2400), a distance between a second neighboring sample set (2230) in the current picture (2200) and a second sample set (2490) in the current picture (2200) or a previous picture (2400), a size of the current block (2250), or an intra prediction mode. For example, as the distance between the second neighboring sample set (2230) and the second sample set (2490) increases, a weight applied to the second prediction block may be determined to be smaller, and a weight applied to the first prediction block may be determined to be larger. The distance between the second peripheral sample set (2230) and the second sample set (2490) can be calculated based on a predetermined sample in the second peripheral sample set (2230) and a predetermined sample in the second sample set (2490).

[0396] In one embodiment, the weights applied to the first prediction block and the weights applied to the second prediction block may be predetermined. For example, the weights applied to the first prediction block and the weights applied to the second prediction block may both be predetermined as 1 / 2.

[0397] In one embodiment, the acquisition unit (2010) acquires information indicating which sample set among the first surrounding sample set (2210) and the second sample set (2490) is used for intra prediction of the current block (2250) from the bitstream, and the prediction decoding unit (2030) can generate a prediction block of the current block (2250) using the sample set indicated by the information acquired from the bitstream.

[0398] For example, if the information obtained from the bitstream indicates the first peripheral sample set (2210), the prediction decoding unit (2030) can generate a current block reconstructed from a prediction block generated based on the first peripheral sample set (2210). In addition, if the information obtained from the bitstream indicates the second sample set (2490), the prediction decoding unit (2030) can generate a current block reconstructed from a prediction block generated based on the second sample set (2490).

[0399] The video encoding device described below may select a sample set that causes residual data of a smaller size among the first peripheral sample set (2210) and the second sample set (2490), and include information indicating the selected sample set in the bitstream. A cost may be used to select either the first peripheral sample set (2210) or the second sample set (2490).

[0400] In FIG. 29, the prediction decoding unit (2030) considers that the second sample set (2490) is located at the lower right side of the current block (2250) and can generate a prediction block from the second sample set (2490). A method of performing intra prediction on the current block (2250) using the second sample set (2490) will be described with reference to FIG. 30.

[0401] FIG. 30 is a diagram illustrating a method for performing intra prediction for a current block using a second sample set according to one embodiment.

[0402] When the second sample set (2490) is located at the lower right of the current block (2250), the prediction decoding unit (2030) can identify samples corresponding to each of the samples in the current block (2250) among the samples included in the second sample set (2490) according to the direction (3000) indicated by the intra prediction mode, and can generate prediction samples using the identified samples.

[0403] As described with reference to FIG. 23, in the 18th intra prediction mode using the first peripheral sample set (2210), both the left samples (2211) within the first peripheral sample set (2210) and the upper samples (2212) within the first peripheral sample set (2210) may be required. Similarly, in the 18th intra prediction mode using the second sample set (2490), both the right samples (2491) within the second sample set (2490) and the lower samples (2492) within the second sample set (2490) may be utilized.

[0404] FIG. 29 illustrates that the right samples (2491) within the second sample set (2490) are arranged to the right of the lower samples (2492) within the second sample set (2490), which means that the sample values ​​of the lower samples (2492) within the second sample set (2490) and the sample values ​​of the right samples (2491) within the second sample set (2490) are stored consecutively in memory.

[0405] In one embodiment, the prediction decoding unit (2030) can identify samples for generating prediction samples corresponding to samples in the current block (2250) in the second sample set (2490) according to a direction (3000) indicated by the intra prediction mode, and can apply the sample values ​​of the identified samples to a predetermined operation formula to produce sample values ​​of the prediction samples.

[0406] For example, a sample (3003) among the lower samples (2492) in the second sample set (2490) can be identified to obtain a prediction sample of a sample (2301) located at (3, 1) in the current block (2250). As the sample value of the sample (3003) is applied to a predetermined operation formula, a prediction sample value of the sample (2301) located at (3, 1) in the current block (2250) can be calculated.

[0407] Additionally, a sample (3004) among the right samples (2491) in the second sample set (2490) can be identified to obtain a prediction sample of a sample (2302) located at (1, 3) in the current block (2250). As the sample value of the sample (3004) is applied to a predetermined operation formula, a prediction sample value of the sample (2302) located at (1, 3) in the current block (2250) can be calculated.

[0408] In one embodiment, the prediction decoding unit (2030) can reconstruct the current block (2250) using a prediction block including the generated prediction samples, when prediction samples corresponding to samples in the current block (2250) are generated based on the second sample set (2490).

[0409] In one embodiment, under the same intra prediction mode, samples required to generate prediction samples from the second sample set (2490) and samples required to generate prediction samples from the first surrounding sample set (2210) may be located in opposite directions.

[0410] In one embodiment, a sample (2303) among the left samples (2211) in the first set of surrounding samples (2210) is identified to generate a prediction sample of a sample (2301) located at (3, 1) in the current block (2250) in FIG. 23, and the surrounding sample (2303) and the sample (3003) identified in FIG. 30 may be located at opposite points along the prediction direction (2300, 3000) according to the intra prediction mode with respect to the sample (2301) located at (3, 1).

[0411] In one embodiment, a sample (2304) among upper samples (2212) in a first set of surrounding samples (2210) is identified to generate a prediction sample of a sample (2302) located at (1, 3) in a current block (2250) in FIG. 23, and this sample (2304) and the sample (3004) identified in FIG. 30 may be located at opposite points along the prediction direction (2300, 3000) according to the intra prediction mode with respect to the sample (2302) located at (1, 3).

[0412] In one embodiment, the prediction block of the current block (2250) may be generated using both the first set of surrounding samples (2210) and the second set of samples (2490), as described with reference to FIG. 31.

[0413] FIG. 31 is a diagram for explaining a method for performing intra prediction for a current block using a first set of surrounding samples and a second set of samples of the current block according to one embodiment.

[0414] In one embodiment, the prediction decoding unit (2030) can perform intra-mode bi-prediction for the current block (2250) by using the first surrounding sample set (2210) and the second sample set (2490) of the current block (2250).

[0415] Bi-prediction according to the intra mode can be understood as a process of predicting the current block (2250) in both directions using both the first surrounding sample set (2210) located on the upper left side of the current block (2250) and the second sample set (2490) located on the lower right side of the current block (2250).

[0416] Referring to FIG. 31, since the first peripheral sample set (2210) and the second sample set (2490) surround the current block (2250), the number of samples included in the first peripheral sample set (2210) and the second sample set (2490) may not need to be as large as shown in FIG. 23 and FIG. 29.

[0417] The reason why the number of left samples (2211) in the first peripheral sample set (2210) in FIG. 23 is 9 and the number of upper samples (2212) in the first peripheral sample set (2210) is 8 is that there may not be samples required for intra prediction in the prediction direction according to the intra prediction mode. In other words, assuming that 4 samples are specified on the left side of the current block (2250) and filtering is applied to the specified samples before the prediction block of the current block (2250) is generated, the peripheral samples required for generating the prediction samples in the prediction block may not be included among the 4 left samples that are specified in advance.

[0418] Therefore, in one embodiment, as illustrated in FIG. 31, when the size of the current block (2250) is 4 X 4, the number of left samples (2211) in the first peripheral sample set (2210), upper samples (2212) in the first peripheral sample set (2210), right samples (2491) in the second sample set (2490), and lower samples (2492) in the second sample set (2490) may each be 5.

[0419] The expression that the number of left samples (2211) in the first peripheral sample set (2210), upper samples (2212) in the first peripheral sample set (2210), right samples (2491) in the second sample set (2490), and lower samples (2492) in the second sample set (2490) is 5 each may be changed to the expression that the number of left samples (2211) in the first peripheral sample set (2210) and right samples (2491) in the second sample set (2490) is 6, and the number of upper samples (2212) in the first peripheral sample set (2210) and lower samples (2492) in the second sample set (2490) is 4. This is because the samples located at the corners among the samples (2211, 2212, 2491, 2492) surrounding the current block (2250) are located at the upper left, lower left, upper right, and lower right, respectively, with respect to the current block (2250).

[0420] In one embodiment, the first set of peripheral samples (2210) and the second set of samples (2490) may include samples that are far from the current block (2250), as illustrated in FIGS. 23 and 29 .

[0421] In one embodiment, the prediction decoding unit (2030) can identify samples necessary for generating prediction samples of samples included in the current block (2250) from each of the first peripheral sample set (2210) and the second sample set (2490), and apply the samples identified in the first peripheral sample set (2210) and the samples identified in the second sample set (2490) to a predetermined operation formula to generate prediction samples of the current block (2250).

[0422] When intra prediction is performed based on the first surrounding sample set (2210), the first sample set (2480), or the second sample set (2490), the samples required to generate the prediction sample from one of the sets are identified, but in pair-prediction according to the intra mode, the samples required to generate the prediction sample from each of the two sample sets can be identified.

[0423] For example, when 18 intra prediction modes are applied to a current block (2250), at least one sample (3103) may be identified from a first surrounding sample set (2210) and at least one sample (3104) may be identified from a second sample set (2490) along a direction (3100) indicated by the intra prediction mode to generate a prediction sample of a sample (3101) located at (3, 3) in the current block (2250). The sample values ​​of the identified samples (3103, 3104) may be applied to a predetermined operation formula to produce a prediction sample value corresponding to the sample (3101) located at (3, 3).

[0424] In addition, for example, when 18 intra prediction modes are applied to a current block (2250), at least one sample (3105) may be identified from a first surrounding sample set (2210) and at least one sample (3106) may be identified from a second sample set (2490) along a direction (3100) indicated by the intra prediction mode to generate a prediction sample of a sample (3102) located at (3, 1) in the current block (2250). The sample values ​​of the identified samples (3105, 3106) may be applied to a predetermined operation formula to produce a prediction sample value corresponding to the sample (3102) located at (3, 1).

[0425] In intra mode pair prediction, the efficiency of intra prediction can be improved because the continuity between samples within the current block (2250) and surrounding samples surrounding the current block (2250) on all sides can be considered.

[0426] In one embodiment, the predictive decoding unit (2030) may adaptively determine which sample set should be used for each of the samples contained in the current block (2250).

[0427] In one embodiment, the prediction decoding unit (2030) can determine which sample set among the first surrounding sample set (2210) and the second sample set (2490) should be used for each of the samples included in the current block (2250), and can generate prediction samples corresponding to each of the samples in the current block (2250) based on the samples included in the determined sample set.

[0428] For example, the prediction decoding unit (2030) may determine that a first set of surrounding samples (2210) is used to generate a prediction sample of one sample within the current block (2250), and that a second set of samples (2490) is used to generate a prediction sample of another sample within the current block (2250).

[0429] The prediction decoding unit (2030) can determine which of the first sample and the second sample should be used for a specific sample by considering the position of the specific sample within the current block (2250), the position of the first sample within the first surrounding sample set (2210) required for generating a prediction sample corresponding to the specific sample, and the position of the second sample within the second sample set (2490) required for generating the prediction sample. Here, the first sample within the first surrounding sample set (2210) required for generating the prediction sample and the second sample within the second sample set (2490) required for generating the prediction sample can be identified according to the direction indicated by the intra prediction mode.

[0430] In one embodiment, the prediction decoding unit (2030) can determine which of the first sample and the second sample should be used for a specific sample based on a distance (d1) between the specific sample and the first sample and a distance (d2) between the specific sample and the second sample.

[0431] For example, the prediction decoding unit (2030) may use the first sample to generate a prediction sample of a specific sample if d1 is less than d2. In this case, the prediction decoding unit (2030) may apply the sample value of the first sample to a predetermined calculation formula to generate a prediction sample of the specific sample.

[0432] According to one embodiment, a set of samples suitable for generating a prediction sample among the first surrounding sample set (2210) and the second sample set (2490) can be adaptively determined for each sample in the current block (2250), so that the similarity between the current block (2250) and the prediction block can be further increased.

[0433] FIG. 32 is a diagram illustrating a method for performing intra prediction for a current block using a first sample set and a second sample set according to one embodiment.

[0434] FIG. 32 illustrates that the first sample set (2480) and the second sample set (2490) are included in the previous picture (2400), but the first sample set (2480) and the second sample set (2490) may also be included in the current picture (2200).

[0435] In one embodiment, the first sample set (2480) may include left samples (2481) and top samples (2482), and the second sample set (2490) may include right samples (2491) and bottom samples (2492).

[0436] For example, when the size of the current block (2250) is 4x4, the number of left samples (2481) in the first sample set (2480), upper samples (2482) in the first sample set (2480), right samples (2491) in the second sample set (2490), and lower samples (2492) in the second sample set (2490) may each be 5. In one embodiment, the number of left samples (2481) in the first sample set (2480), upper samples (2482) in the first sample set (2480), right samples (2491) in the second sample set (2490), and lower samples (2492) in the second sample set (2490) may be determined in various ways.

[0437] In one embodiment, the prediction decoding unit (2030) can generate a prediction block of the current block (2250) through intra prediction using the first sample set (2480) and the second sample set (2490) as reference samples of the current block (2250).

[0438] Using the first sample set (2480) and the second sample set (2490) as reference samples of the current block (2250) can be understood as borrowing the first sample set (2480) and the second sample set (2490) to surround the current block (2250) and using them for intra prediction of the current block (2250).

[0439] In one embodiment, when the first sample set (2480) and the second sample set (2490) are used for intra prediction, the first sample set (2480) may replace the first peripheral sample set (2210), and the second sample set (2490) may replace the second peripheral sample set (2230).

[0440] For example, the prediction decoding unit (2030) can change the position of the first sample set (2480) to the upper left side of the current block (2250), change the position of the second sample set (2490) to the lower right side of the current block (2250), and perform intra prediction for the current block (2250) using the changed first sample set (2480) and second sample set (2490).

[0441] In one embodiment, the prediction decoding unit (2030) may filter the first sample set (2480) and the second sample set (2490) according to an intra prediction mode before using the first sample set (2480) and the second sample set (2490) for intra prediction.

[0442] In one embodiment, the prediction decoding unit (2030) can generate a first prediction block of the current block (2250) based on the first sample set (2480) and can generate a second prediction block of the current block (2250) based on the second sample set (2490).

[0443] The prediction decoding unit (2030) can generate a third prediction block by weighting and adding the first prediction block and the second prediction block, and can generate a restored current block based on the third prediction block.

[0444] In one embodiment, the weight applied to the first prediction block and the weight applied to the second prediction block may be determined based on at least one of the distance between the current picture (2200) and the previous picture (2400) (e.g., POC difference), the size of the current block (2250), or the intra prediction mode.

[0445] In one embodiment, the weights applied to the first prediction block and the weights applied to the second prediction block may be predetermined. For example, the weights applied to the first prediction block and the weights applied to the second prediction block may both be predetermined as 1 / 2.

[0446] In one embodiment, the acquisition unit (2010) acquires information indicating which sample set among the first sample set (2480) and the second sample set (2490) is used for intra prediction of the current block (2250) from the bitstream, and the prediction decoding unit (2030) can generate a prediction block of the current block (2250) using the sample set indicated by the information acquired from the bitstream.

[0447] In one embodiment, the prediction decoding unit (2030) can generate a first prediction block of the current block (2250) based on the first sample set (2480) and can generate a second prediction block of the current block (2250) based on the second sample set (2490). Then, the prediction decoding unit (2030) can select either the first prediction block or the second prediction block to reconstruct the current block (2250).

[0448] In one embodiment, when selecting one of the first prediction block and the second prediction block, the comparison result between the first prediction block and the reference block and the comparison result between the second prediction block and the reference block may be used. Here, the reference block may be a block located between the first sample set (2480) and the second sample set (2490). Since the reference block is an area where restoration has already been completed, it may be used for comparison with the first prediction block and the second prediction block.

[0449] In one embodiment, the prediction decoding unit (2030) can reconstruct the current block (2250) using a prediction block that has a smaller difference from the reference block among the first prediction block and the second prediction block. Accordingly, the prediction decoding unit (2030) can directly select a sample set without having to obtain relevant information from the bitstream.

[0450] In one embodiment, the prediction decoding unit (2030) may determine which sample set among the first sample set (2480) and the second sample set (2490) should be used for each of the samples included in the current block (2250), and may generate prediction samples corresponding to each of the samples in the current block (2250) based on the determined sample set.

[0451] For example, the prediction decoding unit (2030) may determine that a first sample set (2480) is used to generate a prediction sample of one sample within the current block (2250), and may determine that a second sample set (2490) is used to generate a prediction sample of another sample within the current block (2250).

[0452] The prediction decoding unit (2030) may select a sample necessary for generating a prediction sample of a specific sample among the first sample and the second sample by considering at least one of the position of a specific sample within the current block (2250), the position of a first sample necessary for generating a prediction sample corresponding to a specific sample among the first sample set (2480), or the position of a second sample necessary for generating a prediction sample corresponding to a specific sample among the second sample set (2490).

[0453] According to one embodiment, a set of samples suitable for generating a prediction sample among the first sample set (2480) and the second sample set (2490) can be adaptively determined for each sample in the current sample, so that the similarity between the current block (2250) and the prediction block can be further increased.

[0454] In one embodiment, the prediction decoding unit (2030) can generate a prediction block of the current block (2250) through pair prediction based on the first sample set (2480) and the second sample set (2490). For example, the prediction decoding unit (2030) can identify samples necessary for generating prediction samples of samples included in the current block (2250) from each of the first sample set (2480) and the second sample set (2490), and can apply the samples identified from each of the first sample set (2480) and the second sample set (2490) to a predetermined operation formula to generate prediction samples of the current block (2250).

[0455] The process of performing intra pair prediction for the current block (2250) using samples surrounding the current block (2250) has been described with reference to FIG. 31, so a detailed description thereof is omitted here.

[0456] In one embodiment, the prediction decoding unit (2030) can generate a first prediction block of the current block (2250) through intra prediction based on a first surrounding sample set (2210), and can generate a second prediction block of the current block (2250) through pair prediction based on a first sample set (2480) and a second sample set (2490).

[0457] The prediction decoding unit (2030) can generate a third prediction block by weighting and adding the first prediction block and the second prediction block, and can generate a restored current block based on the third prediction block.

[0458] In one embodiment, the weights applied to the first prediction block and the weights applied to the second prediction block can be determined based on at least one of a distance (e.g., POC difference) between the current picture (2200) and the previous picture (2400), a distance between the first surrounding sample set (2210) in the current picture (2200) and the first sample set (2480) in the current picture (2200) or the previous picture (2400), a distance between the second surrounding sample set (2230) in the current picture (2200) and the second sample set (2490) in the current picture (2200) or the previous picture (2400), a size of the current block (2250), or an intra prediction mode.

[0459] For example, the further the distance between the first surrounding sample set (2210) and the first sample set (2480), the smaller the weight applied to the second prediction block may be determined, and the larger the weight applied to the first prediction block may be determined.

[0460] In one embodiment, the weights applied to the first prediction block and the weights applied to the second prediction block may be predetermined. For example, the weights applied to the first prediction block and the weights applied to the second prediction block may both be predetermined as 1 / 2.

[0461] According to one embodiment, the prediction decoding unit (2030) can apply inter prediction to the current block (2250) using a spatial reference block and a temporal reference block when the prediction mode of the current block (2250) is inter prediction.

[0462] Unlike the temporal reference block (2470) in intra prediction, the temporal reference block in inter prediction mode can be determined based on the motion vector of the spatial reference block.

[0463] According to one embodiment, a prediction decoding unit (2030) can perform inter prediction on a current block (2250) to generate a prediction block of the current block (2250) and obtain a current block restored from the prediction block.

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

[0465] 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) with the prediction block.

[0466] The restored current block can be used as a reference block for the next block.

[0467] Referring to FIGS. 33 and 34, an inter prediction process according to one embodiment will be described.

[0468] FIG. 33 is a diagram for explaining a process of performing inter prediction on a current block using a temporal reference block and a spatial reference block according to one embodiment.

[0469] Referring to FIG. 33, the prediction decoding unit (2030) can determine a spatial reference block (2270) within the current picture (2200). The spatial reference block (2270) may be a block restored before the current block (2250).

[0470] The prediction decoding unit (2030) can determine a block vector (2252) and determine a spatial reference block (2270) pointed to by the block vector (2252) within the current picture (2200).

[0471] In one embodiment, the prediction decoding unit (2030) can obtain block vector related information from the bitstream to determine the block vector (2252).

[0472] In one embodiment, the block vector related information may include information (e.g., a flag or index) pointing to any one of the block vector candidates included in a pre-built set of block vector candidates.

[0473] In one embodiment, the prediction decoding unit (2030) may build a block vector candidate set using motion vectors or block vectors of surrounding blocks temporally or spatially related to the current block (2250), and determine a block vector (2252) for pointing to a spatial reference block (2270) based on information obtained from the bitstream.

[0474] In one embodiment, the prediction decoding unit (2030) may determine a block vector (2252) for indicating a spatial reference block (2270) by combining a block vector indicated by information obtained from a bitstream among block vector candidates in a block vector candidate set and a block vector difference obtained from the bitstream.

[0475] In one embodiment, when constructing a block vector candidate set, the prediction decoding unit (2030) may determine each block vector candidate included in the block vector candidate set through template matching based on a motion vector or block vector of a temporal neighboring block and / or a spatial neighboring block.

[0476] In one embodiment, the prediction decoding unit (2030) may directly search for a spatial reference block (2270) through template matching.

[0477] In one embodiment, when a spatial reference block (2270) is determined within a current picture (2200), the prediction decoding unit (2030) can determine a temporal reference block (3370) using a previous picture (3300) and a motion vector (2272) used to restore the spatial reference block (2270).

[0478] For example, if a spatial reference block (2270) is restored through inter prediction, reference picture information and motion vector (2272) related information for the spatial reference block (2270) can be stored in advance in the image decoding device (2000), and the prediction decoding unit (2030) can determine a temporal reference block (3370) pointed to by the motion vector (2272) of the spatial reference block (2270) within the previous picture (3300) pointed to by the reference picture information.

[0479] In one embodiment, the reference picture information and motion vector (2272) related information of the spatial reference block (2270) may be reference picture information and motion vector related information stored for a block including a sample at a predetermined position within the spatial reference block (2270), for example, an upper left sample.

[0480] In one embodiment, the prediction decoding unit (2030) may generate a prediction block of the current block (2250) using the temporal reference block (3370) and / or the spatial reference block (2270) when the temporal reference block (3370) is determined within the previous picture (3300).

[0481] For example, the prediction decoding unit (2030) can determine a temporal reference block (3370) as a prediction block.

[0482] Additionally, as an example, the prediction decoding unit (2030) can interpolate samples within a temporal reference block (3370) and determine a prediction block including the interpolated samples.

[0483] Additionally, as an example, the prediction decoding unit (2030) may generate a first prediction block using samples within a temporal reference block (3370) and generate a second prediction block using a spatial reference block (2270). In addition, the prediction decoding unit (2030) may generate a third prediction block through a weighted sum of the first prediction block and the second prediction block, and generate a reconstructed current block based on the third prediction block.

[0484] In one embodiment, the weight applied to the first prediction block and the weight applied to the second prediction block may be determined based on at least one of a distance between a current picture (2200) and a previous picture (3300) (e.g., a POC difference), a distance between a current block (2250) and a spatial reference block (2270) (or a size of a block vector (2252)), a distance between a current block (2250) and a temporal reference block (3370), or a size of the current block (2250). For example, as the distance between the current block (2250) and the temporal reference block (3370) increases, a weight applied to a first prediction block generated based on the temporal reference block (3370) may be determined smaller, and a weight applied to a second prediction block generated based on the spatial reference block (2270) may be determined larger.

[0485] In one embodiment, the weights applied to the first prediction block and the weights applied to the second prediction block may be predetermined. For example, the weights applied to the first prediction block and the weights applied to the second prediction block may both be predetermined as 1 / 2.

[0486] According to the inter prediction process described with reference to FIG. 33, the motion vector (2272) of the spatial reference block (2270) for which restoration has been completed and the reference picture (i.e., the previous picture (3300)) are used to determine the temporal reference block (3370) of the current block (2250), so that the bit rate of the bitstream can be reduced.

[0487] For example, if the spatial reference block (2270) is determined through a template matching method, there is no need to include the motion vector or reference picture information of the current block (2250) in the bitstream. This is because, if the prediction decoding unit (2030) directly searches for the spatial reference block (2270) through the template matching method, the motion vector (2272) related information and reference picture information of the spatial reference block (2270) that are already stored can be used without obtaining the related information from the bitstream.

[0488] Even if the spatial reference block (2270) is determined based on information obtained from the bitstream (e.g., block vector related information), if the distance between the spatial reference block (2270) and the current block (2250) is smaller than the distance between the temporal reference block (3370) and the current block (2250), it is advantageous in terms of bitrate to include information about the block vector pointing to the spatial reference block (2270) in the bitstream.

[0489] FIG. 34 is a diagram for explaining a process of performing inter prediction on a current block using a temporal reference block and a spatial reference block according to one embodiment.

[0490] As described with reference to FIG. 33, the prediction decoding unit (2030) can determine a spatial reference block (2270) within the current picture (2200). The spatial reference block (2270) may be a block restored before the current block (2250).

[0491] The prediction decoding unit (2030) can determine a block vector (2252) to point to a spatial reference block (2270).

[0492] In one embodiment, the prediction decoding unit (2030) may determine temporal sub-blocks (3412, 3414, 3422, 3424, 3432) within previous pictures (3410, 3420, 3430) using information related to motion vectors (2272a, 2272b-1, 2272b-2, 2272c, 2272d) stored for restoration of sub-blocks (2270a, 2270b, 2270c, 2270d) of a spatial reference block (2270) and reference picture information. Here, the previous pictures (3410, 3420, 3430) may be pictures restored before the current picture (2200). In one embodiment, some of the previous pictures (3410, 3420, 3430) may be earlier than the current picture (2200) in output order, and others may be later than the current picture (2200).

[0493] As illustrated in FIG. 34, the motion vectors (2272a, 2272b-1, 2272b-2, 2272c, 2272d) of each of the sub-blocks (2270a, 2270b, 2270c, 2270d) and previous pictures (3410, 3420, 3430) can be used to restore the sub-blocks (2270a, 2270b, 2270c, 2270d) included in the spatial reference block (2270). For example, a first motion vector (2272a) and a first previous picture (3410) may be used to restore a first sub-block (2270a), and a second motion vector (2272b-1) for list 0, a second motion vector (2272b-2) for list 1, a first previous picture (3410) included in list 0, and a second previous picture (3420) included in list 1 may be used to restore a second sub-block (2270b). The fact that two motion vectors (2272b-1, 2272b-2) and two previous pictures (3410, 3420) are used to restore the second sub-block (2270b) may mean that the second sub-block (2270b) was restored through bi-prediction.

[0494] Additionally, the third motion vector (2272c) and the second previous picture (3420) may be used to restore the third sub-block (2270c), and the fourth motion vector (2272d) and the third previous picture (3430) may be used to restore the fourth sub-block (2270d).

[0495] The prediction decoding unit (2030) can determine a first temporal sub-block (3412) within the first previous picture (3410) by applying a first motion vector (2272a) to the first sub-block (2270a). In addition, the prediction decoding unit (2030) can determine a second temporal sub-block (3414) for list 0 within the first previous picture (3410) by applying a second motion vector (2272b-1) for list 0 to the second sub-block (2270b), and can determine a second temporal sub-block (3422) for list 1 within the second previous picture (3420) by applying a second motion vector (2272b-2) for list 1 to the second sub-block (2270b). Additionally, the prediction decoding unit (2030) can determine a third temporal sub-block (3424) within the second previous picture (3420) by applying a third motion vector (2272c) to the third sub-block (2270c), and can determine a fourth temporal sub-block (3432) within the third previous picture (3430) by applying a fourth motion vector (2272d) to the fourth sub-block (2270d).

[0496] The prediction decoding unit (2030) can generate a prediction block of the current block (2250) using temporal sub-blocks (3412, 3414, 3422, 3424, 3432) determined from previous pictures (3410, 3420, 3430).

[0497] For example, the prediction decoding unit (2030) can determine a block in which sub-blocks (3412, 3414, 3422, 3424, 3432) are combined as a prediction block of the current block (2250).

[0498] In one embodiment, when combining sub-blocks (3412, 3414, 3422, 3424, 3432), the prediction decoding unit (2030) may first weight and add the second temporal sub-block (3414) for list 0 corresponding to the second sub-block (2270b) and the second temporal sub-block (3422) for list 1, and then combine the weighted result with other sub-blocks (3412, 3424, 3432).

[0499] Additionally, for example, the prediction decoding unit (2030) can interpolate samples of a block in which sub-blocks (3412, 3414, 3422, 3424, 3432) are combined, and determine a prediction block including the interpolated samples.

[0500] In addition, for example, the prediction decoding unit (2030) can generate a first prediction block using a block in which sub-blocks (3412, 3414, 3422, 3424, 3432) are combined, and can generate a second prediction block using a spatial reference block (2270). In addition, the prediction decoding unit (2030) can generate a third prediction block through a weighted sum of the first prediction block and the second prediction block, and can generate a reconstructed current block based on the third prediction block.

[0501] In one embodiment, the weight applied to the first prediction block and the weight applied to the second prediction block can be determined based on at least one of a distance (e.g., a POC difference) between the current picture (2200) and at least one of previous pictures (3410, 3420, 3430), a distance between the current block (2250) and a spatial reference block (2270) (or a size of a block vector (2252)), a distance between the current block (2250) and at least one of temporal sub-blocks (3412, 3414, 3422, 3424, 3432), or a size of the current block (2250).

[0502] In one embodiment, the weights applied to the first prediction block and the weights applied to the second prediction block may be predetermined. For example, the weights applied to the first prediction block and the weights applied to the second prediction block may both be predetermined as 1 / 2.

[0503] According to the inter prediction process described with reference to FIG. 34, the motion vectors (2272a, 2272b-1, 2272b-2, 2272c, 2272d) related information of the sub-blocks (2270a, 2270b, 2270c, 2270d) of the spatial reference block (2270) for which restoration has been completed and the reference picture information are used to determine the temporal sub-blocks (3412, 3414, 3422, 3424, 3432) of the current block (2250), so that the bit rate of the bitstream can be reduced.

[0504] Additionally, since the current block (2250) can be predicted using several previous pictures (3410, 3420, 3430) as reference pictures, the accuracy of prediction can be improved.

[0505] In addition, even if the process of dividing the current block (2250) into sub-blocks is not performed, the effect of predicting the current block (2250) based on sub-blocks can be equally achieved by using the sub-blocks (2270a, 2270b, 2270c, 2270d) of the spatial reference block (2270).

[0506] FIG. 35 is a flowchart of an image decoding method according to one embodiment, illustrating a case where the prediction mode of the current block (2250) is intra mode.

[0507] Although not shown in FIG. 35, the image decoding device (2000) can obtain information about the prediction mode of the current block (2250) from the bitstream, and if the prediction mode of the current block (2250) is an intra mode, can obtain information indicating the intra prediction mode from the bitstream.

[0508] In one embodiment, the bitstream may include at least one of information about a prediction mode of a current block (2250), information indicating an intra prediction mode, information indicating a location of a reference block, information indicating whether a temporal reference sample or a spatial reference sample is used for intra prediction of the current block (2250), information indicating an index of a previous picture (2400) including a temporal reference sample, information indicating a motion vector difference, or residual data.

[0509] Referring to FIG. 35, in step S3510, the image decoding device (2000) can determine at least one of the first sample set (2480) or the second sample set (2490) from the current picture (2200) or the previous picture (2400).

[0510] At least one of the first sample set (2480) or the second sample set (2490) may be determined from among samples restored before the current block (2250) in the current picture (2200) or the previous picture (2400).

[0511] In one embodiment, the video decoding device (2000) can determine a reference block in a current picture (2200) or a previous picture (2400), and determine at least one of a first sample set (2480) or a second sample set (2490) from surrounding samples of the reference block.

[0512] In one embodiment, the image decoding device (2000) can determine at least one of the first sample set (2480) or the second sample set (2490) through a template matching method.

[0513] In step S3520, the image decoding device (2000) can perform intra prediction using at least one of the first sample set (2480) or the second sample set (2490).

[0514] A first set of neighboring samples (2210) adjacent to the current block (2250) may be further utilized for intra prediction of the current block (2250). The first set of neighboring samples (2210) may include neighboring samples reconstructed before the current block (2250).

[0515] At step S3530, the image decoding device (2000) restores the current block (2250) using the prediction block generated through intra prediction.

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

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

[0518] If the prediction mode of the current block (2250) is inter mode, the image decoding device (2000) can perform inter prediction on the current block (2250) to restore the current block (2250).

[0519] In one embodiment, the video decoding device (2000) can determine a spatial reference block (2270) within the current picture (2200) based on the block vector (2252) for inter prediction for the current block (2250).

[0520] In one embodiment, the image decoding device (2000) may build a block vector candidate set to determine a block vector (2252) of a current block (2250), and determine a block vector (2252) for pointing to a spatial reference block (2270) based on information obtained from a bitstream among block vector candidates included in the block vector candidate set.

[0521] In one embodiment, the image decoding device (2000) can determine a block vector (2252) pointing to a spatial reference block (2270) by combining a block vector candidate selected from a block vector candidate set and a block vector difference obtained from a bitstream.

[0522] In one embodiment, the image decoding device (2000) may determine a spatial reference block (2270) according to a template matching method.

[0523] In one embodiment, the video decoding device (2000) can apply a motion vector (2272) of a spatial reference block (2270) to the spatial reference block (2270) to determine a temporal reference block (3370) within a previous picture (3300).

[0524] In one embodiment, the image decoding device (2000) can generate a prediction block of the current block (2250) using a spatial reference block (2270) and / or a temporal reference block (3370), and reconstruct the current block (2250) using the prediction block.

[0525] In one embodiment, the video decoding device (2000) can apply motion vectors (2272a, 2272b-1, 2272b-2, 2272c, 2272d) of sub-blocks (2270a, 2270b, 2270c, 2270d) of a spatial reference block (2270) to the sub-blocks (2270a, 2270b, 2270c, 2270d) to determine temporal sub-blocks (3412, 3414, 3422, 3424, 3432) in previous pictures (3410, 3420, 3430).

[0526] In one embodiment, the video decoding device (2000) can generate a prediction block of the current block (2250) using temporal sub-blocks (3412, 3414, 3422, 3424, 3432) and / or a spatial reference block (2270), and reconstruct the current block (2250) using the prediction block.

[0527] Fig. 36 is a block diagram illustrating the configuration of an image encoding device (3600) according to one embodiment.

[0528] Referring to FIG. 36, the image encoding device (3600) may include a prediction encoding unit (3610) and a generation unit (3630).

[0529] According to one embodiment, the prediction encoding unit (3610) and the generation unit (3630) may be implemented with at least one processor. In one embodiment, the prediction encoding unit (3610) and the generation unit (3630) may operate according to instructions stored in memory.

[0530] The image encoding device (3600) may include a memory that stores input / output data of the prediction encoding unit (3610) and the generation unit (3630). In addition, the image encoding device (3600) may include a memory control unit that controls data input / output of the memory.

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

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

[0533] In one embodiment, the prediction mode of the current block (2250) can be determined as intra mode or inter mode.

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

[0535] The intra prediction mode of the current block (2250) 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.

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

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

[0538] In one embodiment, the prediction encoder (3610) may generate residual data corresponding to the difference between the prediction block and the current block (2250). If the prediction block is determined to be the current block (2250), residual data may not be generated.

[0539] According to one embodiment, when the prediction mode of the current block (2250) is an intra mode, the prediction encoding unit (3610) can use not only the first surrounding sample set (2210) of the current block (2250) included in the current picture (2200), but also the spatial reference sample included in the current picture (2200) or the temporal reference sample included in the previous picture (2400) for intra prediction.

[0540] In one embodiment, the predictive encoder (3610) can determine a first sample set (2480) and / or a second sample set (2490) from among samples encoded before the current block (2250) contained in the current picture (2200) or the previous picture (2400).

[0541] If the first sample set (2480) and / or the second sample set (2490) are included in the current picture (2200), the first sample set (2480) and / or the second sample set (2490) may correspond to spatial reference samples, and if the first sample set (2480) and / or the second sample set (2490) are included in the previous picture (2400), the first sample set (2480) and / or the second sample set (2490) may correspond to temporal reference samples.

[0542] When using a sample encoded before the current block (2250) as a reference sample, the size of the residual data can be reduced by predicting the samples of the current block (2250) using not only samples adjacent to the current block (2250) but also spatial reference samples and / or temporal reference samples that are far from the current block (2250).

[0543] In one embodiment, the predictive encoder (3610) can determine a first set of samples (2480) corresponding to a first set of surrounding samples (2210) adjacent to the current block (2250) from among samples encoded before the current block (2250) in the current picture (2200) or the previous picture (2400).

[0544] In one embodiment, the first set of surrounding samples (2210) may include samples encoded before the current block (2250). In one embodiment, the first set of surrounding samples (2210) may include samples adjacent to the left of the current block (2250) (2211) and samples adjacent to the top of the current block (2250) (2212).

[0545] In one embodiment, the predictive encoder (3610) can determine a second set of samples (2490) corresponding to a second set of surrounding samples (2230) adjacent to the current block (2250) from among samples encoded before the current block (2250) in the current picture (2200) or the previous picture (2400).

[0546] In one embodiment, the second set of surrounding samples (2230) may include samples that have not yet been encoded. In one embodiment, the second set of surrounding samples (2230) may include samples adjacent to the right of the current block (2250) (2231) and samples adjacent to the bottom of the current block (2250) (2232).

[0547] In one embodiment, the first set of peripheral samples (2210) may be adjacent to the upper right side of the current block (2250), and the second set of peripheral samples (2230) may be adjacent to the lower left side of the current block (2250).

[0548] In one embodiment, the prediction encoder (3610) may determine a reference block in the current picture (2200) or the previous picture (2400), and determine a first sample set (2480) and / or a second sample set (2490) from surrounding samples of the reference block.

[0549] In one embodiment, the predictive encoder (3610) may determine the first sample set (2480) and / or the second sample set (2490) through a template matching method.

[0550] The method for determining the first sample set (2480) and / or the second sample set (2490) within the current picture (2200) or the previous picture (2400) has been described with reference to FIGS. 24 to 27, so a detailed description thereof will be omitted.

[0551] In one embodiment, the prediction encoding unit (3610) may select a determination method for the first sample set (2480) and / or the second sample set (2490) and generate information indicating the selected determination method. The generated information may be included in the bitstream by the generation unit (3630).

[0552] In one embodiment, the prediction encoder (3610) can perform intra prediction on the current block (2250) using at least one of the first surrounding sample set (2210), the first sample set (2480), or the second sample set (2490) as a reference sample of the current block (2250).

[0553] The intra prediction process using at least one of the first surrounding sample set (2210), the first sample set (2480), or the second sample set (2490) is the same as the process performed by the prediction decoding unit (2030) described above, so a detailed description thereof is omitted.

[0554] According to one embodiment, the prediction encoding unit (3610) can apply inter prediction to the current block (2250) using a spatial reference block and a temporal reference block when the prediction mode of the current block (2250) is inter prediction.

[0555] According to one embodiment, a prediction encoding unit (3610) can perform inter prediction on a current block (2250) to generate a prediction block of the current block (2250) and encode the current block (2250) from the prediction block.

[0556] In one embodiment, the video encoding device (3600) can determine a spatial reference block (2270) within the current picture (2200) for inter prediction for the current block (2250) based on the block vector (2252).

[0557] In one embodiment, the video encoding device (3600) may build a block vector candidate set to encode a block vector (2252) of a current block (2250), and generate information indicating a block vector candidate used to restore the block vector (2252) of the current block (2250) among the block vector candidates included in the block vector candidate set. The generated information may be included in a bitstream.

[0558] In one embodiment, the video encoding device (3600) may obtain a block vector difference corresponding to the difference between a block vector candidate selected from a block vector candidate set and a block vector (2252) of a current block (2250), and include information about the block vector difference in a bitstream.

[0559] In one embodiment, the video encoding device (3600) may determine a spatial reference block (2270) according to a template matching method.

[0560] In one embodiment, the video encoding device (3600) can apply a motion vector (2272) of a spatial reference block (2270) to the spatial reference block (2270) to determine a temporal reference block (3370) within a previous picture (3300).

[0561] In one embodiment, the video encoding device (3600) can generate a prediction block of the current block (2250) using a spatial reference block (2270) and / or a temporal reference block (3370), and encode the current block (2250) using the prediction block.

[0562] In one embodiment, the video encoding device (3600) can apply motion vectors (2272a, 2272b-1, 2272b-2, 2272c, 2272d) of sub-blocks (2270a, 2270b, 2270c, 2270d) of a spatial reference block (2270) to the sub-blocks (2270a, 2270b, 2270c, 2270d) to determine temporal sub-blocks (3412, 3414, 3422, 3424, 3432) in previous pictures (3410, 3420, 3430).

[0563] In one embodiment, the video encoding device (3600) can generate a prediction block of the current block (2250) using temporal sub-blocks (3412, 3414, 3422, 3424, 3432) and / or a spatial reference block (2270), and encode the current block (2250) using the prediction block.

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

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

[0566] In one embodiment, the generation unit (3630) 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.

[0567] The generation unit (3630) 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.

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

[0569] In one embodiment, the bitstream may include information about the prediction mode of a current block (2250) within a current picture (2200).

[0570] In one embodiment, if the prediction mode (2250) of the current block (2250) is an intra mode, the bitstream may include information indicating the intra prediction mode of the current block (2250).

[0571] In one embodiment, when the prediction mode (2250) of the current block is intra mode, the bitstream may include information indicating whether a temporal reference sample or a spatial reference sample is used for intra prediction of the current block (2250).

[0572] When a temporal reference sample is used for intra prediction, the bitstream may include information indicating an index of a previous picture (2400) that includes the temporal reference sample.

[0573] In one embodiment, the bitstream may include at least one of information about a prediction mode of a current block (2250), information indicating an intra prediction mode, information indicating a location of a reference block, information indicating whether a temporal reference sample or a spatial reference sample is used for intra prediction of the current block (2250), information indicating an index of a previous picture (2400) including a temporal reference sample, information indicating a motion vector difference, or residual data.

[0574] FIG. 37 is a flowchart of an image encoding method according to one embodiment, illustrating a case where the prediction mode of the current block (2250) is intra mode.

[0575] Although not shown in FIG. 37, the image encoding device (3600) can determine the prediction mode of the current block (2250), and if the prediction mode of the current block (2250) is an intra mode, determine the intra prediction mode of the current block (2250).

[0576] Referring to FIG. 37, in step S3710, the video encoding device (3600) can determine at least one of the first sample set (2480) or the second sample set (2490) from the current picture (2200) or the previous picture (2400).

[0577] At least one of the first sample set (2480) or the second sample set (2490) may be determined from among samples encoded before the current block (2250) in the current picture (2200) or the previous picture (2400).

[0578] In one embodiment, the video encoding device (3600) can determine a reference block in a current picture (2200) or a previous picture (2400), and determine at least one of a first sample set (2480) or a second sample set (2490) from surrounding samples of the reference block.

[0579] In one embodiment, the video encoding device (3600) can determine at least one of the first sample set (2480) or the second sample set (2490) through a template matching method.

[0580] In step S3720, the image encoding device (3600) can perform intra prediction using at least one of the first sample set (2480) or the second sample set (2490).

[0581] A first set of neighboring samples (2210) adjacent to the current block (2250) may be further utilized for intra prediction of the current block (2250). The first set of neighboring samples (2210) may include neighboring samples encoded before the current block (2250).

[0582] In step S3730, the image encoding device (3600) encodes the current block (2250) using a prediction block generated through intra prediction.

[0583] In one embodiment, the video encoding device (3600) can generate residual data corresponding to the difference between the sample values ​​of the current block (2250) and the sample values ​​of the predicted block.

[0584] If the prediction mode of the current block (2250) is inter mode, the image encoding device (3600) can perform inter prediction on the current block (2250) to encode the current block (2250).

[0585] In one embodiment, the video encoding device (3600) can determine a spatial reference block (2270) within the current picture (2200) for inter prediction for the current block (2250) based on the block vector (2252).

[0586] In one embodiment, the video encoding device (3600) may determine a spatial reference block (2270) according to a template matching method.

[0587] In one embodiment, the video encoding device (3600) can apply a motion vector (2272) of a spatial reference block (2270) to the spatial reference block (2270) to determine a temporal reference block (3370) within a previous picture (3300).

[0588] In one embodiment, the video encoding device (3600) can generate a prediction block of the current block (2250) using a spatial reference block (2270) and / or a temporal reference block (3370), and encode the current block (2250) using the prediction block.

[0589] In one embodiment, the video encoding device (3600) can apply motion vectors (2272a, 2272b-1, 2272b-2, 2272c, 2272d) of sub-blocks (2270a, 2270b, 2270c, 2270d) of a spatial reference block (2270) to the sub-blocks (2270a, 2270b, 2270c, 2270d) to determine temporal sub-blocks (3412, 3414, 3422, 3424, 3432) in previous pictures (3410, 3420, 3430).

[0590] In one embodiment, the video encoding device (3600) can generate a prediction block of the current block (2250) using temporal sub-blocks (3412, 3414, 3422, 3424, 3432) and / or a spatial reference block (2270), and encode the current block (2250) using the prediction block.

[0591] A method and device for encoding an image (3600) 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 (2250).

[0592] A method and device for encoding an image (3600) and a method and device for decoding an image (2000) according to one embodiment have the task of reducing the size of residual data generated through predictive encoding.

[0593] A method and device for encoding an image (3600) and a method and device for decoding an image (2000) according to one embodiment have the task of reducing the bit rate of a bitstream.

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

[0595] A method of decoding an image according to one embodiment may include a step of determining at least one of a first sample set (2480) corresponding to a first surrounding sample set (2210) adjacent to a current block (2250) or a second sample set (2490) corresponding to a second surrounding sample set (2230) adjacent to the current block (2250) from samples reconstructed before the current block (2250) in a current picture or a previous picture.

[0596] In one embodiment, the first set of peripheral samples (2210) may include samples that were reconstructed before the current block (2250), and the second set of peripheral samples (2230) may include unreconstructed samples.

[0597] A method of decoding an image according to one embodiment may include a step of performing intra prediction on a current block (2250) by using a sample included in at least one of a first sample set (2480) or a second sample set (2490) as a reference sample of the current block (2250).

[0598] A method of decoding an image according to one embodiment may include a step of restoring a current block (2250) from a prediction block generated as a result of performing intra prediction.

[0599] According to a method of decoding an image according to one embodiment, by using not only the first surrounding sample set (2210) adjacent to the current block (2250) but also at least one of the first sample set (2480) or the second sample set (2490) for intra prediction, the efficiency of prediction can be increased and the bit rate of the bitstream can be reduced.

[0600] In one embodiment, the first set of peripheral samples (2210) may include peripheral samples located to the left of the current block (2250) and peripheral samples located above the current block (2250), and the second set of peripheral samples (2230) may include peripheral samples located to the right of the current block (2250) and peripheral samples located below the current block (2250).

[0601] According to one embodiment, a second sample set (2490) corresponding to an unrestored second surrounding sample set (2230) can be used for intra prediction, so that the difference between the current block (2250) and the predicted block can be reduced.

[0602] In one embodiment, the step of determining at least one of the first sample set (2480) or the second sample set (2490) may include: determining a reference block within a current picture or a previous picture based on information representing the reference block; and determining at least one of the first sample set (2480) including samples located to the left of the reference block and samples located above the reference block or the second sample set (2490) including samples located to the right of the reference block and samples located below the reference block.

[0603] According to one embodiment, at least one of the first sample set (2480) or the second sample set (2490) can be more conveniently determined using a reference block.

[0604] In one embodiment, the step of determining at least one of the first sample set (2480) or the second sample set (2490) may include the steps of searching for a first sample set (2480) corresponding to the first surrounding sample set (2210) in the current picture or a previous picture; and the step of determining a second sample set (2490) located a predetermined distance from the first sample set (2480).

[0605] According to one embodiment, the bitrate of the bitstream can be reduced by searching at least one of the first sample set (2480) or the second sample set (2490) through template matching.

[0606] In one embodiment, the step of performing intra prediction may include the step of performing intra prediction on the current block (2250) using at least one of the first sample set (2480) or the second sample set (2490) to obtain a first prediction block, and the step of performing intra prediction on the current block (2250) using the first surrounding sample set (2210) to obtain a second prediction block, and the step of restoring the current block (2250) may include the step of restoring the current block (2250) from a third prediction block obtained through a weighted sum of the first prediction block and the second prediction block.

[0607] According to one embodiment, the quality of the final prediction block can be improved through a weighted sum of the first prediction block and the second prediction block.

[0608] In one embodiment, the step of performing intra prediction may include the step of performing intra prediction on the current block (2250) using a first sample set (2480) to obtain a first prediction block, and the step of performing intra prediction on the current block (2250) using a second sample set (2490) to obtain a second prediction block, and the step of restoring the current block (2250) may include the step of restoring the current block (2250) from a third prediction block obtained through a weighted sum of the first prediction block and the second prediction block.

[0609] According to one embodiment, the quality of the final prediction block can be improved through a weighted sum of the first prediction block and the second prediction block.

[0610] In one embodiment, the step of performing intra prediction may include: identifying a sample required to generate a prediction sample of the current sample among the second sample set (2490) based on an intra prediction mode of the current block (2250) and a location of the current sample within the current block (2250); and calculating a sample value of the prediction sample from a sample value of the identified sample.

[0611] According to one embodiment, the lower right sample of the current block (2250) can be used for prediction, so that the quality of the predicted block can be improved.

[0612] In one embodiment, the method for decoding an image further includes a step of obtaining information from a bitstream indicating which sample set is used for intra prediction for a current block (2250), and the step of performing intra prediction may include a step of performing intra prediction for the current block (2250) using at least one of the first sample set (2480) or the second sample set (2490), or the first surrounding sample set (2210), based on the obtained information.

[0613] According to one embodiment, a set of samples suitable for generating a prediction block among multiple sets of samples can be determined through a bitstream, thereby improving the accuracy of the prediction.

[0614] In one embodiment, the step of performing intra prediction includes the step of performing intra prediction using a first sample set (2480) on a current block (2250) to obtain a first prediction block, and the step of performing intra prediction using a second sample set (2490) on the current block (2250) to obtain a second prediction block; and the step of selecting one of the first prediction block and the second prediction block by considering a comparison result between the first prediction block and a reference block adjacent to the first sample set (2480) and the second sample set (2490), and a comparison result between the reference block and the second prediction block, and the step of restoring the current block (2250) may include the step of restoring the current block (2250) by using the selected prediction block.

[0615] According to one embodiment, the bitrate of the bitstream can be reduced because the video decoding device (2000) determines by itself which sample set is suitable for generating a prediction block.

[0616] In one embodiment, the step of performing intra prediction may include: identifying a first sample and a second sample for a current sample in a current block (2250) in each of a first sample set (2480) and a second sample set (2490) based on an intra prediction mode; and generating a prediction sample corresponding to the current sample using the first sample and the second sample.

[0617] In one embodiment, the quality of a predicted block can be improved through intra-pair prediction.

[0618] In one embodiment, the first sample and the second sample may be positioned at opposite points along a direction indicated by the intra prediction mode, with respect to the current sample.

[0619] In one embodiment, the step of performing intra prediction may include: identifying a first sample and a second sample for a current sample within a current block (2250) from each of a first set of surrounding samples (2210) and a second set of samples (2490) based on an intra prediction mode; and generating a prediction sample corresponding to the current sample using the first sample and the second sample.

[0620] In one embodiment, the quality of a predicted block can be improved through intra-pair prediction.

[0621] In one embodiment, the step of performing intra prediction may include: selecting one of the first sample and the second sample, taking into account the position of the current sample within the current block (2250), the position of the first sample within the first sample set (2480) necessary for generating the prediction sample corresponding to the current sample, and the position of the second sample within the second sample set (2490) necessary for generating the prediction sample; and generating the prediction sample corresponding to the current sample using the selected sample.

[0622] In one embodiment, the quality of the prediction block can be improved because which sample set is used to efficiently generate the prediction sample is adaptively determined on a sample-by-sample basis.

[0623] In one embodiment, if a sample included in at least one of the first sample set (2480) or the second sample set (2490) is used as a reference sample of the current block (2250), at least one of the first sample set (2480) or the second sample set (2490) may replace at least one of the first peripheral sample set (2210) or the second peripheral sample set (2230).

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

[0625] In one embodiment, at least one processor can determine at least one of a first set of samples (2480) corresponding to a first set of neighboring samples (2210) adjacent to the current block (2250) or a second set of samples (2490) corresponding to a second set of neighboring samples (2230) adjacent to the current block (2250) from samples reconstructed before the current block (2250) within the current picture or a previous picture.

[0626] In one embodiment, the first set of peripheral samples (2210) may include samples that were reconstructed before the current block (2250), and the second set of peripheral samples (2230) may include unreconstructed samples.

[0627] In one embodiment, at least one processor can perform intra prediction on the current block (2250) using a sample included in at least one of the first sample set (2480) or the second sample set (2490) as a reference sample of the current block (2250).

[0628] In one embodiment, at least one processor can reconstruct a current block (2250) from a predicted block generated as a result of performing intra prediction.

[0629] According to an image decoding device (2000) according to one embodiment, by using not only the first surrounding sample set (2210) adjacent to the current block (2250) but also at least one of the first sample set (2480) or the second sample set (2490) for intra prediction, the efficiency of prediction can be increased and the bit rate of the bitstream can be reduced.

[0630] A method of encoding an image according to one embodiment may include a step of determining at least one of a first sample set (2480) corresponding to a first surrounding sample set (2210) adjacent to a current block (2250) or a second sample set (2490) corresponding to a second surrounding sample set (2230) adjacent to the current block (2250) from samples encoded before the current block (2250) in a current picture or a previous picture.

[0631] In one embodiment, the first set of peripheral samples (2210) may include samples encoded before the current block (2250), and the second set of peripheral samples (2230) may include unencoded samples.

[0632] A method of encoding an image according to one embodiment may include a step of performing intra prediction on a current block (2250) by using a sample included in at least one of a first sample set (2480) or a second sample set (2490) as a reference sample of the current block (2250).

[0633] A method of encoding an image according to one embodiment may include a step of encoding a current block (2250) from a prediction block generated as a result of performing intra prediction.

[0634] According to a method of encoding an image according to one embodiment, by using not only the first surrounding sample set (2210) adjacent to the current block (2250) but also at least one of the first sample set (2480) or the second sample set (2490) for intra prediction, the efficiency of prediction can be increased and the bit rate of the bitstream can be reduced.

[0635] An image encoding device (3600) 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.

[0636] In one embodiment, at least one processor can determine at least one of a first set of samples (2480) corresponding to a first set of neighboring samples (2210) adjacent to the current block (2250) or a second set of samples (2490) corresponding to a second set of neighboring samples (2230) adjacent to the current block (2250) from samples encoded before the current block (2250) within the current picture or a previous picture.

[0637] In one embodiment, the first set of peripheral samples (2210) may include samples encoded before the current block (2250), and the second set of peripheral samples (2230) may include unencoded samples.

[0638] In one embodiment, at least one processor can perform intra prediction on the current block (2250) using a sample included in at least one of the first sample set (2480) or the second sample set (2490) as a reference sample of the current block (2250).

[0639] In one embodiment, at least one processor can encode a current block (2250) from a predicted block generated as a result of performing intra prediction.

[0640] According to a method of decoding an image according to one embodiment, by using not only the first surrounding sample set (2210) adjacent to the current block (2250) but also at least one of the first sample set (2480) or the second sample set (2490) for intra prediction, the efficiency of prediction can be increased and the bit rate of the bitstream can be reduced.

[0641] A computer-readable recording medium according to one embodiment includes a bitstream, and the bitstream may include an encoding result for a current block (2250).

[0642] In one embodiment, the encoding result for the current block (2250) can be generated by determining at least one of a first sample set (2480) corresponding to a first surrounding sample set (2210) adjacent to the current block (2250) or a second sample set (2490) corresponding to a second surrounding sample set (2230) adjacent to the current block (2250) from samples encoded before the current block (2250) in the current picture or a previous picture.

[0643] In one embodiment, the first set of peripheral samples (2210) may include samples encoded before the current block (2250), and the second set of peripheral samples (2230) may include unencoded samples.

[0644] In one embodiment, the encoding result for the current block (2250) can be generated by performing intra prediction on the current block (2250) using a sample included in at least one of the first sample set (2480) or the second sample set (2490) as a reference sample of the current block (2250).

[0645] In one embodiment, the encoding result for the current block (2250) can be generated by encoding the current block (2250) from a prediction block generated as a result of performing intra prediction.

[0646] A method and device for encoding an image (3600) 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 (2250).

[0647] A method and device for encoding an image (3600) and a method and device for decoding an image (2000) according to one embodiment can reduce the size of residual data generated through predictive encoding.

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

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

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

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

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

[0653] 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. A step of determining at least one of a first set of samples (2480) corresponding to a first set of neighboring samples (2210) adjacent to a current block (2250) or a second set of samples (2490) corresponding to a second set of neighboring samples (2230) adjacent to the current block (2250) from samples reconstructed before a current block (2250) in a current picture or a previous picture; wherein the first set of neighboring samples (2210) includes samples reconstructed before the current block (2250), and the second set of neighboring samples (2230) includes unreconstructed samples; A step of performing intra prediction on the current block (2250) by using a sample included in at least one of the first sample set (2480) or the second sample set (2490) as a reference sample of the current block (2250); and A method for decoding an image, comprising a step of restoring the current block (2250) from a prediction block generated as a result of performing the intra prediction.

2. In paragraph 1, The above first peripheral sample set (2210) includes peripheral samples located on the left side of the current block (2250) and peripheral samples located on the top of the current block (2250). A method for decoding an image, wherein the second set of surrounding samples (2230) includes surrounding samples located on the right side of the current block (2250) and surrounding samples located below the current block (2250).

3. In any one of paragraphs 1 and 2, The step of determining at least one of the first sample set (2480) or the second sample set (2490) is: A step of determining a reference block within the current picture or the previous picture based on information indicating the reference block; and A method for decoding an image, comprising the step of determining at least one of the first sample set (2480) including samples located to the left of the reference block and samples located above the reference block or the second sample set (2490) including samples located to the right of the reference block and samples located below the reference block.

4. In any one of the clauses 1 to 3, The step of determining at least one of the first sample set (2480) or the second sample set (2490) is: A step of searching for the first sample set (2480) corresponding to the first surrounding sample set (2210) in the current picture or the previous picture; and A method for decoding an image, comprising the step of determining a second sample set (2490) located at a predetermined distance from the first sample set (2480).

5. In any one of paragraphs 1 to 4, The step of performing the above intra prediction is: A step of performing intra prediction using at least one of the first sample set (2480) or the second sample set (2490) on the current block (2250) to obtain a first prediction block, and performing intra prediction using the first surrounding sample set (2210) on the current block (2250) to obtain a second prediction block, The steps for restoring the current block (2250) are: A method for decoding an image, comprising the step of restoring the current block (2250) from a third prediction block obtained through a weighted sum of the first prediction block and the second prediction block.

6. In any one of paragraphs 1 to 5, The step of performing the above intra prediction is: A step of performing intra prediction using the first sample set (2480) on the current block (2250) to obtain a first prediction block, and performing intra prediction using the second sample set (2490) on the current block (2250) to obtain a second prediction block, The steps for restoring the current block (2250) are: A method for decoding an image, comprising the step of restoring the current block (2250) from a third prediction block obtained through a weighted sum of the first prediction block and the second prediction block.

7. In any one of paragraphs 1 to 6, The step of performing the above intra prediction is: A step of identifying a sample required to generate a prediction sample of the current sample among the second sample set (2490) based on the intra prediction mode of the current block (2250) and the location of the current sample within the current block (2250); and A method for decoding an image, comprising the step of calculating a sample value of the predicted sample from a sample value of the identified sample.

8. In any one of paragraphs 1 to 7, The method of decrypting the above video is as follows: Further comprising a step of obtaining information from a bitstream indicating which sample set is used for intra prediction for the current block (2250); The step of performing the above intra prediction is: A method for decoding an image, comprising: performing intra prediction on the current block (2250) using at least one of the first sample set (2480) or the second sample set (2490), or the first surrounding sample set (2210), based on the acquired information.

9. In any one of paragraphs 1 to 8, The step of performing the above intra prediction is: A step of performing intra prediction using the first sample set (2480) on the current block (2250) to obtain a first prediction block, and performing intra prediction using the second sample set (2490) on the current block (2250) to obtain a second prediction block; and A step of selecting one of the first prediction block and the second prediction block by considering the comparison result between the reference block adjacent to the first sample set (2480) and the second sample set (2490) and the first prediction block, and the comparison result between the reference block and the second prediction block, The steps for restoring the current block (2250) are: A method for decoding an image, comprising the step of restoring the current block (2250) using the selected prediction block.

10. In any one of the clauses 1 to 9, The step of performing the above intra prediction is: A step of identifying a first sample and a second sample for a current sample in the current block (2250) based on an intra prediction mode in each of the first sample set (2480) and the second sample set (2490); and A method for decoding an image, comprising the step of generating a prediction sample corresponding to the current sample using the first sample and the second sample.

11. In any one of clauses 1 to 10, A method for decoding an image, wherein the first sample and the second sample are located at opposite points along a direction indicated by the intra prediction mode with respect to the current sample.

12. In any one of paragraphs 1 to 11, The step of performing the above intra prediction is: A step of identifying a first sample and a second sample for a current sample in the current block (2250) based on an intra prediction mode in each of the first surrounding sample set (2210) and the second sample set (2490); and A method for decoding an image, comprising the step of generating a prediction sample corresponding to the current sample using the first sample and the second sample.

13. In any one of paragraphs 1 to 12, The step of performing the above intra prediction is: A step of selecting one of the first sample and the second sample, considering the position of the current sample in the current block (2250), the position of the first sample in the first sample set (2480) necessary for generating the prediction sample corresponding to the current sample, and the position of the second sample in the second sample set (2490) necessary for generating the prediction sample; and A method for decoding an image, comprising the step of generating a prediction sample corresponding to the current sample using the selected sample.

14. A step of determining at least one of a first set of samples (2480) corresponding to a first set of neighboring samples (2210) adjacent to a current block (2250) or a second set of samples (2490) corresponding to a second set of neighboring samples (2230) adjacent to the current block (2250) from samples encoded before the current block (2250) in the current picture or a previous picture; wherein the first set of neighboring samples (2210) includes samples encoded before the current block (2250), and the second set of neighboring samples (2230) includes uncoded samples; A step of performing intra prediction on the current block (2250) by using a sample included in at least one of the first sample set (2480) or the second sample set (2490) as a reference sample of the current block (2250); and A method for encoding an image, comprising a step of encoding the current block (2250) from a prediction block generated as a result of performing the intra prediction.

15. In a computer-readable recording medium that records a bitstream, The above bitstream contains the encoding result for the current block (2250), The encoding result for the current block (2250) above is: Determine at least one of a first set of samples (2480) corresponding to a first set of neighboring samples (2210) adjacent to a current block (2250) or a second set of samples (2490) corresponding to a second set of neighboring samples (2230) adjacent to the current block (2250) from samples encoded before the current block (2250) in the current picture or a previous picture, wherein the first set of neighboring samples (2210) includes samples encoded before the current block (2250) and the second set of neighboring samples (2230) includes uncoded samples, Perform intra prediction on the current block (2250) by using a sample included in at least one of the first sample set (2480) or the second sample set (2490) as a reference sample of the current block (2250), A recording medium generated by encoding the current block (2250) from a prediction block generated as a result of performing the above intra prediction.

Citation Information

Patent Citations

  • Device for processing signal

    KR102005898B1

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

    KR1020180057566A

  • Ambient controlled transfer module and process system

    KR1020230010791A

  • Method and apparatus for image encoding, and method and apparatus for image decoding

    KR102232246B1

  • KR20230006396A