Image encoding/decoding method and apparatus, and recording medium storing bit stream

文档序号:174651 发布日期:2021-10-29 浏览:21次 中文

阅读说明:本技术 图像编码/解码方法和设备以及存储比特流的记录介质 (Image encoding/decoding method and apparatus, and recording medium storing bit stream ) 是由 李河贤 姜晶媛 林成昶 李镇浩 金晖容 于 2020-03-06 设计创作,主要内容包括:提供了一种图像编码/解码方法。根据本发明的图像解码方法可包括以下步骤:将包括在基于历史的候选列表中的块矢量信息与用作用于当前块的帧内块复制(IBC)预测的IBC块矢量候选的邻近块的块矢量进行比较;并且基于所述比较将包括在基于历史的候选列表中的块矢量信息添加到IBC块矢量候选列表,其中,仅针对最后包括在基于历史的候选列表中的候选执行比较步骤。(An image encoding/decoding method is provided. The image decoding method according to the present invention may include the steps of: comparing block vector information included in the history-based candidate list with block vectors of neighboring blocks serving as Intra Block Copy (IBC) block vector candidates for IBC prediction of the current block; and adding block vector information included in the history-based candidate list to the IBC block vector candidate list based on the comparison, wherein the comparing step is performed only for the candidate last included in the history-based candidate list.)

1. A method of decoding an image, the method comprising:

a step of comparing block vector information included in the history-based candidate list with block vectors of neighboring blocks serving as IBC block vector candidates for intra block copy, IBC, prediction of the current block; and

a step of adding block vector information included in the history-based candidate list to an IBC block vector candidate list based on the comparison,

wherein the comparing step is performed only for candidates that are last included in the history-based candidate list.

2. The method of claim 1, wherein the comparing step is performed only if the area of the current block is greater than 16.

3. The method of claim 1, wherein the adding step comprises: adding block vector information included in the history-based candidate list to the IBC block vector candidate list when the block vector information included in the history-based candidate list is different from the block vectors of the neighboring blocks as a result of the comparison.

4. The method of claim 1, wherein the comparing step is performed only if the number of IBC block vector candidates included in the list of IBC block vector candidates is less than the maximum number of merge candidates that can be included in the list of IBC block vector candidates.

5. The method of claim 4, wherein the adding step is performed until the number of IBC block vector candidates included in the list of IBC block vector candidates reaches a maximum number of merge candidates that can be included in the list of IBC block vector candidates.

6. The method of claim 5, wherein a maximum number of merge candidates that can be included in the list of IBC block vector candidates is determined based on a coding parameter.

7. The method of claim 1, wherein the neighboring block comprises at least one of a block adjacent to a left side of the current block or a block adjacent to an upper side of the current block.

8. The method of claim 1, wherein the history-based candidate list comprises: block vector information of a block decoded prior to decoding of the current block.

9. The method of claim 8, further comprising the step of adding block vector information for the current block to the history-based candidate list.

10. The method of claim 9, wherein block vector information of the current block is not added to the history-based candidate list when a block decoded prior to decoding of the current block and the current block belong to different rows of a Coding Tree Unit (CTU).

11. A method of encoding an image, the method comprising:

a step of comparing block vector information included in the history-based candidate list with block vectors of neighboring blocks serving as IBC block vector candidates for intra block copy, IBC, prediction of the current block; and

a step of adding block vector information included in the history-based candidate list to an IBC block vector candidate list based on the comparison,

wherein the comparing step is performed only for candidates that are last included in the history-based candidate list.

12. The method of claim 11, wherein the comparing step is performed only if the area of the current block is greater than 16.

13. The method of claim 11, wherein the adding step comprises: adding block vector information included in the history-based candidate list to the IBC block vector candidate list when the block vector information included in the history-based candidate list is different from the block vectors of the neighboring blocks as a result of the comparison.

14. The method of claim 11, wherein the comparing step is performed only if the number of IBC block vector candidates included in the list of IBC block vector candidates is less than the maximum number of merge candidates that can be included in the list of IBC block vector candidates.

15. The method of claim 14, wherein the adding step is performed until the number of IBC block vector candidates included in the IBC block vector candidate list reaches a maximum number of merge candidates that can be included in the IBC block vector candidate list.

16. The method of claim 15, wherein a maximum number of merge candidates that can be included in the IBC block vector candidate list is determined based on a coding parameter.

17. The method of claim 11, wherein the neighboring block comprises at least one of a block adjacent to a left side of the current block or a block adjacent to an upper side of the current block.

18. The method of claim 11, wherein the first and second light sources are selected from the group consisting of,

wherein the history-based candidate list comprises: block vector information of a block encoded prior to encoding of the current block,

wherein the method further comprises the step of adding block vector information of the current block to the history-based candidate list.

19. The method of claim 18, wherein when a block encoded prior to encoding of the current block and the current block belong to different rows of a Coding Tree Unit (CTU), block vector information of the current block is not added to the history-based candidate list.

20. A non-transitory computer-readable recording medium for storing a bitstream generated by an image encoding method, the image encoding method comprising:

a step of comparing block vector information included in the history-based candidate list with block vectors of neighboring blocks serving as IBC block vector candidates for intra block copy, IBC, prediction of the current block; and

A step of adding block vector information included in the history-based candidate list to an IBC block vector candidate list based on the comparison,

wherein the comparison is performed only for candidates that are last included in the history-based candidate list.

Technical Field

The present invention relates to an image encoding/decoding method and apparatus, and a recording medium for storing a bitstream. More particularly, the present invention relates to a method of encoding and decoding an image using a candidate list.

Background

Recently, in various applications, demands for high-resolution and high-quality images such as High Definition (HD) or Ultra High Definition (UHD) images have increased. As the resolution and quality of images improve, the amount of data correspondingly increases. This is one of the reasons why transmission costs and storage costs increase when image data is transmitted through an existing transmission medium such as a wired or wireless broadband channel or when image data is stored. To solve these problems of high resolution and high quality image data, efficient image encoding/decoding techniques are required.

There are various video compression techniques such as an inter prediction technique of predicting values of pixels within a current picture from values of pixels within a previous picture or a subsequent picture, an intra prediction technique of predicting values of pixels within a region of the current picture from values of pixels within another region of the current picture, a transform and quantization technique of compressing energy of a residual signal, and an entropy coding technique of assigning a shorter code to a frequently occurring pixel value and a longer code to a less frequently occurring pixel value.

Disclosure of Invention

Technical problem

An object of the present invention is to provide an image encoding/decoding method and apparatus with improved encoding/decoding efficiency.

Another object of the present invention is to provide an image encoding/decoding method and apparatus capable of improving image compression efficiency using a candidate list.

It is another object of the present invention to provide a recording medium for storing a bitstream generated by an image decoding method or apparatus according to the present invention.

Technical scheme

The method of decoding an image according to an embodiment of the present invention includes: a step of comparing block vector information included in the history-based candidate list with block vectors of neighboring blocks serving as IBC block vector candidates for intra-block copy IBC prediction of the current block; and a step of adding block vector information included in the history-based candidate list to an IBC block vector candidate list based on the comparison. The comparing step is performed only for the candidates that are last included in the history-based candidate list.

In the image decoding method, the step of comparing may be performed only when the area of the current block is greater than 16.

In the image decoding method, the adding step may include: adding the block vector information included in the history-based candidate list to the IBC block vector candidate list when the block vector information included in the history-based candidate list is different from the block vectors of the neighboring blocks as a result of the comparison.

In the image decoding method, the comparing step may be performed only when the number of IBC block vector candidates included in the IBC block vector candidate list is less than the maximum number of merge candidates that can be included in the IBC block vector candidate list.

In the image decoding method, the adding step may be performed until the number of IBC block vector candidates included in the IBC block vector candidate list reaches the maximum number of merge candidates that can be included in the IBC block vector candidate list.

In the image decoding method, the maximum number of merge candidates that can be included in the IBC block vector candidate list may be determined based on the encoding parameter.

In the image decoding method, the neighboring block may include at least one of a block adjacent to the left side of the current block or a block adjacent to the top side of the current block.

In the image decoding method, the history-based candidate list may include block vector information of a block that is decoded before decoding of the current block.

The image decoding method may further include the step of adding block vector information of the current block to the history-based candidate list.

In the image decoding method, when a block decoded before decoding of the current block and the current block belong to different code tree unit CTU lines, block vector information of the current block may not be added to the history-based candidate list.

The method of encoding an image according to an embodiment of the present invention includes: a step of comparing block vector information included in the history-based candidate list with block vectors of neighboring blocks serving as IBC block vector candidates for intra block copy, IBC, prediction of the current block; and a step of adding block vector information included in the history-based candidate list to an IBC block vector candidate list based on the comparison. The comparing step is performed only for the candidates that are last included in the history-based candidate list.

In the image encoding method, the comparing step may be performed only when the area of the current block is greater than 16.

In the image encoding method, the adding step may include: adding the block vector information included in the history-based candidate list to the IBC block vector candidate list when the block vector information included in the history-based candidate list and the block vectors of the neighboring blocks are different as a result of the comparison.

In the image encoding method, the comparing step may be performed only when the number of IBC block vector candidates included in the IBC block vector candidate list is less than the maximum number of merge candidates that can be included in the IBC block vector candidate list.

In the image encoding method, the adding step may be performed until the number of IBC block vector candidates included in the IBC block vector candidate list reaches the maximum number of merge candidates that can be included in the IBC block vector candidate list.

In the image encoding method, the maximum number of merge candidates that can be included in the IBC block vector candidate list may be determined based on an encoding parameter.

In the image encoding method, the neighboring block may include at least one of a block adjacent to the left side of the current block or a block adjacent to the top side of the current block.

In the image encoding method, the history-based candidate list may include block vector information of a block encoded before encoding of the current block, and the image encoding method may further include a step of adding the block vector information of the current block to the history-based candidate list.

In the image encoding method, when a block encoded before encoding of a current block and the current block belong to different coding tree unit CTU lines, block vector information of the current block may not be added to the history-based candidate list.

In a non-transitory computer-readable recording medium for storing a bitstream generated by an image encoding method according to an embodiment of the present invention, the image encoding method includes: a step of comparing block vector information included in the history-based candidate list with block vectors of neighboring blocks serving as IBC block vector candidates for intra block copy, IBC, prediction of the current block; and a step of adding block vector information included in the history-based candidate list to an IBC block vector candidate list based on the comparison. The comparing step is performed only for the candidates that are last included in the history-based candidate list.

Advantageous effects

According to the present invention, it is possible to provide an image encoding/decoding method and apparatus with improved encoding/decoding efficiency.

According to the present invention, it is possible to provide an image encoding/decoding method and apparatus capable of improving encoding/decoding efficiency using a candidate list.

According to the present invention, there may be provided a recording medium for storing a bitstream generated by an image encoding method or apparatus according to the present invention.

According to the present invention, there can be provided a recording medium for storing a bitstream received and decoded by an image decoding apparatus according to the present invention and used to reconstruct an image.

Drawings

Fig. 1 is a block diagram showing a configuration of an encoding apparatus according to an embodiment to which the present invention is applied.

Fig. 2 is a block diagram showing a configuration of a decoding apparatus according to an embodiment and to which the present invention is applied.

Fig. 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded.

Fig. 4 is a diagram illustrating an intra prediction process.

Fig. 5 is a diagram illustrating an embodiment of inter-picture prediction processing.

Fig. 6 is a diagram illustrating a transform and quantization process.

Fig. 7 is a diagram illustrating reference samples that can be used for intra prediction.

Fig. 8 and 9 are diagrams illustrating a method of adding a neighbor block adjacent to a current block to a candidate list according to an embodiment of the present invention.

Fig. 10 and 11 are diagrams illustrating a method of adding a neighbor block to a candidate list in consideration of the adjacency lengths of a current block and the neighbor block according to an embodiment of the present invention.

Fig. 12 and 13 are diagrams illustrating a method of adding neighbor blocks to a candidate list in consideration of sizes of the neighbor blocks according to an embodiment of the present invention.

Fig. 14 and 15 are diagrams illustrating a method of adding neighboring blocks to a candidate list in consideration of depths of the neighboring blocks according to an embodiment of the present invention.

Fig. 16 and 17 are diagrams illustrating a method of adding neighboring blocks to a candidate list in consideration of a partition form of the neighboring blocks according to an embodiment of the present invention.

Fig. 18 and 19 are diagrams illustrating a method of adding neighboring blocks to a candidate list in consideration of block forms of the neighboring blocks according to an embodiment of the present invention.

Fig. 20 is a diagram illustrating a method of adding neighboring blocks to a candidate list in consideration of encoding/decoding orders of the neighboring blocks according to an embodiment of the present invention.

Fig. 21 is a diagram illustrating a method of adding neighboring blocks to a candidate list in consideration of positions of the neighboring blocks located at a certain distance from a position of a current block according to an embodiment of the present invention.

Fig. 22 is a diagram illustrating a method of adding a neighboring block to a candidate list in consideration of the position of the neighboring block located at a specific distance from the position of at least one of a current picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column according to an embodiment of the present invention.

Fig. 23 is a diagram illustrating a process of adding block information of a current block to a candidate list according to an embodiment of the present invention.

Fig. 24 is a diagram illustrating a process of adding a candidate in a candidate list as a candidate of an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list according to an embodiment of the present invention.

Fig. 25 is a diagram illustrating an embodiment of neighboring blocks used in constructing an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list.

Fig. 26 is a diagram illustrating a process of adding a candidate in a candidate list to an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list according to an embodiment of the present invention.

Fig. 27 is a diagram illustrating a process of adding a candidate in a history-based candidate list as a candidate of an IBC block vector prediction candidate list or an IBC merge candidate list according to an embodiment of the present invention.

Fig. 28 is a diagram illustrating an embodiment of neighboring blocks used in constructing an IBC block vector prediction candidate list or an IBC merge candidate list.

Fig. 29 is a diagram illustrating a process of adding a candidate in a history-based candidate list as a candidate of an IBC block vector prediction candidate list or an IBC merge candidate list according to an embodiment of the present invention.

Fig. 30 is a diagram illustrating an image decoding method according to an embodiment of the present invention.

Fig. 31 is a diagram illustrating an image encoding method according to an embodiment of the present invention.

Fig. 32 is a diagram illustrating an embodiment of building an IBC block vector candidate list using a history-based candidate list according to an embodiment of the present invention.

Fig. 33 is a diagram illustrating an embodiment of a method of constructing an IBC block vector candidate list using a history-based candidate list according to an embodiment of the present invention.

Fig. 34 is a diagram illustrating an embodiment of a method of constructing a merge candidate list using a history-based candidate list, according to an embodiment of the present invention.

Fig. 35 is a diagram illustrating an embodiment of a method of constructing a merge candidate list using a history-based candidate list, according to an embodiment of the present invention.

Detailed Description

While the invention is susceptible to various modifications and alternative embodiments, examples of which are now provided and described in detail with reference to the accompanying drawings. However, the present invention is not limited thereto, although the exemplary embodiments may be construed to include all modifications, equivalents, or alternatives within the technical spirit and scope of the present invention. In various aspects, like reference numerals refer to the same or similar functionality. In the drawings, the shapes and sizes of elements may be exaggerated for clarity. In the following detailed description of the present invention, reference is made to the accompanying drawings that show, by way of illustration, specific embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the disclosure. It is to be understood that the various embodiments of the disclosure, although different, are not necessarily mutually exclusive. For example, a particular feature, structure, or characteristic described herein in connection with one embodiment may be implemented within other embodiments without departing from the spirit and scope of the disclosure. Moreover, it is to be understood that the location or arrangement of individual elements within each disclosed embodiment may be modified without departing from the spirit and scope of the disclosure. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present disclosure is defined only by the appended claims, appropriately interpreted, along with the full range of equivalents to which the claims are entitled.

The terms "first", "second", and the like, as used in the specification may be used to describe various components, but the components should not be construed as limited to these terms. These terms are only used to distinguish one component from another. For example, a "first" component could be termed a "second" component, and a "second" component could similarly be termed a "first" component, without departing from the scope of the present invention. The term "and/or" includes a combination of items or any of items.

It will be understood that, in the specification, when an element is referred to simply as being "connected to" or "coupled to" another element, rather than "directly connected to" or "directly coupled to" another element, the element may be "directly connected to" or "directly coupled to" the other element, or connected to or coupled to the other element with the other element interposed therebetween. In contrast, when an element is referred to as being "directly coupled" or "directly connected" to another element, there are no intervening elements present.

Further, constituent portions shown in the embodiments of the present invention are independently shown to represent characteristic functions different from each other. Therefore, this does not mean that each constituent element is constituted by a separate hardware or software constituent unit. In other words, for convenience, each constituent includes each of the enumerated constituents. Thus, at least two constituent parts of each constituent part may be combined to form one constituent part, or one constituent part may be partitioned into a plurality of constituent parts to perform each function. An embodiment in which each constituent is combined and an embodiment in which one constituent is partitioned are also included in the scope of the present invention, if not departing from the spirit of the present invention.

The terminology used in the description is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. Unless the context clearly dictates otherwise, expressions used in the singular include expressions in the plural. In this specification, it will be understood that terms such as "comprising," "having," and the like, are intended to indicate the presence of the features, numbers, steps, actions, elements, components, or combinations thereof disclosed in the specification, and are not intended to preclude the possibility that one or more other features, numbers, steps, actions, elements, components, or combinations thereof may be present or added. In other words, when a specific element is referred to as being "included", elements other than the corresponding element are not excluded, and additional elements may be included in the embodiment of the present invention or the scope of the present invention.

Further, some of the components may not be indispensable components for performing the basic functions of the present invention, but are selective components for merely improving the performance thereof. The present invention can be implemented by including only indispensable components for implementing the essence of the present invention and not including components for improving performance. Structures that include only the essential components and not the optional components for only improving performance are also included in the scope of the present invention.

Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. In describing exemplary embodiments of the present invention, well-known functions or constructions will not be described in detail since they may unnecessarily obscure the understanding of the present invention. The same constituent elements in the drawings are denoted by the same reference numerals, and a repetitive description of the same elements will be omitted.

Hereinafter, an image may refer to a picture constituting a video, or may refer to a video itself. For example, "encoding or decoding an image or both encoding and decoding" may refer to "encoding or decoding a moving picture or both encoding and decoding" and may refer to "encoding or decoding one of images of a moving picture or both encoding and decoding".

Hereinafter, the terms "moving picture" and "video" may be used as the same meaning and may be replaced with each other.

Hereinafter, the target image may be an encoding target image as an encoding target and/or a decoding target image as a decoding target. Further, the target image may be an input image input to the encoding apparatus, and an input image input to the decoding apparatus. Here, the target image may have the same meaning as the current image.

Hereinafter, the terms "image", "picture", "frame", and "screen" may be used in the same meaning and may be replaced with each other.

Hereinafter, the target block may be an encoding target block as an encoding target and/or a decoding target block as a decoding target. Further, the target block may be a current block that is a target of current encoding and/or decoding. For example, the terms "target block" and "current block" may be used with the same meaning and may be substituted for each other.

Hereinafter, the terms "block" and "unit" may be used with the same meaning and may be replaced with each other. Or "block" may represent a particular unit.

Hereinafter, the terms "region" and "fragment" may be substituted for each other.

Hereinafter, the specific signal may be a signal representing a specific block. For example, the original signal may be a signal representing the target block. The prediction signal may be a signal representing a prediction block. The residual signal may be a signal representing a residual block.

In embodiments, each of the particular information, data, flags, indices, elements, attributes, and the like may have a value. A value of information, data, flags, indices, elements, and attributes equal to "0" may represent a logical false or first predefined value. In other words, the values "0", false, logical false and the first predefined value may be substituted for each other. A value of information, data, flags, indices, elements, and attributes equal to "1" may represent a logical true or a second predefined value. In other words, the values "1", true, logically true, and the second predefined value may be substituted for each other.

When the variable i or j is used to represent a column, a row, or an index, the value of i may be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, the column, row, index, etc. may start counting from 0, or may start counting from 1.

Description of the terms

An encoder: indicating the device performing the encoding. That is, an encoding apparatus is represented.

A decoder: indicating the device performing the decoding. That is, a decoding apparatus is represented.

Block (2): is an array of M × N samples. Here, M and N may represent positive integers, and a block may represent a two-dimensional form of a sample point array. A block may refer to a unit. The current block may represent an encoding target block that becomes a target at the time of encoding or a decoding target block that becomes a target at the time of decoding. Further, the current block may be at least one of an encoding block, a prediction block, a residual block, and a transform block.

Sampling points are as follows: are the basic units that make up the block. According to bit depth (B)d) The samples can be represented from 0 to 2Bd-a value of 1. In the present invention, a sampling point can be used as a meaning of a pixel. That is, samples, pels, pixels may have the same meaning as each other.

A unit: may refer to encoding and decoding units. When encoding and decoding an image, a unit may be a region generated by partitioning a single image. Further, when a single image is partitioned into sub-partition units during encoding or decoding, a unit may represent a sub-partition unit. That is, the image may be partitioned into a plurality of cells. When encoding and decoding an image, predetermined processing for each unit may be performed. A single cell may be partitioned into sub-cells that are smaller in size than the cell. According to functions, a unit may represent a block, a macroblock, a coding tree unit, a coding tree block, a coding unit, a coding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, and the like. Further, to distinguish a unit from a block, the unit may include a luma component block, a chroma component block associated with the luma component block, and syntax elements for each of the chroma component blocks. The cells may have various sizes and shapes, in particular, the shape of the cells may be a two-dimensional geometric figure, such as a square, rectangle, trapezoid, triangle, pentagon, and the like. In addition, the unit information may include a unit type indicating a coding unit, a prediction unit, a transform unit, etc., and at least one of a unit size, a unit depth, an order of encoding and decoding of the unit, etc.

A coding tree unit: a single coding tree block configured with a luminance component Y and two coding tree blocks associated with chrominance components Cb and Cr. Further, the coding tree unit may represent syntax elements including blocks and each block. Each coding tree unit may be partitioned by using at least one of a quadtree partitioning method, a binary tree partitioning method, and a ternary tree partitioning method to configure a unit of a lower hierarchy such as a coding unit, a prediction unit, a transform unit, and the like. The coding tree unit may be used as a term for specifying a sample block that becomes a processing unit when encoding/decoding an image that is an input image. Here, the quad tree may represent a quad tree.

When the size of the coding block is within a predetermined range, the partitioning may be performed using only the quadtree partitioning. Here, the predetermined range may be defined as at least one of a maximum size and a minimum size of the coding block that can be partitioned using only the quadtree partition. Information indicating the maximum/minimum size of coding blocks allowing quad-tree partitioning may be signaled through a bitstream and may be signaled in at least one unit of a sequence, picture parameter, parallel block group, or slice (slice). Alternatively, the maximum/minimum size of the coding block may be a fixed size predetermined in the encoder/decoder. For example, when the size of the coding block corresponds to 256 × 256 to 64 × 64, it is possible to partition using only quad-tree partitioning. Alternatively, when the size of the coding block is larger than the size of the maximum conversion block, it is possible to perform partitioning using only the quadtree partitioning. Here, the block to be partitioned may be at least one of an encoding block and a transform block. In this case, information (e.g., split _ flag) indicating the partition of the coding block may be a flag indicating whether to perform the quadtree partitioning. When the size of the coding block falls within a predetermined range, it is possible to perform partitioning using only binary tree or ternary tree partitioning. In this case, the above description of the quadtree partition may be applied to the binary tree partition or the ternary tree partition in the same manner.

And (3) encoding a tree block: may be used as a term for specifying any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.

Adjacent blocks: may represent blocks adjacent to the current block. The blocks adjacent to the current block may represent blocks that are in contact with the boundary of the current block or blocks located within a predetermined distance from the current block. The neighboring blocks may represent blocks adjacent to a vertex of the current block. Here, the block adjacent to the vertex of the current block may mean a block vertically adjacent to a neighboring block horizontally adjacent to the current block or a block horizontally adjacent to a neighboring block vertically adjacent to the current block.

Reconstruction of neighboring blocks: may represent neighboring blocks that are adjacent to the current block and have been encoded or decoded in space/time. Here, reconstructing neighboring blocks may mean reconstructing neighboring cells. The reconstructed spatially neighboring block may be a block within the current picture and that has been reconstructed by encoding or decoding or both encoding and decoding. The reconstruction temporal neighboring block is a block at a position corresponding to the current block of the current picture within the reference image or a neighboring block of the block.

Depth of cell: may represent the degree of partitioning of the cell. In the tree structure, the highest node (root node) may correspond to the first unit that is not partitioned. Further, the highest node may have the smallest depth value. In this case, the depth of the highest node may be level 0. A node with a depth of level 1 may represent a unit generated by partitioning the first unit once. A node with a depth of level 2 may represent a unit generated by partitioning the first unit twice. A node with a depth of level n may represent a unit generated by partitioning the first unit n times. A leaf node may be the lowest node and is a node that cannot be partitioned further. The depth of a leaf node may be a maximum level. For example, the predefined value of the maximum level may be 3. The depth of the root node may be the lowest, and the depth of the leaf node may be the deepest. Further, when a cell is represented as a tree structure, the level at which the cell exists may represent the cell depth.

Bit stream: a bitstream including encoded image information may be represented.

Parameter set: corresponding to header information among configurations within the bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set may be included in the parameter set. In addition, the parameter set may include a slice header, a parallel block (tile) group header, and parallel block header information. The term "parallel block group" denotes a group of parallel blocks and has the same meaning as a stripe.

An adaptive parameter set may represent a parameter set that may be shared by being referenced in different pictures, sub-pictures, slices, parallel block groups, parallel blocks, or chunks (fricks). Further, information in the adaptation parameter set may be used by referring to different adaptation parameter sets for sub-pictures, slices, groups of parallel blocks, or partitions within a picture.

Further, with regard to the adaptive parameter set, different adaptive parameter sets may be referred to by using identifiers of the different adaptive parameter sets for sub-pictures, slices, groups of parallel blocks, or partitions within a picture.

Further, with regard to the adaptive parameter set, different adaptive parameter sets may be referenced by using identifiers for different adaptive parameter sets for slices, parallel block groups, parallel blocks, or partitions within a sub-picture.

Furthermore, with regard to the adaptive parameter set, different adaptive parameter sets may be referenced by using identifiers for different adaptive parameter sets for parallel blocks or partitions within a slice.

Furthermore, with regard to the adaptive parameter set, different adaptive parameter sets may be referenced by using identifiers of the different adaptive parameter sets for partitions within the parallel blocks.

Information on the adaptive parameter set identifier may be included in a parameter set or a header of the sub-picture, and an adaptive parameter set corresponding to the adaptive parameter set identifier may be used for the sub-picture.

Information on the adaptive parameter set identifier may be included in a parameter set or a header of the parallel block, and an adaptive parameter set corresponding to the adaptive parameter set identifier may be used for the parallel block.

Information on an adaptive parameter set identifier may be included in a header of a partition, and an adaptive parameter set corresponding to the adaptive parameter set identifier may be used for the partition.

A picture may be partitioned into one or more parallel block rows and one or more parallel block columns.

A sprite may be partitioned into one or more parallel block rows and one or more parallel block columns within the picture. A sprite may be an area within the picture having a rectangular/square form and may include one or more CTUs. Furthermore, at least one or more parallel blocks/tiles/stripes may be included within one sprite.

A parallel block may be a region within a picture having a rectangular/square form and may include one or more CTUs. Furthermore, a parallel block may be partitioned into one or more partitions.

A block may represent one or more rows of CTUs within a parallel block. A parallel block may be partitioned into one or more partitions, and each partition may have at least one or more CTU rows. A parallel block that is not partitioned into two or more may represent a partitioned block.

A stripe may comprise one or more parallel blocks within a picture and may comprise one or more tiles within a parallel block.

And (3) analysis: may represent determining the value of the syntax element by performing entropy decoding, or may represent entropy decoding itself.

Symbol: at least one of a syntax element, a coding parameter, and a transform coefficient value that may represent the encoding/decoding target unit. Further, the symbol may represent an entropy encoding target or an entropy decoding result.

Prediction mode: may be information indicating a mode encoded/decoded using intra prediction or a mode encoded/decoded using inter prediction.

A prediction unit: may represent basic units when performing prediction, such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation. A single prediction unit may be partitioned into multiple partitions of smaller size, or may be partitioned into multiple lower level prediction units. The plurality of partitions may be basic units in performing prediction or compensation. The partition generated by the partition prediction unit may also be a prediction unit.

Prediction unit partitioning: may represent a shape obtained by partitioning a prediction unit.

The reference picture list may refer to a list including one or more reference pictures used for inter prediction or motion compensation. There are several types of available reference picture lists, including LC (list combination), L0 (list 0), L1 (list 1), L2 (list 2), L3 (list 3).

The inter prediction indicator may refer to a direction of inter prediction of the current block (uni-directional prediction, bi-directional prediction, etc.). Alternatively, the inter prediction indicator may refer to the number of reference pictures used to generate a prediction block of the current block. Alternatively, the inter prediction indicator may refer to the number of prediction blocks used when inter prediction or motion compensation is performed on the current block.

The prediction list indicates whether to use at least one reference picture in a specific reference picture list to generate a prediction block using a flag. The inter prediction indicator may be derived using the prediction list utilization flag, and conversely, the prediction list utilization flag may be derived using the inter prediction indicator. For example, when the prediction list utilization flag has a first value of zero (0), it indicates that a reference picture in the reference picture list is not used to generate the prediction block. On the other hand, when the prediction list utilization flag has a second value of one (1), it indicates that the reference picture list is used to generate the prediction block.

The reference picture index may refer to an index indicating a specific reference picture in the reference picture list.

The reference picture may represent a reference picture that is referenced by a particular block for purposes of inter prediction or motion compensation for the particular block. Alternatively, the reference picture may be a picture including a reference block that is referred to by the current block for inter prediction or motion compensation. Hereinafter, the terms "reference picture" and "reference image" have the same meaning and are interchangeable.

The motion vector may be a two-dimensional vector used for inter prediction or motion compensation. The motion vector may represent an offset between the encoding/decoding target block and the reference block. For example, (mvX, mvY) may represent a motion vector. Here, mvX may represent a horizontal component, and mvY may represent a vertical component.

The search range may be a two-dimensional area searched to retrieve a motion vector during inter prediction. For example, the size of the search range may be M × N. Here, M and N are both integers.

The motion vector candidate may refer to a prediction candidate block or a motion vector of a prediction candidate block at the time of prediction of a motion vector. Further, the motion vector candidate may be included in a motion vector candidate list.

The motion vector candidate list may represent a list consisting of one or more motion vector candidates.

The motion vector candidate index may represent an indicator indicating a motion vector candidate in the motion vector candidate list. Alternatively, it may be an index of a motion vector predictor.

The motion information may represent information including at least one of items including a motion vector, a reference picture index, an inter prediction indicator, a prediction list utilization flag, reference picture list information, a reference picture, a motion vector candidate index, a merge candidate, and a merge index.

The merge candidate list may represent a list composed of one or more merge candidates.

The merge candidates may represent spatial merge candidates, temporal merge candidates, combined bi-predictive merge candidates, or zero merge candidates. The merge candidate may include motion information such as an inter prediction indicator, a reference picture index of each list, a motion vector, a prediction list utilization flag, and an inter prediction indicator.

The merge index may represent an indicator indicating a merge candidate in the merge candidate list. Alternatively, the merge index may indicate a block in a reconstructed block spatially/temporally adjacent to the current block from which the merge candidate has been derived. Alternatively, the merge index may indicate at least one piece of motion information of the merge candidate.

A transformation unit: may represent a basic unit when encoding/decoding (such as transform, inverse transform, quantization, inverse quantization, transform coefficient encoding/decoding) is performed on the residual signal. A single transform unit may be partitioned into multiple lower-level transform units having smaller sizes. Here, the transform/inverse transform may include at least one of a first transform/first inverse transform and a second transform/second inverse transform.

Zooming: may represent a process of multiplying the quantized level by a factor. The transform coefficients may be generated by scaling the quantized levels. Scaling may also be referred to as inverse quantization.

Quantization parameters: may represent a value used when a transform coefficient is used to generate a quantized level during quantization. The quantization parameter may also represent a value used when generating a transform coefficient by scaling a quantized level during inverse quantization. The quantization parameter may be a value mapped on a quantization step.

Incremental quantization parameter: may represent a difference between the predicted quantization parameter and the quantization parameter of the encoding/decoding target unit.

Scanning: a method of ordering coefficients within a cell, block or matrix may be represented. For example, changing a two-dimensional matrix of coefficients into a one-dimensional matrix may be referred to as scanning, and changing a one-dimensional matrix of coefficients into a two-dimensional matrix may be referred to as scanning or inverse scanning.

Transform coefficients: may represent coefficient values generated after performing a transform in an encoder. The transform coefficient may represent a coefficient value generated after at least one of entropy decoding and inverse quantization is performed in a decoder. The quantized level obtained by quantizing the transform coefficient or the residual signal or the quantized transform coefficient level may also fall within the meaning of the transform coefficient.

Level of quantization: may represent values generated by quantizing a transform coefficient or a residual signal in an encoder. Alternatively, the quantized level may represent a value that is an inverse quantization target subjected to inverse quantization in a decoder. Similarly, the quantized transform coefficient levels as a result of the transform and quantization may also fall within the meaning of quantized levels.

Non-zero transform coefficients: may represent transform coefficients having values other than zero, or transform coefficient levels or quantized levels having values other than zero.

Quantization matrix: a matrix used in quantization processing or inverse quantization processing performed in order to improve subjective image quality or objective image quality may be represented. The quantization matrix may also be referred to as a scaling list.

Quantization matrix coefficients: each element within the quantization matrix may be represented. The quantized matrix coefficients may also be referred to as matrix coefficients.

Default matrix: may represent a predefined quantization matrix predefined in the encoder or decoder.

Non-default matrix: may represent quantization matrices that are not predefined in the encoder or decoder but signaled by the user.

And (3) statistical value: the statistical value for at least one of the variables, encoding parameters, constant values, etc. having a particular value that can be calculated may be one or more of an average value, a sum value, a weighted average value, a weighted sum value, a minimum value, a maximum value, a most frequently occurring value, a median value, an interpolation corresponding to the particular value.

Fig. 1 is a block diagram showing a configuration of an encoding apparatus according to an embodiment to which the present invention is applied.

The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. The video may comprise at least one image. The encoding apparatus 100 may sequentially encode at least one image.

Referring to fig. 1, the encoding apparatus 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference picture buffer 190.

The encoding apparatus 100 may perform encoding of an input image by using an intra mode or an inter mode, or both the intra mode and the inter mode. Further, the encoding apparatus 100 may generate a bitstream including encoding information by encoding an input image and output the generated bitstream. The generated bitstream may be stored in a computer-readable recording medium or may be streamed through a wired/wireless transmission medium. When the intra mode is used as the prediction mode, the switch 115 may switch to intra. Alternatively, when the inter mode is used as the prediction mode, the switch 115 may switch to the inter mode. Here, the intra mode may mean an intra prediction mode, and the inter mode may mean an inter prediction mode. The encoding apparatus 100 may generate a prediction block for an input block of an input image. Also, the encoding apparatus 100 may encode the residual block using the input block and the residual of the prediction block after generating the prediction block. The input image may be referred to as a current image that is a current encoding target. The input block may be referred to as a current block that is a current encoding target, or as an encoding target block.

When the prediction mode is the intra mode, the intra prediction unit 120 may use samples of blocks that have been encoded/decoded and are adjacent to the current block as reference samples. The intra prediction unit 120 may perform spatial prediction on the current block by using the reference samples or generate prediction samples of the input block by performing spatial prediction. Here, the intra prediction may mean prediction inside a frame.

When the prediction mode is an inter mode, the motion prediction unit 111 may retrieve a region that best matches the input block from a reference image when performing motion prediction, and derive a motion vector by using the retrieved region. In this case, a search area may be used as the area. The reference image may be stored in the reference picture buffer 190. Here, when encoding/decoding of a reference picture is performed, the reference picture may be stored in the reference picture buffer 190.

The motion compensation unit 112 may generate a prediction block by performing motion compensation on the current block using the motion vector. Here, inter prediction may mean prediction or motion compensation between frames.

When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a partial region of a reference picture. In order to perform inter-picture prediction or motion compensation on a coding unit, it may be determined which mode among a skip mode, a merge mode, an Advanced Motion Vector Prediction (AMVP) mode, and a current picture reference mode is used for motion prediction and motion compensation on a prediction unit included in a corresponding coding unit. Then, inter-picture prediction or motion compensation may be performed differently according to the determined mode.

The subtractor 125 may generate a residual block by using the difference of the input block and the prediction block. The residual block may be referred to as a residual signal. The residual signal may represent the difference between the original signal and the predicted signal. Further, the residual signal may be a signal generated by transforming or quantizing or transforming and quantizing the difference between the original signal and the prediction signal. The residual block may be a residual signal of a block unit.

The transform unit 130 may generate a transform coefficient by performing a transform on the residual block and output the generated transform coefficient. Here, the transform coefficient may be a coefficient value generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 may skip the transform of the residual block.

The level of quantization may be generated by applying quantization to the transform coefficients or to the residual signal. Hereinafter, the level of quantization may also be referred to as a transform coefficient in embodiments.

The quantization unit 140 may generate a quantized level by quantizing the transform coefficient or the residual signal according to the parameter, and output the generated quantized level. Here, the quantization unit 140 may quantize the transform coefficient by using the quantization matrix.

The entropy encoding unit 150 may generate a bitstream by performing entropy encoding on the values calculated by the quantization unit 140 or on encoding parameter values calculated when encoding is performed according to the probability distribution, and output the generated bitstream. The entropy encoding unit 150 may perform entropy encoding on the sample point information of the image and information for decoding the image. For example, the information for decoding the image may include syntax elements.

When entropy encoding is applied, symbols are represented such that a smaller number of bits are allocated to symbols having a high generation probability and a larger number of bits are allocated to symbols having a low generation probability, and thus, the size of a bit stream for symbols to be encoded can be reduced. The entropy encoding unit 150 may use an encoding method for entropy encoding, such as exponential Golomb, Context Adaptive Variable Length Coding (CAVLC), Context Adaptive Binary Arithmetic Coding (CABAC), and the like. For example, the entropy encoding unit 150 may perform entropy encoding by using a variable length coding/code (VLC) table. Further, the entropy encoding unit 150 may derive a binarization method of the target symbol and a probability model of the target symbol/bin, and perform arithmetic encoding by using the derived binarization method and context model.

In order to encode the transform coefficient levels (quantized levels), the entropy encoding unit 150 may change the coefficients of the two-dimensional block form into the one-dimensional vector form by using a transform coefficient scanning method.

The encoding parameters may include information (flags, indices, etc.) such as syntax elements encoded in the encoder and signaled to the decoder, as well as information derived when performing encoding or decoding. The encoding parameter may represent information required when encoding or decoding an image. For example, at least one value or a combination of the following may be included in the encoding parameter: unit/block size, unit/block depth, unit/block partition information, unit/block shape, unit/block partition structure, whether or not to perform partition in the form of a quadtree, whether or not to perform partition in the form of a binary tree, the partition direction (horizontal direction or vertical direction) in the form of a binary tree, the partition form (symmetric partition or asymmetric partition) in the form of a binary tree, whether or not the current coding unit is partitioned by partition in the form of a ternary tree, the direction (horizontal direction or vertical direction) of partition in the form of a ternary tree, the type (symmetric type or asymmetric type) of partition in the form of a ternary tree, whether or not the current coding unit is partitioned by partition in the form of a multi-type tree, the direction (horizontal direction or vertical direction) of partition in the form of a multi-type tree, the type (symmetric type or asymmetric type) of partition in the form of a multi-type tree, the tree structure (binary tree or ternary tree) of partition in the form of a multi-type tree, the partition in the form of a multi-type tree, and the partition in the form of a multi-type tree (binary tree) in the form of partition in the form of a tree structure, Prediction mode (intra prediction or inter prediction), luma intra prediction mode/direction, chroma intra prediction mode/direction, intra partition information, inter partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filtering method, reference sample filter tap, reference sample filter coefficient, prediction block filtering method, prediction block filter tap, prediction block filter coefficient, prediction block boundary filtering method, prediction block boundary filter tap, prediction block boundary filter coefficient, intra prediction mode, inter prediction mode, motion information, motion vector difference, reference picture index, inter prediction angle, inter prediction indicator, prediction list utilization flag, reference picture list, reference picture, motion vector predictor index, motion vector predictor candidate, chroma intra prediction mode/direction, chroma intra prediction mode, chroma prediction mode/direction, chroma intra prediction mode, chroma prediction mode/direction, chroma prediction mode, chroma intra prediction mode, chroma intra prediction mode, chroma prediction mode, etc., chroma prediction mode, etc., Motion vector candidate list, whether merge mode is used, merge index, merge candidate list, whether skip mode is used, interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, representation accuracy of motion vector, transform type, transform size, information whether primary (first) transform is used, information whether secondary transform is used, primary transform index, secondary transform index, information whether residual signal is present, coding block pattern, Coding Block Flag (CBF), quantization parameter residual, quantization matrix, whether intra loop filter is applied, intra loop filter coefficient, intra loop filter tap, intra loop filter shape/form, whether deblocking filter is applied, deblocking filter coefficient, deblocking filter tap, deblocking filter strength, and the like, Deblocking filter shape/form, whether adaptive sample offset is applied, adaptive sample offset value, adaptive sample offset class, adaptive sample offset type, whether adaptive loop filter is applied, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape/form, binarization/inverse binarization method, context model determination method, context model update method, whether normal mode is performed, whether bypass mode is performed, context binary bit, bypass binary bit, significant coefficient flag, last significant coefficient flag, coding flag for unit of coefficient group, position of last significant coefficient, flag as to whether value of coefficient is greater than 1, flag as to whether value of coefficient is greater than 2, flag as to whether value of coefficient is greater than 3, information as to remaining coefficient values, information as to whether value of coefficient is greater than 1, information as to whether value of coefficient is greater than 2, information as to whether value of coefficient is greater than 3, information as to whether to coefficient is greater than 1, information as to whether to be processed, Sign information, reconstructed luminance sample points, reconstructed chrominance sample points, residual luminance sample points, residual chrominance sample points, luminance transform coefficients, chrominance transform coefficients, quantized luminance levels, quantized chrominance levels, a transform coefficient level scanning method, a size of a motion vector search region at a decoder side, a shape of a motion vector search region at a decoder side, the number of times of motion vector search at a decoder side, information on a CTU size, information on a minimum block size, information on a maximum block depth, information on a minimum block depth, an image display/output order, slice identification information, a slice type, slice partition information, parallel block identification information, a parallel block type, parallel block partition information, parallel block group identification information, a parallel block group type, parallel block group partition information, a motion vector search region in a motion vector search region, a motion vector search region in a motion vector search region, and a motion vector in a motion vector region, Picture type, bit depth of input samples, bit depth of reconstructed samples, bit depth of residual samples, bit depth of transform coefficients, bit depth of quantized levels, and information on luminance signals or information on chrominance signals.

Here, signaling the flag or index may mean that the corresponding flag or index is entropy-encoded and included in the bitstream by an encoder, and may mean that the corresponding flag or index is entropy-decoded from the bitstream by a decoder.

When the encoding apparatus 100 performs encoding by inter prediction, the encoded current picture may be used as a reference picture for another picture to be subsequently processed. Accordingly, the encoding apparatus 100 may reconstruct or decode the encoded current image or store the reconstructed or decoded image as a reference image in the reference picture buffer 190.

The quantized level may be inversely quantized in the inverse quantization unit 160 or may be inversely transformed in the inverse transformation unit 170. The inverse quantized or inverse transformed coefficients, or both, may be added to the prediction block by adder 175. A reconstructed block may be generated by adding the inverse quantized or inverse transformed coefficients or both the inverse quantized and inverse transformed coefficients to the prediction block. Here, the inverse quantized or inverse transformed coefficient or the coefficient subjected to both inverse quantization and inverse transformation may represent a coefficient on which at least one of inverse quantization and inverse transformation is performed, and may represent a reconstructed residual block.

The reconstructed block may pass through the filter unit 180. Filter unit 180 may apply at least one of a deblocking filter, Sample Adaptive Offset (SAO), and Adaptive Loop Filter (ALF) to the reconstructed samples, reconstructed blocks, or reconstructed images. The filter unit 180 may be referred to as an in-loop filter.

The deblocking filter may remove block distortion generated in a boundary between blocks. To determine whether to apply the deblocking filter, whether to apply the deblocking filter to the current block may be determined based on samples included in a number of rows or columns included in the block. When a deblocking filter is applied to a block, another filter may be applied according to the required deblocking filtering strength.

To compensate for coding errors, an appropriate offset value may be added to the sample value by using a sample adaptive offset. The sample adaptive offset may correct the offset of the deblocked image from the original image in units of samples. A method of applying an offset in consideration of edge information on each sampling point may be used, or the following method may be used: the sampling points of the image are divided into a predetermined number of areas, an area to which an offset is applied is determined, and the offset is applied to the determined area.

The adaptive loop filter may perform filtering based on a comparison of the filtered reconstructed image and the original image. The samples included in the image may be partitioned into predetermined groups, a filter to be applied to each group may be determined, and the differential filtering may be performed on each group. The information whether or not to apply the ALF may be signaled through a Coding Unit (CU), and the form and coefficient of the ALF to be applied to each block may vary.

The reconstructed block or the reconstructed image that has passed through the filter unit 180 may be stored in the reference picture buffer 190. The reconstructed block processed by the filter unit 180 may be a part of a reference image. That is, the reference image is a reconstructed image composed of the reconstruction blocks processed by the filter unit 180. The stored reference pictures may be used later in inter prediction or motion compensation.

Fig. 2 is a block diagram showing a configuration of a decoding apparatus according to an embodiment and to which the present invention is applied.

The decoding apparatus 200 may be a decoder, a video decoding apparatus, or an image decoding apparatus.

Referring to fig. 2, the decoding apparatus 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260, and a reference picture buffer 270.

The decoding apparatus 200 may receive the bitstream output from the encoding apparatus 100. The decoding apparatus 200 may receive a bitstream stored in a computer-readable recording medium or may receive a bitstream streamed through a wired/wireless transmission medium. The decoding apparatus 200 may decode the bitstream by using an intra mode or an inter mode. Further, the decoding apparatus 200 may generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.

When the prediction mode used at the time of decoding is an intra mode, the switch may be switched to intra. Alternatively, when the prediction mode used at the time of decoding is an inter mode, the switch may be switched to the inter mode.

The decoding apparatus 200 may obtain a reconstructed residual block by decoding an input bitstream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding apparatus 200 may generate a reconstructed block that becomes a decoding target by adding the reconstructed residual block to the prediction block. The decoding target block may be referred to as a current block.

The entropy decoding unit 210 may generate symbols by entropy decoding the bitstream according to the probability distribution. The generated symbols may comprise symbols in the form of quantized levels. Here, the entropy decoding method may be an inverse process of the above-described entropy encoding method.

To decode the transform coefficient levels (quantized levels), the entropy decoding unit 210 may change the coefficients of the one-directional vector form into a two-dimensional block form by using a transform coefficient scanning method.

The quantized levels may be inversely quantized in the inverse quantization unit 220 or inversely transformed in the inverse transformation unit 230. The quantized level may be the result of inverse quantization or inverse transformation, or both, and may be generated as a reconstructed residual block. Here, the inverse quantization unit 220 may apply a quantization matrix to the quantized level.

When using the intra mode, the intra prediction unit 240 may generate a prediction block by performing spatial prediction on the current block, wherein the spatial prediction uses a sampling value of a block that is adjacent to the decoding target block and has already been decoded.

When the inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation on the current block, wherein the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270.

The adder 255 may generate a reconstructed block by adding the reconstructed residual block to the predicted block. Filter unit 260 may apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or the reconstructed image. The filter unit 260 may output a reconstructed image. The reconstructed block or reconstructed image may be stored in the reference picture buffer 270 and used when performing inter prediction. The reconstructed block processed by the filter unit 260 may be a part of a reference image. That is, the reference image is a reconstructed image composed of the reconstruction blocks processed by the filter unit 260. The stored reference pictures may be used later in inter prediction or motion compensation.

Fig. 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded. FIG. 3 schematically illustrates an example of partitioning a single unit into multiple lower level units.

In order to efficiently partition an image, a Coding Unit (CU) may be used when encoding and decoding. The coding unit may be used as a basic unit when encoding/decoding an image. Further, the encoding unit may be used as a unit for distinguishing an intra prediction mode from an inter prediction mode when encoding/decoding an image. The coding unit may be a basic unit for prediction, transform, quantization, inverse transform, inverse quantization, or encoding/decoding processing of transform coefficients.

Referring to fig. 3, a picture 300 is sequentially partitioned by a maximum coding unit (LCU), and the LCU unit is determined as a partition structure. Here, the LCU may be used in the same meaning as a Coding Tree Unit (CTU). A unit partition may refer to partitioning a block associated with the unit. In the block partition information, information of a unit depth may be included. The depth information may represent the number of times or degree the unit is partitioned or both. A single unit may be partitioned into a plurality of lower level units hierarchically associated with depth information based on a tree structure. In other words, a cell and a lower level cell generated by partitioning the cell may correspond to a node and a child node of the node, respectively. Each of the partitioned lower level units may have depth information. The depth information may be information representing the size of the CU, and may be stored in each CU. The cell depth represents the number and/or degree of times associated with partitioning a cell. Thus, partition information of a lower-ranked unit may include information about the size of the lower-ranked unit.

The partition structure may represent a distribution of Coding Units (CUs) within LCU 310. Such a distribution may be determined according to whether a single CU is partitioned into multiple CUs (including positive integers equal to or greater than 2, 4, 8, 16, etc.) or not. The horizontal size and the vertical size of the CU generated by the partitioning may be half of the horizontal size and the vertical size of the CU before the partitioning, respectively, or may have sizes smaller than the horizontal size and the vertical size before the partitioning, respectively, according to the number of times of the partitioning. A CU may be recursively partitioned into multiple CUs. By recursively partitioning, at least one of the height and the width of the CU after the partitioning may be reduced compared to at least one of the height and the width of the CU before the partitioning. The partitioning of CUs may be performed recursively until a predefined depth or a predefined size. For example, the depth of an LCU may be 0 and the depth of a minimum coding unit (SCU) may be a predefined maximum depth. Here, as described above, the LCU may be a coding unit having a maximum coding unit size, and the SCU may be a coding unit having a minimum coding unit size. Partitions start from LCU 310, and CU depth is increased by 1 when the horizontal size or vertical size, or both, of a CU is reduced by partitioning. For example, the size of a non-partitioned CU may be 2N × 2N for each depth. Further, in the case of a partitioned CU, a CU of size 2N × 2N may be partitioned into four CUs of size N × N. As the depth increases by 1, the size of N may be halved.

Also, information on whether a CU is partitioned or not may be represented by using partition information of the CU. The partition information may be 1-bit information. All CUs except the SCU may include partition information. For example, a CU may not be partitioned when the value of the partition information is a first value, and may be partitioned when the value of the partition information is a second value.

Referring to fig. 3, an LCU having a depth of 0 may be a 64 × 64 block. 0 may be a minimum depth. The SCU with depth 3 may be an 8 x 8 block. 3 may be the maximum depth. CUs of the 32 × 32 block and the 16 × 16 block may be represented as depth 1 and depth 2, respectively.

For example, when a single coding unit is partitioned into four coding units, the horizontal and vertical dimensions of the partitioned four coding units may be half the size of the horizontal and vertical dimensions of the CU before being partitioned. In one embodiment, when a coding unit having a size of 32 × 32 is partitioned into four coding units, each of the partitioned four coding units may have a size of 16 × 16. When a single coding unit is partitioned into four coding units, it can be said that the coding units can be partitioned into a quad-tree form.

For example, when one coding unit is partitioned into two sub-coding units, the horizontal size or vertical size (width or height) of each of the two sub-coding units may be half of the horizontal size or vertical size of the original coding unit. For example, when a coding unit having a size of 32 × 32 is vertically partitioned into two sub-coding units, each of the two sub-coding units may have a size of 16 × 32. For example, when a coding unit having a size of 8 × 32 is horizontally partitioned into two sub-coding units, each of the two sub-coding units may have a size of 8 × 16. When a coding unit is partitioned into two sub-coding units, it can be said that the coding unit is partitioned or partitioned according to a binary tree partition structure.

For example, when one coding unit is partitioned into three sub-coding units, the horizontal size or the vertical size of the coding unit may be partitioned at a ratio of 1:2:1, thereby generating three sub-coding units having a ratio of 1:2:1 in the horizontal size or the vertical size. For example, when a coding unit of size 16 × 32 is horizontally partitioned into three sub-coding units, the three sub-coding units may have sizes of 16 × 8, 16 × 16, and 16 × 8, respectively, in order from the uppermost sub-coding unit to the lowermost sub-coding unit. For example, when a coding unit having a size of 32 × 32 is vertically partitioned into three sub-coding units, the three sub-coding units may have sizes of 8 × 32, 16 × 32, and 8 × 32, respectively, in order from a left sub-coding unit to a right sub-coding unit. When one coding unit is partitioned into three sub-coding units, it can be said that the coding unit is partitioned by three or partitioned in a ternary tree partition structure.

In fig. 3, a Coding Tree Unit (CTU)320 is an example of a CTU to which a quad tree partition structure, a binary tree partition structure, and a ternary tree partition structure are all applied.

As described above, in order to partition the CTU, at least one of a quad tree partition structure, a binary tree partition structure, and a ternary tree partition structure may be applied. Various tree partition structures may be sequentially applied to the CTUs according to a predetermined priority order. For example, a quadtree partitioning structure may be preferentially applied to CTUs. Coding units that can no longer be partitioned using the quadtree partition structure may correspond to leaf nodes of the quadtree. The coding units corresponding to leaf nodes of the quadtree may be used as root nodes of a binary and/or ternary tree partition structure. That is, coding units corresponding to leaf nodes of a quadtree may or may not be further partitioned in a binary tree partition structure or a ternary tree partition structure. Accordingly, by preventing coding units resulting from binary tree partitioning or ternary tree partitioning of coding units corresponding to leaf nodes of a quadtree from undergoing further quadtree partitioning, block partitioning operations and/or operations of signaling partition information may be efficiently performed.

The fact that the coding units corresponding to the nodes of the quadtree are partitioned may be signaled using the four-partition information. The partition information having a first value (e.g., "1") may indicate that the current coding unit is partitioned in a quadtree partition structure. The partition information having the second value (e.g., "0") may indicate that the current coding unit is not partitioned according to the quadtree partition structure. The quad-partition information may be a flag having a predetermined length (e.g., one bit).

There may be no priority between the binary tree partition and the ternary tree partition. That is, the coding unit corresponding to the leaf node of the quadtree may further undergo any partition of the binary tree partition and the ternary tree partition. Furthermore, a coding unit generated by binary tree partitioning or ternary tree partitioning may undergo further binary tree partitioning or further ternary tree partitioning, or may not be further partitioned.

A tree structure in which there is no priority between a binary tree partition and a ternary tree partition is referred to as a multi-type tree structure. The coding units corresponding to leaf nodes of the quadtree may be used as root nodes of the multi-type tree. Whether to partition the coding unit corresponding to the node of the multi-type tree may be signaled using at least one of multi-type tree partition indication information, partition direction information, and partition tree information. In order to partition coding units corresponding to nodes of the multi-type tree, multi-type tree partition indication information, partition direction information, and partition tree information may be sequentially signaled.

The multi-type tree partition indication information having a first value (e.g., "1") may indicate that the current coding unit is to undergo multi-type tree partitioning. The multi-type tree partition indication information having the second value (e.g., "0") may indicate that the current coding unit will not undergo multi-type tree partitioning.

When the coding unit corresponding to the node of the multi-type tree is further partitioned according to the multi-type tree partition structure, the coding unit may include partition direction information. The partition direction information may indicate in which direction the current coding unit is to be partitioned for the multi-type tree partition. The partition direction information having a first value (e.g., "1") may indicate that the current coding unit is to be vertically partitioned. The partition direction information having the second value (e.g., "0") may indicate that the current coding unit is to be horizontally partitioned.

When the coding unit corresponding to the node of the multi-type tree is further partitioned according to the multi-type tree partition structure, the current coding unit may include partition tree information. The partition tree information may indicate a tree partition structure to be used for partitioning nodes of the multi-type tree. The partition tree information having a first value (e.g., "1") may indicate that the current coding unit is to be partitioned in a binary tree partition structure. The partition tree information having the second value (e.g., "0") may indicate that the current coding unit is to be partitioned in a ternary tree partition structure.

The partition indication information, the partition tree information, and the partition direction information may each be a flag having a predetermined length (e.g., one bit).

At least any one of the quadtree partition indication information, the multi-type tree partition indication information, the partition direction information, and the partition tree information may be entropy-encoded/entropy-decoded. In order to entropy-encode/entropy-decode those types of information, information on neighboring coding units adjacent to the current coding unit may be used. For example, there is a high likelihood that the partition type (partitioned or not, partition tree, and/or partition direction) of the left neighboring coding unit and/or the upper neighboring coding unit of the current coding unit is similar to the partition type of the current coding unit. Accordingly, context information for entropy-encoding/decoding information regarding the current coding unit may be derived from information regarding neighboring coding units. The information on the neighboring coding units may include at least any one of four-partition information, multi-type tree partition indication information, partition direction information, and partition tree information.

As another example, in binary tree partitioning and ternary tree partitioning, binary tree partitioning may be performed preferentially. That is, the current coding unit may first undergo binary tree partitioning, and then coding units corresponding to leaf nodes of the binary tree may be set as root nodes for the ternary tree partitioning. In this case, neither quad-tree nor binary-tree partitioning may be performed for coding units corresponding to nodes of the ternary tree.

Coding units that cannot be partitioned in a quadtree partition structure, a binary tree partition structure, and/or a ternary tree partition structure become basic units for coding, prediction, and/or transformation. That is, the coding unit cannot be further partitioned for prediction and/or transform. Therefore, partition structure information and partition information for partitioning a coding unit into prediction units and/or transform units may not exist in a bitstream.

However, when the size of the coding unit (i.e., a basic unit for partitioning) is greater than the size of the maximum transform block, the coding unit may be recursively partitioned until the size of the coding unit is reduced to be equal to or less than the size of the maximum transform block. For example, when the size of the coding unit is 64 × 64 and when the size of the maximum transform block is 32 × 32, the coding unit may be partitioned into four 32 × 32 blocks for transform. For example, when the size of a coding unit is 32 × 64 and the size of a maximum transform block is 32 × 32, the coding unit may be partitioned into two 32 × 32 blocks for transform. In this case, the partition of the coding unit for the transform is not separately signaled, and may be determined by a comparison between a horizontal size or a vertical size of the coding unit and a horizontal size or a vertical size of the maximum transform block. For example, when the horizontal size (width) of the coding unit is larger than the horizontal size (width) of the maximum transform block, the coding unit may be vertically halved. For example, when the vertical size (height) of the coding unit is greater than the vertical size (height) of the maximum transform block, the coding unit may be horizontally halved.

Information of the maximum and/or minimum size of the coding unit and information of the maximum and/or minimum size of the transform block may be signaled or determined at a higher level of the coding unit. The higher level may be, for example, sequence level, picture level, slice level, parallel block group level, parallel block level, etc. For example, the minimum size of the coding unit may be determined to be 4 × 4. For example, the maximum size of the transform block may be determined to be 64 × 64. For example, the minimum size of the transform block may be determined to be 4 × 4.

Information of a minimum size of a coding unit corresponding to a leaf node of the quadtree (quadtree minimum size) and/or information of a maximum depth from a root node of the multi-type tree to the leaf node (maximum tree depth of the multi-type tree) may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a stripe level, a parallel block group level, a parallel block level, etc. Information of a minimum size of the quadtree and/or information of a maximum depth of the multi-type tree may be signaled or determined for each of the intra-picture slices and the inter-picture slices.

The difference information between the size of the CTU and the maximum size of the transform block may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a stripe level, a parallel block group level, a parallel block level, etc. Information of the maximum size of the coding unit corresponding to each node of the binary tree (hereinafter, referred to as the maximum size of the binary tree) may be determined based on the size of the coding tree unit and the difference information. The maximum size of the coding unit corresponding to each node of the ternary tree (hereinafter, referred to as the maximum size of the ternary tree) may vary according to the type of the strip. For example, for intra-picture stripes, the maximum size of the treble may be 32 x 32. For example, for inter-picture slices, the maximum size of the ternary tree may be 128 × 128. For example, a minimum size of a coding unit corresponding to each node of the binary tree (hereinafter, referred to as a minimum size of the binary tree) and/or a minimum size of a coding unit corresponding to each node of the ternary tree (hereinafter, referred to as a minimum size of the ternary tree) may be set to a minimum size of the coding block.

As another example, the maximum size of the binary tree and/or the maximum size of the ternary tree may be signaled or determined at the stripe level. Optionally, a minimum size of the binary tree and/or a minimum size of the ternary tree may be signaled or determined at the slice level.

According to the above-described size and depth information of various blocks, the four-partition information, the multi-type tree partition indication information, the partition tree information, and/or the partition direction information may or may not be included in the bitstream.

For example, when the size of the coding unit is not greater than the minimum size of the quadtree, the coding unit does not include the quadrant information. The quadrant information may be inferred to be a second value.

For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is larger than the maximum size (horizontal size and vertical size) of the binary tree and/or the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be partitioned or tri-partitioned. Accordingly, the multi-type tree partition indication information may not be signaled, but may be inferred to be a second value.

Alternatively, when the sizes (horizontal size and vertical size) of the coding units corresponding to the nodes of the multi-type tree are the same as the maximum sizes (horizontal size and vertical size) of the binary tree and/or are twice as large as the maximum sizes (horizontal size and vertical size) of the ternary tree, the coding units may not be further bi-partitioned or tri-partitioned. Accordingly, the multi-type tree partition indication information may not be signaled but may be derived as the second value. This is because when the coding units are partitioned in the binary tree partition structure and/or the ternary tree partition structure, coding units smaller than the minimum size of the binary tree and/or the minimum size of the ternary tree are generated.

Alternatively, binary tree partitioning or ternary tree partitioning may be restricted based on the size of the virtual pipeline data unit (hereinafter, pipeline buffer size). For example, when a coding unit is partitioned into sub-coding units that do not fit the pipeline buffer size by binary tree partitioning or ternary tree partitioning, the corresponding binary tree partitioning or ternary tree partitioning may be limited. The pipeline buffer size may be the size of the largest transform block (e.g., 64 x 64). For example, when the pipeline buffer size is 64 × 64, the following partitions may be restricted.

-nxm (N and/or M is 128) ternary tree partitions for coding units

128 xn (N < ═ 64) binary tree partitioning for the horizontal direction of the coding units

-N × 128(N < ═ 64) binary tree partitioning for the vertical direction of the coding units

Alternatively, when the depth of the coding unit corresponding to the node of the multi-type tree is equal to the maximum depth of the multi-type tree, the coding unit may not be further bi-partitioned and/or tri-partitioned. Accordingly, the multi-type tree partition indication information may not be signaled, but may be inferred to be a second value.

Alternatively, the multi-type tree partition indication information may be signaled only when at least one of the vertical direction binary tree partition, the horizontal direction binary tree partition, the vertical direction ternary tree partition, and the horizontal direction ternary tree partition is possible for a coding unit corresponding to a node of the multi-type tree. Otherwise, the coding unit may not be partitioned and/or tri-partitioned. Accordingly, the multi-type tree partition indication information may not be signaled, but may be inferred to be a second value.

Alternatively, the partition direction information may be signaled only when both the vertical direction binary tree partition and the horizontal direction binary tree partition or both the vertical direction ternary tree partition and the horizontal direction ternary tree partition are possible for the coding units corresponding to the nodes of the multi-type tree. Otherwise, the partition direction information may not be signaled, but may be derived as a value indicating possible partition directions.

Alternatively, the partition tree information may be signaled only when both vertical and vertical ternary tree partitions, or both horizontal and horizontal ternary tree partitions, are possible for the coding tree corresponding to the nodes of the multi-type tree. Otherwise, partition tree information may not be signaled, but may be derived as a value indicating a possible partition tree structure.

Fig. 4 is a diagram illustrating an intra prediction process.

The arrow from the center to the outside in fig. 4 may represent the prediction direction of the intra prediction mode.

Intra-coding and/or decoding may be performed by using reference samples of neighboring blocks of the current block. The neighboring blocks may be reconstructed neighboring blocks. For example, intra-coding and/or decoding may be performed by using coding parameters or values of reference samples included in the reconstructed neighboring blocks.

The prediction block may represent a block generated by performing intra prediction. The prediction block may correspond to at least one of a CU, a PU, and a TU. The unit of the prediction block may have a size of one of a CU, a PU, and a TU. The prediction block may be a square block having a size of 2 × 2, 4 × 4, 16 × 16, 32 × 32, 64 × 64, or the like, or may be a rectangular block having a size of 2 × 8, 4 × 8, 2 × 16, 4 × 16, 8 × 16, or the like.

The intra prediction may be performed according to an intra prediction mode for the current block. The number of intra prediction modes that the current block may have may be a fixed value, and may be a value differently determined according to the properties of the prediction block. For example, the properties of the prediction block may include the size of the prediction block, the shape of the prediction block, and the like.

The number of intra prediction modes may be fixed to N regardless of the block size. Alternatively, the number of intra prediction modes may be 3, 5, 9, 17, 34, 35, 36, 65, 67, or the like. Alternatively, the number of intra prediction modes may vary according to the block size or the color component type or both the block size and the color component type. For example, the number of intra prediction modes may vary depending on whether the color component is a luminance signal or a chrominance signal. For example, as the block size becomes larger, the number of intra prediction modes may increase. Alternatively, the number of intra prediction modes of the luma component block may be greater than the number of intra prediction modes of the chroma component block.

The intra prediction mode may be a non-angle mode or an angle mode. The non-angle mode may be a DC mode or a planar mode, and the angle mode may be a prediction mode having a specific direction or angle. The intra prediction mode may be represented by at least one of a mode number, a mode value, a mode number, a mode angle, and a mode direction. The number of intra prediction modes may be M greater than 1, including non-angular and angular modes. In order to intra-predict the current block, a step of determining whether samples included in a reconstructed neighboring block can be used as reference samples of the current block may be performed. When there are samples that cannot be used as reference samples of the current block, a value obtained by copying or performing interpolation or both copying and interpolation on at least one sample value among samples included in the reconstructed neighboring blocks may be used to replace an unavailable sample value of the samples, and thus the replaced sample value is used as a reference sample of the current block.

Fig. 7 is a diagram illustrating reference samples that can be used for intra prediction.

As shown in fig. 7, at least one of the reference sample line 0 to the reference sample line 3 may be used for intra prediction of the current block. In fig. 7, instead of retrieving from reconstructed neighboring blocks, the samples for segment a and segment F may be padded with samples closest to segment B and segment E, respectively. Index information indicating a reference sample line to be used for intra prediction of the current block may be signaled. For example, in fig. 7, reference sample line indicators 0, 1, and 2 may be signaled as index information indicating the reference sample line indicators 0, 1, and 2. When the upper boundary of the current block is the boundary of the CTU, only the reference sample line 0 may be available. Therefore, in this case, the index information may not be signaled. When a reference sample line other than the reference sample line 0 is used, filtering for a prediction block, which will be described later, may not be performed.

When performing intra prediction, a filter may be applied to at least one of the reference samples and the prediction samples based on the intra prediction mode and the current block size.

In the case of the planar mode, when generating a prediction block of the current block, a sample value of the prediction target sample may be generated by using a weighted sum of an upper reference sample and a left reference sample of the current sample and an upper right reference sample and a lower left reference sample of the current block according to a position of the prediction target sample within the prediction block. Also, in case of the DC mode, when generating a prediction block of the current block, an average value of upper and left reference samples of the current block may be used. Also, in case of the angle mode, a prediction block may be generated by using the upper reference sample, the left side reference sample, the upper right reference sample, and/or the lower left reference sample of the current block. To generate predicted sample values, interpolation of real units may be performed.

In the case of intra prediction between color components, a prediction block for a current block of a second color component may be generated based on a corresponding reconstructed block of a first color component. For example, the first color component may be a luminance component and the second color component may be a chrominance component. For intra prediction between color components, parameters of a linear model between the first color component and the second color component may be derived based on the template. The template may include top and/or left neighboring samples of the current block and top and/or left neighboring samples of the reconstructed block of the first color component corresponding thereto. For example, the parameters of the linear model may be derived using the sample value of the first color component having the largest value among the sample points in the template and the sample value of the second color component corresponding thereto, and the sample value of the first color component having the smallest value among the sample points in the template and the sample value of the second color component corresponding thereto. When deriving parameters of the linear model, the corresponding reconstructed block may be applied to the linear model to generate a prediction block for the current block. According to the video format, sub-sampling may be performed on reconstructed blocks of the first color component and adjacent samples of corresponding reconstructed blocks. For example, when one sample point of the second color component corresponds to four sample points of the first color component, the four sample points of the first color component may be subsampled to calculate one corresponding sample point. In this case, parameter derivation of the linear model and intra prediction between color components may be performed based on the corresponding sub-sampled sampling points. Whether to perform intra prediction between color components and/or the range of templates may be signaled as an intra prediction mode.

The current block may be partitioned into two sub-blocks or four sub-blocks in a horizontal direction or a vertical direction. The partitioned sub-blocks may be sequentially reconstructed. That is, intra prediction may be performed on the sub-block to generate the sub-prediction block. Further, inverse quantization and/or inverse transformation may be performed on the sub-block to generate a sub-residual block. The reconstructed sub-block may be generated by adding the sub-prediction block to the sub-residual block. The reconstructed sub-block may be used as a reference sample for intra prediction of a subsequent sub-block. A sub-block may be a block that includes a predetermined number (e.g., 16) or more samples. Thus, for example, when the current block is an 8 × 4 block or a 4 × 8 block, the current block may be partitioned into two sub-blocks. Also, when the current block is a 4 × 4 block, the current block may not be partitioned into sub-blocks. When the current block has other sizes, the current block may be partitioned into four sub-blocks. Information about whether to perform intra prediction based on sub-block and/or partition direction (horizontal or vertical) may be signaled. The sub-block based intra prediction may be limited to be performed only when the reference sample line 0 is used. When the sub-block-based intra prediction is performed, filtering for a prediction block, which will be described later, may not be performed.

The final prediction block may be generated by performing filtering on the prediction block that is intra-predicted. The filtering may be performed by applying a predetermined weight to the filtering target sample, the left reference sample, the upper reference sample, and/or the upper left reference sample. The weight for filtering and/or the reference sample point (range, position, etc.) may be determined based on at least one of the block size, the intra prediction mode, and the position of the filtering target sample point in the prediction block. The filtering may be performed only in the case of predetermined intra prediction modes, such as DC, planar, vertical, horizontal, diagonal, and/or adjacent diagonal modes. The adjacent diagonal patterns may be patterns that add k to or subtract k from the diagonal patterns. For example, k may be a positive integer of 8 or less.

The intra prediction mode of the current block may be entropy-encoded/entropy-decoded by predicting an intra prediction mode of a block existing adjacent to the current block. When the intra prediction modes of the current block and the neighboring block are the same, the same information of the intra prediction modes of the current block and the neighboring block may be signaled by using predetermined flag information. Also, indicator information of the same intra prediction mode as that of the current block among intra prediction modes of the neighboring blocks may be signaled. When the intra prediction mode of the current block is different from that of the adjacent block, the intra prediction mode information of the current block may be entropy-encoded/entropy-decoded by performing entropy-encoding/entropy-decoding based on the intra prediction mode of the adjacent block.

Fig. 5 is a diagram illustrating an embodiment of inter-picture prediction processing.

In fig. 5, a rectangle may represent a picture. In fig. 5, arrows indicate prediction directions. Pictures can be classified into intra pictures (I pictures), predictive pictures (P pictures), and bi-predictive pictures (B pictures) according to the coding type of the picture.

I pictures can be encoded by intra prediction without the need for inter-picture prediction. P pictures can be encoded through inter-picture prediction by using reference pictures existing in one direction (i.e., forward or backward) with respect to a current block. B pictures can be encoded through inter-picture prediction by using reference pictures existing in two directions (i.e., forward and backward) with respect to a current block. When inter-picture prediction is used, the encoder may perform inter-picture prediction or motion compensation, and the decoder may perform corresponding motion compensation.

Hereinafter, an embodiment of inter-picture prediction will be described in detail.

Inter-picture prediction or motion compensation may be performed using the reference picture and the motion information.

The motion information of the current block may be derived during inter-picture prediction by each of the encoding apparatus 100 and the decoding apparatus 200. The motion information of the current block may be derived by using motion information of reconstructed neighboring blocks, motion information of co-located blocks (also referred to as col blocks or co-located blocks), and/or motion information of blocks adjacent to the co-located blocks. The co-located block may represent a block spatially co-located with the current block within a previously reconstructed co-located picture (also referred to as a col picture or a co-located picture). The co-located picture may be one picture among one or more reference pictures included in the reference picture list.

The derivation method of motion information may be different according to the prediction mode of the current block. For example, the prediction modes applied to the inter prediction include an AMVP mode, a merge mode, a skip mode, a merge mode having a motion vector difference, a sub-block merge mode, a geometric partition mode, an inter-intra combined prediction mode, an affine mode, and the like. Here, the merge mode may be referred to as a motion merge mode.

For example, when AMVP is used as the prediction mode, at least one of a motion vector of a reconstructed neighboring block, a motion vector of a co-located block, a motion vector of a block adjacent to the co-located block, and a (0, 0) motion vector may be determined as a motion vector candidate for the current block, and a motion vector candidate list may be generated by using the motion vector candidates. The motion vector candidate of the current block may be derived by using the generated motion vector candidate list. Motion information of the current block may be determined based on the derived motion vector candidates. The motion vector of the co-located block or the motion vector of a block adjacent to the co-located block may be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block may be referred to as a spatial motion vector candidate.

The encoding apparatus 100 may calculate a Motion Vector Difference (MVD) between the motion vector of the current block and the motion vector candidate, and may perform entropy encoding on the Motion Vector Difference (MVD). Also, the encoding apparatus 100 may perform entropy encoding on the motion vector candidate index and generate a bitstream. The motion vector candidate index may indicate a best motion vector candidate among the motion vector candidates included in the motion vector candidate list. The decoding apparatus may perform entropy decoding on the motion vector candidate index included in the bitstream, and may select a motion vector candidate of the decoding target block from among the motion vector candidates included in the motion vector candidate list by using the entropy-decoded motion vector candidate index. Further, the decoding apparatus 200 may add the entropy-decoded MVD to the motion vector candidate extracted by the entropy decoding, thereby deriving the motion vector of the decoding target block.

In addition, the encoding apparatus 100 may perform entropy encoding on the resolution information of the calculated MVD. The decoding apparatus 200 may adjust the resolution of the entropy-decoded MVD using the MVD resolution information.

In addition, the encoding apparatus 100 calculates a Motion Vector Difference (MVD) between the motion vector in the current block and the motion vector candidate based on the affine model, and performs entropy encoding on the MVD. The decoding apparatus 200 derives a motion vector on a per sub-block basis by deriving an affine control motion vector of the decoding target block from the sum of the entropy-decoded MVD and the affine control motion vector candidate.

The bitstream may include a reference picture index indicating a reference picture. The reference picture index may be entropy-encoded by the encoding apparatus 100 and then signaled to the decoding apparatus 200 as a bitstream. The decoding apparatus 200 may generate a prediction block of the decoding target block based on the derived motion vector and the reference picture index information.

Another example of a method of deriving motion information of a current block may be a merge mode. The merge mode may represent a method of merging motions of a plurality of blocks. The merge mode may represent a mode in which motion information of the current block is derived from motion information of neighboring blocks. When the merge mode is applied, the merge candidate list may be generated using motion information of reconstructed neighboring blocks and/or motion information of co-located blocks. The motion information may include at least one of a motion vector, a reference picture index, and an inter-picture prediction indicator. The prediction indicator may indicate unidirectional prediction (L0 prediction or L1 prediction) or bidirectional prediction (L0 prediction and L1 prediction).

The merge candidate list may be a list of stored motion information. The motion information included in the merge candidate list may be at least one of: motion information of a neighboring block adjacent to the current block (spatial merge candidate), motion information of a co-located block of the current block in a reference picture (temporal merge candidate), new motion information generated by a combination of motion information existing in a merge candidate list, motion information of a block encoded/decoded before the current block (history-based merge candidate), and a zero merge candidate.

The encoding apparatus 100 may generate a bitstream by performing entropy encoding on at least one of the merging flag and the merging index, and may signal the bitstream to the decoding apparatus 200. The merge flag may be information indicating whether a merge mode is performed for each block, and the merge index may be information indicating which of neighboring blocks of the current block is a merge target block. For example, the neighboring blocks of the current block may include a left neighboring block located at the left side of the current block, an upper neighboring block arranged above the current block, and a temporal neighboring block temporally adjacent to the current block.

In addition, the encoding apparatus 100 performs entropy encoding on correction information for correcting a motion vector among the motion information of the merging candidates, and signals it to the decoding apparatus 200. The decoding apparatus 200 may correct the motion vector of the merge candidate selected by the merge index based on the correction information. Here, the correction information may include at least one of information on whether to perform correction, correction direction information, and correction size information. As described above, the prediction mode in which the motion vector of the merging candidate is corrected based on the signaled correction information may be referred to as a merging mode having a motion vector difference.

The skip mode may be a mode in which motion information of neighboring blocks is applied to the current block as it is. When the skip mode is applied, the encoding apparatus 100 may perform entropy encoding on information of the fact of which block motion information is to be used as motion information of the current block to generate a bitstream, and may signal the bitstream to the decoding apparatus 200. The encoding apparatus 100 may not signal syntax elements regarding at least any one of motion vector difference information, a coded block flag, and a transform coefficient level to the decoding apparatus 200.

The sub-block merge mode may represent a mode in which motion information is derived in units of sub-blocks of a coding block (CU). When the sub-block merge mode is applied, the sub-block merge candidate list may be generated using motion information (sub-block-based temporal merge candidate) and/or affine control point motion vector merge candidate of a sub-block co-located with the current sub-block in the reference image.

The geometric partition mode may represent a mode in which motion information is derived by partitioning the current block into predetermined directions, each prediction sample is derived using each of the derived motion information, and the prediction sample of the current block is derived by weighting each of the derived prediction samples.

The inter-intra combined prediction mode may represent a mode in which prediction samples of the current block are derived by weighting prediction samples generated by inter prediction and prediction samples generated by intra prediction.

The decoding apparatus 200 may correct the derived motion information by itself. The decoding apparatus 200 may search for a predetermined region based on the reference block indicated by the derived motion information and derive motion information having the minimum SAD as corrected motion information.

The decoding apparatus 200 may compensate for the prediction samples derived via the inter prediction using the optical flow.

Fig. 6 is a diagram illustrating a transform and quantization process.

As shown in fig. 6, a transform process and/or a quantization process are performed on the residual signal to generate a quantized level signal. The residual signal is the difference between the original block and the predicted block (i.e., intra-predicted block or inter-predicted block). The prediction block is a block generated by intra prediction or inter prediction. The transform may be a primary transform, a secondary transform, or both a primary and a secondary transform. Transform coefficients are generated for a primary transform of the residual signal, and secondary transform coefficients are generated for a secondary transform of the transform coefficients.

At least one scheme selected from among various predefined transformation schemes is used to perform the primary transformation. Examples of such predefined transformation schemes include Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), and Karhunen-loeve transform (KLT), for example. The transform coefficients generated by the primary transform may undergo a secondary transform. The transform scheme for the primary transform and/or the secondary transform may be determined according to encoding parameters of the current block and/or neighboring blocks of the current block. Optionally, transformation information indicating the transformation scheme may be signaled. The DCT-based transform may include, for example, DCT-2, DCT-8, and so on. The DST-based transformation may include, for example, DST-7.

The quantized level signal (quantized coefficient) may be generated by performing quantization on the residual signal or on the result of performing the primary transform and/or the secondary transform. The quantized level signal may be scanned according to at least one of a diagonal up-right scan, a vertical scan, and a horizontal scan, according to an intra prediction mode of the block or a block size/shape. For example, when the coefficients are scanned in a diagonal top-right scan, the coefficients in block form change to one-dimensional vector form. In addition to the diagonal top-right scan, a horizontal scan that horizontally scans coefficients in the form of two-dimensional blocks or a vertical scan that vertically scans coefficients in the form of two-dimensional blocks may be used depending on the intra prediction mode and/or the size of the transform block. The scanned quantized level coefficients may be entropy encoded for insertion into the bitstream.

The decoder entropy decodes the bitstream to obtain quantized level coefficients. The quantized level coefficients may be arranged in a two-dimensional block form by inverse scanning. For the inverse scan, at least one of a diagonal upper-right scan, a vertical scan, and a horizontal scan may be used.

The quantized level coefficients may then be inverse quantized, then secondary inverse transformed as needed, and finally primary inverse transformed as needed to generate a reconstructed residual signal.

Inverse mapping in the dynamic range may be performed for the luma component reconstructed by intra-prediction or inter-prediction before in-loop filtering. The dynamic range may be partitioned into 16 equal segments and the mapping function for each segment may be signaled. The mapping function may be signaled at the stripe level or parallel block group level. An inverse mapping function for performing inverse mapping may be derived based on the mapping function. In-loop filtering, reference picture storage, and motion compensation are performed in the inverse mapping region, and a prediction block generated by inter prediction is converted to the mapping region via mapping using a mapping function and then used to generate a reconstructed block. However, since the intra prediction is performed in the mapping region, the prediction block generated via the intra prediction may be used to generate a reconstructed block without mapping/inverse mapping.

When the current block is a residual block of the chrominance components, the residual block may be converted to an inverse mapping region by performing scaling on the chrominance components of the mapping region. The availability of scaling may be signaled at the stripe level or parallel block group level. Scaling may be applied only if a mapping for the luma component is available and the partitions of the luma component and the partitions of the chroma component follow the same tree structure. Scaling may be performed based on an average of sample values of a luma prediction block corresponding to a chroma block. In this case, when the current block uses inter prediction, the luma prediction block may represent a mapped luma prediction block. The values required for scaling may be derived by referring to a look-up table using the index of the slice to which the average of the sample values of the luma prediction block belongs. Finally, the residual block may be converted to an inverse mapping region by scaling the residual block using the derived value. Chroma component block recovery, intra prediction, inter prediction, in-loop filtering, and reference picture storage may then be performed in the inverse mapped region.

Information indicating whether mapping/inverse mapping of the luminance component and the chrominance component is available may be signaled through a sequence parameter set.

A prediction block for the current block may be generated based on a block vector indicating a displacement between the current block and a reference block in the current picture. In this way, a prediction mode for generating a prediction block with reference to a current picture is referred to as an Intra Block Copy (IBC) mode. The IBC mode may be applied to an mxn (M < ═ 64, N < ═ 64) coding unit. The IBC mode may include a skip mode, a merge mode, an AMVP mode, and the like. In the case of the skip mode or the merge mode, a merge candidate list is constructed and a merge index is signaled so that one merge candidate can be specified. The block vector of the designated merge candidate may be used as the block vector of the current block. The merge candidate list may include at least one of a spatial candidate, a history-based candidate, a candidate based on an average of two candidates, and a zero merge candidate. In the case of AMVP mode, the difference block vector may be signaled. In addition, a prediction block vector may be derived from a left neighboring block and an upper neighboring block of the current block. The index of the neighboring block to be used may be signaled. The prediction block in IBC mode is included in the current CTU or the left CTU and is limited to blocks in the already reconstructed region. For example, the value of the block vector may be restricted such that the prediction block of the current block is located in the region of three 64 × 64 blocks preceding the 64 × 64 block to which the current block belongs in the encoding/decoding order. By limiting the values of the block vectors in this manner, memory consumption and device complexity according to an IBC mode implementation may be reduced.

Hereinafter, an image encoding/decoding method according to an embodiment of the present invention will be described with reference to fig. 8 to 35.

The embodiments described below relate to a method of determining a reference block of a current block, and an image may be encoded/decoded according to a combination of at least one of the following embodiments. According to the following embodiments of the present invention, a reference block of a current block can be efficiently determined in an image encoding/decoding process, thereby improving encoding efficiency of an image encoder.

In this specification, a block may represent a unit. In addition, the candidate list represents a candidate set, and may include at least one candidate.

The determination of the reference block of the current block according to an embodiment of the present invention may be performed in at least one of image encoding/decoding processes including inter prediction, intra prediction, transformation, inverse transformation, quantization, inverse quantization, entropy encoding/entropy decoding, and/or in-loop filtering.

In this specification, the IBC motion vector may have the same meaning as the IBC block vector.

In addition, in the present specification, the IBC motion vector candidate list may have the same meaning as the IBC block vector prediction candidate list.

In addition, in the present specification, the IBC block vector prediction candidate list and/or the IBC merge candidate list may have the same meaning as the IBC block vector candidate list.

The image encoding/decoding according to the present invention may be performed by a step of including neighboring blocks in a candidate list and/or a step of determining a reference block of a current block from the candidate list.

The reference block of the current block may be determined from a candidate list including neighboring blocks or block information of the neighboring blocks. The current block may be encoded/decoded using the determined reference block in at least one of inter prediction, intra prediction, transformation, inverse transformation, quantization, inverse quantization, entropy encoding/entropy decoding, or in-loop filter as an image encoding/decoding process.

The reference block may represent at least one of block information of the reference block. That is, the determined block information of the reference block may be used for the current block to perform at least one of image encoding/decoding processes. At this time, the block information of the reference block may be determined as the block information of the current block. Accordingly, a reference block described below may represent at least one of block information of the reference block.

At this time, at least one of the neighboring blocks included in the candidate list and/or the information of the neighboring blocks included in the candidate list may represent a candidate.

In addition, at least one of the blocks included in the candidate list and/or the block information of the blocks included in the candidate list may represent a candidate.

That is, a block may represent a candidate as the block itself, or at least one candidate representing information about the block. Accordingly, in the following embodiments, a block and information on the block may be collectively referred to as a block.

The information on the block may represent at least one of information on a neighboring block, information on a reference block, or information on the current block.

In addition, the information on the block may include at least one of the encoding parameters.

In addition, the information on the block may include at least one piece of information used in inter prediction, intra prediction, transformation, inverse transformation, quantization, inverse quantization, entropy encoding/entropy decoding, or in-loop filter.

That is, the information on the block may represent at least one of: block size, block depth, block partition information, block form (square or rectangular), whether partitioning is performed in the form of a quadtree, whether partitioning is performed in the form of a binary tree, partition direction (horizontal or vertical direction) of a binary tree, partition form (symmetric or asymmetric partition) of a binary tree, prediction mode (e.g., intra prediction mode or inter prediction mode), intra luma prediction mode/direction, intra chroma prediction mode/direction, intra partition information, inter partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filter tap, reference sample filter coefficient, prediction block filter tap, prediction block filter coefficient, prediction block boundary filter tap, prediction block boundary filter coefficient, motion vector (e.g., motion vector of at least one of L0, L1, L2, L3, etc.), and the like, Motion vector differences (e.g., motion vector differences of at least one of L0, L1, L2, L3, etc.), inter prediction directions (inter prediction directions of at least one of unidirectional prediction or bidirectional prediction), reference image indices (e.g., reference image indices of at least one of L0, L1, L2, L3, etc.), inter prediction indicators, prediction list utilization flags, reference image lists, motion vector prediction indices, motion vector prediction candidates, motion vector candidate lists, whether merge mode is used, merge index, merge candidate list, whether skip mode is used, interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, representation precision of motion vector (representation unit of motion vector, e.g., integer sample, 1/2 sample, 1/4 sample, 1/8 sample, etc.), inter prediction direction (inter prediction direction of at least one of unidirectional prediction or bidirectional prediction), motion vector prediction direction of at least one of L0, L1, L2, L3, etc.), inter prediction indicator, prediction list utilization flag, and motion vector prediction mode of the merge candidate list, whether skip mode is used, interpolation filter tap, interpolation filter coefficient, and motion vector size of motion vector, 1/16 samples, 1/32 samples, etc.), IBC motion vector difference, IBC motion vector index, IBC motion vector prediction candidate, IBC motion vector candidate list, IBC merge candidate list, weight of each block when two prediction blocks are generated, transform type, transform size, information on whether primary transform is used, information on whether secondary transform is used, primary transform index, secondary transform index, information on whether residual signal is present, coding block pattern, coding block flag, quantization parameter, residual quantization parameter, quantization matrix, whether intra loop filter is applied, intra loop filter coefficient, intra loop filter tap, intra loop filter shape/form, whether deblocking filter is applied, deblocking filter coefficient, deblocking filter tap, deblocking filter strength, etc, Deblocking filter shape/form, whether adaptive sample offset is applied, adaptive sample offset value, adaptive sample offset class, adaptive sample offset type, whether adaptive loop filter is applied, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape/form, binarization/inverse binarization method, context model determination method, context model update method, whether normal mode is performed, whether bypass mode is performed, context binary bit, bypass binary bit, significant coefficient flag, last significant coefficient flag, coding flag for unit of coefficient group, position of last significant coefficient, flag as to whether value of coefficient is greater than 1, flag as to whether value of coefficient is greater than 2, flag as to whether value of coefficient is greater than 3, information as to remaining coefficient values, information as to whether value of coefficient is greater than 1, information as to whether value of coefficient is greater than 2, information as to whether value of coefficient is greater than 3, information as to whether to coefficient is greater than 1, information as to whether to be processed, Sign information, reconstructed luma samples, reconstructed chroma samples, residual luma samples, residual chroma samples, luma transform coefficients, chroma transform coefficients, quantized luma levels, quantized chroma levels, transform coefficient level scanning methods, sizes of motion vector search regions at the decoder side, shapes of motion vector search regions at the decoder side, the number of motion vector searches at the decoder side, information on CTU size, information on minimum block size, information on maximum block depth, information on minimum block depth, slice identification information, slice partition information, parallel block identification information, parallel block type, parallel block partition information, parallel block group identification information, parallel block group partition information, bit depth of input samples, bit depth of reconstructed samples, parallel block size, motion vector search result, and motion vector search result, Bit-depth of residual samples, bit-depth of transform coefficients or bit-depth of quantized levels, or a combination thereof.

According to embodiments of the present invention, neighboring blocks may be included in the candidate list.

At least one or up to V neighboring blocks spatially/temporally adjacent to the current block may be included in the candidate list of the current block.

In addition, at least one or up to V pieces of block information of neighboring blocks spatially/temporally adjacent to the current block may be included in the candidate list of the current block.

At this time, V may be a positive integer including 0. In addition, V may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, V may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

When the neighboring block is included in the same picture (picture), a sub-picture in the same picture, a slice in the same picture, a parallel block in the same picture, a partition in the same picture, a CTU in the same picture, etc. as the current block, the neighboring block at this time may be referred to as a neighboring block spatially adjacent to the current block.

In addition, when the neighboring block and the current block are included in different images, sub-pictures in different images, slices in different images, parallel blocks in different images, partitions in different images, CTUs in different images, etc., the neighboring block may be referred to as a neighboring block temporally adjacent to the current block.

Hereinafter, a method of adding a spatial or temporal neighboring block to the candidate list will be described in detail. The encoder/decoder may include spatially or temporally neighboring blocks of the current block in the candidate list of the current block using at least one of the following methods or a combination thereof.

Fig. 8 and 9 are diagrams illustrating a method of adding a neighbor block adjacent to a current block to a candidate list according to an embodiment of the present invention.

Up to V neighboring blocks adjacent to the current block may be included in the candidate list of the current block. Here, V may be a positive integer including 0. At this time, the neighboring block being adjacent to the current block may indicate that at least one of a boundary or vertex of the current block is in contact with or adjacent to at least one of a boundary or vertex of the neighboring block.

A block located within the height of the current block based on the upper position of the current block may be referred to as a neighboring block adjacent to the current block.

In addition, a block located within the width of the current block based on the left position of the current block may be referred to as a neighboring block adjacent to the current block.

The neighboring blocks may be included in the candidate list in order from neighboring blocks that adjoin a boundary of the current block to neighboring blocks that adjoin a vertex of the current block.

Alternatively, the neighboring blocks may be included in the candidate list in order from neighboring blocks adjoining a vertex of the current block to neighboring blocks adjoining a boundary of the current block.

The neighboring blocks may be included in the candidate list in order from a neighboring block adjacent to the left side of the current block to a neighboring block adjacent to the upper side of the current block.

Alternatively, the neighboring blocks may be included in the candidate list in order from a neighboring block adjacent to the upper side of the current block to a neighboring block adjacent to the left side of the current block.

Even when at least one block exists between the current block and the neighboring block, the neighboring block may be considered to be adjacent to the current block.

For example, referring to FIG. 9, blocks E, F, H, I, K, L, N and R may also be adjacent to current block X.

The gray blocks shown in fig. 8 and 9 may represent neighboring blocks that may be adjacent to the current block X and included in the candidate list.

For example, referring to FIG. 9, blocks B, C and D may represent blocks obtained by vertically partitioning a parent node into three partition trees.

In addition, blocks E, F and G may represent blocks obtained by horizontally partitioning a parent node into three partition trees.

In addition, the blocks P and Q may represent blocks obtained by partitioning one parent node into a horizontal binary tree.

In addition, the blocks R and S may represent blocks obtained by partitioning one parent node into a vertical binary tree.

In addition, blocks H, I, J and K and blocks L, M, N and O may represent blocks obtained by partitioning one parent node into a quadtree.

Examples of block partitioning may be used generally in other figures below.

At this time, in the example of fig. 8, the candidate list of the current block X may be constructed to include at least one of blocks { a, B, C, D, E } adjacent to the current block X.

In addition, in the example of fig. 9, the candidate list of the current block X may be constructed to include at least one of blocks { a, B, C, D, G, J, M, O, P, Q, S } adjacent to the current block X.

Fig. 10 and 11 are diagrams illustrating a method of adding a neighbor block to a candidate list in consideration of the adjacency lengths of a current block and the neighbor block according to an embodiment of the present invention.

Up to V neighboring blocks may be included in the candidate list of the current block depending on whether at least one of neighboring blocks adjacent to the current block adjoins the current block.

For example, up to V neighboring blocks among neighboring blocks adjacent to the current block, which have a neighbor length (width or height) of N or more with the current block, may be included in the candidate list of the current block.

At this time, N may represent a positive integer (such as 2, 4, 8, 16, etc.). In addition, N may be determined based on at least one of the encoding parameter of the current block and the candidate encoding parameter. In addition, N may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

If there is no neighboring block having a neighbor length of N or more from the current block among neighboring blocks neighboring the current block, (N-K) may be used instead of N to construct a candidate list of the current block. At this time, K may represent a positive integer greater than 0.

That is, up to V neighbor blocks among neighbor blocks adjacent to the current block, each of which has an adjacent length of (N-K) or more with the current block, may be included in the candidate list of the current block.

In addition, the neighboring blocks may be included in the candidate list in order from a neighboring block having a large neighbor length with the current block to a neighboring block having a small neighbor length with the current block.

Alternatively, the neighboring blocks may be included in the candidate list in order from a neighboring block having a small neighbor length with the current block to a neighboring block having a large neighbor length with the current block.

In addition, up to V neighbor blocks among neighbor blocks adjacent to the current block, each of which has an adjacent length of N or more and M or less from the current block, may be included in the candidate list of the current block. Here, M and N may be expressed as positive integers of the square of 2 (such as 2, 4, 8, and 16).

Referring to fig. 10, the gray block shown in fig. 10 adjoins the current block X by a length of N or more, and thus may represent a neighboring block that may be included in the candidate list.

For example, block X may represent a 32 × 32 block, block a may represent a 16 × 16 block, blocks B and D may represent a 4 × 16 block, block C may represent an 8 × 16 block, blocks E and G may represent 16 × 4 blocks, block F may represent a 16 × 8 block, blocks H, I, J, K, L, M, N and O may represent 8 × 8 blocks, blocks P and Q may represent 16 × 8 blocks, and blocks R and S may represent 8 × 16 blocks. Examples of such block sizes may be generalized in the figures.

At this time, for example, at least one of neighboring blocks each having a contiguous length of 8 or more with the current block X may be included in the candidate list. That is, the candidate list of the current block X may be constructed to include at least one of the blocks { C, G, M, O, P, Q }.

Referring to fig. 11, the gray block shown in fig. 11 adjoins the current block X by a length of N or more, and thus may represent a neighboring block that may be included in the candidate list.

For example, each neighboring block having a contiguous length of 16 or more from the current block X may be included in the candidate list. That is, the candidate list for current block X may be constructed to include block { G }.

Fig. 12 and 13 are diagrams illustrating a method of adding neighbor blocks to a candidate list in consideration of sizes of the neighbor blocks according to an embodiment of the present invention.

Up to V neighboring blocks may be included in the candidate list of the current block according to sizes of the neighboring blocks adjacent to the current block. At this time, the size of the block may represent at least one of a width, a height, or an area of the block.

For example, up to V neighboring blocks among neighboring blocks adjacent to the current block, each of which has a size of M × N or more, may be included in the candidate list of the current block.

At this time, M may represent the width of the block, N may represent the height of the block, and M and N may be positive integers. In addition, M and N may be the same or different. In addition, at least one of M or N may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. Additionally, at least one of M or N may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

In addition, up to V neighbor blocks among neighbor blocks adjacent to the current block, each of which has a size of M × N or less, may be included in the candidate list of the current block.

In addition, up to V neighbor blocks among neighbor blocks neighboring the current block, each of which has a size of M × N or more and P × Q or less, may be included in the candidate list of the current block. At this time, P may represent the width of the block, Q may represent the height of the block, and P and Q may be positive integers.

Additionally, if at least one of the width or height of the neighboring block is greater than at least one of M or N, the neighboring block may be included in the candidate list.

In addition, up to V neighbor blocks among neighbor blocks adjacent to the current block, each of which has an area of M × N or more, may be included in the candidate list of the current block.

In addition, up to V neighbor blocks among neighbor blocks neighboring the current block, each of which has an area of M × N or less, may be included in the candidate list of the current block.

In addition, up to V neighbor blocks among neighbor blocks neighboring the current block, each of which has an area of M × N or more and P × Q or less, may be included in the candidate list of the current block.

The neighboring blocks may be included in the candidate list in order from a neighboring block having a large size adjacent to the current block to a neighboring block having a small size.

Alternatively, the neighboring blocks may be included in the candidate list in order from a neighboring block having a small size adjacent to the current block to a neighboring block having a large size.

In addition, if the size of a neighboring block adjacent to the current block is greater than or equal to the size of the current block, the neighboring block may be included in the candidate list.

Alternatively, if the size of a neighboring block adjacent to the current block is less than or equal to the size of the current block, the neighboring block may be included in the candidate list.

Referring to fig. 12, the gray block shown in fig. 12 has a size greater than or equal to mxn, and thus may represent a neighboring block that may be included in the candidate list.

For example, if the size of the neighboring block is 16 × 8 or 8 × 16, the neighboring block may be included in the candidate list. That is, the candidate list of the current block X may be constructed to include at least one of the blocks { a, C, P, Q, S }.

Referring to fig. 13, the gray block shown in fig. 13 has a size greater than or equal to mxn, and thus may represent a neighboring block that may be included in the candidate list.

For example, if the area of the neighboring block is 16 × 8 (128) or 8 × 16 (128), the neighboring block may be included in the candidate list. That is, the candidate list of the current block X may be constructed to include at least one of the blocks { a, C, F, P, Q, R, S }.

Fig. 14 and 15 are diagrams illustrating a method of adding neighboring blocks to a candidate list in consideration of depths of the neighboring blocks according to an embodiment of the present invention.

Up to V neighboring blocks may be included in the candidate list of the current block according to the depths of the neighboring blocks adjacent to the current block.

For example, up to V neighboring blocks among neighboring blocks neighboring the current block, each of which has a depth of K or more, may be included in the candidate list of the current block.

At this time, K may be a positive integer including 0. In addition, K may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, K may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

In addition, up to V neighbor blocks among neighbor blocks neighboring the current block, each of which has a depth of K or less, may be included in the candidate list of the current block.

In addition, up to V neighbor blocks among neighbor blocks neighboring the current block, each of which has a depth of K or more and L or less, may be included in the candidate list of the current block. At this time, L may be a positive integer including 0.

The neighboring blocks may be included in the candidate list in order from a neighboring block having a large depth adjacent to the current block to a neighboring block having a small depth adjacent to the current block.

Alternatively, the neighboring blocks may be included in the candidate list in order from a neighboring block having a small depth adjacent to the current block to a neighboring block having a large depth adjacent to the current block.

In addition, if the depth of the neighboring block is greater than or equal to the depth of the current block, the neighboring block may be included in the candidate list.

In addition, if the depth of the neighboring block is less than or equal to the depth of the current block, the neighboring block may be included in the candidate list.

Referring to fig. 14, the gray blocks shown in fig. 14 have a depth greater than or equal to K, and thus may represent neighboring blocks that may be included in the candidate list.

For example, the current block X may have a depth of 1, the block a may have a depth of 2, and the blocks B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R and S may have a depth of 3. Examples of such block depths may be generalized in the following figures.

At this time, for example, if the depth of the neighboring block is greater than or equal to 3, the neighboring block may be included in the candidate list. That is, the candidate list of the current block X may be constructed to include at least one of the blocks { B, C, D, E, F, G, J, K, M, O, P, Q, S }.

Referring to fig. 15, the gray blocks shown in fig. 15 have a depth less than or equal to K, and thus may represent neighboring blocks that may be included in the candidate list.

For example, if the depth of the neighboring block is less than or equal to 2, the neighboring block may be included in the candidate list. That is, the candidate list for current block X may be constructed to include block { A }.

Fig. 16 and 17 are diagrams illustrating a method of adding neighboring blocks to a candidate list in consideration of a partition form of the neighboring blocks according to an embodiment of the present invention.

Up to V neighboring blocks may be included in the candidate list of the current block according to the partition form of the neighboring blocks adjacent to the current block.

Whether any of the partitioned versions of the neighboring blocks is included in the candidate list may be determined by at least one of encoding parameters or candidate encoding parameters of the current block or the neighboring blocks. In addition, this may be determined according to a predetermined method in the encoder and the decoder, or may be determined by a value signaled from the encoder to the decoder.

For example, at least one of blocks partitioned into a quad tree among neighboring blocks adjacent to the current block may be included in the candidate list.

In addition, at least one of blocks partitioned into a binary tree among neighboring blocks adjacent to the current block may be included in the candidate list.

In addition, at least one of blocks partitioned into a ternary tree among neighboring blocks adjacent to the current block may be included in the candidate list.

At this time, the binary tree partition may include not only a symmetric binary tree in which the binary tree nodes have the same size but also an asymmetric tree in which the binary tree nodes have different sizes.

In addition, the ternary tree partition may include not only a symmetric ternary tree in which upper and lower blocks and left and right blocks as trifurcated tree nodes and intermediate blocks therebetween have the same size, but also an asymmetric ternary tree in which upper and lower blocks and left and right blocks as trifurcated tree nodes and intermediate blocks therebetween have different sizes.

The neighboring blocks may be included in the candidate list in an order of neighboring blocks partitioned into a quad tree, neighboring blocks partitioned into a binary tree, and neighboring blocks partitioned into a ternary tree adjacent to the current block.

Alternatively, the neighboring blocks may be included in the candidate list in order of neighboring blocks partitioned into a ternary tree, neighboring blocks partitioned into a binary tree, and neighboring blocks partitioned into a quaternary tree adjacent to the current block.

In addition, if the partition form of the neighboring block is equal to the partition form of the current block, the neighboring block may be included in the candidate list.

In addition, if the partition form of the neighboring block is different from that of the current block, the neighboring block may be included in the candidate list.

Referring to fig. 16, the gray blocks shown in fig. 16 are neighboring blocks partitioned into a binary tree, and thus the neighboring blocks may be included in the candidate list.

For example, blocks X, A, H, I, J, K, L, M, N and O may have quad-tree partition form, blocks B, C, D, E, F and G may have tri-tree partition form, and blocks P, Q, R and S may have binary-tree partition form. Examples of such block partition forms may be generalized in the following figures.

At this time, for example, if the partition form of the neighboring block is a ternary tree partition form, the neighboring block may be included in the candidate list. That is, the candidate list of the current block X may be constructed to include at least one of the blocks { B, C, D, E, F, G }.

Referring to fig. 17, the gray block shown in fig. 17 is a neighboring block having the same partition form as the current block, and thus the neighboring block may be included in the candidate list.

For example, if the partition form of the current block X is a quad-tree partition form, the neighboring blocks may be included in the candidate list. That is, the candidate list of the current block X may be constructed to include at least one of the blocks { a, J, K, M, O }.

Fig. 18 and 19 are diagrams illustrating a method of adding neighboring blocks to a candidate list in consideration of block forms of the neighboring blocks according to an embodiment of the present invention.

Up to V neighboring blocks may be included in the candidate list of the current block according to block forms of neighboring blocks adjacent to the current block.

For example, at least one of blocks having a square form among neighboring blocks adjacent to the current block may be included in the candidate list.

In addition, at least one of blocks having a non-square (rectangular) form among neighboring blocks adjacent to the current block may be included in the candidate list.

In addition, the neighboring blocks may be included in the candidate list in order of the neighboring block having a square form and the neighboring block having a rectangular form adjacent to the current block.

Alternatively, the neighboring blocks may be included in the candidate list in order of a neighboring block having a rectangular form and a neighboring block having a square form adjacent to the current block.

In addition, if the block form of the neighboring block is equal to the block form of the current block, the neighboring block may be included in the candidate list.

Alternatively, if the block form of the neighboring block is different from that of the current block, the neighboring block may be included in the candidate list.

Referring to fig. 18, the gray block shown in fig. 18 is a neighboring block having the same form as the current block, and thus the neighboring block may be included in the candidate list.

For example, if the block form of the neighboring block is a rectangular form, the neighboring block may be included in the candidate list. That is, the candidate list of the current block X may be constructed to include at least one of the blocks { B, C, D, G, P, Q, S }.

Referring to fig. 19, the gray blocks shown in fig. 19 are neighboring blocks having the same block form as the current block, and thus the neighboring blocks may be included in the candidate list.

For example, if the block form of the neighboring block is a square form, the neighboring block may be included in the candidate list. That is, the candidate list of the current block X may be constructed to include at least one of the blocks { a, J, K, M, O }.

According to an embodiment of the present invention, if at least one of the boundary or vertex of the current block adjoins at least one of the boundary or vertex of the neighboring block, the neighboring block may be included in the candidate list using a relative length of the boundary of the neighboring block having the adjoining boundary or vertex, a relative size of the neighboring block, or a relative depth of the neighboring block.

For example, up to V neighboring blocks may be included in the candidate list of the current block according to the relative lengths of the neighboring blocks having a contiguous boundary, the relative sizes of the neighboring blocks, or the relative depths of the neighboring blocks.

At this time, if there are a neighboring block having a boundary length of M and a neighboring block adjoining the boundary length of N, a specific neighboring block may be included in the candidate list by comparing N with M.

For example, if there are a neighboring block with a boundary length of 8 and a neighboring block adjoining the boundary length of 4, only a neighboring block with a larger boundary length (i.e., a neighboring block with a boundary length of 8) may be included in the candidate list.

As another example, if there are a neighboring block with a boundary length of 4 and a neighboring block adjoining the boundary length of 16, only a neighboring block with a smaller boundary length (i.e., a neighboring block with a boundary length of 4) may be included in the candidate list.

In addition, if there are neighboring blocks having a block size of M × N and neighboring blocks having a block size of P × Q, a specific neighboring block may be included in the candidate list by comparing the sizes of the neighboring blocks. At this time, M and N and P and Q may be the same positive integer or different positive integers.

For example, if there are neighboring blocks having a block size of 8 × 8 and neighboring blocks having a block size of 16 × 16, neighboring blocks having a larger block size (i.e., neighboring blocks having a block size of 16 × 16) may be included in the candidate list.

In addition, if there are neighboring blocks of block depth N and neighboring blocks of block depth M, the particular neighboring block may be included in the candidate list by comparing N to M.

For example, if there are a neighboring block having a block depth of 0 and a neighboring block having a block depth of 2, a neighboring block having a smaller block depth (i.e., a neighboring block having a block depth of 0) may be included in the candidate list.

Fig. 20 is a diagram illustrating a method of adding neighboring blocks to a candidate list in consideration of encoding/decoding orders of the neighboring blocks according to an embodiment of the present invention.

Up to V neighboring blocks may be included in the candidate list of the current block according to an encoding/decoding order of the neighboring blocks adjacent to the current block.

At this time, the encoding/decoding order may be at least one of a horizontal priority order, a vertical priority order, a zigzag (zig-zag) order, an upper right diagonal order, a lower left diagonal order, a raster order, a depth priority order, or a size priority order.

Referring to fig. 20, gray blocks shown in fig. 20 indicate neighboring blocks that may be included in a candidate list according to encoding/decoding orders of the neighboring blocks.

For example, if the encoding/decoding order of the neighboring blocks is A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R and S, up to Z neighboring blocks may be included in the candidate list in order. That is, the example of fig. 20 shows the case where Z is 4. At this time, the candidate list of the current block X may be constructed to include at least one of the blocks { a, B, C, D }.

Fig. 21 is a diagram illustrating a method of adding neighboring blocks to a candidate list in consideration of positions of the neighboring blocks located at a certain distance from a position of a current block according to an embodiment of the present invention.

Up to V neighboring blocks located at a certain distance from the position of the current block may be included in the candidate list of the current block. That is, even if there are a plurality of blocks between the current block and the neighboring blocks, up to V neighboring blocks may be included in the candidate list of the current block according to a certain condition.

At this time, the value V may be determined based on at least one of the encoding parameter of the current block and the candidate encoding parameter. In addition, V may be predetermined in the encoder and decoder, or may be signaled from the encoder to the decoder.

Blocks located at a distance of-kxm or + kxm in a horizontal direction or a distance of-lxn or + lxn in a vertical direction from a specific position of the current block may be determined as neighboring blocks, and the neighboring blocks may be included in the candidate list. That is, a block located at a distance obtained by adding at least one of a-K × M or + K × M sampling position in the horizontal direction and a-L × N or + L × N sampling position in the vertical direction to at least one specific position of the current block may be determined as a neighboring block, and the neighboring block may be included in the candidate list.

In addition, at least one of blocks included in a specific region based on the current block among the neighboring blocks located at the above-mentioned position may be included in the candidate list of the current block. At this time, the specific region may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

That is, M and N may represent relative distances from a particular location of the current block. Here, the specific location in the current block may be at least one of the following locations for the block: (0, 0) position, (width-1, 0) position, (width, 0) position, (0, height-1) position, (0, height) position, (-1, -1) position, (-1, 0) position, (0, -1) position, (width-1, -1) position, (width, -1) position, (-1, height) position, (width/2-1, 0) position, (width/2 +1, 0) position, (0, height/2-1) position, (0, height/2 +1) position, (width/2-1, -1) position, (width/2, -1) position, (width/2 +1, -1) position, (-1, height/2) position or (-1, height/2 +1) position.

Here, M may represent a horizontal distance in units of spots, and N may represent a vertical distance in units of spots. M and N may be positive integers. In addition, M and N may be the same value or different values. In addition, at least one of M or N may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. Additionally, at least one of M or N may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

Here, the absolute value of M and the absolute value of N may have a maximum value of MaxM and a maximum value of MaxN, respectively. In addition, the absolute value of M and the absolute value of N may be determined to be equal to or less than K or L times the size of the CTU.

Here, at least one of MaxM or MaxN may be a positive integer. In addition, at least one of MaxM or MaxN may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. Additionally, at least one of MaxM or MaxN may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

Here, at least one of K or L may be a positive integer including 0. In addition, at least one of K or L may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, at least one of K or L may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

If a block located at least one of a distance of-kxm or + kxm in the horizontal direction or a distance of-lxn or + lxn in the vertical direction is located at or across at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column, a neighboring block at the corresponding position may not be included in the candidate list.

In addition, if there is no at least one of neighboring blocks that are immediately adjacent to the current block, at least one of neighboring blocks located at a certain distance from the position of the current block may be included in the candidate list.

In addition, when a neighboring block located at a certain distance from the position of the current block is included in the candidate list, the neighboring block located in a certain scan order may be included in the candidate list. At this time, the specific scanning order may be at least one of a horizontal priority order, a vertical priority order, a zigzag order, an upper right diagonal order, a lower left diagonal order, a raster order, a depth priority order, or a size priority order. In addition, at least one of the neighboring blocks may be included in the candidate list in order that a distance between the current block and a block located at a certain distance therefrom is small.

Referring to fig. 21, the gray blocks shown in fig. 21 may represent neighboring blocks located at a certain distance from the position of the current block and may be included in the candidate list.

In addition, a portion indicated by oblique lines in fig. 21 may represent at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column.

As in the example of fig. 21, when the current block X has a size of 16 × 16 and M and N are 16, at least one of neighboring blocks that do not cross at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column may be included in the candidate list. That is, the candidate list of the current block X may be constructed to include at least one of blocks { A0, A1, A3, A6, A7, A8, B0, B1, C0, C1, D0, D1, D2, D3, D4, D5, D6, E0, E1, E2, F0, F1, F2, G0, G1, G2, G3, G4, G5 }. Accordingly, at least one of neighboring blocks located at a relative position from the position of the current block may be included in the candidate list of the current block.

To reduce the size of the line buffer, if a block located at least one of a distance of-kxm or + kxm in the horizontal direction or a distance of-lxn or + lxn in the vertical direction is located at or across at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column, a block that spans at least one of the picture, the sub-picture, the slice, the parallel block, the partition, the CTU boundary, the CTU row, or the CTU column may not be included in the candidate list, and a block located at a boundary of at least one of the picture, the sub-picture, the slice, the parallel block, the partition, the CTU boundary, the CTU row, or the CTU column may not be included in the candidate list.

In addition, information on a block located at a specific position in a neighboring block located at a specific distance from the position of the current block may be determined as information on a representative block of the neighboring blocks, and the corresponding block may be included in the candidate list.

For example, the particular position may be at least one of an upper left position, a lower left position, an upper right position, a lower right position, a middle position, an upper left position adjacent to the middle position, a lower left position adjacent to the middle position, an upper right position adjacent to the middle position, or a lower right position adjacent to the middle position.

The particular block located at a boundary of at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column may represent that the particular block belongs to a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column other than the picture, the sub-picture, the slice, the parallel block, the partition, the CTU boundary, the CTU row, or the CTU column to which the current block belongs, and is located at a boundary of at least one of the picture, the sub-picture, the slice, the parallel block, the partition, the CTU boundary, the CTU row, or the CTU column. That is, this may mean that a specific block is located above and/or to the left of the current block within at least one of the picture, sub-picture, slice, parallel block, partition, CTU boundary, CTU row, or CTU column.

A particular block that crosses a boundary of at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column may represent that the particular block belongs to a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column other than the picture, the sub-picture, the slice, the parallel block, the partition, the CTU boundary, the CTU row, or the CTU column to which the current block belongs, and is located at least one of the picture, the sub-picture, the slice, the parallel block, the partition, the CTU boundary, the CTU row, or the CTU column. That is, this may mean that a specific block is located above and/or to the left of the current block within at least one of the picture, sub-picture, slice, parallel block, partition, CTU boundary, CTU row, or CTU column.

Fig. 22 is a diagram illustrating a method of adding a neighboring block to a candidate list in consideration of the position of the neighboring block located at a specific distance from the position of at least one of a current picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column according to an embodiment of the present invention.

Up to V neighboring blocks located at a certain distance from a position of at least one of a current picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column may be included in the candidate list of the current block. That is, even if there are a plurality of blocks between the current block and the neighboring blocks, up to V neighboring blocks may be included in the candidate list of the current block.

Blocks located at least one of a distance of K × M in a horizontal direction and a distance of L × N in a vertical direction from a specific position of at least one of a current picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column may be determined as neighboring blocks of the current block and may be included in the candidate list.

That is, a block located at a position obtained by adding at least one of a K × M distance in a horizontal direction and an L × N distance in a vertical direction to at least one of a current picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column may be determined as a neighboring block and may be included in the candidate list.

In addition, at least one of neighboring blocks included in a specific region based on the current block among neighboring blocks located at the above-mentioned positions may be included in the candidate list. At this time, the specific region may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

That is, M and N may represent absolute distances from a specific position of at least one of a current picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column. Here, the specific location of at least one of the current picture, the sub-picture, the slice, the parallel block, the slice, the CTU boundary, the CTU row, or the CTU column may be defined as a (0, 0) location based on at least one of the current picture, the sub-picture, the slice, the parallel block, the slice, the CTU boundary, the CTU row, or the CTU column.

Here, M may represent a distance in the horizontal direction in units of spots, N may represent a distance in the vertical direction in units of spots, and M and N may be positive integers of the square of 2 (such as 2, 4, 8, 16, and 32). For example, M and N may be the same value or different values. In addition, at least one of M or N may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. Additionally, at least one of M or N may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

Here, at least one of K or L may be a positive integer including 0. In addition, at least one of K or L may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, at least one of K or L may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

In addition, if at least one of neighboring blocks that are immediately adjacent to the current block does not exist, a neighboring block located at a specific distance from a specific position of at least one of the current picture, the sub-picture, the slice, the parallel block, the partition, the CTU boundary, the CTU row, or the CTU column may be included in the candidate list.

In addition, when a neighboring block located at a specific distance from a specific position of at least one of a current picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column is included in the candidate list, the neighboring block located in a specific scanning order may be included in the candidate list. At this time, the specific scanning order may be at least one of a horizontal priority order, a vertical priority order, a zigzag order, an upper right diagonal order, a lower left diagonal order, a raster order, a depth priority order, or a size priority order. In addition, at least one of the neighboring blocks may be included in the candidate list in order that the distance between the current block and the neighboring block is small.

Referring to fig. 22, the gray blocks shown in fig. 22 may represent neighboring blocks located at a certain distance from the position of the current picture and may be included in the candidate list.

As in the example of fig. 22, when the specific position of the current picture is the (0, 0) position, the current block X has a size of 16 × 16, K and L are positive integers including 0, and M and N are 16, neighboring blocks corresponding to the (K × M, L × N) position from the (0, 0) position of the current position may be included in the candidate list, and the candidate list of the current block X may be constructed to include at least one of the blocks {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 }. At this time, the value K of the x coordinate and the value L of the y coordinate in (K × M, L × N) may have the same value or different values.

Accordingly, at least one of neighboring blocks located at an absolute position from a current picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column may be included in the candidate list of the current block.

According to an embodiment of the present invention, up to V neighboring blocks may be included in the candidate list of the current block according to the encoding parameter relationship between the current block and neighboring blocks adjacent thereto.

For example, if at least one of the encoding parameters of the current block is the same as at least one of the encoding parameters of the neighboring blocks, up to V neighboring blocks may be included in the candidate list of the current block.

For example, if the prediction modes are the same, if the intra luma prediction mode/direction is the same, if the intra chroma prediction mode/direction is the same, if the motion vectors are the same, if the motion vector differences are the same, if the reference picture lists are the same, if the reference picture indexes are the same, if the reference pictures are the same, if the inter prediction directions (inter prediction indicators or prediction list utilization flags) are the same, if the use of the merge mode is the same, if the use of the skip mode is the same, if the motion vector prediction indexes are the same, if the merge indexes are the same, if the motion vectors indicate the same precision, if the transform types are the same, if the transform sizes are the same, if the use of the primary transform is the same, if the use of the secondary transform is the same, if the primary transform index is the same, if the residual signal presence/absence information is the same, if the coded block modes are the same, or if the quantization parameters are the same, then neighboring blocks may be included in the candidate list.

As another example, if at least one of the encoding parameters of the current block is similar to at least one of the encoding parameters of the neighboring blocks, up to V neighboring blocks may be included in the candidate list of the current block.

For example, if a difference between an intra luminance prediction mode/direction and an intra luminance prediction mode/direction of a neighboring block is equal to or less than a value T, or if a difference between a motion vector of a current block and a motion vector of a neighboring block is equal to or less than a value T, if a difference between a motion vector difference of the current block and a motion vector difference of the neighboring block is equal to or less than a value T, or if a difference between a reference picture index of the current block and a reference picture index of the neighboring block is equal to or less than a value T, the neighboring block may be included in the candidate list. Here, T may represent a real number.

For example, if the reference picture lists are different but the reference pictures are the same, or if the reference picture indexes are different but the reference pictures are the same, the neighboring blocks may be included in the candidate list.

According to an embodiment of the present invention, the encoder/decoder may entropy-encode/decode encoding parameter identifiers of neighboring blocks to be included in the candidate list, and include the neighboring blocks in the candidate list based on similarity between the encoding parameters.

For example, the encoder may entropy-encode encoding parameter identifiers of neighboring blocks to be included in the candidate list, and include, in the candidate list, a neighboring block having the same value as the encoding parameter, a neighboring block having a value greater than the encoding parameter, or a neighboring block having a value less than the encoding parameter.

In addition, the decoder may entropy-decode the encoding parameter identifiers of the neighboring blocks to be included in the candidate list, and include, in the candidate list, a neighboring block having the same value as the encoding parameter, a neighboring block having a value greater than the encoding parameter, or a neighboring block having a value smaller than the encoding parameter.

According to an embodiment of the present invention, a block having the same spatial position as the current block (co-located with the current block) in the reference image may be included as a neighboring block in the candidate list of the current block. At this time, the blocks temporally adjacent to the current block may represent blocks co-located with the current block in the reference picture or blocks having a spatial location corresponding to the spatial location of the current block in the reference picture.

For example, at least one of neighboring blocks of a reference picture that belongs to a current picture among pictures other than a picture belonging to the current block may be included in the candidate list. At least one of the neighboring blocks belonging to the reference picture may be referred to as a temporally adjacent neighboring block.

At this time, the neighboring blocks may represent blocks having the same spatial position as the current block (co-located with the current block) among the blocks in the reference picture, or blocks adjacent to the block having the same spatial position as the current block among the blocks in the reference picture.

According to an embodiment of the present invention, a reference block for a current block may be determined from a candidate list.

The candidate list may be changed using at least one of the following methods or at least one combination thereof, before a reference block to be used for encoding/decoding of the current block among neighboring blocks included in the candidate list. If at least one combination of the following methods is used, the following methods may be performed in a particular order to change the candidate list.

Hereinafter, neighboring blocks included in the candidate list may be referred to as candidates, and block information of the neighboring blocks included in the candidate list may be referred to as candidates. In addition, the blocks included in the candidate list may be referred to as candidates, and the block information of the blocks included in the candidate list may be referred to as candidates.

The candidates in the candidate list may be ordered in a predetermined order. At this time, the ordering in the predetermined order may be determined based on at least one of the encoding parameter of the current block or the candidate encoding parameter.

For example, the ordering in the predetermined order may be determined in an order in which at least one of the encoding parameter of the current block or the encoding parameter of the candidate increases. In addition, the ordering in the predetermined order may be determined in an order in which at least one of the encoding parameter of the current block or the encoding parameter of the candidate is decreased.

The encoder may sort the candidates in the candidate list in an order in which the candidates in the candidate list are determined to be the reference block with high probability, and assign the candidate index having the short codeword length to the candidate having the high probability determined to be the reference block.

The encoder/decoder may limit the size of the candidate list to up to U. Here, U may be a positive integer including 0. In addition, U may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, U may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

For example, if there are more than U candidates in the candidate list, candidates other than U candidates may be excluded from the candidate list. At this time, the excluded candidates may be determined by a sorting method in the candidate list.

The encoder/decoder may remove up to U candidates in the candidate list from the candidate list. Here, U may be a positive integer including 0. In addition, U may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, U may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

At least one of the candidates that duplicate each other may be removed from the candidate list if there are at least two candidates that duplicate each other in the candidate list. At this time, among candidates that repeat each other, a candidate having a higher ranking among the candidate lists may remain in the candidate list, and a candidate having a lower ranking may be removed from the candidate list. Here, if at least one of the encoding parameters of the candidates is repeated, the candidates may be candidates that are repeated each other.

For example, the inverse of the method that utilizes at least one of the embodiments in which neighboring blocks are included in the candidate list, or at least one combination thereof, may be used to determine whether a candidate in the candidate list is removed.

The encoder/decoder may add up to U candidates to the candidate list. Here, U may be a positive integer including 0. In addition, U may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, U may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

The candidates may be added to the list until a maximum number of candidates in the candidate list is reached. At this point, candidates that duplicate each other may be added.

When the encoder/decoder adds the candidate to the candidate list, at least one of the embodiments in which the neighboring blocks are included in the candidate list or at least one combination thereof may be used.

In addition, if a candidate to be added to the candidate list is duplicated with a candidate in the candidate list, the candidate to be added may not be added to the candidate list.

The encoder/decoder may determine up to W neighboring blocks (candidates) included in the candidate list as reference blocks of the current block. In addition, the encoder or the decoder may determine up to W block information (candidates) of neighboring blocks included in the candidate list as information on a reference block of the current block.

Here, W may be a positive integer including 0. In addition, W may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, W may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

For example, if the current block is predicted by partitioning the current block into sub-blocks, the encoder/decoder may determine W candidates in the candidate list as information on a reference block of the current block in order to encode/decode the current block. For example, W may be 2.

At this time, a prediction mode that performs prediction by partitioning the current block into two sub-blocks may be referred to as a Geometric Partition Mode (GPM).

If the size of the current block is equal to or greater than mxn, the current block may be encoded/decoded in GPM. Additionally, GPM may be an example of a merge mode. That is, in the above example, the candidate list for performing encoding/decoding may represent a merge candidate list. Whether the current block is encoded/decoded in GPM may be signaled at the coding unit level. Here, M and N may be positive integers. In addition, M and N may be the same value or different values, and for example, M and N may be 8.

If the current block is encoded/decoded in the GPM, the current block may be partitioned into two sub-blocks. At this time, information regarding the partition direction for partitioning the current block into two sub-blocks may be encoded/decoded. To encode/decode the two partitioned subblocks, a neighboring block for encoding/decoding each region may be selected from the candidate list.

In order to derive motion information of each sub-block, an index of each sub-block may be encoded/decoded. For example, if the current block is partitioned into a first region and a second region, a first index for encoding/decoding of the first region and a second index for encoding/decoding of the second region may be encoded/decoded. Here, when the two pieces of information are determined as information on the reference block of the current block, the information indicated by the first index may be information on the first reference block of the current block, and the information indicated by the second index may be information on the second reference block of the current block.

The encoder/decoder may select the first neighboring block and the second neighboring block from the candidate list of the current block using the first index and the second index. At this time, the first region and the second region may share one candidate list derived based on the current block before the partition. The encoder or the decoder may encode/decode the first region using the information on the selected first neighboring block and encode/decode the second region using the information on the selected second neighboring block.

If the current block is encoded/decoded in the GPM, the first and second neighbor blocks may be determined from a single candidate list by the first and second indexes of the current block. The encoder/decoder may derive a first prediction block for the current block using information regarding a first neighboring block and derive a second prediction block for the current block using information regarding a second neighboring block.

The encoder/decoder may generate a final prediction block for the current block by weighted summing the first prediction block and the second prediction block. At this time, the weighted summation of the prediction blocks may be performed by giving weights to the first region of the first prediction block and weights to the second region of the second prediction block.

The first neighboring block may represent a first reference block of the current block, and the second neighboring block may represent a second reference block of the current block. In addition, the information on the first neighboring block may represent information on a first reference block of the current block, and the information on the second neighboring block may represent information on a second reference block of the current block.

The encoder/decoder may perform encoding/decoding of the current block using at least one of the determined reference blocks. In addition, the encoder or the decoder may perform encoding/decoding of the current block using at least one block information of the block information of at least one of the determined reference blocks.

In addition, at least one of the determined block information of the reference block may be determined as at least one of the block information of the current block. In addition, at least one of the determined block information of the reference block may be determined as at least one of the block information of the current block.

Hereinafter, a method of determining a specific neighboring block in the candidate list as a reference block at the encoder/decoder will be described. The encoder or decoder may determine the reference block in the candidate list using at least one of the following methods, or at least one combination thereof.

For example, the encoder/decoder may determine the Y-th candidate in the candidate list as the reference block. Here, Y may be a positive integer including 0. In addition, Y may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, Y may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

At this time, since the Y-th candidate in the candidate list may be identified in the encoder/decoder, the candidate index for determining the reference block may not be entropy-encoded/entropy-decoded. For the Y-th candidate, an embodiment relating to the ordering in the candidate list may be used to determine the order of the candidates in the candidate list.

According to an embodiment of the present invention, the encoder/decoder may reduce or reduce the candidate list such that up to Y candidates remain in the candidate list, and determine the Y candidates as the reference block. Here, Y may be a positive integer including 0. In addition, Y may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, Y may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

For example, the encoder/decoder may determine Y candidates as the reference block by retaining only the Y candidates having the highest probability of being selected as the reference block among the candidates in the candidate list.

At this time, since Y candidates in the candidate list may be identified in the encoder/decoder, the candidate index for determining the reference block may not be entropy-encoded/entropy-decoded.

For example, the candidate list may be reduced or reduced using an inverse of the method that utilizes at least one of the embodiments in which neighboring blocks are included in the candidate list, or at least one combination thereof.

As another example, the encoder or decoder may determine the reference block by entropy encoding/decoding a candidate index indicating a particular candidate in the candidate list. Here, the candidate index may be a value to which the position, order, and the like of the candidate in the candidate list are mapped. The encoder or the decoder may encode/decode the current block using the determined reference block (or at least one of block information of the reference block).

That is, the encoder may encode the current block using the determined reference block (or at least one of block information of the reference block) among the candidates in the candidate list, and entropy-encode the candidate index of the reference block. Meanwhile, the decoder may entropy-decode the candidate index of the reference block and decode the current block using a candidate indicated by the candidate index among candidates in the candidate list as the reference block (or at least one of block information of the reference block).

For example, if the candidate list consists of { A, B, C, D, E, F }, the index of the candidate in the candidate list may be assigned {0, 1, 2, 3, 4, 5 }. If the candidate index is 2, candidate C may be determined as the reference block. In addition, if the candidate index is 1, candidate B may be determined as block information of the reference block.

The encoder/decoder may entropy encode/decode up to Y candidate indices. If the plurality of candidate indexes are entropy-encoded/entropy-decoded, the current block may be encoded/decoded using a plurality of reference blocks indicated by the plurality of candidate indexes.

Here, Y may be a positive integer including 0. In addition, Y may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, Y may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

That is, the encoder may encode the current block using the determined Y reference blocks among the candidates in the candidate list, and entropy-encode Y candidate indexes of the Y reference blocks. Meanwhile, the decoder may entropy-decode Y candidate indexes of the Y reference blocks and decode the current block using, as the Y reference blocks, candidates indicated by the Y candidate indexes among candidates in the candidate list.

The encoder/decoder may entropy encode/decode up to Y candidate indices. If the plurality of candidate indexes are entropy-encoded/entropy-decoded, the current block may be encoded/decoded using a plurality of reference blocks indicated by the plurality of candidate indexes.

Here, Y may be a positive integer including 0. In addition, Y may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, Y may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

That is, the encoder may encode the current block using the determined Y reference blocks among the candidates in the candidate list, and entropy-encode Y candidate indexes of the Y reference blocks. Meanwhile, the decoder may entropy-decode Y candidate indexes of the Y reference blocks and decode the current block using, as the Y reference blocks, candidates indicated by the Y candidate indexes among candidates in the candidate list.

The encoder/decoder may entropy encode/decode up to Y candidate indices. If the plurality of candidate indexes are entropy-encoded/entropy-decoded, the current block may be encoded/decoded using a plurality of reference blocks indicated by the plurality of candidate indexes.

Here, Y may be a positive integer including 0. In addition, Y may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, Y may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

That is, the encoder may encode the current block using the determined Y reference blocks among the candidates in the candidate list, and entropy-encode Y candidate indexes of the Y reference blocks. Meanwhile, the decoder may entropy-decode Y candidate indexes of the Y reference blocks and decode the current block using, as the Y reference blocks, candidates indicated by the Y candidate indexes among candidates in the candidate list.

Fig. 23 is a diagram illustrating a method of adding block information of a current block to a candidate list according to an embodiment of the present invention.

At least one of block information of the current block used in the encoding or decoding process or generated after the encoding or decoding process may be added to or included in the candidate list.

The information on the block may be at least one of encoding parameters such as an intra prediction mode, a motion vector, motion information, an IBC motion vector, a weight value, an inter prediction direction, a reference picture index, an inter prediction indicator, or a prediction list utilization flag.

For example, if the current block is not an affine mode or if a sub-block-based temporal motion vector derivation mode is not used, at least one of block information of the current block may be included in the candidate list.

As another example, if the current block is not an affine mode or is not a GPM mode, or if a sub-block-based temporal motion vector derivation mode is not used, at least one of block information of the current block may be included in the candidate list.

The candidate list according to the present invention may be maintained in units of pictures, sub-pictures, slices, parallel blocks, CTU boundaries, CTU rows, and CTU columns during encoding/decoding, and may be used in units of pictures, sub-pictures, slices, parallel blocks, CTU boundaries, CTU rows, and CTU columns. In addition, the candidate list according to the present invention may include at least one of block information of a previously encoded/decoded block based on the current block in units of a picture, a sub-picture, a slice, a parallel block, a CTU boundary, a CTU row, and a CTU column. In addition, according to the present invention, the candidate list may include at least one of block information in a unit previously encoded/decoded. The candidate list including at least one of previously encoded/decoded block information based on the current block may be referred to as a history-based candidate list. At this time, the history-based candidate list may include block vector information of a block encoded/decoded before encoding/decoding of the current block.

In the following description, the candidate list may represent a candidate list according to the present invention.

As shown in fig. 23, at least one of the candidate block information in the candidate list may be determined or selected for the encoding/decoding process of the current block. Accordingly, the encoding/decoding process of the current block may be performed using at least one of the determined candidate block information.

At this time, at least one of block information for encoding/decoding processing of the current block or at least one of block information of the current block generated after encoding/decoding processing of the current block may be added to or included in the candidate list. In the following description, adding at least one of block information, candidates, or blocks to a candidate list and including at least one of block information, candidates, or blocks in the candidate list may have the same meaning.

For example, when at least one of the block information of the current block is included in the candidate list, at least one of the block information of the current block may be first or last added to the candidate list. In addition, the block information may be added to a position in the candidate list that is predetermined between the encoder and the decoder, or may be added to an arbitrary position that is signaled from the encoder to the decoder.

As another example, when at least one of the block information of the current block is included in the candidate list, the maximum number of candidates in the candidate list may be considered. The block information of the current block may not be included in the candidate list if the number of candidates currently included in the candidate list is the maximum number of candidates.

For example, the maximum number of candidates in the candidate list may be determined as P. Here, P may be a positive integer including 0. For example, P may be 5. P may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, P may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

Candidates in the candidate list according to the present invention may be added to or included in at least one of an intra prediction mode candidate list, a primary MPM (most probable mode) list, a secondary MPM list, a residual intra prediction mode candidate list, a motion vector candidate list, a merge candidate list, an IBC motion vector candidate list, an IBC merge candidate list, a sub block motion vector candidate list, or a sub block merge candidate list.

Here, the primary MPM list may be an intra prediction mode candidate list including at least one of intra prediction modes of the spatially neighboring blocks, a derived intra prediction mode (derived mode) that is a result of adding or subtracting a specific value to or from the intra prediction modes of the spatially neighboring blocks, or a base intra prediction mode. At this time, the base intra prediction mode may be at least one of a DC mode, a planar mode, a vertical mode, or a horizontal mode. The specific value may be at least one of 0, a positive integer, or a negative integer. The specific value may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, the specific value may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

The secondary MPM list may be an intra prediction mode candidate list consisting of intra prediction modes that are not included in the primary MPM list. If the candidate in the primary MPM list is not determined as the intra prediction mode in the current block, the candidate in the secondary MPM list may be determined as the intra prediction mode.

The residual intra prediction mode candidate list may be an intra prediction mode candidate list consisting of intra prediction modes that are not included in at least one of the primary MPM list or the secondary MPM list. If a candidate included in at least one of the primary MPM list or the secondary MPM list is not determined as the intra prediction mode in the current block, a candidate in the residual intra prediction mode candidate list may be determined as the intra prediction mode.

Accordingly, the intra prediction mode candidate list may represent at least one of a primary MPM list, a secondary MPM list, or a residual intra prediction mode candidate list.

For example, the candidates in the candidate list may be included in the intra prediction mode candidate list at a specific position or in a specific order.

For example, the candidates in the candidate list may be first included in the intra prediction mode candidate list. As another example, the candidates in the candidate list may be finally included in the intra prediction mode candidate list. As another example, the candidates in the candidate list may be included before at least one of the spatial intra prediction modes in the intra prediction mode candidate list. As another example, the candidates in the candidate list may be included after at least one of the spatial intra prediction modes in the intra prediction mode candidate list. As another example, the candidates in the candidate list may be included before at least one of the derived intra prediction modes in the intra prediction mode candidate list. As another example, the candidates in the candidate list may be included after at least one of the derived intra prediction modes in the intra prediction mode candidate list. As another example, the candidates in the candidate list may be included before at least one of the base intra prediction modes in the intra prediction mode candidate list. As another example, the candidates in the candidate list may be included after at least one of the base intra prediction modes in the intra prediction mode candidate list.

As another example, the candidates in the candidate list may be included in the motion vector candidate list at a particular location or in a particular order.

For example, a candidate in the candidate list may be first included in the motion vector candidate list. As another example, the candidates in the candidate list may be finally included in the motion vector candidate list. As another example, a candidate in the candidate list may be included before at least one of the spatial motion vectors in the motion vector candidate list. As another example, a candidate in the candidate list may be included after at least one of the spatial motion vectors in the motion vector candidate list. As another example, a candidate in the candidate list may be included before at least one of the temporal motion vectors in the motion vector candidate list. As another example, a candidate in the candidate list may be included after at least one of the temporal motion vectors in the motion vector candidate list. As another example, a candidate in the candidate list may be included before at least one of the zero motion vectors in the motion vector candidate list. As another example, a candidate in the candidate list may be included after at least one of the zero motion vectors in the motion vector candidate list.

As another example, the candidates in the candidate list may be included in the merge candidate list at a particular location or in a particular order.

For example, the candidates in the candidate list may be first included in the merge candidate list. As another example, the candidates in the candidate list may be last included in the merge candidate list. As another example, a candidate in the candidate list may be included before at least one of the spatial merge candidates in the merge candidate list. As another example, the candidates in the candidate list may be included after at least one of the spatial merge candidates in the merge candidate list. As another example, the candidates in the candidate list may be included before at least one of the temporal merge candidates in the merge candidate list. As another example, the candidates in the candidate list may be included after at least one of the temporal merge candidates in the merge candidate list. As another example, a candidate in the candidate list may be included before at least one of the combined merge candidates in the merge candidate list. As another example, the candidates in the candidate list may be included after at least one of the combined merge candidates in the merge candidate list. As another example, a candidate in the candidate list may be included before at least one of the zero merge candidates in the merge candidate list. As another example, the candidates in the candidate list may be included after at least one of the zero merge candidates in the merge candidate list.

As another example, the candidates in the candidate list may be included in the IBC block vector candidate list at a particular location or in a particular order. At this time, the candidates in the candidate list may be block vector information.

For example, the candidates in the candidate list may be first included in the IBC block vector candidate list. As another example, the candidates in the candidate list may be finally included in the IBC block vector candidate list. As another example, a candidate in the candidate list may be included before the last included zero vector in the IBC block vector candidate list. As another example, the candidates in the candidate list may be included before at least one of the IBC block vector candidates in the IBC block vector candidate list. As another example, the candidates in the candidate list may be included after at least one of the IBC block vector candidates in the IBC block vector candidate list. As another example, a candidate in the candidate list may be included before at least one of the combined IBC block vector candidates in the IBC block vector candidate list. As another example, the candidates in the candidate list may be included after at least one of the combined IBC block vector candidates in the IBC block vector candidate list.

As another example, the candidates in the candidate list may be included in the sub-block motion vector candidate list at a specific position or in a specific order.

As another example, the candidates in the candidate list may be included in the subblock merge candidate list at a specific position or in a specific order.

In the above example, the combination merge candidate may be a merge candidate generated by combining at least one of the candidates in the merge candidate list. When generating the combined merge candidate, an average value of at least one of the vector values of the candidates may be used. For example, in the above example, the combination merge candidate may represent a merge candidate generated by calculating an average of vector values of two merge candidates.

The candidate list according to the present invention may be initialized at the beginning of a sequence, picture, sub-picture, slice, parallel block, partition, CTU boundary, CTU row and CTU column. That is, the candidates in the candidate list may be all deleted in units of sequence, picture, sprite, slice, parallel block, CTU boundary, CTU row and CTU column, or initialized to at least one specific value.

For example, the candidate list may be initialized to have a specific value for the value of the information on the block. The specific value may be at least one of 0, a positive integer, or a negative integer. The specific value may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, the specific value may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

At this time, the specific value may be a value corresponding to one of the intra prediction modes or a value corresponding to a temporal motion vector.

For example, the specific value may be a value indicating a DC mode or a planar mode as a non-directional intra prediction mode.

As another example, the specific value may be a motion vector value of the corresponding position block in the corresponding position image. That is, the specific value may be a temporal motion vector.

As another example, the specific value may be a sub-block unit motion vector value of the corresponding position block in the corresponding position image. That is, the specific value may be a sub-block unit temporal motion vector value (or a sub-block unit temporal motion vector value).

As another example, the particular value may be a zero (0, 0) motion vector or IBC motion vector value.

When the block information of the current block is added to the candidate list according to the present invention, in order to prevent the same or similar block information from being included in the candidate list, a redundancy check may be performed between at least one of the information on the block included in the candidate list and the information on the current block. As a result of the redundancy check, at least one of the block information of the current block may not be included in the candidate list. In addition, as a result of the redundancy check, at least one of the information regarding the block included in the candidate list may be removed, and at least one of the block information of the current block may be included in the candidate list.

The redundancy check may be performed only for the M candidates located at the beginning of the candidate list. As another example, redundancy checks may be performed only for M candidates located at the end of the candidate list. Here, M may be a positive integer including 0. For example, M may be 1 or 2. M may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, M may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

For example, if at least one of the block information of the current block to be included is different from at least one of the information on the block included in the candidate list, at least one of the block information of the current block to be included may be included in the candidate list.

For example, at least one of the block information of the current block to be included may be first added to the candidate list. As another example, at least one of the block information of the current block to be included may be finally added to the candidate list.

In addition, the block information of the current block may be included in the candidate list by one of embodiments in which a specific candidate or candidate information is included in the candidate list at a specific position or in a specific order.

As another example, if at least one of the block information of the current block to be included is the same as at least one of the information on the block included in the candidate list, at least one of the block information of the current block to be included may not be included in the candidate list.

As another example, if at least one of the block information of the current block to be included and at least one of the information on the block included in the candidate list are similar to each other, at least one of the block information of the current block to be included may not be included in the candidate list.

For example, whether the information on the blocks included in the candidate list is similar may be determined via an absolute value of an intra prediction mode value, a motion vector value, or an IBC motion vector value.

For example, if an absolute value of a difference between a value of an intra prediction mode to be included and a value of an intra prediction mode included in the candidate list is less than or equal to T, the intra prediction mode to be included may not be included in the candidate list. As another example, if an absolute value of a difference between a value of a motion vector or IBC motion vector to be included and a value of a motion vector or IBC motion vector included in the candidate list is less than or equal to T, the motion vector or IBC motion vector to be included may not be included in the candidate list

In (1). As another example, if the X component value of the motion vector to be included or the IBC motion vector is associated with a packet

The absolute value of the difference between the X component values of the motion vectors included in the candidate list or IBC motion vectors is small

Equal to or greater than T, the motion vector to be included or the IBC motion vector may not be included in the candidate list. As another example, if an absolute value of a difference between a Y component value of a motion vector or IBC motion vector to be included and a Y component value of a motion vector or IBC motion vector included in the candidate list is less than or equal to T, the motion vector or IBC motion vector to be included may not be included in the candidate list.

As another example, if at least one of the block information of the current block to be included and at least one of the information on the block included in the candidate list are not similar to each other, at least one of the block information of the new current block to be included may not be included in the candidate list.

For example, whether the information about the blocks included in the candidate list is similar may be determined by an absolute value of an intra prediction mode value, a motion vector value, or an IBC motion vector value.

For example, if an absolute value of a difference between a value of an intra prediction mode to be included and a value of an intra prediction mode included in the candidate list is greater than T, the intra prediction mode to be included may not be included in the candidate list. As another example, if an absolute value of a difference between a value of a motion vector or IBC motion vector to be included and a value of a motion vector or IBC motion vector included in the candidate list is greater than T, the motion vector or IBC motion vector to be included may not be included in the candidate list. As another example, if an absolute value of a difference between an X component value of a motion vector or IBC motion vector to be included and an X component value of a motion vector or IBC motion vector included in the candidate list is greater than T, the motion vector or IBC motion vector to be included may not be included in the candidate list. As another example, if an absolute value of a difference between a Y component value of a motion vector or IBC motion vector to be included and a Y component value of a motion vector or IBC motion vector included in the candidate list is greater than T, the motion vector or IBC motion vector to be included may not be included in the candidate list.

At this time, T may be a positive integer including 0. T may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. Additionally, T may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

In addition, T in the motion vector or IBC motion vector may be a value representing at least one of M/N pixel units (such as an integer pixel unit, 1/2 pixel units, 1/4 pixel units, 1/16 pixel units, etc.). Here, M and N may be positive integers. M and N may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, M and N may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

The following description relates to redundancy checking between candidates in a candidate list and candidates in at least one of an intra prediction mode candidate list, a motion vector candidate list, a merge candidate list, an IBC motion vector candidate list, an IBC merge candidate list, a sub block motion vector candidate list, or a sub block merge candidate list in a case where at least one of the candidates in the candidate list is added to at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the sub block motion vector candidate list, or the sub block merge candidate list.

When at least one of the candidates in the candidate list is added to at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list, a redundancy check between the candidate in the candidate list and at least one of the candidates included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list may be performed.

For example, at least one of the candidates in the candidate list may be first or last included in at least one of an intra prediction mode candidate list, a motion vector candidate list, a merge candidate list, an IBC motion vector candidate list, an IBC merge candidate list, a subblock motion vector candidate list, or a subblock merge candidate list. In addition, the block information of the current block may be included in the candidate list by one of embodiments in which a specific candidate or candidate information is included in the candidate list at a specific position or in a specific order.

To prevent adding the same or similar candidates to at least one of the candidate list or the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list, a redundancy check between at least one of the candidates in the candidate list and a candidate included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list may be performed. As a result of the redundancy check, at least one of the candidates in the candidate list may or may not be included in at least one of an intra prediction mode candidate list, a motion vector candidate list, a merge candidate list, an IBC motion vector candidate list, an IBC merge candidate list, a subblock motion vector candidate list, or a subblock merge candidate list.

The redundancy check may be performed only for the M candidates located at the beginning of the candidate list. As another example, redundancy checks may be performed only for M candidates located at the end of the candidate list. Here, M may be a positive integer including 0. For example, M may be 1 or 2. M may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, M may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder. At this time, a redundancy check may be performed between the spatial motion vector above or to the left of the current block and one or two candidates at the beginning of the candidate list.

For example, if at least one of the information on the block to be included in the candidate list is different from at least one of the information on the block included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list, at least one of the information on the block to be included in the candidate list may be included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list.

For example, at least one of the information on the block in the candidate list may be included in at least one of an intra prediction mode candidate list, a motion vector candidate list, a merge candidate list, an IBC motion vector candidate list, an IBC merge candidate list, a sub block motion vector candidate list, or a sub block merge candidate list in ascending order of index.

In addition, at least one of the information on the block in the candidate list may be included in at least one of an intra prediction mode candidate list, a motion vector candidate list, a merge candidate list, an IBC motion vector candidate list, an IBC merge candidate list, a sub block motion vector candidate list, or a sub block merge candidate list in descending order of index.

As another example, if at least one of the information on the block to be included in the candidate list is equal to at least one of the information on the block included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list, at least one of the information on the block to be included in the candidate list may not be included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list.

As another example, if at least one of the information on the block to be included in the candidate list is similar to at least one of the information on the block included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list, at least one of the information on the block to be included in the candidate list may not be included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list.

At this time, the case where at least one of the information on the block to be included in the candidate list is similar to at least one of the information on the block included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list may represent one of the following conditions.

For example, if an absolute value of a difference between a value of an intra prediction mode to be included and a value of an intra prediction mode included in the intra prediction mode candidate list is less than or equal to S, the intra prediction mode to be included may not be included in the intra prediction mode candidate list.

For example, if an absolute value of a difference between a value of a motion vector or IBC motion vector to be included and a value of a motion vector or IBC motion vector included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list is less than or equal to S, the motion vector or IBC motion vector to be included may not be included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list.

For example, if an absolute value of a difference between an X component value of a motion vector or IBC motion vector to be included and an X component value of a motion vector or IBC motion vector included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the subblock motion vector candidate list, or the subblock merge candidate list is less than or equal to S, the motion vector or IBC motion vector to be included may not be included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list.

For example, if an absolute value of a difference between a Y component value of a motion vector or IBC motion vector to be included and a Y component value of a motion vector or IBC motion vector included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the subblock motion vector candidate list, or the subblock merge candidate list is less than or equal to S, the motion vector or IBC motion vector to be included may not be included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list.

As another example, if at least one of the information on the block to be included in the candidate list is not similar to at least one of the information on the block included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list, at least one of the information on the block to be included in the candidate list may not be included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list.

At this time, the case where at least one of the information on the block to be included in the candidate list is dissimilar to at least one of the information on the block included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list may represent one of the following conditions.

For example, if an absolute value of a difference between a value of an intra prediction mode to be included and a value of an intra prediction mode included in the intra prediction mode candidate list is greater than S, the intra prediction mode to be included may not be included in the intra prediction mode candidate list.

For example, if an absolute value of a difference between a value of a motion vector or IBC motion vector to be included and a value of a motion vector or IBC motion vector included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list is greater than S, the motion vector or IBC motion vector to be included may not be included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list.

For example, if an absolute value of a difference between an X component value of a motion vector or IBC motion vector to be included and an X component value of a motion vector or IBC motion vector included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the subblock motion vector candidate list, or the subblock merge candidate list is greater than S, the motion vector or IBC motion vector to be included may not be included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list.

For example, if an absolute value of a difference between a Y component value of a motion vector or IBC motion vector to be included and a Y component value of a motion vector or IBC motion vector included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list is greater than S, the motion vector or IBC motion vector to be included may not be included in at least one of the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the sub-block motion vector candidate list, or the sub-block merge candidate list.

In the above description, S may be a positive integer including 0. S may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, S may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder. In addition, in the case of a motion vector or IBC motion vector, S may be a value representing at least one of M/N pixel units (such as an integer pixel unit, 1/2 pixel unit, 1/4 pixel unit, 1/16 pixel unit, etc.). Here, M and N may be positive integers.

A redundancy check between at least one of the candidates in the candidate list and a candidate included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list may be performed. As a result of the redundancy check, at least one of candidates included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the subblock motion vector candidate list, or the subblock merge candidate list may be removed, and at least one of the candidates in the candidate list may be included in at least one of the intra prediction mode candidate list, the motion vector candidate list, the merge candidate list, the IBC motion vector candidate list, the IBC merge candidate list, the subblock motion vector candidate list, or the subblock merge candidate list.

For example, at least one of the candidates in the candidate list may be first or last included in at least one of an intra prediction mode candidate list, a motion vector candidate list, a merge candidate list, an IBC motion vector candidate list, an IBC merge candidate list, a subblock motion vector candidate list, or a subblock merge candidate list.

The candidate list according to the present invention may manage the candidates by a FIFO (first in first out) rule. For example, if a new candidate needs to be added to the candidate list and the number of candidates in the candidate list is equal to the maximum number of candidates, the first added candidate may be first removed from the candidate list and then the new candidate may be added to the candidate list.

For example, the new candidate may be added to the candidate list first or last.

For example, the candidate list according to the present invention may include at least one of information regarding an intra prediction mode.

As another example, the candidate list may include intra prediction modes of spatially neighboring blocks. As another example, the candidate list may include a derived intra prediction mode as a result of subtracting a specific value from or adding the specific value to intra prediction modes of the spatially neighboring blocks. As another example, the candidate list may include a base intra prediction mode. As another example, the candidate list may include spatial motion vectors or spatial merge candidates.

As another example, the candidate list may include Intra Block Copy (IBC) merging candidates or motion vectors for IBC mode using the current image as a reference image. As another example, the candidate list may include temporal motion vectors or temporal merging candidates. As another example, the candidate list may include sub-block unit motion vectors or sub-block unit merge candidates. As another example, the candidate list may include a motion vector of the sub-block unit IBC mode or a sub-block unit IBC merge candidate. As another example, the candidate list may include a sub-block unit temporal motion vector or a sub-block unit temporal merge candidate. At this time, the sub-block may have the same meaning as the sub-block.

As another example, the candidate list may include spatial motion vectors or spatial merge candidates in units of CTUs. As another example, the candidate list may include IBC motion vectors or IBC merge candidates in units of CTUs. As another example, the candidate list may include a temporal motion vector or a temporal merging candidate of the corresponding position CTU in units of CTUs. As another example, the candidate list may include a sub-block unit motion vector or a sub-block unit merge candidate of a corresponding position CTU in units of CTUs. As another example, the candidate list may include a sub-block unit IBC motion vector or a sub-block unit IBC merge candidate of a corresponding position CTU in units of CTUs. As another example, the candidate list may include a sub-block unit temporal motion vector or a sub-block unit temporal merging candidate of a corresponding position CTU in units of CTUs.

As another example, the candidate list may include spatial motion vectors or spatial merge candidates, but may not include temporal motion vectors or temporal merge candidates. As another example, the candidate list may include a spatial motion vector, a spatial merge candidate, an IBC motion vector, or an IBC merge candidate, but may not include a temporal motion vector or a temporal merge candidate. As another example, the candidate list may include temporal motion vectors or temporal merging candidates, but may not include spatial motion vectors or spatial merging candidates. As another example, the candidate list may include a spatial motion vector, a spatial merge candidate, a temporal motion vector, or a temporal merge candidate. As another example, the candidate list may include a spatial motion vector, a spatial merge candidate, a temporal motion vector, or a temporal merge candidate, but may not include a sub-block unit motion vector or a sub-block unit merge candidate. As another example, the candidate list may include a spatial motion vector, a spatial merge candidate, a temporal motion vector, or a temporal merge candidate, but may not include a sub-block unit motion vector, a sub-block unit merge candidate, an IBC motion vector, or an IBC merge mode.

As another example, the candidate list may include only IBC motion vectors or IBC merge candidates. As another example, the candidate list may include spatial motion vectors or spatial merge candidates in units of CTUs, but may not include temporal motion vectors or temporal merge candidates. As another example, the candidate list may include a temporal motion vector or a temporal merging candidate in units of CTUs, but may not include a spatial motion vector or a spatial merging candidate. As another example, the candidate list may include a spatial motion vector, a spatial merge candidate, a temporal motion vector, or a temporal merge candidate in units of CTUs. As another example, the candidate list may include only IBC motion vectors or IBC merge candidates in CTU units.

At least one of the information on the specific block may be included in the candidate list if the specific block is at or crosses a boundary of at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column. At this point, the candidate list may be used to replace the line buffer.

For example, if the specific block is at a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column above the current block, or if the specific block is at a boundary of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column above the current block, or if the specific block crosses an upper boundary of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column to which the current block belongs, at least one of information on the specific block may be included in the candidate list.

As another example, if the specific block is at a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column on the left side of the current block, or if the specific block is at a boundary of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column on the left side to which the current block does not belong, or if the specific block crosses a left boundary of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column to which the current block belongs, at least one of information on the specific block may be included in the candidate list.

In addition, if the specific block is at a boundary of or crosses at least one of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, or a CTU column, at least one of information on the specific block may not be included in the candidate list. At this time, since information on a specific block is not included in the candidate list, the line buffer may be removed.

For example, if the specific block is at a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column above the current block, or if the specific block is at a boundary of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column above the current block, or if the specific block crosses an upper boundary of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column to which the current block belongs, at least one of information on the specific block may not be included in the candidate list.

As another example, if the specific block is at a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column on the left side of the current block, or if the specific block is at a boundary of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column on the left side to which the current block does not belong, or if the specific block crosses a left boundary of a picture, a sub-picture, a slice, a parallel block, a partition, a CTU boundary, a CTU row, and a CTU column to which the current block belongs, at least one of information on the specific block may not be included in the candidate list.

In addition, if a block related to block information already included in the candidate list and the current block belong to different pictures, sub-pictures, slices, parallel blocks, CTU boundaries, CTU rows, and CTU columns, at least one of the information on the current block may not be included in the candidate list.

That is, when the block information of the current block is added to the candidate list for the specific block, if the specific block and the current block are located in or belong to different pictures, sub-pictures, slices, parallel blocks, CTU boundaries, CTU rows, and CTU columns, at least one of the information on the current block may not be included in the candidate list for the specific block.

When a candidate is added to the candidate list, a specific candidate having a result of adding or subtracting a specific value to or from at least one of the candidate information on the block may be added to the candidate list as block information.

For example, a specific candidate having a new intra prediction mode may be added to the candidate list using a result of adding or subtracting a specific value to or from the intra prediction modes of the candidates to be included in the candidate list as the new intra prediction mode.

As another example, a specific candidate having a new motion vector may be added to the candidate list using a result of adding or subtracting a specific value to or from the motion vector of the candidate to be included in the candidate list as the new motion vector.

In addition, when a candidate is added to the candidate list, the candidate may not be added to the candidate list, but a specific candidate having a result of adding or subtracting a specific value to or from at least one of the candidate information on the block may be added to the candidate list as block information.

In addition, when at least one candidate is added to the candidate list, a specific candidate having a result of calculating a statistical value of at least one of the information on the block for the at least one candidate may be added to the candidate list as the block information.

In addition, a result having a specific value added to or subtracted from at least one of the information on the block of the candidates included in the candidate list may be added to the candidate list as a specific candidate of the block information.

For example, a specific candidate having a new intra prediction mode may be added to the candidate list using a result of adding or subtracting a specific value to or from intra prediction modes of candidates included in the candidate list as the new intra prediction mode.

As another example, a specific candidate having a new motion vector may be added to the candidate list using a result of adding or subtracting a specific value to or from the motion vector of the candidates included in the candidate list as the new motion vector.

In addition, a result having a specific value added to or subtracted from at least one of the information on the block of the candidates included in the candidate list may be added as a specific candidate of the block information, and the candidates already included in the candidate list may be excluded from the candidate list.

In addition, a result of having a calculation of a statistical value of at least one of the information on the block for at least one candidate included in the candidate list may be added to the candidate list as a specific candidate of the block information.

At this time, the specific value may be at least one of 0, a positive integer, or a negative integer. The specific value may be determined based on at least one of an encoding parameter of the current block or a candidate encoding parameter. In addition, the specific value may be predetermined in the encoder/decoder or may be signaled from the encoder to the decoder.

The candidate list according to the present invention may be used when at least one of an intra prediction mode candidate list, a motion vector candidate list, a merge candidate list, an IBC motion vector candidate list, an IBC merge candidate list, a sub block motion vector candidate list, or a sub block merge candidate list is constructed.

For example, when constructing the intra prediction mode candidate list, candidates in the candidate list may be used as candidates. For example, the candidates of the candidate list may be included in the intra prediction mode candidate list.

As another example, when constructing a motion vector candidate list, candidates in the candidate list may be used as candidates. For example, a candidate of the candidate list may be included in the motion vector candidate list.

As another example, when building a merge candidate list, the candidates in the candidate list may be used as candidates. For example, the candidates of the candidate list may be included in the merge candidate list.

As another example, when constructing the subblock motion vector candidate list, candidates in the candidate list may be used as candidates. For example, the candidates of the candidate list may be included in the sub-block motion vector candidate list.

As another example, when building a subblock merge candidate list, candidates in the candidate list may be used as candidates. For example, candidates of the candidate list may be included in the subblock merge candidate list.

Fig. 24 is a diagram illustrating a process of adding a candidate in a candidate list as a candidate of an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list according to an embodiment of the present invention.

If at least one candidate in the candidate list is used when at least one of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list is constructed, the candidate first added to the candidate list may be first added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list. At this time, the next candidate in the candidate list may be included in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list, without reaching the maximum number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list.

For example, as shown in fig. 24, if candidates in the candidate list are included in the order of H0, H1, H2, H3, and H4, the candidate H0 first included in the candidate list may be first used as a candidate of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list.

At this time, if the maximum number of candidates of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list is not reached, the next candidate H1 may be used as a candidate of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list.

When at least one candidate in the candidate list is added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate by the above-described method, redundancy check with a candidate in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list may be performed only for M candidates in the candidate list. Here, M may be a positive integer including "0".

For example, as shown in fig. 24, if a candidate H0, which is first included in the candidate list, is first added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate, the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list may be performed only for candidates H0 and H1

Or merging redundancy checks of candidates in the candidate list. At this time, if redundancy is performed for the first candidate H0

If the remaining checks and the same candidate exists, candidate H0 may not be included. If it is performed for the next candidate H1

Row redundancy check and no identical candidate exists, candidate H1 may be added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate. In addition, if the maximum number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list is not reached and the candidates H2, H3, or H4 are sequentially added to the candidate list, the redundancy check for the candidates in the candidate list may not be performed.

As another example, as shown in fig. 24, if a candidate H0 first included in the candidate list is first included in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate, redundancy checking with candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list may be performed only for candidates H3 and H4. For example, if the number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list does not reach the maximum number of candidates, the candidate H3 or H4 is added, and if a redundancy check is first performed for the candidate H3 and the same candidate exists, the candidate H3 may not be added. If a redundancy check is performed for the next candidate H4 and there is no identical candidate, the candidate H4 may be added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate. At this time, when the candidates H0, H1, and H2 are added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list, redundancy check with the candidates in each candidate list may not be performed.

Fig. 25 is a diagram illustrating an embodiment of neighboring blocks used in constructing an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list.

When at least one candidate in the candidate list is added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate by the same method as the above-described embodiment, redundancy checks with N neighboring blocks constructing the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list may be performed only for M candidates in the candidate list. Here, M may be a positive integer including "0", and N may be a positive integer greater than 0.

For example, as shown in fig. 24, if candidate H0, which is first included in the candidate list, is added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate, redundancy checking with respect to neighboring blocks used in constructing the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list may be performed only for candidates H0 and H1. For example, as shown in fig. 25, if neighboring blocks are used to construct an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list, redundancy checks with neighboring blocks a1 and B1 may be first performed with respect to candidate H0. As a result, if the same candidate exists, the candidate H0 may not be added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list. If redundancy checking with the neighboring blocks a1 and B1 is performed for the next candidate H1 and the same candidate does not exist, the candidate H1 may be added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate. At this time, if the maximum number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list is not reached and the candidates H2, H3, and/or H4 are added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list, the redundancy check with the neighboring block may not be performed for the candidates H2, H3, and/or H4.

For example, as shown in fig. 24, if candidate H0, which is first included in the candidate list, is first added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate, redundancy checking with respect to neighboring blocks used in constructing the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list may be performed only for candidates H3 and H4. For example, if neighboring blocks are used to construct an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list as shown in fig. 25, the number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list does not reach the maximum number of candidates, and the candidates H3 or H4 are added, redundancy checks with the neighboring blocks a1 and B1 may be sequentially performed with respect to the candidate H3. As a result, if there is the same candidate as H3, the candidate H3 may not be added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list. If redundancy checking with the neighboring blocks a1 and B1 is performed for the next candidate H4 and the same candidate does not exist, the candidate may be added to an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list as a candidate. At this time, when the candidates H0, H1, and H2 are added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list, redundancy check with the neighboring blocks may not be performed.

When at least one candidate in the candidate list is added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate by the above-described method, a redundancy check may not be performed with respect to the candidates in the candidate list, and when the number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list does not satisfy the maximum number of candidates, the candidates in the candidate list may be included until the maximum number of candidates is satisfied.

As another example, when at least one candidate in the candidate list is added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate by the above-described method, the redundancy check may not be performed with respect to the candidates in the candidate list, and when the number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list does not satisfy the maximum number of candidates, the candidates in the candidate list may be included until the number of candidates satisfies (the maximum number of candidates-1).

Fig. 26 is a diagram illustrating a process of adding a candidate in a candidate list to an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list according to an embodiment of the present invention.

If at least one candidate in the candidate list is used in constructing at least one of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list, the candidate finally added to the candidate list may be first included in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list. At this time, if the maximum number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list is not reached, a next candidate in the candidate list may be included in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list.

For example, as shown in fig. 26, if candidates in the candidate list are included in the order of H0, H1, H2, H3, and H4, the candidate H4 lastly included in the candidate list may be first used as a candidate of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list. If the maximum number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list is not reached, the next candidate H3 may be used as a candidate for the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list.

In addition, when at least one candidate in the candidate list is added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate by the above-described method, redundancy check with the candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list may be performed only for M candidates in the candidate list. Here, M may be a positive integer including "0".

For example, as shown in fig. 26, if the candidate H4, which is finally included in the candidate list, is first added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list, the redundancy check with the candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list may be performed only for the candidates H4 and H3. If a redundancy check is first performed against candidate H4 and there are identical candidates, candidate H4 may not be added. If a redundancy check is performed for the next candidate H3 and there is no identical candidate, the candidate H3 may be added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate.

At this time, if the maximum number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list is not reached and H2, H1, or H0 is sequentially added to each candidate list, redundancy check with the candidates in the candidate list may not be performed.

In addition, when at least one candidate in the candidate list is added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate by the above-described method, redundancy checks with N neighboring blocks used to construct the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list may be performed only for M candidates in the candidate list. Here, M may be a positive integer including "0", and N may be a positive integer greater than "0".

For example, as shown in fig. 26, if candidate H4, which is finally included in the candidate list, is first added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list, redundancy checking with neighboring blocks used to construct the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list may be performed only for candidates H4 and H3. For example, if neighboring blocks are used to construct an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list as shown in fig. 25, redundancy check with the neighboring blocks a1 and B1 is first performed for the candidate H4 and the same candidate exists, the candidate H4 may not be added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list. If redundancy checking with the neighboring blocks a1 and B1 is performed for the next candidate H3 and the same candidate does not exist, the next candidate may be added to an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list as a candidate.

At this time, if the maximum number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list is not reached and H2, H1, or H0 is sequentially added to each candidate list, redundancy check with the neighboring block may not be performed.

In addition, as shown in fig. 26, if a candidate H4, which is finally included in the candidate list, is first added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate, redundancy checking with neighboring blocks used to construct the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list may be performed only for candidates H1 and H0. For example, if neighboring blocks are used to construct an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list as shown in fig. 25, and the number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list does not satisfy the maximum number of candidates, the candidate H1 or H0 is added, and if redundancy checks with the neighboring blocks a1 and B1 are sequentially performed for the candidate H1 and the same candidate exists, the candidate H1 may not be added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list. If redundancy checking with the neighboring blocks a1 and B1 is performed for the next candidate H0 and the same candidate does not exist, the candidate H0 may be added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list as a candidate.

At this time, when the candidates H4, H3, and H2 are added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list, redundancy check with the neighboring blocks may not be performed.

In addition, when at least one candidate in the candidate list is added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list by the above-described method, a redundancy check may not be performed with respect to the candidates in the candidate list, and when the number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list does not satisfy the maximum number of candidates, the candidates in the candidate list may be included until the maximum number of candidates is satisfied.

In addition, when at least one candidate in the candidate list is added to the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list by the above-described method, a redundancy check may not be performed with respect to the candidates in the candidate list, and when the number of candidates in the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list does not satisfy the maximum number of candidates, the candidates in the candidate list may be included until (the maximum number of candidates-N) is satisfied. Here, N may be a positive integer greater than 0.

When at least one of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list is constructed using the candidate list, a maximum of N candidates in the candidate list may be used as candidates of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list. Here, N may be a positive integer including 0.

For example, even if the number of candidates in the candidate list is equal to the maximum number M of candidates in the candidate list, if the maximum number of candidates in the candidate list defined in the encoder/decoder that can be used in the motion vector candidate list is (M-1), only (M-1) candidates in the candidate list may be used to construct the motion vector candidate list. Here, M may be a positive integer greater than 0. In addition, the above examples are equally applicable to an intra prediction mode candidate list or a merge candidate list.

In addition, when the candidate list is used to construct at least one of an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list of the current encoding/decoding target block, all available candidates in the candidate list that can be referred to by the current encoding/decoding target block may be used to construct the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list.

At this time, if the current target block shares at least one of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list of the upper block, the candidate list that may be referred to by the current encoding/decoding target block may represent the candidate list of the upper block.

In addition, the candidate list may represent at least one of an intra prediction mode candidate list, a motion vector candidate list, or a merge candidate list. That is, at least one of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list of the candidate lists may be the same.

In addition, the candidate list may represent a candidate list other than at least one of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list. That is, the candidate list may be different from at least one of the intra prediction mode candidate list, the motion vector candidate list, or the merge candidate list.

Fig. 27 is a diagram illustrating a process of adding a candidate in a history-based candidate list as a candidate of an IBC block vector prediction candidate list or an IBC merge candidate list according to an embodiment of the present invention.

The IBC block vector prediction candidate list and/or the IBC merge candidate list may have the same meaning as the IBC block vector candidate list.

The history-based candidate list for an Intra Block Copy (IBC) mode for copying a reference block in a current image region, which is encoded/decoded before encoding/decoding of an encoding/decoding target block, may be separately constructed using at least one of the above-described methods. At this time, the history-based candidate list may have the same meaning as the candidate list. Additionally, the history-based candidate list may have the same meaning as the IBC candidate list.

In addition, in the present specification, a candidate included in the IBC block vector prediction candidate list or the IBC merge candidate list may be referred to as an IBC block vector candidate.

When at least one candidate in the history-based candidate list is used to construct at least one of an IBC block vector prediction candidate list or an IBC merge candidate list, at least one of methods of constructing a motion vector candidate list or a merge candidate list may be used.

If at least one candidate in the history-based candidate list is used to construct at least one of the IBC block vector prediction candidate list or the IBC merge candidate list, the candidate first added to the history-based candidate list may be first included in the IBC block vector prediction candidate list or the IBC merge candidate list. If the maximum number of candidates in the IBC block vector prediction candidate list or the IBC merge candidate list is not reached, the next candidate in the history-based candidate list may be included in the IBC block vector prediction candidate list or the IBC merge candidate list.

For example, the history-based candidate list may include block vector information of a block encoded/decoded before encoding/decoding of the current block as a candidate. At this time, the block vector information may be used for IBC prediction of the current block.

That is, at least one piece of block vector information in the history-based candidate list may be used to construct the IBC block vector candidate list.

In addition, the block vector information in the history-based candidate list may be added to the IBC block vector candidate list until the number of IBC block vector candidates included in the IBC block vector candidate list reaches the maximum number of merge candidates.

At this time, the maximum number of merge candidates that may be included in the IBC block vector candidate list may be determined based on the encoding parameter. The encoding parameters may be determined at the sequence parameter level.

For example, as shown in fig. 27, when candidates in the history-based candidate list are included in the order of H0, H1, H2, H3, H4, the candidate H0 first included in the history-based candidate list may be first used as a candidate of the IBC block vector prediction candidate list or the IBC merge candidate list. If the maximum number of candidates in the IBC block vector prediction candidate list or the IBC merge candidate list is not reached, the next candidate H1 may be used as a candidate for the IBC block vector prediction candidate list or the IBC merge candidate list.

When at least one candidate in the history-based candidate list is added to the IBC block vector prediction candidate list or the IBC merge candidate list as a candidate by the above-described method, redundancy checking with candidates in the IBC block vector prediction candidate list or the IBC merge candidate list may be performed only for M candidates in the history-based candidate list. Here, M may be a positive integer including 0.

For example, M may be 1. That is, when at least one of the block vector information in the history-based candidate list is added to the IBC block vector candidate list, a redundancy check with a candidate in the IBC block vector candidate list may be performed only for one candidate in the history-based candidate list. For example, a redundancy check with an IBC block vector candidate in the IBC block vector candidate list may be performed only for the last candidate in the history-based candidate list.

As another example, a redundancy check may be performed for the last candidate in the history-based candidate list with neighboring blocks used as IBC block vector candidates. That is, redundancy checks with neighboring blocks that may be used as IBC block vector candidates may be performed for the block vector information that is last included in the history-based candidate list.

At this time, the candidates in the history-based candidate list that have not undergone redundancy check are set to be not equal to the IBC block vector candidates in the IBC block vector candidate list, and the block vector information of the history-based candidate list may be added to the IBC block vector candidate list until the number of IBC block vector candidates included in the IBC block vector candidate list reaches the maximum number of merge candidates.

At this time, the redundancy check may be performed only when a certain condition is satisfied. For example, the redundancy check may be performed only when the area (width × height) of the current block exceeds K. For example, K may be 16. That is, the redundancy check may be performed only when the area of the current block exceeds 16.

In addition, the redundancy check may be performed only when the number of IBC block vector candidates included in the IBC block vector candidate list is less than the maximum number of merge candidates that may be included in the IBC block vector candidate list. At this time, the block vector information in the history-based candidate list may be added to the IBC block vector candidate list based on the result of the redundancy check until the number of IBC block vector candidates included in the IBC block vector candidate list reaches the maximum number of merge candidates.

For example, as shown in fig. 27, if the candidate H0 first included in the history-based candidate list is first added to the IBC block vector prediction candidate list or the IBC merge candidate list as a candidate, a redundancy check with the candidates in the IBC block vector prediction candidate list or the IBC merge candidate list may be performed only for the candidates H0 and H1. At this time, if a redundancy check is first performed for candidate H0 and the same candidate exists, candidate H0 may not be added. If a redundancy check is performed for the next candidate H1 and there is no identical candidate, candidate H1 may be added to the IBC block vector prediction candidate list or IBC merge candidate list as a candidate. At this time, if the maximum number of candidates in the IBC block vector prediction candidate list or the IBC merge candidate list is not reached and H2, H3, or H4 is sequentially added to each candidate list, redundancy check with the candidates of each candidate list may not be performed.

In addition, when at least one candidate in the history-based candidate list is added to the IBC block vector prediction candidate list or the IBC merge candidate list as a candidate by the above-described method, redundancy check with the candidates in the IBC block vector prediction candidate list or the IBC merge candidate list may be performed only for M candidates in the history-based candidate list. Here, M may be a positive integer including 0.

For example, as shown in fig. 27, if a candidate H0, which is first included in the history-based candidate list, is first added to the IBC block vector prediction candidate list or the IBC merge candidate list as a candidate, redundancy checking with candidates in the IBC block vector prediction candidate list or the IBC merge candidate list may be performed only for candidates H3 and H4. At this time, if the number of candidates in the IBC block vector prediction candidate list or the IBC merge candidate list does not satisfy the maximum number of candidates, the candidate H3 or H4 is added, and if a redundancy check is first performed for the candidate H3 and the same candidate exists, the candidate H3 may not be added. If a redundancy check is performed for the next candidate H4 and there is no identical candidate, candidate H4 may be added to the IBC block vector prediction candidate list or IBC merge candidate list as a candidate. At this time, when the candidates H0, H1, and H2 are added to the IBC block vector prediction candidate list or the IBC merge candidate list, redundancy check with the candidates in the candidate list may not be performed.

Fig. 28 is a diagram illustrating an embodiment of neighboring blocks used in constructing an IBC block vector prediction candidate list or an IBC merge candidate list.

When at least one candidate of the history-based candidate list is added to the IBC block vector prediction candidate list or the IBC merge candidate list as a candidate by the same method as the above-described method, redundancy checks with N neighboring blocks used in constructing the IBC block vector prediction candidate list or the IBC merge candidate list may be performed only for M candidates of the history-based candidate list. Here, M may be a positive integer including 0, and N may be a positive integer greater than 0. For example, M may be 1.

For example, as shown in fig. 27, if a candidate H0, which is first included in the history-based candidate list, is first added to the IBC block vector prediction candidate list or the IBC merge candidate list as a candidate, redundancy checking with neighboring blocks used in constructing the IBC block vector prediction candidate list or the IBC merge candidate list may be performed only for candidates H0 and H1. For example, if neighboring blocks are used to construct an IBC block vector prediction candidate list or an IBC merge candidate list as shown in fig. 28, redundancy checks with neighboring blocks a1 and B1 may be performed first for candidate H0. As a result, if the same candidate exists, the candidate H0 may not be added to the IBC block vector prediction candidate list or the IBC merge candidate list. If redundancy checking with neighboring blocks a1 and B1 is performed for the next candidate H1 and the same candidate does not exist, the candidate H1 may be added to the IBC block vector prediction candidate list or the IBC merge candidate list as a candidate. At this time, if the maximum number of candidates in the IBC block vector prediction candidate list or the IBC merge candidate list is not reached and H2, H3, or H4 is added to each history-based candidate list, redundancy check with the neighboring block may not be performed.

In addition, as shown in fig. 27, if a candidate H0, which is first included in the history-based candidate list, is first added to the IBC block vector prediction candidate list or the IBC merge candidate list as a candidate, redundancy checking with neighboring blocks used in constructing the IBC block vector prediction candidate list or the IBC merge candidate list may be performed only for candidates H3 and H4. For example, if neighboring blocks are used to construct an IBC block vector prediction candidate list or IBC merge candidate list as shown in fig. 28, the number of candidates in the IBC block vector prediction candidate list or IBC merge candidate list does not reach the maximum number of candidates and candidate H3 and/or H4 are added, and redundancy check with neighboring blocks a1 and B1 is performed first with candidate H3 and the same candidate exists, candidate H3 may not be added to the IBC block vector prediction candidate list or IBC merge candidate list. If redundancy checking with neighboring blocks a1 and B1 is performed for the next candidate H4 and no identical candidate exists, the candidate H4 may be added to the IBC block vector prediction candidate list or the IBC merge candidate list as a candidate. At this time, when the candidates H0, H1, and/or H2 are added to the IBC block vector prediction candidate list or the IBC merge candidate list, redundancy check with neighboring blocks may not be performed.

Fig. 29 is a diagram illustrating a process of adding a candidate in a history-based candidate list as a candidate of an IBC block vector prediction candidate list or an IBC merge candidate list according to an embodiment of the present invention.

As shown in fig. 29, if at least one candidate in the history-based candidate list is used to construct at least one of the IBC block vector prediction candidate list or the IBC merge candidate list, a candidate lastly included in the candidate list may be first included in the IBC block vector prediction candidate list or the IBC merge candidate list. If the maximum number of candidates of the IBC block vector prediction candidate list or the IBC merge candidate list is not reached, a next candidate in the history-based candidate list may be included in the IBC block vector prediction candidate list or the IBC merge candidate list.

When the history-based candidate list is used to construct at least one of the IBC block vector prediction candidate list or the IBC merge candidate list of the current encoding/decoding target block, the IBC block vector prediction candidate list or the IBC merge candidate list may be constructed for all candidates available in the history-based candidate list that may be referred to by the current encoding/decoding target block.

When at least one candidate in the history-based candidate list is added as an IBC block vector candidate by the same method as the above-described embodiment, redundancy checks with N neighboring blocks used as IBC block vector candidates may be performed only for M candidates in the history-based candidate list. Here, M may be a positive integer including 0, and N may be a positive integer greater than 0. For example, M may be 1. That is, when at least one candidate in the history-based candidate list is added to the IBC block vector candidate list as a candidate, a redundancy check with the IBC block vector candidate may be performed only for one candidate in the history-based candidate list.

For example, when adding block vector information included in the history-based candidate list to the IBC block vector candidate list as a candidate, a redundancy check with the IBC block vector candidate may be performed only for the last block vector information in the history-based candidate list. At this time, since candidates in the history-based candidate list that have not undergone redundancy check are set as block vectors that are not equal to neighboring blocks, the block vector information in the history-based candidate list may be added to the IBC block vector candidate list until the number of IBC block vector candidates included in the IBC block vector candidate list reaches the maximum number of merge candidates.

As a detailed example, as shown in fig. 29, if candidate H4, which is finally included in the history-based candidate list, is first added to the IBC block vector candidate list as a candidate, redundancy checking with neighboring blocks that can be used as IBC block vector candidates may be performed only for candidate H4. For example, if neighboring blocks are used to construct IBC block vector candidates as shown in fig. 28, redundancy checks with neighboring blocks a1 and B1 may be performed only for candidate H4, and H3, H2, H1, and H0 may be set to not have the same block vector as the neighboring blocks.

At this time, the redundancy check may be performed only when a certain condition is satisfied. For example, the redundancy check may be performed only when the area (width × height) of the current block exceeds K. For example, K may be 16. That is, the redundancy check may be performed only when the area of the current block exceeds 16.

The history-based candidate list that may be referred to by the current encoding/decoding target block may represent the history-based candidate list of the upper block if the current encoding/decoding target block shares at least one of the IBC block vector candidate list or the IBC merge candidate list of the upper block of the current target block.

Fig. 30 is a diagram illustrating an image decoding method according to an embodiment of the present invention.

Referring to fig. 30, the image decoding apparatus may compare block vector information included in the history-based candidate list with block vectors of neighboring blocks serving as IBC block vector candidates for IBC prediction of the current block (S3001). Here, step S3001 may be performed only for candidates lastly included in the history-based candidate list.

In addition, step S3001 may be performed only when the area of the current block is greater than 16.

Further, step S3001 may be performed only when the number of IBC block vector candidates included in the IBC block vector candidate list is less than the maximum number of merge candidates that may be included in the IBC block vector candidate list.

In addition, the image decoding apparatus may add block vector information included in the history-based candidate list to the IBC block vector candidate list based on the result of performing step S3001 (S3002).

Further, if the block vector information included in the history-based candidate list and the block vectors of neighboring blocks are different as a result of performing step S3001, the block vector information included in the history-based candidate list may be added to the IBC block vector candidate list.

Further, step S3002 may be performed until the number of IBC block vector candidates included in the IBC block vector candidate list reaches the maximum number of merge candidates that may be included in the IBC block vector candidate list.

Further, a maximum number of merge candidates that may be included in the IBC block vector candidate list may be determined based on the encoding parameters.

Also, the neighboring block may include at least one of a block adjacent to the left side of the current block or a block adjacent to the upper side of the current block.

Further, the history-based candidate list may include block vector information of a block that is decoded before decoding of the current block.

In addition, the image decoding apparatus may add block vector information of the current block to the history-based candidate list.

At this time, if a block decoded before decoding of the current block and the current block belong to different CTU (coding tree unit) lines, the block vector information of the current block may not be added to the history-based candidate list.

Fig. 31 is a diagram illustrating an image encoding method according to an embodiment of the present invention.

Referring to fig. 31, the image encoding apparatus may compare block vector information included in the history-based candidate list with block vectors of neighboring blocks serving as IBC block vector candidates for IBC prediction of the current block (S3101). Here, step S3101 may be performed only for candidates that are finally included in the history-based candidate list.

In addition, step S3101 may be performed only when the area of the current block is greater than 16.

Further, step S3101 may be performed only when the number of IBC block vector candidates included in the IBC block vector candidate list is less than the maximum number of merge candidates that may be included in the IBC block vector candidate list.

In addition, the image encoding apparatus may add block vector information included in the history-based candidate list to the IBC block vector candidate list based on the result of performing step S3101 (S3102).

Further, if the block vector information included in the history-based candidate list and the block vectors of neighboring blocks are different as a result of performing step S3101, the block vector information included in the history-based candidate list may be added to the IBC block vector candidate list.

Further, step S3102 may be performed until the number of IBC block vector candidates included in the IBC block vector candidate list reaches the maximum number of merge candidates.

Further, a maximum number of merge candidates that may be included in the IBC block vector candidate list may be determined based on the encoding parameters.

Also, the neighboring block may include at least one of a block adjacent to the left side of the current block or a block adjacent to the upper side of the current block.

Further, the history-based candidate list may include block vector information of a block encoded prior to encoding of the current block.

In addition, the image decoding apparatus may add block vector information of the current block to the history-based candidate list.

At this time, if a block encoded before encoding of the current block and the current block belong to different CTU (coding tree unit) lines, block vector information of the current block may not be added to the history-based candidate list.

The bitstream generated by the image encoding method of the present invention may be temporarily stored in a non-transitory computer-readable recording medium and may be decoded by the above-described image decoding method.

Specifically, a non-transitory computer-readable recording medium for storing a bitstream generated by an image encoding method, wherein the image encoding method includes: comparing block vector information included in the history-based candidate list with block vectors of neighboring blocks serving as Intra Block Copy (IBC) block vector candidates for IBC prediction of the current block, and adding the block vector information included in the history-based candidate list to the IBC block vector candidate list based on the comparison. The comparison is performed only for the candidates that were last included in the history-based candidate list.

Fig. 32 is a diagram illustrating an embodiment of building an IBC block vector candidate list using a history-based candidate list according to an embodiment of the present invention.

Referring to fig. 32, in adding block vector information of the history-based candidate list to the IBC block vector candidate list, an index indicating a candidate in the history-based candidate list may be used. At this time, the history-based candidate list used to construct the IBC block vector candidate list may be referred to as hmvpibcandlist. Additionally, the IBC block vector candidate list may be referred to as a bvCandList.

For example, an index (e.g., hMvpIdx) indicating a candidate in the history-based candidate list may have a value of 0 to (the maximum number of candidates in the history-based candidate list-1). At this time, the maximum number of candidates in the history-based candidate list may be referred to as numhmvppibccand.

Candidates in the history-based candidate list may be selected by indexing. For example, a candidate in the history-based candidate list may be selected by hmvppldx in the form of hmvpibcandlist [ hmvppldx ].

Fig. 33 is a diagram illustrating an embodiment of a method of constructing an IBC block vector candidate list using a history-based candidate list according to an embodiment of the present invention.

Referring to fig. 33, in adding block vector information of the history-based candidate list to the IBC block vector candidate list, an index indicating a candidate in the history-based candidate list may be used. At this time, the history-based candidate list used to construct the IBC block vector candidate list may be referred to as hmvpibcandlist. Additionally, the IBC block vector candidate list may be referred to as a bvCandList.

For example, an index (e.g., hMvpIdx) indicating a candidate in the history-based candidate list may have a value of 1 to (the maximum number of candidates in the history-based candidate list). At this time, the maximum number of candidates in the history-based candidate list may be referred to as numhmvppibccand.

Candidates in the history-based candidate list may be selected by indexing. For example, a candidate in the history-based candidate list may be selected by hMvppIdx in the form of HmvpIBCAndList [ hMvppIdx-1 ].

Fig. 34 is a diagram illustrating an embodiment of a method of constructing a merge candidate list using a history-based candidate list, according to an embodiment of the present invention.

Referring to fig. 34, in adding block vector information of the history-based candidate list to the merge candidate list, an index indicating a candidate in the history-based candidate list may be used. At this time, the history-based candidate list for constructing the merge candidate list may be referred to as hmvpandlist. In addition, the merge candidate list may be referred to as a mergeCandList.

For example, an index (e.g., hMvpIdx) indicating a candidate in the history-based candidate list may have a value of 0 to (the maximum number of candidates in the history-based candidate list-1). At this time, the maximum number of candidates in the history-based candidate list may be referred to as numhmvpland.

Candidates in the history-based candidate list may be selected by indexing. For example, a candidate in the history-based candidate list may be selected by hmvppldx in the form of hmvpandlist hmvppldx.

Fig. 35 is a diagram illustrating an embodiment of a method of constructing a merge candidate list using a history-based candidate list, according to an embodiment of the present invention.

Referring to fig. 35, in adding block vector information of the history-based candidate list to the merge candidate list, an index indicating a candidate in the history-based candidate list may be used. At this time, the history-based candidate list for constructing the merge candidate list may be referred to as hmvpandlist. In addition, the merge candidate list may be referred to as a mergeCandList.

For example, an index (e.g., hMvpIdx) indicating a candidate in the history-based candidate list may have a value of 1 to (the maximum number of candidates in the history-based candidate list). At this time, the maximum number of candidates in the history-based candidate list may be referred to as numhmvpland.

Candidates in the history-based candidate list may be selected by indexing. For example, a candidate in the history-based candidate list may be selected by hmvppldx in the form of hmvpandlist [ hmvppldx-1 ].

Embodiments of the present invention are applicable only when block sizes are within a certain range.

For example, the present invention is applicable only when the size of the current block is equal to or greater than 8 × 8. For example, the present invention is applicable only when the size of the current block is equal to or greater than 16 × 16. For example, the present invention is applicable only when the size of the current block is equal to or greater than 32 × 32. For example, the present invention is applicable only when the size of the current block is equal to or greater than 64 × 64. For example, the present invention is applicable only when the size of the current block is equal to or greater than 128 × 128. For example, the embodiment is applicable only when the size of the current block is equal to or less than 4 × 4. For example, the embodiment is applicable only when the size of the current block is equal to or smaller than 8 × 8. For example, the embodiment is applicable only when the size of the current block is equal to or smaller than 16 × 16. For example, the embodiment is applicable only when the size of the current block is equal to or smaller than 16 × 16. For example, the embodiment is applicable only when the size of the current block is equal to or greater than 16 × 16 and equal to or less than 64 × 64.

As in the above-described embodiments of the present invention, the reference picture set used in the reference picture list construction and reference picture list modification process may use the reference picture list of at least one of L0, L1, L2, or L3.

According to the above-described embodiments of the present invention, when the boundary strength is calculated in the deblocking filter, 1 to N motion vectors of the current block may be used. Here, N may indicate a positive integer of 1 or more, and may be 2, 3, 4, or the like.

The above-described embodiment of the present invention is applicable even when the motion vector has at least one of 16 pixel (16 pixel) units, 8 pixel (8 pixel) units, 4 pixel (4 pixel) units, integer pixel (integer pixel) units, 1/2 pixel (1/2 pixel) units, 1/4 pixel (1/4 pixel) units, 1/8 pixel (1/8 pixel) units, 1/16 pixel (1/16 pixel) units, 1/32 pixel (1/32 pixel) units, or 1/64 pixel (1/64 pixel) units. In addition, the motion vector in the encoding/decoding process of the current block may be selectively used for each pixel unit.

At least one of flags, indexes, etc. entropy-encoded by the encoder and entropy-decoded by the decoder may use at least one of the following binarization methods.

Truncated rice binarization method

k-order exponential Columbus binarization method

Restricted k-order exponential Columbus binarization method

Fixed-length binarization method

Unitary binarization method

Truncated unary binary method

The above embodiments can be performed in the same way in both the encoder and the decoder.

At least one or a combination of the above embodiments may be used for encoding/decoding video.

The order applied to the above embodiments may be different between the encoder and the decoder, or the order applied to the above embodiments may be the same in the encoder and the decoder.

The above-described embodiments may be performed on each luminance signal and each chrominance signal, or may be performed identically on the luminance signal and the chrominance signal.

The block form to which the above-described embodiments of the present invention are applied may have a square form or a non-square form.

The above-described embodiments of the present invention may be applied according to the size of at least one of an encoding block, a prediction block, a transform block, a current block, an encoding unit, a prediction unit, a transform unit, a unit, and a current unit. Here, the size may be defined as a minimum size or a maximum size or both of the minimum size and the maximum size so that the above-described embodiment is applied, or may be defined as a fixed size to which the above-described embodiment is applied. Further, in the above-described embodiments, the first embodiment may be applied to the first size, and the second embodiment may be applied to the second size. In other words, the above embodiments may be applied in combination according to the size. Further, the above-described embodiments may be applied when the size is equal to or greater than the minimum size and equal to or less than the maximum size. In other words, when the block size is included in a specific range, the above-described embodiment may be applied.

For example, when the size of the current block is 8 × 8 or more, the above-described embodiment may be applied. For example, when the size of the current block is only 4 × 4, the above-described embodiment may be applied. For example, when the size of the current block is 16 × 16 or less, the above-described embodiment may be applied. For example, the above-described embodiment may be applied when the size of the current block is equal to or greater than 16 × 16 and equal to or less than 64 × 64.

The above-described embodiments of the present invention may be applied according to temporal layers. To identify a temporal layer to which the above embodiments may be applied, a corresponding identifier may be signaled, and the above embodiments may be applied to a specified temporal layer identified by the corresponding identifier. Here, the identifier may be defined as the lowest layer or the highest layer or both the lowest layer and the highest layer to which the above-described embodiments can be applied, or may be defined as indicating a specific layer to which the embodiments are applied. Further, a fixed time tier to which the embodiments apply may be defined.

For example, when the temporal layer of the current image is the lowest layer, the above-described embodiment can be applied. For example, when the temporal layer identifier of the current picture is 1, the above-described embodiment can be applied. For example, when the temporal layer of the current image is the highest layer, the above-described embodiment can be applied.

A stripe type or a parallel block group type to which the above-described embodiments of the present invention are applied may be defined, and the above-described embodiments may be applied according to the corresponding stripe type or parallel block group type.

In the above embodiments, the method is described based on the flowchart having a series of steps or units, but the present invention is not limited to the order of the steps, and some steps may be performed simultaneously with other steps or in a different order. Further, those of ordinary skill in the art will appreciate that the steps in the flowcharts are not mutually exclusive, and that other steps may be added to or deleted from the flowcharts without affecting the scope of the present invention.

The described embodiments include various aspects of the examples. Not all possible combinations for the various aspects may be described, but those skilled in the art will recognize different combinations. Accordingly, the present invention is intended to embrace all such alternatives, modifications and variances which fall within the scope of the appended claims.

The embodiments of the present invention can be implemented in the form of program instructions that can be executed by various computer components and recorded in a computer-readable recording medium. The computer readable recording medium may include program instructions, data files, data structures, etc. alone or in combination. The program instructions recorded in the computer-readable recording medium may be specially designed and constructed for the present invention or well known to those skilled in the computer software art. Examples of the computer-readable recording medium include magnetic recording media (such as hard disks, floppy disks, and magnetic tapes), optical data storage media (such as CD-ROMs or DVD-ROMs), magneto-optical media (such as floppy disks), and hardware devices (such as Read Only Memories (ROMs), Random Access Memories (RAMs), flash memories, etc.) that are specifically constructed to store and implement program instructions. Examples of program instructions include not only machine language code, which is formatted by a compiler, but also high-level language code that may be implemented by a computer using an interpreter. The hardware device may be configured to be operated by one or more software modules to perform the processing according to the present invention, and vice versa.

Although the present invention has been described in terms of specific items such as detailed elements, and limited embodiments and drawings, they are provided only to assist a more general understanding of the present invention, and the present invention is not limited to the above-described embodiments. It will be understood by those skilled in the art that various modifications and changes may be made from the above description.

Therefore, the spirit of the present invention should not be limited to the above-described embodiments, and the entire scope of the claims and their equivalents will fall within the scope and spirit of the present invention.

INDUSTRIAL APPLICABILITY

The present invention can be used to encode or decode an image.

83页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于光流的预测细化

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类