Encoding / decoding method and device based on intra block copy, and bit stream storage medium

By adopting an intra-block replication method based on intra-frame block replication in image encoding/decoding, building block vector candidate list and using prediction mode information, the problem of insufficient image encoding efficiency in the prior art is solved, and higher compression efficiency and lower transmission and storage costs are achieved.

CN120034645APending Publication Date: 2025-05-23ELECTRONICS & TELECOMM RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510226153.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2019-12-24
Filing Date
2020-06-17
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The prior art has limitations in improving image encoding efficiency, especially when processing high resolution and high quality images, resulting in increased transmission and storage costs.

Method used

The encoding/decoding method based on intra-block replication is adopted to decode and encode the current block by building a block vector candidate list and using prediction mode information to improve compression efficiency.

Benefits of technology

It achieves higher compression efficiency, reduces the transmission and storage cost of image data, and is suitable for high-definition and ultra-high-definition images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034645A_ABST
    Figure CN120034645A_ABST
Patent Text Reader

Abstract

The invention provides an encoding / decoding method and device based on intra block copying and a bit stream storage medium. An image decoding method according to the present invention is characterized by comprising: a step of acquiring prediction mode information on a current block from a bitstream; a step of deriving an intra block copy prediction mode of the current block by using prediction mode information on the current block; and a step of restoring the current block on the basis of the intra block copy prediction mode, in which the intra block copy prediction mode is at least one of a block copy-based skip mode, a block copy-based merge mode, and a block copy-based AMVP mode.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of an invention patent application with an application date of June 17, 2020, application number "202080040723.8", and invention name "Encoding / decoding method, device and bitstream storage medium based on intra-frame block replication". Technical Field

[0002] The present invention relates to an image encoding / decoding method and apparatus and a recording medium for storing a bit stream. More specifically, the present invention relates to a method and apparatus for encoding / decoding an image based on intra-block copying and a recording medium for storing a bit stream generated by the image encoding method or apparatus of the present invention. Background Art

[0003] Recently, in various applications, the demand for high-resolution and high-quality images such as high-definition (HD) or ultra-high-definition (UHD) images has increased. As the resolution and quality of images increase, the amount of data increases accordingly. This is one of the reasons why transmission costs and storage costs increase when image data is transmitted through existing transmission media such as wired or wireless broadband channels or when image data is stored. In order to solve these problems of high-resolution and high-quality image data, efficient image encoding / decoding technology is required.

[0004] There are various video compression techniques, such as inter-frame prediction techniques that predict the values ​​of pixels in a current picture from the values ​​of pixels in a previous picture or a subsequent picture, intra-frame prediction techniques that predict the values ​​of pixels in an area of ​​the current picture from the values ​​of pixels in another area of ​​the current picture, transformation and quantization techniques for compressing the energy of residual signals, and entropy coding techniques that assign shorter codes to frequently occurring pixel values ​​and longer codes to less frequently occurring pixel values.

[0005] Conventional image encoding / decoding methods and apparatuses use encoding / decoding techniques based on restricted intra-block copying, and thus have limitations in improving encoding efficiency. Summary of the invention

[0006] Technical issues An object of the present invention is to provide an image encoding / decoding method and apparatus with improved compression efficiency.

[0007] Another object of the present invention is to provide an intra-block copy-based image encoding / decoding method and apparatus with improved compression efficiency.

[0008] Another object of the present invention is to provide a recording medium for storing a bit stream generated by the image encoding / decoding method or apparatus according to the present invention.

[0009] Another object of the present invention is to provide an image encoding / decoding method and apparatus based on configuration of a block vector candidate list.

[0010] Technical Solution According to the present invention, a method for decoding an image includes: obtaining prediction mode information of a current block from a bitstream, decoding an intra-block copy prediction mode of the current block using the prediction mode information of the current block, and reconstructing the current block based on the intra-block copy prediction mode. The intra-block copy prediction mode is at least one of a block copy-based skip mode, a block copy-based merge mode, or a block copy-based AMVP mode.

[0011] Reconstructing the current block may include constructing a block vector candidate list for the current block, deriving a block vector for the current block from candidate block vectors included in the block vector candidate list, and reconstructing the current block using the derived block vector.

[0012] The step of constructing a block vector candidate list for the current block may include acquiring, from a bitstream, first information indicating a maximum number of allowable candidate block vectors in the block vector candidate list.

[0013] The first information may be signaled in a sequence parameter set.

[0014] The first information may be entropy decoded based on the second information indicating whether the intra block copy prediction mode is used.

[0015] The maximum number of allowable candidate block vectors in the block vector candidate list may be derived from a difference between a predetermined positive integer and a value of the first information.

[0016] The predetermined positive integer may be 6.

[0017] When the intra block copy prediction mode of the current block is in the block copy based AMVP mode and a maximum number of allowable candidate block vectors in the block vector candidate list is greater than a predetermined value, information indicating an index of the L0 motion vector predictor may be decoded.

[0018] When the number of candidate block vectors included in the block vector candidate list is less than a maximum number of allowable candidate block vectors in the block vector candidate list, constructing the block vector candidate list for the current block may include adding history-based block vector candidates to the block vector candidate list until the number of candidate block vectors becomes equal to the maximum number of allowable candidate block vectors in the block vector candidate list.

[0019] The method may further include determining whether a predetermined candidate among the history-based block vector candidates overlaps with a candidate block vector included in the block vector candidate list.

[0020] When the current block has a size smaller than a predetermined size, an update process of the history-based block vector candidate list of the current block may not be performed.

[0021] According to the present invention, a method for encoding an image includes: encoding the current block based on an intra block copy prediction mode of the current block, and encoding the intra block copy prediction mode of the current block using prediction mode information of the current block. The intra block copy prediction mode is at least one of a block copy-based skip mode, a block copy-based merge mode, or a block copy-based AMVP mode.

[0022] The step of encoding the current block may include constructing a block vector candidate list for the current block, deriving a block vector for the current block from candidate block vectors included in the block vector candidate list, and encoding the current block using the derived block vector.

[0023] The method may further include encoding first information indicating a maximum number of allowable candidate block vectors in the block vector candidate list into a bitstream.

[0024] The first information may be signaled in a sequence parameter set.

[0025] The first information may be encoded based on the second information indicating whether the intra block copy prediction mode is used.

[0026] The maximum number of allowable candidate block vectors in the block vector candidate list may be encoded by a difference between a predetermined positive integer and a value of the first information.

[0027] The predetermined positive integer may be 6.

[0028] When the intra block copy prediction mode of the current block is in the block copy based AMVP mode and a maximum number of allowable candidate block vectors in the block vector candidate list is greater than a predetermined value, information indicating an index of the L0 motion vector predictor may be encoded.

[0029] When the number of candidate block vectors included in the block vector candidate list is less than a maximum number of allowable candidate block vectors in the block vector candidate list, constructing the block vector candidate list for the current block may include adding history-based block vector candidates to the block vector candidate list until the number of candidate block vectors becomes equal to the maximum number of allowable candidate block vectors in the block vector candidate list.

[0030] When the current block has a size smaller than a predetermined size, an update process of the history-based block vector candidate list of the current block may not be performed.

[0031] A recording medium according to the present invention can store a bit stream generated by the image encoding method according to the present invention.

[0032] Beneficial Effects According to the present invention, an image encoding / decoding method and apparatus with improved compression efficiency can be provided.

[0033] According to the present invention, a symmetric / rotational image encoding / decoding method and apparatus based on intra-block copying with improved compression efficiency can be provided.

[0034] According to the present invention, there can be provided a recording medium for storing a bit stream generated by the image encoding / decoding method or apparatus according to the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.

[0036] Figure 2 is a block diagram showing a configuration of a decoding device according to an embodiment to which the present invention is applied.

[0037] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded.

[0038] Figure 4 is a diagram illustrating an intra prediction process.

[0039] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.

[0040] Figure 6 is a diagram illustrating transform and quantization processing.

[0041] Figure 7 is a diagram showing reference samples that can be used for intra prediction.

[0042] Figure 8a is a flowchart illustrating an image encoding method according to an embodiment of the present invention.

[0043] Figure 8b is a flowchart illustrating an image decoding method according to an embodiment of the present invention.

[0044] Fig. 9 is a diagram illustrating a relationship between a current block and a prediction block according to an exemplary embodiment of the present invention.

[0045] Fig.10 is a diagram illustrating neighboring blocks adjacent to a current block according to an embodiment of the present invention.

[0046] Fig.11 is a diagram illustrating a current block being partitioned when a predetermined threshold is 32 according to an embodiment of the present invention.

[0047] Fig.12 is a diagram illustrating a process of sharing and using a block vector candidate list constructed in an upper block according to an embodiment of the present invention.

[0048] Fig.13 is a diagram illustrating a process of deriving information indicating an allowable maximum number of block vector candidate lists according to an embodiment of the present invention.

[0049] Fig.14 2 is a diagram illustrating a process of entropy encoding / decoding an L0 motion vector prediction flag according to an embodiment of the present invention.

[0050] Fig.15 is a diagram illustrating a process of entropy encoding / decoding merge index information according to an embodiment of the present invention.

[0051] Fig.16 is a diagram illustrating a correspondence relationship between a chrominance component block and a luminance component region according to another embodiment of the present invention.

[0052] Fig.17 is a diagram illustrating a luminance component sub-block according to another embodiment of the present invention.

[0053] Fig.18 is a diagram illustrating a relationship between a current block and a prediction block according to an exemplary embodiment of the present invention.

[0054] Fig.19 2 is a diagram illustrating when prediction encoding modes of luminance component subblocks corresponding to chrominance component blocks are the same according to an embodiment of the present invention.

[0055] Fig. 20 2 is a diagram illustrating when prediction encoding modes of luminance component subblocks corresponding to chrominance component blocks are different according to an exemplary embodiment.

[0056] Figures 21a to 23 is a diagram illustrating encoding information transmitted in association with intra-block partitioning according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0057] Various modifications may be made to the present invention, and there are various embodiments of the present invention, wherein examples of various embodiments of the present invention will now be provided with reference to the accompanying drawings and described in detail. However, the present invention is not limited thereto, although the exemplary embodiments may be interpreted as including all modifications, equivalents or substitutions within the technical concept and technical scope of the present invention. In various aspects, similar figure numerals refer to the same or similar functions. In the accompanying drawings, the shapes and sizes of the elements may be exaggerated for clarity. In the following detailed description of the present invention, reference is made to the accompanying drawings that illustrate specific embodiments of the present invention in a graphical manner. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, without departing from the spirit and scope of the present disclosure, the specific features, structures and characteristics described herein in conjunction with one embodiment may be implemented in other embodiments. In addition, it should be understood that the position or arrangement of each element within each disclosed embodiment may be modified without departing from the spirit and scope of the present disclosure. Therefore, the following detailed description should not be regarded as having a limiting meaning, and the scope of the present disclosure is limited only by the appended claims (when properly interpreted, together with the full range of equivalents claimed by the claims).

[0058] The terms "first", "second", etc. used in the specification may be used to describe various components, but the components should not be interpreted as being limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present invention, a "first" component may be named a "second" component, and a "second" component may also be similarly named a "first" component. The term "and / or" includes a combination of multiple items or any one of the multiple items.

[0059] It will be understood that in this specification, when an element is simply referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” another element, the element may be “directly connected to” or “directly coupled to” another element, or connected to or coupled to another element with other elements interposed therebetween. Conversely, it will be understood that when an element is referred to as being “directly coupled to” or “directly connected to” another element, there are no intervening elements.

[0060] In addition, the components shown in the embodiments of the present invention are shown independently to represent the characteristic functions that are different from each other. Therefore, this does not mean that each component is composed of a separate hardware or software component unit. In other words, for convenience, each component includes each component in the listed components. Therefore, at least two components of each component can be combined to form a component, or a component can be divided into multiple components to perform each function. If it does not depart from the essence of the present invention, the embodiment in which each component is combined and the embodiment in which a component is divided are also included in the scope of the present invention.

[0061] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Unless there is a significantly different meaning in the context, the expression used in the singular includes the expression in the plural form. In this specification, it will be understood that terms such as "including", "having" etc. are intended to indicate the presence of features, numbers, steps, actions, elements, parts or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, parts or combinations thereof may exist or may be added. In other words, when a particular element is referred to as "included", it does not exclude elements other than the corresponding element, but may include other elements in an embodiment of the present invention or in the scope of the present invention.

[0062] In addition, some components may not be essential components for performing the basic functions of the present invention, but are selective components that only improve its performance. The present invention can be implemented by only including essential components for implementing the essence of the present invention without including components for improving performance. Structures that only include essential components without including selective components that only improve performance are also included in the scope of the present invention.

[0063] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. When describing the exemplary embodiments of the present invention, well-known functions or configurations will not be described in detail because they may unnecessarily obscure the understanding of the present invention. The same constituent elements in the accompanying drawings are represented by the same reference numerals, and repeated descriptions of the same elements will be omitted.

[0064] Hereinafter, an image may refer to a picture constituting a video, or may refer to the 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 the images of the moving picture or both encoding and decoding".

[0065] Hereinafter, the terms "motion picture" and "video" may be used as the same meaning and may be replaced with each other.

[0066] Hereinafter, a target image may be an encoding target image as an encoding target and / or a decoding target image as a decoding target. In addition, a target image may be an input image input to an encoding device, and an input image input to a decoding device. Here, the target image may have the same meaning as the current image.

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

[0068] Hereinafter, the target block may be an encoding target block as an encoding target and / or a decoding target block as a decoding target. In addition, the target block may be a current block as a target of current encoding and / or decoding. For example, the terms "target block" and "current block" may be used as the same meaning and may be replaced with each other.

[0069] Hereinafter, the terms "block" and "unit" may be used as the same meaning and may be replaced with each other. Alternatively, a "block" may refer to a specific unit.

[0070] In the following, the terms "region" and "segment" are used interchangeably.

[0071] Hereinafter, a specific signal may be a signal representing a specific block. For example, an original signal may be a signal representing a target block. A prediction signal may be a signal representing a prediction block. A residual signal may be a signal representing a residual block.

[0072] In an embodiment, each of the specific information, data, flags, indexes, elements, attributes, etc. may have a value. The value of the information, data, flags, indexes, elements, and attributes equal to "0" may represent a logical false or a first predefined value. In other words, the value "0", false, logical false, and the first predefined value may be replaced with each other. The value of the information, data, flags, indexes, elements, and attributes equal to "1" may represent a logical true or a second predefined value. In other words, the value "1", true, logical true, and the second predefined value may be replaced with each other.

[0073] When the variable i or j is used to represent a column, row, or index, the value of i can 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. can be counted from 0 or 1.

[0074] Description of terms Encoder: This refers to a device that performs encoding. In other words, it refers to an encoding device.

[0075] Decoder: Refers to a device that performs decoding. In other words, it refers to a decoding device.

[0076] Block: is an M×N sample array. Here, M and N may represent positive integers, and a block may represent a sample array in a two-dimensional form. A block may refer to a unit. A 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. In addition, the current block may be at least one of a coding block, a prediction block, a residual block, and a transform block.

[0077] Sample: It is the basic unit of a block. d ), the sample points can be represented as In the present invention, a sample point may be used as the meaning of a pixel. That is, a sample point, a pel, and a pixel may have the same meaning as each other.

[0078] Unit: may refer to a coding and decoding unit. When encoding and decoding an image, a unit may be a region generated by partitioning a single image. In addition, when a single image is partitioned into sub-division units during encoding or decoding, a unit may represent a sub-division unit. That is, an image may be partitioned into a plurality of units. When encoding and decoding an image, a predetermined process for each unit may be performed. A single unit may be partitioned into sub-units having a size smaller than that of the unit. According to the function, 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. In addition, in order to distinguish a unit from a block, a unit may include a luminance component block, a chrominance component block associated with the luminance component block, and a syntax element for each color component block. A unit may have various sizes and shapes, and specifically, the shape of a unit may be a two-dimensional geometric figure such as a square, a rectangle, a trapezoid, a triangle, a pentagon, and the like. Also, the unit information may include at least one of a unit type indicating a coding unit, a prediction unit, a transformation unit, etc., and a unit size, a unit depth, an order of encoding and decoding of the unit, and the like.

[0079] 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. In addition, the coding tree unit may represent a syntax element including a block 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 subordinate units such as coding units, prediction units, transform units, etc. 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 as an input image. Here, the quadtree may represent a quadtree.

[0080] When the size of the coding block is within a predetermined range, it is possible to divide it using only quadtree partitioning. Here, the predetermined range may be defined as at least one of the maximum size and the minimum size of the coding block that can be divided using only quadtree partitioning. Information indicating the maximum / minimum size of the coding block that allows quadtree partitioning may be signaled through a bitstream, and the information may be signaled in at least one unit of a sequence, a picture parameter, a parallel block group, or a slice (fragment). Optionally, 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 divide it using only quadtree partitioning. Optionally, when the size of the coding block is larger than the size of the maximum conversion block, it is possible to divide it using only quadtree partitioning. Here, the block to be divided may be at least one of a coding block and a transform block. In this case, the information indicating the division of the coding block (e.g., split_flag) may be a flag indicating whether quadtree partitioning is performed. When the size of the coding block falls within a predetermined range, it is possible to divide it using only binary or ternary tree partitioning. In this case, the above description of the quadtree partition can be applied to the binary tree partition or the ternary tree partition in the same manner.

[0081] Coding tree block: may be used as a term used to designate any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.

[0082] Neighboring block: may refer to a block adjacent to the current block. The block adjacent to the current block may refer to a block that touches the boundary of the current block or a block that is located within a predetermined distance from the current block. The neighboring block may refer to a block adjacent to a vertex of the current block. Here, the block adjacent to a vertex of the current block may refer to a block that is vertically adjacent to a neighboring block that is horizontally adjacent to the current block or a block that is horizontally adjacent to a neighboring block that is vertically adjacent to the current block.

[0083] Reconstructed neighboring block: may represent a neighboring block that is adjacent to the current block and has been encoded or decoded in space / time. Here, the reconstructed neighboring block may represent a reconstructed neighboring unit. The reconstructed spatial neighboring block may be a block that is within the current picture and has been reconstructed by encoding or decoding or both encoding and decoding. The reconstructed 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.

[0084] Unit depth: may represent the degree of partitioning of a unit. In a tree structure, the highest node (root node) may correspond to the first unit that is not partitioned. In addition, the highest node may have a minimum 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 a node that cannot be further partitioned. The depth of a leaf node may be the 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. In addition, when a unit is represented as a tree structure, the level at which the unit exists may represent the unit depth.

[0085] Bitstream: can represent a stream of bits including coded image information.

[0086] Parameter set: corresponds to header information among the configurations in 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 tile group header, and tile header information. The term "tile group" means a group of tiles and has the same meaning as a slice.

[0087] The adaptation parameter set may represent a parameter set that can be shared by being referenced in different pictures, sub-pictures, slices, tile groups, tiles, or bricks. In addition, information in the adaptation parameter set may be used by referring to different adaptation parameter sets for sub-pictures, slices, tile groups, tiles, or bricks within a picture.

[0088] Furthermore, regarding adaptation parameter sets, different adaptation parameter sets may be referenced by using identifiers of different adaptation parameter sets for a sub-picture, a slice, a tile group, a tile, or a partition within a picture.

[0089] Furthermore, regarding adaptation parameter sets, different adaptation parameter sets may be referenced by using identifiers of different adaptation parameter sets for slices, tile groups, tiles, or partitions within a sub-picture.

[0090] Furthermore, regarding adaptation parameter sets, different adaptation parameter sets may be referenced by using identifiers of different adaptation parameter sets for tiles or partitions within a slice.

[0091] Furthermore, with respect to adaptation parameter sets, different adaptation parameter sets may be referenced by using identifiers of different adaptation parameter sets for partitions within a tile.

[0092] Information about the adaptation parameter set identifier may be included in a parameter set or a header of a sub-picture, and an adaptation parameter set corresponding to the adaptation parameter set identifier may be used for the sub-picture.

[0093] Information about the adaptation parameter set identifier may be included in a parameter set or a header of a tile, and an adaptation parameter set corresponding to the adaptation parameter set identifier may be used for the tile.

[0094] Information about the adaptation parameter set identifier may be included in a header of the tile, and an adaptation parameter set corresponding to the adaptation parameter set identifier may be used for the tile.

[0095] A picture may be partitioned into one or more tile rows and one or more tile columns.

[0096] A sub-picture may be partitioned into one or more parallel block rows and one or more parallel block columns within a picture. A sub-picture may be an area having a rectangular / square form within a picture and may include one or more CTUs. In addition, at least one or more parallel blocks / blocks / strips may be included in a sub-picture.

[0097] A tile may be an area having a rectangular / square form within a picture and may include one or more CTUs. In addition, a tile may be partitioned into one or more partitions.

[0098] A partition may represent one or more CTU rows within a tile. A tile may be partitioned into one or more partitions, and each partition may have at least one or more CTU rows. A tile that is not partitioned into two or more may represent a partition.

[0099] A slice may include one or more tiles within a picture, and may include one or more partitions within a tile.

[0100] Parsing: may mean determining the value of a syntax element by performing entropy decoding, or may mean the entropy decoding itself.

[0101] Symbol: At least one of a syntax element, a coding parameter, and a transform coefficient value that can represent a coding / decoding target unit. In addition, the symbol can represent an entropy coding target or an entropy decoding result.

[0102] Prediction mode: may be information indicating a mode for encoding / decoding using intra prediction or a mode for encoding / decoding using inter prediction.

[0103] Prediction unit: may represent a basic unit when performing predictions 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 sizes, or may be partitioned into multiple lower-level prediction units. Multiple partitions may be basic units when performing prediction or compensation. Partitions generated by splitting a prediction unit may also be prediction units.

[0104] Prediction unit partition: may represent a shape obtained by partitioning a prediction unit.

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

[0106] The inter prediction indicator may refer to the direction of inter prediction of the current block (unidirectional prediction, bidirectional prediction, etc.). Optionally, the inter prediction indicator may refer to the number of reference pictures used to generate the prediction block of the current block. Optionally, the inter prediction indicator may refer to the number of prediction blocks used when performing inter prediction or motion compensation on the current block.

[0107] The prediction list utilization flag indicates whether at least one reference picture in a specific reference picture list is used to generate a prediction block. The prediction list utilization flag may be used to derive the inter prediction indicator, and conversely, the inter prediction indicator may be used to derive the prediction list utilization flag. For example, when the prediction list utilization flag has a first value of zero (0), it indicates that the 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.

[0108] The reference picture index may refer to an index indicating a specific reference picture in a reference picture list.

[0109] A reference picture may refer to a reference picture referenced by a specific block for the purpose of inter-frame prediction or motion compensation of the specific block. Alternatively, a reference picture may be a picture including a reference block referenced by a current block for inter-frame prediction or motion compensation. Hereinafter, the terms "reference picture" and "reference image" have the same meaning and are interchangeable.

[0110] A motion vector may be a two-dimensional vector used for inter-frame prediction or motion compensation. A motion vector may represent an offset between an encoding / decoding target block and a 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.

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

[0112] The motion vector candidate may refer to a prediction candidate block or a motion vector of the prediction candidate block when predicting a motion vector. In addition, the motion vector candidate may be included in a motion vector candidate list.

[0113] The motion vector candidate list may mean a list consisting of one or more motion vector candidates.

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

[0115] 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, a reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.

[0116] The merge candidate list may mean a list consisting of one or more merge candidates.

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

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

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

[0120] Scaling: may refer to the process of multiplying the level of quantization by a factor. Transform coefficients may be generated by scaling the level of quantization. Scaling may also be referred to as inverse quantization.

[0121] Quantization parameter: may indicate a value used when a transform coefficient is used to generate a quantized level during quantization. The quantization parameter may also indicate a value used when a transform coefficient is generated by scaling the quantized level during inverse quantization. The quantization parameter may be a value mapped to a quantization step size.

[0122] Delta quantization parameter: may represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.

[0123] Scan: may refer to a method of ordering coefficients within a cell, block, or matrix. For example, changing a two-dimensional matrix of coefficients to a one-dimensional matrix may be called scanning, and changing a one-dimensional matrix of coefficients to a two-dimensional matrix may be called scanning or inverse scanning.

[0124] Transform coefficient: may refer to a coefficient value generated after performing a transform in an encoder. Transform coefficient may refer to a coefficient value generated after performing at least one of entropy decoding and inverse quantization in a decoder. A quantization level obtained by quantizing a transform coefficient or a residual signal or a quantized transform coefficient level may also fall within the meaning of a transform coefficient.

[0125] Quantization level: may represent a value generated by quantizing a transform coefficient or a residual signal in an encoder. Alternatively, the quantization level may represent a value that is a dequantization target subjected to dequantization in a decoder. Similarly, the quantized transform coefficient level as a result of transformation and quantization may also fall within the meaning of the quantization level.

[0126] Non-zero transform coefficient: may refer to a transform coefficient having a value other than zero, or a transform coefficient level or quantization level having a value other than zero.

[0127] Quantization matrix: may refer to a matrix used in a quantization process or an inverse quantization process performed to improve subjective image quality or objective image quality. The quantization matrix may also be referred to as a scaling list.

[0128] Quantization matrix coefficients: can represent each element in the quantization matrix. Quantization matrix coefficients can also be called matrix coefficients.

[0129] Default matrix: may represent a predetermined quantization matrix predefined in an encoder or a decoder.

[0130] Non-default matrix: may denote a quantization matrix that is not predefined in the encoder or decoder but is signaled by the user.

[0131] Statistical value: The statistical value for at least one of a variable, a coding parameter, a constant value, etc. having a calculable specific value can be one or more of the average value, summed value, weighted average value, weighted sum value, minimum value, maximum value, most frequently occurring value, median value, and interpolation value of the corresponding specific value.

[0132] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.

[0133] The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. A video may include at least one image. The encoding device 100 may sequentially encode at least one image.

[0134] Reference Figure 1 , the encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame 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.

[0135] The encoding device 100 may perform encoding of an input image by using an intra mode or an inter mode or both an intra mode and an inter mode. In addition, the encoding device 100 may generate a bit stream including encoding information by encoding the input image, and output the generated bit stream. The generated bit stream 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 a prediction mode, the switch 115 may switch to the intra mode. Alternatively, when the inter mode is used as a prediction mode, the switch 115 may switch to the inter mode. Here, the intra mode may represent an intra prediction mode, and the inter mode may represent an inter prediction mode. The encoding device 100 may generate a prediction block for an input block of the input image. In addition, the encoding device 100 may encode a residual block using a residual of the input block and the prediction block after generating the prediction block. The input image may be referred to as a current image as a current encoding target. The input block may be referred to as a current block as a current encoding target, or may be referred to as an encoding target block.

[0136] When the prediction mode is the intra mode, the intra prediction unit 120 may use samples of a block that has been encoded / decoded and is 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 may generate prediction samples of the input block by performing spatial prediction. Here, intra prediction may refer to prediction within a frame.

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

[0138] The motion compensation unit 112 may generate a predicted block by performing motion compensation on the current block using a motion vector. Here, inter prediction may refer to prediction or motion compensation between frames.

[0139] 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 area 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 the skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode is used for motion prediction and motion compensation of a prediction unit included in the corresponding coding unit. Then, inter-picture prediction or motion compensation may be performed differently according to the determined mode.

[0140] The subtractor 125 may generate a residual block by using the difference between 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 prediction signal. In addition, the residual signal may be a signal generated by transforming or quantizing the difference between the original signal and the prediction signal, or by 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.

[0141] 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 on the residual block.

[0142] The quantized level may be generated by applying quantization to a transform coefficient or to a residual signal. Hereinafter, the quantized level may also be referred to as a transform coefficient in an embodiment.

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

[0144] The entropy encoding unit 150 may generate a bitstream by performing entropy encoding on the value calculated by the quantization unit 140 or the encoding parameter value 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 sample information of the image and information for decoding the image. For example, the information for decoding the image may include a syntax element.

[0145] When entropy coding is applied, symbols are represented so that a smaller number of bits are allocated to symbols with a high probability of generation, and a larger number of bits are allocated to symbols with a low probability of generation, and thus, the size of the bitstream for the symbol to be encoded can be reduced. The entropy coding unit 150 may use a coding method for entropy coding such as exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. For example, the entropy coding unit 150 may perform entropy coding by using a variable length coding / code (VLC) table. In addition, the entropy coding unit 150 may derive a binarization method of a target symbol and a probability model of a target symbol / binary bit, and perform arithmetic coding by using the derived binarization method and context model.

[0146] In order to encode a transform coefficient level (quantized level), the entropy encoding unit 150 may change a coefficient in a two-dimensional block form into a one-dimensional vector form by using a transform coefficient scanning method.

[0147] The coding parameters may include information such as syntax elements (flags, indexes, etc.) that are encoded in the encoder and sent to the decoder by signaling, as well as information derived when performing encoding or decoding. The coding parameters may represent information required when encoding or decoding an image. For example, at least one value or combination of the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether to perform quadtree partitioning, whether to perform binary tree partitioning, binary tree partition direction (horizontal or vertical), binary tree partition form (symmetric partitioning or asymmetric partitioning), whether the current coding unit is partitioned by ternary tree partitioning, the direction of ternary tree partitioning (horizontal or vertical), the type of ternary tree partitioning (symmetric type or asymmetric type), whether the current coding unit is partitioned by multi-type tree partitioning, and the type of multi-type tree partitioning. direction (horizontal or vertical), type of multi-type tree partition (symmetric or asymmetric), tree (binary tree or ternary tree) structure of multi-type tree partition, prediction mode (intra-frame prediction or inter-frame prediction), luminance intra-frame prediction mode / direction, chrominance intra-frame prediction mode / direction, intra-frame partition information, inter-frame partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filtering method, reference sample filter taps, reference sample filter coefficients, prediction block filtering method, prediction block filter taps, prediction block filter coefficients, prediction block boundary filtering method, prediction block boundary filter taps, prediction block boundary filter coefficients, intra-frame prediction mode , inter prediction mode, motion information, motion vector, 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, motion vector candidate list, whether to use merge mode, merge index, merge candidate, merge candidate list, whether to use skip mode, interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, representation accuracy of motion vector, transform type, transform size, information on whether primary (first) transform is used, information on whether secondary transform is used, primary transform index, secondary transform index , information on whether a residual signal exists, coding block pattern, coding block flag (CBF), quantization parameter, quantization parameter residual, quantization matrix, whether to apply an intra-frame loop filter, intra-frame loop filter coefficients, intra-frame loop filter taps, intra-frame loop filter shape / form, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, whether to apply adaptive sample offset, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether to apply an adaptive loop filter, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form,Binarization / debinarization method, context model determination method, context model update method, whether to execute normal mode, whether to execute bypass mode, context binary bit, bypass binary bit, valid coefficient flag, last valid coefficient flag, encoding flag for unit of coefficient group, position of last valid coefficient, flag on whether the value of coefficient is greater than 1, flag on whether the value of coefficient is greater than 2, flag on whether the value of coefficient is greater than 3, information on remaining coefficient values, sign information, reconstructed luminance sample, reconstructed chrominance sample, residual luminance sample, residual chrominance sample, luminance transform coefficient, chrominance transform coefficient, quantized luminance level, quantized chrominance level, transform coefficient level scanning method, motion vector search area at decoder side domain size, shape of a motion vector search area at a decoder side, number of motion vector searches at a decoder side, information on a CTU size, information on a minimum block size, information on a maximum block size, information on a maximum block depth, information on a minimum block depth, image display / output order, slice identification information, slice type, slice partition information, tile identification information, tile type, tile partition information, tile group identification information, tile group type, tile group partition information, 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 quantization levels, and information on a luminance signal or information on a chrominance signal.

[0148] Here, signaling a flag or an index may mean entropy encoding the corresponding flag or index by an encoder and including it in a bitstream, and may mean entropy decoding the corresponding flag or index from the bitstream by a decoder.

[0149] When the encoding apparatus 100 performs encoding by inter-frame prediction, the encoded current image may be used as a reference image for another image that is subsequently processed. Therefore, 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.

[0150] The quantized level may be dequantized in the dequantization unit 160 or may be inversely transformed in the inverse transform unit 170. The dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient may be added to the prediction block by the adder 175. By adding the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient to the prediction block, a reconstructed block may be generated. Here, the dequantized or inversely transformed coefficient or the dequantized and inversely transformed coefficient may mean a coefficient on which at least one of dequantization and inverse transformation is performed, and may mean a reconstructed residual block.

[0151] The reconstructed block may pass through the filter unit 180. The filter unit 180 may apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed sample, the reconstructed block, or the reconstructed image. The filter unit 180 may be referred to as an in-loop filter.

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

[0153] In order to compensate for the coding error, a suitable offset value may be added to the sample value by using sample adaptive offset. Sample adaptive offset can correct the offset of the deblocked image from the original image in units of samples. A method of applying the offset in consideration of edge information about each sample may be used, or a method of partitioning the samples of the image into a predetermined number of regions, determining the region to which the offset is applied, and applying the offset to the determined region may be used.

[0154] The adaptive loop filter may perform filtering based on a comparison result of a filtered reconstructed image and an original image. Samples included in an image may be partitioned into predetermined groups, a filter to be applied to each group may be determined, and differential filtering may be performed on each group. Information on whether ALF is applied may be signaled by a coding unit (CU), and the form and coefficient of ALF to be applied to each block may vary.

[0155] 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 the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 180. The stored reference image may be used later in inter-frame prediction or motion compensation.

[0156] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment and to which the present invention is applied.

[0157] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.

[0158] Reference Figure 2 , the decoding device 200 may include an entropy decoding unit 210, a dequantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260 and a reference picture buffer 270.

[0159] The decoding device 200 may receive a bit stream output from the encoding device 100. The decoding device 200 may receive a bit stream stored in a computer-readable recording medium, or may receive a bit stream streamed through a wired / wireless transmission medium. The decoding device 200 may decode the bit stream by using an intra mode or an inter mode. In addition, the decoding device 200 may generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.

[0160] When the prediction mode used in decoding is the intra mode, the switch may be switched to the intra mode. Alternatively, when the prediction mode used in decoding is the inter mode, the switch may be switched to the inter mode.

[0161] The decoding device 200 can obtain a reconstructed residual block by decoding the input bit stream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 can 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.

[0162] The entropy decoding unit 210 may generate symbols by entropy decoding the bit stream according to the probability distribution. The generated symbols may include symbols in the form of quantized levels. Here, the entropy decoding method may be an inverse process of the above entropy encoding method.

[0163] In order to decode a transform coefficient level (a quantized level), the entropy decoding unit 210 may change a coefficient in a one-way vector form into a two-dimensional block form by using a transform coefficient scanning method.

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

[0165] When the intra mode is used, the intra prediction unit 240 may generate a predicted block by performing spatial prediction on the current block, wherein the spatial prediction uses sample values ​​of a block that is adjacent to the decoding target block and has 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 .

[0166] The adder 255 can generate a reconstructed block by adding the reconstructed residual block to the prediction block. The filter unit 260 can 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 can output the reconstructed image. The reconstructed block or the reconstructed image can be stored in the reference picture buffer 270 and used when performing inter-frame prediction. The reconstructed block processed by the filter unit 260 can be a part of the reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 260. The stored reference image can be used later in inter-frame prediction or motion compensation.

[0167] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded. Figure 3 An example of partitioning a single unit into a plurality of subordinate units is schematically shown.

[0168] In order to efficiently partition an image, a coding unit (CU) may be used when encoding and decoding. A coding unit may be used as a basic unit when encoding / decoding an image. In addition, a coding unit may be used as a unit for distinguishing an intra prediction mode from an inter prediction mode when encoding / decoding an image. A coding unit may be a basic unit for prediction, transformation, quantization, inverse transformation, inverse quantization, or encoding / decoding processing of a transformation coefficient.

[0169] Reference Figure 3 , the image 300 is partitioned sequentially according to the 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 the coding tree unit (CTU). Unit partitioning may mean partitioning a block associated with the unit. In the block partition information, information about the unit depth may be included. The depth information may indicate the number or degree of the unit being partitioned or both the number and degree of the unit being partitioned. A single unit may be partitioned into a plurality of subordinate units hierarchically associated with the depth information based on a tree structure. In other words, the unit and the subordinate units generated by partitioning the unit may correspond to a node and a child node of the node, respectively. Each of the partitioned subordinate units may have depth information. The depth information may be information indicating the size of a CU and may be stored in each CU. The unit depth indicates the number and / or degree associated with partitioning the unit. Therefore, the partition information of the subordinate unit may include information about the size of the subordinate unit.

[0170] The partition structure may represent the distribution of coding units (CUs) within the LCU 310. Such a distribution may be determined based on whether a single CU is partitioned into multiple (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.) CUs. The horizontal size and vertical size of the CUs generated by the partition may be half of the horizontal size and vertical size of the CU before the partition, respectively, or may have sizes smaller than the horizontal size and vertical size before the partition according to the number of partitions. The CU may be recursively partitioned into multiple CUs. Through recursive partitioning, at least one of the height and width of the CU after the partition may be reduced compared to at least one of the height and width of the CU before the partition. The partitioning of the CU may be recursively executed until a predefined depth or a predefined size. For example, the depth of the LCU may be 0, and the depth of the smallest coding unit (SCU) may be the predefined maximum depth. Here, as described above, the LCU may be a coding unit with the maximum coding unit size, and the SCU may be a coding unit with the smallest coding unit size. The partitioning starts from the LCU 310, and when the horizontal size or vertical size or both the horizontal size and vertical size of the CU are reduced by the partition, the CU depth is incremented by 1. For example, for each depth, the size of the unpartitioned CU may be 2N×2N. In addition, in the case of a partitioned CU, a CU with a size of 2N×2N may be partitioned into four CUs with a size of N×N. As the depth is incremented by 1, the size of N may be halved.

[0171] In addition, information indicating whether the CU is partitioned may be represented by using the partition information of the CU. The partition information may be 1-bit information. All CUs except the SCU may include the partition information. For example, when the value of the partition information is the first value, the CU may not be partitioned, and when the value of the partition information is the second value, the CU may be partitioned.

[0172] Referring Figure 3 , the LCU with a depth of 0 may be a 64×64 block. 0 may be the minimum depth. The SCU with a depth of 3 may be an 8×8 block. 3 may be the maximum depth. The CUs of the 32×32 block and the 16×16 block may be represented as depth 1 and depth 2, respectively.

[0173] For example, when a single coding unit is partitioned into four coding units, the horizontal size and vertical size of the four partitioned coding units may be half the size of the horizontal size and vertical size of the CU before the partition. In one embodiment, when a coding unit with a size of 32×32 is partitioned into four coding units, each of the four partitioned coding units may have a size of 16×16. When a single coding unit is partitioned into four coding units, it may be said that the coding unit may be partitioned in a quadtree form.

[0174] For example, when a 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 of size 32×32 is partitioned vertically 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 of size 8×32 is partitioned horizontally 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, the coding unit may be said to be partitioned into two or partitioned according to a binary tree partition structure.

[0175] 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 having a size of 16×32 is partitioned horizontally 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 partitioned vertically 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 the left sub-coding unit to the right sub-coding unit. When one coding unit is partitioned into three sub-coding units, the coding unit may be said to be partitioned into three sub-coding units or partitioned according to a ternary tree partition structure.

[0176] exist Figure 3 , a coding tree unit (CTU) 320 is an example of a CTU to which a quadtree partition structure, a binary tree partition structure, and a ternary tree partition structure are all applied.

[0177] As described above, in order to partition a CTU, at least one of a quadtree 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 a CTU according to a predetermined priority order. For example, a quadtree partition structure may be preferentially applied to a CTU. Coding units that can no longer be partitioned using a quadtree partition structure may correspond to leaf nodes of a quadtree. Coding units corresponding to leaf nodes of a 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 be further partitioned according to a binary tree partition structure or a ternary tree partition structure, or may not be further partitioned. Therefore, by preventing coding units obtained from binary tree partitions or ternary tree partitions of coding units corresponding to leaf nodes of a quadtree from undergoing further quadtree partitions, block partitioning operations and / or operations of signaling partition information may be effectively performed.

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

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

[0180] A tree structure in which there is no priority between binary tree partitions and ternary tree partitions is called a multi-type tree structure. A coding unit corresponding to a leaf node of a quadtree may be used as a root node of a multi-type tree. At least one of multi-type tree partition indication information, partition direction information, and partition tree information may be used to signal whether to partition a coding unit corresponding to a node of a multi-type tree. In order to partition a coding unit corresponding to a node of a multi-type tree, multi-type tree partition indication information, partition direction information, and partition tree information may be sequentially signaled.

[0181] The multi-type tree partition indication information having a first value (eg, '1') may indicate that the current coding unit will undergo multi-type tree partitioning. The multi-type tree partition indication information having a second value (eg, '0') may indicate that the current coding unit will not undergo multi-type tree partitioning.

[0182] When a coding unit corresponding to a node of a multi-type tree is further partitioned according to a 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 will 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 will be partitioned vertically. The partition direction information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned horizontally.

[0183] 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 to partition the node of the multi-type tree. The partition tree information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned according to a binary tree partition structure. The partition tree information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned according to a ternary tree partition structure.

[0184] The partition indication information, partition tree information and partition direction information may all be flags with a predetermined length (eg, one bit).

[0185] 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 / decoded. In order to entropy encode / decode those types of information, information about neighboring coding units adjacent to the current coding unit may be used. For example, there is a high probability that the partition type (partitioned or not partitioned, 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. Therefore, context information for entropy encoding / decoding the information about the current coding unit may be derived from the information about the neighboring coding units. The information about the neighboring coding units may include at least any one of the quadtree partition information, the multi-type tree partition indication information, the partition direction information, and the partition tree information.

[0186] As another example, among binary tree partitioning and ternary tree partitioning, binary tree partitioning may be preferentially performed. That is, the current coding unit may first undergo binary tree partitioning, and then the coding unit corresponding to the leaf node of the binary tree may be set as the root node for the ternary tree partitioning. In this case, for the coding unit corresponding to the node of the ternary tree, neither quadtree partitioning nor binary tree partitioning may be performed.

[0187] A coding unit that cannot be partitioned according to a quadtree partition structure, a binary tree partition structure, and / or a ternary tree partition structure becomes a basic unit for encoding, prediction, and / or transformation. That is, the coding unit cannot be further partitioned for prediction and / or transformation. Therefore, partition structure information and partition information for partitioning a coding unit into a prediction unit and / or a transformation unit may not exist in the bitstream.

[0188] However, when the size of the coding unit (ie, the basic unit for partitioning) is larger 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 smaller 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 transforming. For example, when the size of the coding unit is 32×64 and the size of the maximum transform block is 32×32, the coding unit may be partitioned into two 32×32 blocks for transforming. In this case, the partitioning of the coding unit for transforming is not separately signaled, and the partitioning of the coding unit for transforming may be determined by comparison between the horizontal size or vertical size of the coding unit and the horizontal size or 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 divided into two equal parts. For example, when the vertical size (height) of the coding unit is larger than the vertical size (height) of the maximum transform block, the coding unit may be horizontally divided into two equal parts.

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

[0190] Information on the minimum size of the coding unit corresponding to the leaf node of the quadtree (quadtree minimum size) and / or information on the maximum depth from the 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 an upper level of the coding unit. For example, the upper level may be a sequence level, a picture level, a slice level, a parallel block group level, a parallel block level, etc. Information on the minimum size of the quadtree and / or information on the maximum depth of the multi-type tree may be signaled or determined for each of the intra-picture slice and the inter-picture slice.

[0191] The difference information between the size of the CTU and the maximum size of the transform block may be signaled or determined at the upper level of the coding unit. For example, the upper level may be a sequence level, a picture level, a slice level, a parallel block group level, a parallel block level, etc. The 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 slice. For example, for an intra-picture slice, the maximum size of the ternary tree may be 32×32. For example, for an inter-picture slice, the maximum size of the ternary tree may be 128×128. For example, the minimum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the minimum size of the binary tree) and / or the minimum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the minimum size of the ternary tree) may be set to the minimum size of the coding block.

[0192] 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 slice level. Alternatively, the minimum size of the binary tree and / or the minimum size of the ternary tree may be signaled or determined at the slice level.

[0193] According to the sizes and depth information of the above-mentioned various blocks, quad partition information, multi-type tree partition indication information, partition tree information and / or partition direction information may or may not be included in the bitstream.

[0194] 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 quad partition information. The quad partition information may be inferred as the second value.

[0195] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is greater 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 into two or three partitions. Therefore, the multi-type tree partition indication information may not be signaled, but the multi-type tree partition indication information may be inferred as the second value.

[0196] Optionally, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is the same as the maximum size (horizontal size and vertical size) of the binary tree and / or is twice as large as the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be further partitioned into two or three partitions. Therefore, the multi-type tree partition indication information may not be sent by signal, but the multi-type tree partition indication information may be inferred as a second value. This is because when the coding unit is partitioned according to the binary tree partition structure and / or the ternary tree partition structure, a coding unit smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.

[0197] Optionally, the binary tree partition or ternary tree partition may be limited based on the size of the virtual pipeline data unit (hereinafter, the pipeline buffer size). For example, when the coding unit is divided into sub-coding units that do not fit the pipeline buffer size by the binary tree partition or ternary tree partition, the corresponding binary tree partition or ternary tree partition may be limited. The pipeline buffer size may be the size of the maximum transform block (e.g., 64×64). For example, when the pipeline buffer size is 64×64, the following division may be limited.

[0198] - N×M (N and / or M is 128) ternary tree partitions for coding units - 128×N (N<=64) binary tree partitions in the horizontal direction for coding units - N×128 (N<=64) binary tree partitions in the vertical direction for coding units Optionally, 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 partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be sent by a signal, but the multi-type tree partition indication information may be inferred as the second value.

[0199] Optionally, only when at least one of vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning is possible for a coding unit corresponding to a node of a multi-type tree, a multi-type tree partition indication information may be sent by a signal. Otherwise, the coding unit may not be partitioned into two and / or three partitions. Therefore, the multi-type tree partition indication information may not be sent by a signal, but the multi-type tree partition indication information may be inferred as a second value.

[0200] Optionally, only when both vertical binary tree partitioning and horizontal binary tree partitioning or both vertical ternary tree partitioning and horizontal ternary tree partitioning are possible for the coding unit corresponding to the node of the multi-type tree, the partition direction information can be sent by signal. Otherwise, the partition direction information may not be sent by signal, but the partition direction information may be inferred as a value indicating a possible partition direction.

[0201] Optionally, only when both vertical binary tree partitioning and vertical ternary tree partitioning or both horizontal binary tree partitioning and horizontal ternary tree partitioning are possible for a coding tree corresponding to a node of a multi-type tree, partition tree information may be signaled. Otherwise, partition tree information may not be signaled, but the partition tree information may be inferred as a value indicating a possible partition tree structure.

[0202] Figure 4 is a diagram illustrating an intra prediction process.

[0203] Figure 4 The arrows from the center to the outside in FIG. 1 represent the prediction direction of the intra prediction mode.

[0204] Intra-frame encoding 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-frame encoding and / or decoding may be performed by using values ​​of reference samples or encoding parameters included in the reconstructed neighboring blocks.

[0205] 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 of a size of 2×2, 4×4, 16×16, 32×32, or 64×64, etc., or may be a rectangular block of a size of 2×8, 4×8, 2×16, 4×16, and 8×16, etc.

[0206] 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 determined differently according to 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.

[0207] Regardless of the block size, the number of intra-frame prediction modes can be fixed to N. Alternatively, the number of intra-frame prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65 or 67, etc. Optionally, the number of intra-frame prediction modes can 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-frame prediction modes can 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-frame prediction modes can increase. Optionally, the number of intra-frame prediction modes of the luminance component block can be greater than the number of intra-frame prediction modes of the chrominance component block.

[0208] 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, which is greater than 1, including non-angle modes and angle modes. In order to perform intra prediction on a current block, a step of determining whether a sample included in a reconstructed neighboring block can be used as a reference sample 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 interpolating at least one sample value included in the reconstructed neighboring block, or by both copying and interpolating, may be used to replace the unavailable sample value of the sample, so that the replaced sample value is used as the reference sample of the current block.

[0209] Figure 7 is a diagram showing reference samples that can be used for intra prediction.

[0210] like Figure 7 As shown in , at least one of the reference sample line 0 to the reference sample line 3 can be used for intra prediction of the current block. Figure 7 In , the samples of fragment A and fragment F can be filled with the samples of the closest fragment B and fragment E, respectively, instead of retrieving from the reconstructed neighboring blocks. The index information indicating the reference sample line to be used for intra prediction of the current block can be sent by signaling. For example, in Figure 7 In the example, reference sample line indicators 0, 1, and 2 may be signaled as index information indicating reference sample line 0, reference sample line 1, and reference sample line 2. When the upper boundary of the current block is the boundary of the CTU, only reference sample line 0 may be available. Therefore, in this case, index information may not be signaled. When reference sample lines other than reference sample line 0 are used, filtering for a prediction block, which will be described later, may not be performed.

[0211] When intra prediction is performed, a filter may be applied to at least one of a reference sample and a prediction sample based on an intra prediction mode and a current block size.

[0212] In the case of the planar mode, when generating a prediction block of the current block, according to the position of the prediction target sample within the prediction block, the sample value of the prediction target sample may be generated by using the weighted sum of the upper reference sample and the left reference sample of the current sample and the upper right reference sample and the lower left reference sample of the current block. In addition, in the case of the DC mode, when generating the prediction block of the current block, the average value of the upper reference sample and the left reference sample of the current block may be used. In addition, in the case of the angular mode, the prediction block may be generated by using the upper reference sample, the left reference sample, the upper right reference sample and / or the lower left reference sample of the current block. In order to generate the prediction sample value, interpolation of real number units may be performed.

[0213] In the case of intra prediction between color components, a prediction block of a current block of a second color component may be generated based on a corresponding reconstruction 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 a template. The template may include upper and / or left neighboring samples of the current block and upper and / or left neighboring samples of a reconstruction block of the first color component corresponding thereto. For example, the sample value of the first color component having the maximum value among the samples 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 minimum value among the samples in the template and the sample value of the second color component corresponding thereto may be used to derive the parameters of the linear model. When deriving the parameters of the linear model, the corresponding reconstruction block may be applied to the linear model to generate a prediction block of the current block. Depending on the video format, subsampling may be performed on the neighboring samples of the reconstruction block of the first color component and the corresponding reconstruction block. For example, when one sample of the second color component corresponds to four samples of the first color component, the four samples of the first color component may be subsampled to calculate one corresponding sample. In this case, parameter derivation of a linear model and intra prediction between color components may be performed based on the corresponding subsampled samples. Whether to perform intra prediction between color components and / or the range of the template may be signaled as an intra prediction mode.

[0214] The current block may be partitioned into two sub-blocks or four sub-blocks in the horizontal direction or the vertical direction. The partitioned sub-blocks may be reconstructed sequentially. That is, intra prediction may be performed on the sub-block to generate a sub-prediction block. In addition, 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. The sub-block may be a block including 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. In addition, 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 on whether intra prediction is performed based on sub-blocks and / or partition directions (horizontal or vertical) may be sent by a signal. Intra prediction based on sub-blocks may be performed only when reference sample line 0 is used. When subblock-based intra prediction is performed, filtering for a prediction block, which will be described later, may not be performed.

[0215] The final prediction block can be generated by performing filtering on the prediction block predicted by the intra-frame. Filtering can be performed by applying predetermined weights to the filtering target samples, the left reference samples, the upper reference samples and / or the upper left reference samples. The weights and / or reference samples (range, position, etc.) used for filtering can be determined based on at least one of the block size, the intra-frame prediction mode and the position of the filtering target samples in the prediction block. Filtering can be performed only in the case of a predetermined intra-frame prediction mode (e.g., DC, plane, vertical, horizontal, diagonal and / or adjacent diagonal mode). The adjacent diagonal mode can be a mode in which k is added to the diagonal mode or k is subtracted from the diagonal mode. For example, k can be a positive integer of 8 or less.

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

[0217] Figure 5 is a diagram illustrating an embodiment of an inter-picture prediction process.

[0218] exist Figure 5 In , a rectangle can represent a picture. Figure 5In FIG. 1 , the arrow indicates the prediction direction. According to the encoding type of the picture, the picture can be classified into an intra picture (I picture), a predicted picture (P picture) and a bi-predicted picture (B picture).

[0219] An I picture may be encoded by intra prediction without requiring inter-picture prediction. A P picture may be encoded by inter-picture prediction using a reference picture existing in one direction (i.e., forward or backward) relative to the current block. A B picture may be encoded by inter-picture prediction using a reference picture existing in two directions (i.e., forward and backward) relative to the 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.

[0220] Hereinafter, embodiments of inter-picture prediction will be described in detail.

[0221] Reference pictures and motion information may be used to perform inter-picture prediction or motion compensation.

[0222] The motion information of the current block may be derived during inter-picture prediction by each of the encoding device 100 and the decoding device 200. The motion information of the current block may be derived by using the motion information of a reconstructed neighboring block, the motion information of a co-located block (also referred to as a col block or a co-located block), and / or the motion information of a block adjacent to the co-located block. The co-located block may represent a block in a previously reconstructed co-located picture (also referred to as a col picture or a co-located picture) that is spatially located at the same position as the current block. The co-located picture may be one of the one or more reference pictures included in the reference picture list.

[0223] 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 inter prediction include AMVP mode, merge mode, skip mode, merge mode with motion vector difference, sub-block merge mode, geometric partition mode, combined inter-intra prediction mode, affine mode, etc. Here, the merge mode may be referred to as motion merge mode.

[0224] For example, when AMVP is used as a 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 for the current block may be derived by using the generated motion vector candidate list. The motion information of the current block may be determined based on the derived motion vector candidate. 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.

[0225] The encoding device 100 may calculate a motion vector difference (MVD) between a motion vector of a current block and a motion vector candidate, and may perform entropy encoding on the motion vector difference (MVD). In addition, the encoding device 100 may perform entropy encoding on a motion vector candidate index and generate a bitstream. The motion vector candidate index may indicate the best motion vector candidate among the motion vector candidates included in the motion vector candidate list. The decoding device may perform entropy decoding on the motion vector candidate index included in the bitstream, and may select a motion vector candidate for a decoding target block from the motion vector candidates included in the motion vector candidate list by using the entropy-decoded motion vector candidate index. In addition, the decoding device 200 may add the entropy-decoded MVD to the motion vector candidate extracted by entropy decoding, thereby deriving a motion vector of the decoding target block.

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

[0227] In addition, the encoding device 100 calculates a motion vector difference (MVD) between a motion vector in the current block and a motion vector candidate based on an affine model, and performs entropy encoding on the MVD. The decoding device 200 derives a motion vector based on each sub-block by deriving an affine controlled motion vector of a decoding target block according to the sum of the entropy-decoded MVD and the affine controlled motion vector candidate.

[0228] 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 as a bitstream to the decoding apparatus 200. The decoding apparatus 200 may generate a prediction block of a decoding target block based on the derived motion vector and the reference picture index information.

[0229] 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 multiple blocks. The merge mode may represent a mode of deriving motion information of a current block from motion information of neighboring blocks. When the merge mode is applied, the motion information of reconstructed neighboring blocks and / or the motion information of the same-positioned blocks may be used to generate a merge candidate list. 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).

[0230] 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 the following: 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 combining motion information present in the merge candidate list, motion information of a block encoded / decoded before the current block (history-based merge candidate), and a zero merge candidate.

[0231] The encoding device 100 may generate a bitstream by performing entropy encoding on at least one of a merge flag and a merge index, and may signal the bitstream to the decoding device 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 neighboring block among 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 on 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.

[0232] In addition, the encoding device 100 performs entropy encoding on the correction information for correcting the motion vector in the motion information of the merge candidate, and transmits it to the decoding device 200 by signal. The decoding device 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 merge candidate is corrected based on the correction information transmitted by the signal may be referred to as a merge mode with a motion vector difference.

[0233] The skip mode may be a mode in which the motion information of the 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's motion information is to be used as the 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 a syntax element regarding at least any one of the motion vector difference information, the coded block flag, and the transform coefficient level to the decoding apparatus 200.

[0234] The subblock merge mode may represent a mode for deriving motion information in units of subblocks of a coding block (CU). When the subblock merge mode is applied, the subblock merge candidate list may be generated using motion information of a subblock co-located with the current subblock in a reference image (subblock-based temporal merge candidates) and / or affine control point motion vector merge candidates.

[0235] The geometric partition mode may denote a mode in which motion information is derived by partitioning the current block in a predetermined direction, each prediction sample is derived using each of the derived motion information, and a prediction sample of the current block is derived by weighting each of the derived prediction samples.

[0236] The inter-intra combined prediction mode may mean a mode of deriving a prediction sample of a current block by weighting a prediction sample generated by inter prediction and a prediction sample generated by intra prediction.

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

[0238] The decoding apparatus 200 may compensate for prediction samples derived through inter-frame prediction using optical flow.

[0239] Figure 6 is a diagram illustrating transform and quantization processing.

[0240] like Figure 6 As shown in , a transform process and / or a quantization process is performed on the residual signal to generate a quantized level signal. The residual signal is the difference between the original block and the prediction block (i.e., an intra-frame prediction block or an inter-frame prediction block). The prediction block is a block generated by intra-frame prediction or inter-frame prediction. The transform can be a primary transform, a secondary transform, or both a primary transform and a secondary transform. The primary transform of the residual signal generates transform coefficients, and the secondary transform of the transform coefficients generates secondary transform coefficients.

[0241] At least one scheme selected from various predefined transform schemes is used to perform the primary transform. For example, examples of the predefined transform schemes include discrete cosine transform (DCT), discrete sine transform (DST) and Karhunen-Loève transform (KLT). The transform coefficients generated by the primary transform may undergo a secondary transform. The transform scheme used for the primary transform and / or the secondary transform may be determined based on the coding parameters of the current block and / or the neighboring blocks of the current block. Optionally, transform information indicating the transform scheme may be sent by a signal. DCT-based transforms may include, for example, DCT-2, DCT-8, etc. DST-based transforms may include, for example, DST-7.

[0242] A quantized level signal (quantized coefficient) may be generated by performing quantization on a residual signal or on a result of performing a primary transform and / or a secondary transform. Depending on the intra prediction mode of the block or the block size / shape, the quantized level signal may be scanned according to at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning. For example, when the coefficients are scanned according to a diagonal upper right scan, the coefficients in block form are changed to a one-dimensional vector form. In addition to the diagonal upper right scan, horizontal scanning that scans the coefficients in two-dimensional block form horizontally or vertical scanning that scans the coefficients in two-dimensional block form vertically 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 a bitstream.

[0243] The decoder performs entropy decoding on the bit stream to obtain quantized level coefficients. The quantized level coefficients can be arranged in a two-dimensional block form by inverse scanning. For inverse scanning, at least one of diagonal upper right scanning, vertical scanning, and horizontal scanning can be used.

[0244] The quantized level coefficients may then be dequantized, then inversely transformed secondary if necessary, and finally inversely transformed primary if necessary to generate a reconstructed residual signal.

[0245] Inverse mapping in the dynamic range can be performed for the luminance component reconstructed by intra-frame prediction or inter-frame prediction before in-loop filtering. The dynamic range can be divided into 16 equal segments, and the mapping function for each segment can be sent by signal. The mapping function can be sent by signal at the slice level or parallel block group level. The inverse mapping function for performing inverse mapping can be derived based on the mapping function. In-loop filtering, reference picture storage and motion compensation are performed in the inverse mapping area, and the prediction block generated by inter-frame prediction is converted to the mapping area via mapping using the mapping function, and then used to generate the reconstructed block. However, since intra-frame prediction is performed in the mapping area, the prediction block generated by intra-frame prediction can be used to generate the reconstructed block without mapping / inverse mapping.

[0246] When the current block is a residual block of a chrominance component, the residual block can be transformed to the inverse mapped region by performing scaling on the chrominance component of the mapped region. The availability of the scaling can be signaled at the slice level or at the parallel block group level. The scaling can be applied only when the mapping for the luminance component is available and the partitioning of the luminance component and the partitioning of the chrominance component follow the same tree structure. The scaling can be performed based on the average of the sample values of the luminance prediction block corresponding to the chrominance difference block. In this case, when inter prediction is used for the current block, the luminance prediction block can represent the mapped luminance prediction block. The value required for scaling can be derived by using the index reference lookup table of the segment to which the average of the sample values of the luminance prediction block belongs. Finally, by scaling the residual block using the derived value, the residual block can be transformed to the inverse mapped region. Then, chrominance component block recovery, intra prediction, inter prediction, in-loop filtering, and reference picture storage can be performed in the inverse mapped region.

[0247] The information indicating whether the mapping / inverse mapping of the luminance component and the chrominance component is available can be signaled via the sequence parameter set.

[0248] A prediction block for the current block can be generated based on the block vector indicating the displacement between the current block in the current picture and the reference block. In this way, the prediction mode for generating the prediction block by referring to the current picture is referred to as the intra block copy (IBC) mode. The IBC mode can be applied to M×N (M <= 64, N <= 64) coding units. The IBC mode can include a skip mode, a merge mode, an AMVP mode, etc. 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 specified merge candidate can be used as the block vector of the current block. The merge candidate list can include at least one of a spatial candidate, a history-based candidate, a candidate based on the average of two candidates, and a zero merge candidate. In the case of the AMVP mode, a differential block vector can be signaled. In addition, the prediction block vector can be derived from the left neighboring block and the upper neighboring block of the current block. The index of the neighboring block to be used can be signaled. The prediction block in the IBC mode is included in the current CTU or the left CTU and is limited to the blocks in the already reconstructed region. For example, the value of the block vector can be restricted so that the prediction block of the current block is located in the region of three 64×64 blocks before the 64×64 block to which the current block belongs in the coding / decoding order. By restricting the value of the block vector in this way, the memory consumption and device complexity according to the IBC mode implementation can be reduced.

[0249] Figure 8a is a flowchart showing an image coding method according to an embodiment of the present invention, Figure 8b is a flowchart showing an image decoding method according to an embodiment of the present invention.

[0250] Hereinafter, the encoding / decoding method of the present disclosure will be described.

[0251] A single picture may be encoded using at least one of intra prediction, inter prediction, or intra block copy prediction methods.

[0252] When the luma component and the chroma component have independent block partition structures (ie, dual tree structures) or when the luma component and the chroma component have the same block partition structure (ie, single tree structure), an intra block copy prediction-based encoding / decoding method may be used.

[0253] The intra block copy prediction method may refer to a method of deriving a prediction block from an encoding / decoding area in the same picture (ie, intra frame) using a derived block vector.

[0254] When a block to be currently encoded / decoded (i.e., a current block) is encoded / decoded using an intra block copy prediction method and the derived block vector is (x, y), a block having the same size as the current block, being x pixels apart from the current block in the horizontal direction (i.e., if x is a positive integer, x pixels to the right in the horizontal direction, and if x is a negative integer, -x pixels to the left in the horizontal direction) and being y pixels apart from the current block in the vertical direction (i.e., if y is a positive integer, y pixels down in the vertical direction, and if y is a negative integer, -y pixels up in the vertical direction) may be used as a prediction block of the current block. For example, Fig. 9 2 is a diagram showing a relationship between a current block and a predicted block according to an embodiment of the present invention. Fig. 9 , when x and y are negative integers and the upper left sample point position of the current block is (x0, y0), the upper left sample point position of the prediction block of the current block is (x0+x, y0+y).

[0255] If the current luma component block uses intra block copy prediction, one of the following methods may be used to encode / decode the block.

[0256] The intra block copy-based skip mode, which derives a block vector of a current block from a block vector of a block encoded / decoded before the current block, is similar to the skip mode in the intra prediction method, and there is no residual signal.

[0257] The intra block copy-based merge mode in which a block vector of a current block is derived from a block vector of a block encoded / decoded before the current block is similar to the merge mode in the inter prediction method, and there is a residual signal.

[0258] The intra block copy based AMVP mode for encoding a block vector is similar to the AMVP mode of the inter prediction method.

[0259] According to an embodiment, the encoding mode of the current luma component block may be derived in a decoder as follows.

[0260] At least one of the encoding information described below may be used to determine an encoding mode of a current luminance component block, and at least one of the encoding information may be included in a bitstream and transmitted in the bitstream.

[0261] The encoding information may include information indicating that the luma component block is in the skip mode (eg, a skip mode identifier, a flag, an index, skip_flag, cu_skip_flag, etc.).

[0262] When the information indicating the skip mode has a specific value, this indicates that the luma component block is in skip mode. For example, if the identifier, flag, or index has 1 as a first value, this indicates that the luma component block is in skip mode, and if the identifier, flag, or index has 0 as a second value, this indicates that the luma component block is not in skip mode.

[0263] The encoding information may include prediction mode information (eg, index, identifier, flag, etc.) of the luma component block. The prediction mode information may include intra prediction mode, inter prediction mode, and intra block copy.

[0264] For example, the syntax indicating the prediction mode information having a first value of 0 indicates that the intra prediction mode is applied, the syntax having a second value of 1 indicates that the inter prediction mode is applied, and the syntax having a third value of 2 indicates that the intra block copy prediction mode is applied.

[0265] In addition, for example, the first prediction mode information (e.g., index, flag, identifier, pred_mode_flag, etc.) may indicate the intra prediction mode. The first prediction mode information having a first value of 1 indicates that the intra prediction mode is applied, and the first prediction mode information having a second value of 0 indicates that the intra prediction mode is not applied. If the intra prediction mode is not applied, the second prediction mode information (e.g., index, flag, identifier, pred_mode_ibc_flag, etc.) may be received to indicate whether the inter prediction mode or the intra block copy prediction is applied. The second prediction mode information having a first value of 1 may indicate that the intra block copy prediction mode is applied, and the second prediction mode information having a second value of 0 may indicate that the inter prediction mode is applied.

[0266] The encoding information may include information indicating that the luma component block is in the merge mode (eg, a merge mode identifier, a flag, an index, merge_flag, etc.).

[0267] When the current luminance component block is not in skip mode but in intra block copy mode, a merge mode with a specific mode may indicate a merge mode. For example, an identifier, a flag, or an index with a first value of 1 may indicate that the merge mode is applied, and an identifier, a flag, or an index with a second value of 0 may indicate that the merge mode is not applied.

[0268] The encoding information may be used to determine the encoding mode of the current luma component block as follows.

[0269] For example, when the luma component block is in skip mode and the parallel block group, slice or parallel block belongs to type I, the prediction mode information may not be received and the block may be determined as a skip mode based on intra block copy. For example, the prediction modes available when the parallel block group, slice or parallel block is type I include intra prediction mode and intra block copy prediction mode, and the skip mode does not exist in the intra prediction mode. Therefore, when the luma component block is in skip mode and the corresponding parallel block group, slice or parallel block is type I, the corresponding block may be determined as a skip mode based on intra block copy.

[0270] In addition, for example, when the luma component block is in skip mode and the tile group, slice, or tile does not belong to type I, prediction mode information may be received. At this time, when it is determined based on the prediction mode information that the luma component block is in intra block copy prediction mode, it may be determined that the luma block is in intra block copy-based skip mode.

[0271] In addition, for example, when the luma component block is not in skip mode and it is determined based on the prediction mode information that the luma component block is in intra block copy prediction mode, information indicating a merge mode may be received. Alternatively, for example, when the luma component block is not in skip mode, information indicating a merge mode may be received. At this time, when the information indicating the merge mode indicates that the luma component block is in merge mode, it may be determined that the luma component block is in an intra block copy-based merge mode.

[0272] In addition, for example, when the luma component block is not in the skip mode and is not in the merge mode but in the intra block copy prediction mode, it can be determined that the luma component block is in the intra block copy AMVP mode. For example, it can be determined based on the information indicating the merge mode whether the prediction mode for the luma component block is in the merge mode based on the intra block copy or the AMVP mode based on the intra block copy. Here, the information indicating the merge mode can indicate whether the inter-frame prediction encoding parameters of the current block are derived from the inter-frame prediction encoding parameters of the neighboring blocks adjacent to the current block.

[0273] In the decoder, the coding mode of the current luminance component block or the current chrominance component block may be derived as follows.

[0274] When the luma component and the chroma component have the same block partition structure (ie, a single tree structure), the encoding mode may be determined as follows.

[0275] For example, the prediction mode (eg, intra prediction, inter prediction, or intra block copy prediction) of a chroma component block may be equal to the prediction mode of a luma component block corresponding to the chroma component block.

[0276] In addition, for example, when the corresponding luminance component block is in a skip mode based on intra-block copying, the residual signal may not be encoded / decoded and transmitted in the chrominance component block. At this time, information indicating that the residual signal is not transmitted (e.g., cu_cbf, tu_cbf, etc.) may not be transmitted in the bitstream.

[0277] In addition, for example, when the luminance component and the chrominance component have the same block partition structure and the current chrominance component block is in the intra block copy prediction mode (or when the luminance component block corresponding to the current chrominance component block is in the intra block copy prediction mode), information required for encoding / decoding the current chrominance component block can be derived from the encoding / decoding information of the luminance component block corresponding to the current chrominance component block.

[0278] When the luminance component and the chrominance component have an independent block partition structure (i.e., a dual tree structure), the prediction mode of the chrominance component block may be determined from the prediction mode information of the chrominance component block included in the bitstream and transmitted in the bitstream. The prediction mode of the chrominance component block may include an intra-frame prediction mode, an inter-frame prediction mode, an intra-frame block copy prediction mode, etc., as in the prediction mode of the luminance component block.

[0279] For example, the syntax indicating the prediction mode information having a first value of 0 may indicate the intra prediction mode, the syntax having a second value of 1 may indicate the inter prediction mode, and the syntax having a third value of 2 may indicate the intra block copy prediction mode.

[0280] In addition, for example, the first prediction mode information (e.g., index, flag, identifier, pred_mode_flag, etc.) may indicate whether the prediction mode of the chroma component block is an intra-frame prediction mode or an inter-frame prediction mode. The first prediction mode information having a first value of 1 may indicate the intra-frame prediction mode, and the first prediction mode information having a second value of 0 may indicate the inter-frame prediction mode. In addition, the second prediction mode information (e.g., index, flag, identifier, pred_mode_ibc_flag, etc.) may be transmitted or derived, the second prediction mode information having a first value of 1 may indicate that the intra-frame block copy mode is applied, and the second prediction mode information having a second value of 0 may indicate that the prediction mode of the chroma component block is determined to be the intra-frame prediction mode or the inter-frame prediction mode determined in the first prediction mode information.

[0281] In addition, for example, second prediction mode information (e.g., index, flag, identifier, pred_mode_ibc_flag, etc.) may be sent or derived, second prediction mode information having a first value of 1 may indicate an intra block copy mode, and second prediction mode information having a second value of 0 may indicate an intra prediction mode.

[0282] When the luma component and the chroma component have independent block partition structures and the current chroma component block is in an intra block copy prediction mode, information required for encoding / decoding the current chroma component block (e.g., a block vector, etc.) can be derived from encoding / decoding information of the luma component block corresponding to the current chroma component block.

[0283] Hereinafter, the steps of deriving a block vector for intra block copy prediction will be described.

[0284] The step of deriving a block vector for intra block copy prediction may include at least one of a step of deriving a block vector of a luma component block and a step of deriving a block vector of a chroma component block.

[0285] Hereinafter, the steps of deriving a block vector of a luminance component block will be described.

[0286] According to an embodiment, a method of deriving a block vector when a current block is a luma component block and is encoded in an intra block copy based skip mode or an intra block copy based merge mode will be described below.

[0287] In order to derive the block vector of the luminance component block, a block vector candidate list may be constructed from block vector candidates of the luminance component block encoded / decoded before the current block, and one of the candidates in the constructed block vector candidate list may be used as the block vector of the current block. At this time, information (e.g., identifier, index, flag, merge_idx, etc.) for identifying the candidates in the block vector candidate list may be derived or encoded / decoded based on the encoding parameters transmitted in the bitstream.

[0288] The block vector candidate list may consist of a maximum of N candidates. At this time, N may be a positive integer including 0. In addition, one or more candidates described below may be included in the block vector candidate list.

[0289] Fig.10 2 is a diagram showing neighboring blocks adjacent to a current block according to an embodiment of the present invention. Fig.10 , a block vector may be derived from at least one of a block B1 adjacent to an upper end of the current block X, a block A1 adjacent to a left side of the current block, a block B0 located at an upper right corner of the current block, a block B2 located at an upper left corner of the current block, or a block A0 located at a lower left corner of the current block, and the derived block vector may be determined as a block vector candidate of the current block.

[0290] For example, if block vectors exist in all blocks A1, B1, B0, and A0, block B2 located at the upper left corner of the current block may not be used as a block vector candidate.

[0291] In addition, for example, it may be determined whether a block vector exists in each of the blocks A0, A1, B0, B1, and B2 according to a predetermined priority order (i.e., whether the block is encoded / decoded using the intra block copy prediction method), and if the block vector exists, the block vector of the block may be determined as a vector candidate. At this time, the predetermined priority order of the block vector candidate list may be A1, B1, B0, A0, and B2.

[0292] The block vector candidate list may be constructed by a predetermined priority order, and a redundancy check between block vector candidates existing in the block vector candidate list and a newly added block vector candidate may be performed.

[0293] For example, when the block vector candidate list is constructed in the order of A1, B1, B0, A0, and B2, a redundancy check between block B1 and block A1 may be performed, and a redundancy check between block B0 and block B1 may be performed. In addition, a redundancy check between block A0 and block A1 may be performed, and a redundancy check between block B2 and blocks A1 and B1 may be performed. The redundancy check may be performed only when the block vector exists in the block.

[0294] Furthermore, for example, a redundancy check may be performed between the block vector to be added and all block vectors present in the block vector candidate list.

[0295] When a block vector exists in at least one of blocks A0, A1, B0, B1, and B2, it may be determined whether the block vector of the block is available in the current block, and if available, the block vector of the neighboring block may be determined as a block vector candidate. If not available, the block vector of the neighboring block may not be used as a block vector candidate. At this time, whether the block vector is available may be determined according to whether the reference sample (block) at the position indicated by the block vector is available.

[0296] The block vectors of the blocks encoded / decoded before the current block may be stored in a buffer, and at least one of the block vectors stored in the buffer may be determined as a block vector candidate. At this time, the intra block vectors may be stored in a buffer having a specific size in the order of encoding / decoding, and if the buffer is full, the first stored block vector may be deleted and a new (i.e., recently encoded / decoded) block vector may be stored. When the block vector candidate list may be constructed in the order of the block vectors stored in the buffer (e.g., from the oldest to the newest or from the newest to the oldest), the priority order may be changed. For example, the block vectors may be included in the block vector candidate list from the block vector most recently stored in the buffer to the block vector first stored in the buffer or from the block vector first stored in the buffer to the block vector most recently stored in the buffer. The block vector candidates may be referred to as history-based block vector candidates.

[0297] When a block vector candidate list is constructed using at least one of the history-based block vector candidates, it may be determined whether the history-based block vector candidate is available in the current block, and if available, the candidate may be added to the block vector candidate list. At this time, whether the history-based block vector is available may be determined based on whether a reference sample (block) at a position indicated by the block vector is available.

[0298] When a block vector candidate list is constructed using at least one of the history-based block vector candidates, a redundancy check may be performed between the history-based block vector candidate and the block vector candidates in the block vector candidate list, and if the same block vector does not exist as a result of the redundancy check, the history-based block vector candidate may be added to the block vector candidate list.

[0299] For example, when a block vector candidate list is constructed using at least one of the history-based block vector candidates, a predetermined candidate among the history-based block vector candidates may be added to the block vector candidate list without performing a redundancy check with the block vector candidates in the block vector candidate list. For example, the predetermined candidate may represent a block vector candidate other than the first candidate among the history-based block vector candidates. Here, the first candidate may represent a block vector candidate first or most recently stored in the history-based block vector list composed of the history-based block vector candidates.

[0300] In addition, for example, when constructing a block vector candidate list using at least one of the history-based block vector candidates, a redundancy check may be performed on a predetermined candidate among the history-based block vector candidates against the block vector candidates in the block vector candidate list. When there is no identical block vector as a result of performing the redundancy check, the predetermined candidate may be added to the block vector candidate list. For example, the predetermined candidate may represent the first candidate among the history-based block vector candidates. Here, the first candidate may represent the block vector candidate that was most recently stored in the history-based block vector list composed of the history-based block vector candidates.

[0301] A buffer including history-based block vector candidates may be maintained and used in units of pictures, slices, parallel blocks, CTUs, CTU rows, or CTU columns during encoding / decoding. In addition, the buffer may include at least one piece of encoding information among the encoding information of the blocks that were encoded / decoded before the current block in units of pictures, slices, parallel blocks, CTUs, CTU rows, or CTU columns.

[0302] When at least two block vector candidates among the block vector candidates in the block vector candidate list can be used to construct a combined block vector candidate. At this time, when constructing the combined block vector candidate, the history-based block vector candidates may not be used. At this time, when constructing the combined block vector candidate, the block vector candidates of adjacent neighboring blocks may not be used. At this time, it may be determined whether the combined block vector candidate composed of the block vector candidates is available, and the combined block vector candidate may be used only when it is available. At this time, it may be determined whether the block vector is available based on whether the reference sample (block) at the position indicated by the block vector is available.

[0303] If the width of the current luma block is W and the height of the current luma block is H, then (- (W << n) + a, - (H << n) + b), (- (W << n) + c, 0), or (0, - (H << n) + d) may be included in the block vector candidate list as block vector candidates. At this time, n may be a positive integer greater than 0, and a, b, c, and d may have integer values. The block vector candidate may be referred to as a fixed basic block vector candidate.

[0304] The block vector candidate list may be constructed in a predetermined order using at least one of the block vectors of adjacent neighboring block candidates, history-based block vector candidates, combined block vector candidates, and fixed basic block vector candidates.

[0305] Here, referring to Fig.10 , the adjacent neighboring blocks may be at least one of A0 or A1 and at least one of B0, B1, or B2.

[0306] For example, a block vector candidate list may be constructed in the order of block vectors of adjacent neighboring block candidates, history-based block vector candidates, combined block vector candidates, and fixed basic block vector candidates.

[0307] In addition, for example, fixed basic block vectors may be constructed in the following order until the number of candidates in the block vector candidate list satisfies the maximum number (or the maximum number of block vector candidates).

[0308] 1. (-(W << 1), 0) 2. (0, -(H << 1)) 3. (-(W << 1) - 1, 0) 4. (0, -(H << 1) - 1) 5. (-(W << 1) - 2, 0) 6. (0, -(H << 1) - 2) 7. (-(W << 1) - 3, 0) 8. (0, -(H << 1) - 3) 9. (-(W << 1) - 4, 0) 10. (0, -(H << 1) - 4) Optionally, the fixed basic block vector may be the vector (0, 0), and a block vector candidate list with the maximum number of candidates may be constructed by adding the fixed basic block vector until the number of candidates in the block vector candidate list satisfies the maximum number. For example, if the number of block vector candidates added to the block vector candidate list using block vectors of adjacent neighboring blocks, history-based block vectors, combined block vectors, etc. is less than the maximum number N of block vector candidates, the fixed basic block vector may be added to the block vector candidate list until the maximum number of block vector candidates is satisfied. At this time, the fixed basic block vector may be the vector (0, 0).

[0309] When constructing the block vector candidate list, the number of history-based block vector candidates that may be included in the block vector candidate list may be the maximum number N of block vector candidates or (N - m). m may be an integer greater than 0.

[0310] When partitioning a higher-level block and encoding / decoding each block in the skip mode based on intra-block copy or the merge mode based on intra-block copy, if at least one of the blocks partitioned from the higher-level block is smaller than a predetermined threshold or critical value, the partitioned blocks may share and use the block vector candidate list constructed in the higher-level block.

[0311] When determining whether to share the block vector candidate list constructed in the higher-level block, when using the width and height of the higher-level block, the block vector candidate list constructed in the higher-level block may be used for the partitioned blocks when the following conditions are satisfied.

[0312] Quadtree partition: (width of parent block × height of parent block) / 4<threshold Horizontal or vertical binary tree partition: (width of parent block × height of parent block) / 2<threshold Ternary tree: (width of parent block × height of parent block) / 4<threshold The threshold may be predetermined in the encoder / decoder or signaled from the encoder to the decoder.

[0313] Fig.11 is a diagram illustrating a current block partitioned when a predetermined threshold is 32 according to an embodiment of the present invention.

[0314] Reference Fig.11 , if the area of ​​the lower block of at least one of the quadtree partition, the vertical or horizontal binary partition, and the ternary tree partition of the upper block is less than 32, the above conditions are satisfied, and each lower block is encoded / decoded in the intra-block copy-based skip mode or the intra-block copy-based merge mode, then the lower block can be encoded / decoded using a block vector candidate list, wherein the block vector candidate list includes history-based block vector candidates and block vectors of neighboring blocks (e.g., A1, B1, B0, A0, and B2) encoded / decoded before the upper block at the position of the upper block and stored in the buffer, and a fixed basic block vector derived from the width and height of the upper block.

[0315] When the width and height of the current block are equal to or less than a predetermined value, the predetermined vector candidate may not be allowed as a block vector candidate.

[0316] Reference Fig.11 , when the width and height of the current block are 4×4 (or when the product of the width and height of the current block is less than or equal to 16), block vectors of neighboring blocks may not be allowed as block vector candidates.

[0317] At this time, at least one of history-based block vectors, combined block vectors or fixed basic block vectors may be used to construct the block vector candidate list. For example, the block vector candidate list may be constructed using only history-based block vectors or only history-based block vectors and fixed basic block vectors.

[0318] In addition, at this time, the update process of the history-based block vector candidate list may not be performed. For example, when the width and height of the current block are 4×4 (or when the product of the width and height of the current block is less than or equal to 16), the encoded / decoded block vector of the current block may not be added to the history-based block vector candidate list.

[0319] Furthermore, the block vector candidate list may be constructed using encoded / decoded history-based block vector candidates in previous upper blocks.

[0320] When the block vector candidate list constructed in the upper block is shared and used, the prediction block indicated by the block vector of the lower block may not be located in the upper block.

[0321] For example, Fig.12 2 is a diagram illustrating a process of sharing and using a block vector candidate list constructed in a superior block according to an embodiment of the present invention. Fig.12 , when the block vector candidate list at the upper block position is shared and used, it can be determined that the block vector BV for encoding / decoding at least one of the lower blocks in the intra-frame prediction block copy mode is valid only when the prediction block exists in the area encoded / decoded before the upper block.

[0322] When the block vector candidate list constructed in the upper block is shared and used, at least one of the partitioned lower blocks may have one of an intra block copy-based skip mode, an intra block copy-based merge mode, or an intra block copy-based AMVP mode.

[0323] When the block vector candidate list constructed in the upper block is shared and used, at least one of the partitioned lower blocks can be encoded / decoded only in the skip mode based on intra-frame block copy, the merge mode based on intra-frame block copy, the AMVP mode based on intra-frame block copy, or the AMVP mode using a motion vector.

[0324] When the merge candidate list constructed in the upper block is shared and used, the partitioned lower block may not be encoded / decoded in the intra block copy-based skip mode and the intra block copy-based merge mode. Although the partitioned lower block may be encoded / decoded in the intra block AMVP mode, it may be determined that the block vector of the block is valid only when the prediction block obtained from the block vector exists in the area encoded / decoded before the upper block.

[0325] The merge candidate list may mean a list of block vectors including a motion vector and a temporal motion vector, a history-based motion vector, a combined motion vector, and a zero vector without including the adjacent neighboring blocks of the upper block.

[0326] When the width and / or height of the current block is equal to or less than a predetermined value, the intra prediction block copy skip mode and the intra prediction block merge mode may not be allowed.

[0327] For example, when the width and height of the current block are less than 8, the intra block copy based skip mode and the intra prediction block merge mode may not be allowed.

[0328] If a value of width W×height H of the current block is less than or equal to a threshold condition that a merge candidate list constructed in an upper block may be used in a lower block, an intra block copy based skip mode and an intra block copy based merge mode may not be allowed.

[0329] For example, if the threshold of the merge candidate list constructed in the upper block that can be used in the lower block is 32, the intra block copy based skip mode and the intra block copy based merge mode can be allowed only when the width×height H of the current block is greater than 32.

[0330] When the value of the width W×height H of the current block is less than or equal to the threshold condition that the block vector candidate list constructed in the upper block can be used in the lower block, the skip mode and the merge mode may not be allowed. The skip mode and the merge mode may indicate a mode for encoding / decoding using a motion vector instead of a block vector of a spatial / temporal neighboring block of the current block.

[0331] For example, if the threshold condition that the block vector candidate list constructed in the upper block can be used in the lower block is 32, the skip mode and merge mode based on the motion vector instead of the block vector can be allowed only when the width×height H of the current block is greater than 32.

[0332] The combined merge candidate list may be composed of motion vectors and block vectors of adjacent neighboring blocks of the upper block, and when a value derived based on the width and / or height of at least one block in the blocks partitioned from the upper block is less than a predetermined threshold, the combined merge candidate list constructed in the upper block may be shared and used.

[0333] A combined merge candidate list may be constructed using at least one of a neighboring block motion vector candidate of an upper block, a block vector candidate of a neighboring block, a temporal motion vector candidate, a history-based motion vector candidate, a history-based block vector candidate, a (0, 0) motion vector candidate, or a fixed basic block vector, and the combined merge candidate list may be shared and used.

[0334] For example, when a block is encoded / decoded in an intra-prediction block copy skip mode or an intra-prediction block merge mode, a candidate corresponding to a block vector in the combined merge candidate list may be encoded / decoded. At this time, when encoding / decoding is performed in an intra-prediction block copy skip mode or an intra-prediction block merge mode, the information for identifying the corresponding candidate in the combined merge candidate list may indicate only the block vector candidate.

[0335] In addition, for example, when the corresponding block is encoded / decoded in skip mode or merge mode, only the candidate corresponding to the motion vector in the combined merge candidate list instead of the block vector may be encoded / decoded. At this time, when encoding / decoding is performed in skip mode or merge mode, the information for identifying the corresponding candidate in the combined merge candidate list may indicate only the motion vector candidate.

[0336] According to an embodiment, when the current block is a luminance component block and is encoded in an intra block copy-based AMVP mode, a block vector derivation method is as follows.

[0337] Similar to the skip mode or merge mode based on intra-block copying, a prediction block vector candidate list may be constructed using up to N prediction block vector candidates. One of the candidates included in the constructed prediction block vector candidate list may be used as the prediction block vector of the current block, and information (e.g., identifier, index, flag, mvp_l0_flag, etc.) for identifying the prediction candidate in the prediction block vector candidate list may be derived or encoded / decoded based on the encoding parameters transmitted in the bitstream.

[0338] A vector difference between a block vector of a current block and a predicted block vector may be calculated, and a calculation result may be entropy encoded. A decoder may receive block vector difference information in a bitstream, or derive a vector difference from information sent in a bitstream, and add the block vector difference of the current block to the predicted block vector to derive a block vector of the current block.

[0339] The following one or more candidates may be included in the prediction block vector candidate list.

[0340] exist Fig.10 In the example, it may be determined whether the blocks are encoded / decoded in the order of A0 and A1 using the intra block copy prediction method, and a block vector of the block encoded / decoded using the intra block copy prediction method may be determined as the prediction candidate A. Alternatively, it may be determined whether the block corresponding to A1 is encoded / decoded using the intra block copy prediction method, and when encoding / decoding is performed using the intra block copy prediction method, the prediction candidate A may be determined.

[0341] exist Fig.10 , it may be determined whether to encode / decode blocks in the order of B0, B1, and B2 using the intra block copy prediction method, and a block vector of the block encoded / decoded using the intra block copy prediction method may be determined as a prediction candidate B. Alternatively, it may be determined whether to encode / decode a block corresponding to B1 using the intra block copy prediction method, and when encoding / decoding is performed using the intra block copy prediction method, the prediction candidate B may be determined.

[0342] At this time, the predetermined order of the prediction block vector candidate list can be A and B.

[0343] Block vectors of blocks encoded / decoded before the current block may be stored in a buffer, and one or more of the block vectors stored in the buffer may be determined as prediction block vector candidates. At this time, the block vectors may be stored in a buffer having a specific size in the order of encoding / decoding, and if the buffer is filled, the first stored block vector may be deleted and a new (i.e., most recently encoded / decoded) block vector may be stored. When the prediction block vector candidate list is constructed in the order of the block vectors stored in the buffer (e.g., in the order from oldest to newest or in the order from newest to oldest), the priority may be different. For example, the block vector most recently stored in the buffer may be first included in the prediction block vector candidate list, or the block vector first stored in the buffer may be first included in the prediction block vector candidate list. The block vectors may be referred to as history-based block vector candidates.

[0344] When a block vector candidate list is constructed using at least one of the history-based block vector candidates, it may be determined whether the history-based block vector candidate is available in the current block, and if available, the candidate may be added to the block vector candidate list. At this time, whether the history-based block vector is available may be determined based on whether a reference sample (block) at a position indicated by the block vector is available.

[0345] When a block vector candidate list is constructed using at least one of the history-based block vector candidates, a redundancy check may be performed between the history-based block vector candidates and block vector candidates existing in the block vector candidate list, and when the same block vector does not exist as a result of the redundancy check, the candidate may be added to the block vector candidate list.

[0346] For example, when a block vector candidate list is constructed using at least one history-based block vector candidate among the history-based block vector candidates, a redundancy check may not be performed between a predetermined candidate among the history-based block vector candidates and a block vector candidate existing in the block vector candidate list, and the candidate may be added to the block vector candidate list. For example, the predetermined candidate may represent a block vector candidate other than the first candidate among the history-based block vector candidates. Here, the first candidate may represent a block vector candidate that is stored first or most recently in the history-based block vector list composed of the history-based block vector candidates.

[0347] As another example, when constructing a block vector candidate list using at least one history-based block vector candidate among the history-based block vector candidates, a redundancy check may be performed between a predetermined candidate among the history-based block vector candidates and the block vector candidates existing in the block vector candidate list, and the candidate may be added to the block vector candidate list. For example, the predetermined candidate may represent the first candidate among the history-based block vector candidates. Here, the first candidate may represent the block vector candidate most recently stored in a history-based block vector list composed of history-based block vector candidates.

[0348] A buffer including history-based block vector candidates may be maintained in units of pictures, slices, parallel blocks, CTUs, CTU rows, CTU columns during encoding / decoding, and may be used in units of pictures, slices, parallel blocks, CTUs, CTU rows, CTU columns. In addition, the buffer may include at least one piece of coding information among the coding information of the blocks encoded / decoded before the current block in units of pictures, slices, parallel blocks, CTUs, CTU rows, CTU columns.

[0349] At least two block vector candidates among the block vector candidates existing in the block vector candidate list may be used to construct a combined block vector candidate. At this time, when constructing the combined block vector candidate, history-based block vector candidates may not be used. At this time, when constructing the combined block vector candidate, block vector candidates of adjacent neighboring blocks may not be used. At this time, it may be determined whether the combined block vector candidate composed of block vector candidates is available in the current block, and only if it is available, this may be determined as the combined block vector candidate. At this time, it may be determined whether the block vector is available according to whether the reference sample (block) at the position indicated by the block vector is available.

[0350] When the width of the current luminance block is W and the height of the current luminance block is H, (- (W << n) + a, - (H << n) + b), (- (W << n) + c, 0), or (0, - (H << n) + d) may be included in the block vector candidate list as block vector candidates. At this time, n may be a positive integer greater than 0, and a, b, c, and d may have integer values. The block vector candidate may be referred to as a fixed basic block vector candidate.

[0351] At least one of the block vectors of adjacent neighboring blocks, history-based block vectors, combined block vectors, or fixed basic block vector candidates may be used to construct a block vector candidate list in a predetermined order.

[0352] For example, the block vector candidate list may be constructed in the order of the block vectors of adjacent neighboring blocks, history-based block vectors, combined block vectors, and fixed basic block vector candidates.

[0353] Furthermore, for example, fixed basic block vectors may be constructed in the following order until the number of candidates in the block vector candidate list reaches the maximum number.

[0354] 1. (-(W<<1), 0) 2. (0, -(H<<1)) 3. (-(W<<1)-1, 0) 4. (0, -(H<<1)-1) 5. (-(W<<1)-2, 0) 6. (0, -(H<<1)-2) 7. (-(W<<1)-3, 0) 8. (0, -(H<<1)-3) 9. (-(W<<1)-4, 0) 10. (0, -(H<<1)-4) Alternatively, the fixed basic block vector may be a (0, 0) vector, and the fixed basic block vector may be added to construct a block vector candidate list of candidates having the maximum value until the number of candidates in the block vector candidate list reaches the maximum number. For example, when the number of block vector candidates added to the block vector candidate list using block vectors of adjacent neighboring blocks, history-based block vectors, combined block vectors, etc. is less than the maximum number N of block vector candidates, the fixed basic block vector may be added to the block vector candidate list until the maximum number of block vector candidates is reached. At this time, the fixed basic block vector may be a (0, 0) vector.

[0355] When constructing a block vector candidate list, the number of history-based block vector candidates that may be included in the block vector candidate list may be the maximum number of block vector candidates N or (Nm). m may be a natural number greater than 0.

[0356] According to an embodiment, when the current block is a luma component block and is encoded / decoded in an intra block copy-based skip mode, an intra block copy-based merge mode, or an intra block copy-based AMVP mode, a block vector derivation method is as follows.

[0357] The block vector candidate list may consist of at most N candidates. At this time, N may be a positive integer including 0. In addition, the block vector candidate list may include one or more of the candidates described below.

[0358] Refer again Fig.10 , a block vector may be derived from blocks corresponding to block A1 adjacent to the left side of the current block X and block B1 adjacent to the top of the current block, and the derived block vector may be determined as a block vector candidate for the current block.

[0359] Here, whether a block vector exists in each of the blocks included in the positions A1 and B1 (i.e., whether the block has been encoded / decoded using the intra block copy prediction method) may be determined according to a predetermined priority, and when a block vector exists, the block vector of the block may be determined as a block vector candidate. At this time, the predetermined priority of the block vector candidate list may be A1 and B1.

[0360] When the block vector candidate list is constructed according to the predetermined priority, a redundancy check may be performed between block vector candidates existing in the block vector candidate list and the newly added block vector candidates.

[0361] For example, when a block vector candidate list is constructed in the order of A1 and B1, block B1 may be subjected to a redundancy check with block A1, and only when block B1 has a block vector that is not equal to the block vector of block A1, the block vector of block B1 may be added to the list. Redundancy check may be performed only when a block vector exists in a block.

[0362] In addition, when the number of candidates in the block vector candidate list is less than the maximum number of allowable candidates in the predefined or derived list, at least one block vector candidate may be introduced and used from a buffer storing block vectors of blocks encoded / decoded before the current block.

[0363] Here, information indicating the maximum number of allowable block vectors in the block vector candidate list may be encoded / decoded at a high level such as a sequence parameter set (SPS), a picture parameter set (PPS), an adaptation parameter set (APS), a picture header, a sub-picture, a slice header, a parallel block group, etc.

[0364] For example, in a slice header or SPS, information indicating the maximum allowable number of merge candidate lists for inter prediction mode (e.g., six_minus_max_num_merge_cand) may be encoded / decoded, and as described below, the maximum number of allowable candidates may be derived based on the information about the maximum allowable number. In addition, the derived maximum number of allowable candidates may be defined as the maximum number of block vector candidates in the block vector list.

[0365] Maximum number of merge candidates MaxNumMergeCand = 6 - six_minus_max_num_merge_cand Among them, MaxNumMergeCand can have a value of 1 to 6.

[0366] The maximum number of block vector candidates MaxNumIBCCand = MaxNumMergeCand In addition, for example, in a slice header or SPS, information indicating the maximum allowable number of merge lists of inter prediction modes (e.g., six_minus_max_num_merge_cand) may be encoded / decoded, and as described below, the maximum number of allowable candidates MaxNumMergeCand may be derived based on the information indicating the maximum allowable number. In addition, the maximum number of block vector candidates of a block vector list may be defined based on the derived number MaxNumMergeCand.

[0367] Maximum number of merge candidates MaxNumMergeCand = 6 - six_minus_max_num_merge_cand The maximum number of block vector candidates MaxNumIBCCand = Max (N, MaxNumMergeCand), N is a positive integer greater than 0, and for example, N=2.

[0368] In addition, for example, in the slice header or SPS, information indicating the maximum allowable number of merge lists of inter prediction modes (e.g., six_minus_max_num_merge_cand) may be encoded / decoded, and as described above, the maximum number of allowable candidates MaxNumMergeCand may be derived based on the information indicating the maximum allowable number. In addition, the maximum number of block vector candidates in the block vector list may be defined based on the derived number MaxNumMergeCand and the coding mode of the current block.

[0369] Maximum number of merge candidates MaxNumMergeCand = 6 - six_minus_max_num_merge_cand When the current block is in the intra-block copy based skip mode or the intra-block copy based merge mode, The maximum number of block vector candidates MaxNumIBCCand = MaxNumMergeCand Optionally, when the current block is in AMVP mode based on intra-block copy, The maximum number of block vector candidates MaxNumIBCCand = Max (N, MaxNumMergeCand), where N is a positive integer greater than 0.

[0370] For example, when N=2 and MaxNumMergeCand=1, the maximum number of candidates in the block vector candidate list in the skip mode based on intra-frame block copy or the merge mode based on intra-frame block copy can be derived as 1, and the maximum number of candidates in the block vector candidate list in the AMVP mode based on intra-frame block copy can be derived as 2.

[0371] In addition, for example, in a slice header or SPS, information indicating the maximum allowable number of merge lists of inter prediction modes (e.g., six_minus_max_num_merge_cand) may be encoded / decoded, and as described below, the maximum number of allowable candidates MaxNumMergeCand may be derived based on the information indicating the maximum allowable number. In addition, the maximum number of block vector candidates in the block vector list may be defined based on the derived number MaxNumMergeCand and the coding mode of the current block.

[0372] Maximum number of merge candidates MaxNumMergeCand = 6 - six_minus_max_num_merge_cand When the current block is in the intra-block copy based skip mode or the intra-block copy based merge mode, The maximum number of block vectors MaxNumIBCCand = MaxNumMergeCand When the current block is in AMVP mode based on intra-block copy, The maximum number of block vector candidates MaxNumIBCCand = N, where N is a positive integer greater than 0 For example, when the current block is in the intra block copy based AMVP mode, the maximum number of block vector candidates may be defined as 2.

[0373] In addition, for example, when MaxNumMergeCand = 6, the maximum number of candidates in the block vector candidate list in the intra-frame block copy based skip mode or the intra-frame block copy based merge mode can be defined as 6, and the maximum number of candidates in the block vector candidate list in the intra-frame block copy based AMVP mode can be defined as 2.

[0374] Furthermore, for example, in a slice header or SPS, information indicating the maximum allowable number of block vector candidate lists (eg, six_minus_max_num_ibc_cand) may be separately encoded / decoded, and as described above, the maximum number of allowable block vector candidates of a block vector list may be derived based on the information indicating the maximum allowable number.

[0375] Maximum number of allowable block vector candidates (eg, MaxNumIBCCand) = 6 - six_minus_max_num_ibc_cand Among them, the maximum number of block vector candidates allowed (e.g., MaxNumIBCCand) may have a value from 0 to 6.

[0376] Also, information indicating the maximum number of allowable block vector candidates (eg, six_minus_max_num_ibc_cand) may have a value of 0 to 5.

[0377] Here, for convenience of description, the names of MaxNumIBCCand and six_minus_max_num_ibc_cand are arbitrarily described, and signals having other names may be configured.

[0378] Furthermore, for example, in a slice header or SPS, information indicating the maximum allowable number of block vector candidate lists (eg, max_num_merge_cand_minus_max_num_ibc_cand) may be separately encoded / decoded, and as described below, the maximum number of allowable block vector candidates of a block vector list may be derived based on the information indicating the maximum allowable number.

[0379] The maximum number of allowed block vector candidates MaxNumIBCCand = MaxNumMergeCand - max_num_merge_cand_minus_max_num_ibc_cand Here, MaxNumIBCCand may have a value in the range of 2 to MaxNumMergeCand.

[0380] In addition, only when the intra-block copy (IBC) function is used at a high level (such as SPS, PPS, APS, or slice header), information indicating the maximum allowable number (e.g., six_minus_max_num_ibc_cand, max_num_merge_cand_minus_max_num_ibc_cand, etc.) may be encoded / decoded. For example, only when the information indicating whether the intra-block copy function is used (e.g., sps_ibc_enabled_flag) decoded in the SPS is the second value 1, the information indicating the maximum allowable number may be encoded / decoded. In addition, for example, when the information indicating whether the intra-block copy function is used (e.g., sps_ibc_enabled_flag) decoded in the SPS is the first value 0, the information indicating the maximum allowable number may be derived as 0.

[0381] In addition, for example, information indicating the maximum allowable number in the block vector candidate list (e.g., pic_six_minus_max_num_ibc_merge_cand) in the picture header or SPS may be separately encoded / decoded, and as described below, the maximum number of block vector candidates included in the block vector candidate list may be derived based on the information indicating the maximum allowable number.

[0382] Maximum number of block vector candidates MaxNumIBCCand = 6 - pic_six_minus_max_num_ibc_merge_cand Among them, MaxNumIBCCand may have a value of 1 to 6. Alternatively, MaxNumIBCCand may have a value of 0 to 6. In addition, if MaxNumIBCCand=0, this may mean that the IBC mode is not allowed in all slices related to the picture header.

[0383] Furthermore, for example, encoding / decoding of information indicating the allowable maximum number of block vector candidate lists that may be signaled in a picture header (e.g., pic_six_minus_max_num_ibc_merge_cand) may be omitted based on a coding parameter value decoded at a higher level (such as a video parameter set, a sequence parameter set, a picture parameter set, etc.), and a value of the information may be estimated based on a value encoded / decoded at a higher level.

[0384] Fig.13 2 is a diagram illustrating a process of deriving information indicating the maximum allowable number of block vector candidate lists according to an embodiment of the present invention. Fig.13 According to the value of information (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) decoded in a picture parameter set referred to by a picture header, information (e.g., pic_six_minus_max_num_ibc_merge_cand) indicating the maximum number of allowable block vector candidates of a block vector candidate list in a picture header may be encoded / decoded or estimated. In addition, when the information (e.g., pic_six_minus_max_num_ibc_merge_cand) does not exist, the information (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) encoded at a high level may be used to estimate the information.

[0385] For example, when information (eg, pps_six_minus_max_num_ibc_merge_cand_plus1) decoded in a picture parameter set has a value of 0, this may mean that information (eg, pic_six_minus_max_num_ibc_merge_cand) indicating the maximum number of allowable block vector candidates of a block vector list exists in a picture header of the reference picture parameter set.

[0386] In addition, for example, when information (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) decoded in a picture parameter set has a value greater than 0, this may mean that information (e.g., pic_six_minus_max_num_ibc_merge_cand) indicating the maximum number of allowable block vector candidates of a block vector list does not exist in a picture header of a reference picture parameter set. At this time, the information (e.g., pic_six_minus_max_num_ibc_merge_cand) may be estimated as information (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) decoded in a picture parameter set - 1.

[0387] Reference Fig.13 , information indicating presence / absence of predetermined information encoded / decoded in a picture header (eg, constant_slice_header_params_enabled_flag) in a picture parameter set may be encoded / decoded.

[0388] For example, when other information (e.g., constant_slice_header_params_enabled_flag) decoded in the picture parameter set has a first value, information (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) decoded in the picture parameter set may be entropy encoded / decoded, and when the other information has a second value, information (e.g., pps_six_minus_max_num_ibc_merge_cand_plus1) decoded in the picture parameter set may be estimated to 0 without entropy encoding / decoding. Here, the first value may represent 1, and the second value may represent 0.

[0389] In addition, for example, when the following conditions are satisfied, information decoded in a picture parameter set (eg, pps_six_minus_max_num_ibc_merge_cand_plus1) may be entropy encoded / decoded.

[0390] Condition: Information decoded in a picture parameter set (eg, constant_slice_header_params_enabled_flag) has a first value, and information decoded in a sequence parameter set (eg, sps_ibc_enabled_flag) has a first value.

[0391] In addition, for example, when the following conditions are satisfied, information decoded in the picture parameter set (eg, pps_max_num_merge_cand_minus1_max_num_triangle_cand_plus1) may be entropy encoded / decoded.

[0392] Condition: Information decoded in a picture parameter set (eg, constant_slice_header_params_enabled_flag) has a first value, and information decoded in a sequence parameter set (eg, sps_triangle_enabled_flag) has a first value.

[0393] In addition, for example, when the following conditions are satisfied, information decoded in a picture parameter set (eg, pps_collocated_from_l0_idc) may be entropy encoded / decoded.

[0394] Condition: Information decoded in a picture parameter set (eg, constant_slice_header_params_enabled_flag) has a first value, and information decoded in a sequence parameter set (eg, sps_temporal_mvp_enabled_flag) has a first value.

[0395] Additionally, the first value may represent 1, and the second value may represent 0.

[0396] In addition, the maximum number of allowable block vector candidates of the block vector candidate list may be a fixed value N predefined in the encoder / decoder. Here, N may be a positive integer including zero.

[0397] For example, the maximum number of allowable block vector candidates of the block vector candidate list may be two.

[0398] Furthermore, for example, the maximum number of allowable block vector candidates of the block vector candidate list may be five.

[0399] Furthermore, for example, the maximum number of allowable block vector candidates of the block vector candidate list may be six.

[0400] In addition, the maximum number of allowable block vector candidates of the block vector candidate list may be a fixed value N predefined in the encoder / decoder. Here, N may be a positive integer including 0, and the value N may vary according to the encoding mode of the current block.

[0401] For example, when the current block is in the intra block copy based skip mode or the intra block copy based merge mode, the predefined value N may be 6.

[0402] In addition, for example, when the current block is in the AMVP mode based on intra block copy, the predefined value N may be 2.

[0403] When the number of block vectors in the block vector candidate list is less than the maximum number of allowable block vector candidates and one or more block vectors exist in the buffer storing the block vectors of the block encoded / decoded before the current block, at least one block vector candidate may be introduced and used from the buffer storing the block vectors of the block encoded / decoded before the current block. For example, the at least one block vector candidate may be included in the block vector candidate list.

[0404] At this time, the intra block vectors may be stored in a buffer having a certain size in the order of encoding / decoding, and if the buffer is full, the first stored block vector may be deleted and a new (i.e., most recently encoded / decoded) block vector may be stored. The block vector candidate list may be constructed by prioritizing according to the storage order of the block vectors stored in the buffer (e.g., from the oldest vector to the newest vector or from the newest vector to the oldest vector). For example, a vector most recently stored in the buffer may be first included in the block vector candidate list, or a vector first stored in the buffer may be first included in the block vector candidate list. The block vector candidates may be referred to as history-based block vector candidates.

[0405] When the number of block vectors in the block vector candidate list is less than the maximum number of allowable block vector candidates and one or more block vectors exist in a buffer storing block vectors of blocks encoded / decoded before the current block, history-based block vector candidates may be added to the block vector candidate list until the number of block vectors in the block vector candidate list is equal to the maximum number of allowable block vector candidates.

[0406] When a block vector candidate list is constructed using at least one of the history-based block vector candidates, a redundancy check between the history-based block vector candidates and block vector candidates of neighboring blocks of the current block may be performed, and when the same block vector does not exist as a result of performing the redundancy check, the candidate may be added to the block vector candidate list.

[0407] For example, refer to Fig.10 , a redundancy check between the history-based block vector candidate and the block vector of block A1 and / or block B1 may be performed, wherein both block A1 and block B1 are neighboring blocks of the current block.

[0408] Furthermore, for example, a redundancy check with block A1 and / or block B1 may be performed only for the first history-based block vector candidate.

[0409] Furthermore, for example, redundancy checks with block A1 and / or block B1 may be performed only for up to the second history-based block vector candidates.

[0410] Furthermore, for example, a redundancy check with block A1 and / or block B1 may be performed for all history-based block vector candidates.

[0411] Here, the first history-based block vector candidate may mean a most recently stored block vector candidate in the history-based block vector list consisting of history-based block vector candidates.

[0412] Furthermore, the second history-based block vector candidate may represent a second block vector candidate stored after the first history-based block vector candidate in the history-based block vector list.

[0413] When a block vector candidate list is constructed using at least one of the history-based block vector candidates, a predetermined candidate among the history-based block vector candidates may be added to the block vector candidate list without performing a redundancy check with block vector candidates existing in the block vector candidate list or block vector candidates of a neighboring block.

[0414] When the number of block vector candidates in the list consisting of block vectors of neighboring blocks and history-based block vector candidates is less than a predefined or derived maximum number of allowable candidates for the list, zero vectors having a horizontal block vector size and a vertical block vector size of (0, 0) may be added until the number of block vector candidates in the list is equal to the maximum number of allowable candidates.

[0415] When the current block is in the intra block copy-based AMVP mode and the number of candidates in the block vector list constructed in a predetermined order is less than a predefined number N of AMVP candidates (where N is a positive integer greater than 0, for example, N=2), a zero vector having a horizontal block vector size and a vertical block vector size of (0, 0) may be added until the number of block vector candidates in the block vector list becomes equal to the predefined number of AMVP candidates.

[0416] For example, when the current block is in the AMVP mode based on intra block copy, the maximum number of candidates in the block vector list is defined in the same manner as the maximum number of merge candidates MaxNumMergeCand derived from the information on the maximum number of merge candidates for the inter prediction merge mode decoded in the slice header or SPS (e.g., six_minus_max_num_merge_cand), and the maximum number of merge candidates MaxNumMergeCand is 1, that is, when the number of candidates in the block vector candidate list is less than the predefined number 2 of AMVP candidates, a zero vector with a horizontal block vector size and a vertical block vector size of (0,0) may be added as a block vector candidate to the block vector candidate list so that the number 2 of AMVP candidates is satisfied.

[0417] In addition, information (eg, an identifier, an index, a flag, etc.) for identifying a corresponding candidate in the block vector candidate list may be derived based on encoding parameters transmitted in the bitstream.

[0418] For example, when the current block is in an intra block copy-based skip mode or an intra block copy-based merge mode, the candidate may be identified based on merge index (eg, merge_idx) information decoded / estimated in the current block.

[0419] In addition, for example, when the current block is in the intra block copy-based AMVP mode, the candidate may be identified based on L0 motion vector prediction flag (eg, mvp_l0_flag) information decoded / inferred in the current block.

[0420] When the maximum number of candidates in the block vector list is 1, L0 motion vector prediction flag (eg, mvp_l0_flag) information may be inferred to be 0 without performing entropy encoding / decoding.

[0421] For example, when the information indicating the maximum number of allowable candidate block vectors in the block vector list (e.g., MaxNumIbcMergeCand) is 1 (i.e., MaxNumMergeCand=1), the information indicating the index of the L0 motion vector predictor (e.g., mvp_l0_flag) may be inferred to be 0 without performing entropy encoding / decoding. That is, referring to Fig.14 , when MaxNumMergeCand is greater than 1, information indicating the index of the L0 motion vector predictor (e.g., mvp_l0_flag) may be entropy encoded / decoded. Otherwise (when MaxNumMergeCand is equal to or less than 1), mvp_l0_flag may be inferred to be 0 without performing entropy encoding / decoding. The information may be a flag.

[0422] Here, the L0 motion vector prediction flag may represent information indicating an index of an L0 motion vector predictor.

[0423] Here, for the convenience of description, the name of MaxNumMergeCand is arbitrarily described, and a signal having another name may be configured. That is, instead of MaxNumMergeCand, MaxNumIbcMergeCand may be used. For example, when MaxNumIbcMergeCand is greater than 1, information indicating an index of an L0 motion vector predictor (e.g., mvp_l0_flag) may be entropy encoded / decoded. Otherwise (when MaxNumIbcMergeCand is equal to or less than 1), mvp_l0_flag may be inferred to be 0 without performing entropy encoding / decoding. The information may be a flag.

[0424] Reference Fig.15 , when the current block is in an intra-block copy-based skip mode or an intra-block copy-based merge mode, and the allowable maximum number of candidates in the block vector candidate list (e.g., MaxNumIbcMergeCand) is greater than 1, merge index information (e.g., merge_idx) may be encoded / decoded.

[0425] When the current block is in the intra block copy based skip mode or the intra block copy based merge mode, the block vector candidate identified in the block vector list may be used as the block vector of the current block. Here, the block vector list may be constructed by the above method.

[0426] When the current block is in the intra block copy based AMVP mode, a value generated by adding the decoded block vector difference (BVD) to the block vector candidate identified in the block vector list may be used as the block vector of the current block. Here, the block vector list may be constructed by the above method.

[0427] Additionally, rounding may be performed on the identified block vector candidate according to a value of information indicating the precision of the decoded motion vector difference (eg, amvr_precision_flag).

[0428] offset = (right shift == 0)?0:(1<<(right shift - 1)) mvX[0] = ((mvX[0]+offset-(mvX[0]>=0))>>right shift)<<left shift mvX[ 1 ] = ( ( mvX[ 0 ] + offset - ( mvX[ 1 ]>=0 ) )>>right shift )<<left shift When amvr_precision_flag has the first value 0 (block vector has 1 integer pixel unit size), right shift=4, left shift=4.

[0429] When amvr_precision_flag has the second value 1 (block vector has a size of 4 integer pixel units), right shift = 6, left shift = 6 Hereinafter, the steps of deriving a block vector of a chroma component block will be described below.

[0430] According to an embodiment, when the block partitions of the luma component and the chroma component in the same CTU are the same (i.e., the block partition structure of the luma block and the block partition structure of the chroma block are the same), and the current block is a chroma component block and is encoded using an intra block copy prediction method, the block vector of the chroma component block may be derived as follows.

[0431] The luma component block corresponding to the current chroma component block may be determined as follows.

[0432] When the upper left sampling point position of the current chroma component block is (xc, yc), the width is Wc and the height is Hc, the upper left sampling point position of the luminance component block corresponding to the current chroma component block may be (xc / K1, yc / K2), the width may be K1×Wc, and the height may be K2×Hc. At this time, K1 and K2 may vary according to the chroma component format, and when the chroma component format to be encoded is the 4:2:0 format, both K1 and K2 may be 2, and when the chroma component format to be encoded is the 4:4:4 format, both K1 and K2 may be 1. In addition, in the case of the 4:2:2 format, K1=2, K2=1.

[0433] Since the block partition structures of the chrominance component block and the luminance component block are the same, the luminance component block corresponding to the current chrominance component block may consist of one luminance component block.

[0434] When the block vector of the luminance component block corresponding to the chrominance component block is (MVL[0], MVL[1]), the block vector of the chrominance component block may be (MVL[0] / K1, MVL[1] / K2). When the chrominance component format of the picture to be encoded is the 4:2:0 format, both K1 and K2 may be 2, and when the chrominance component format of the picture to be encoded is the 4:4:4 format, both K1 and K2 may be 1. Furthermore, in the case of the 4:2:2 format, K1=2 and K2=1. In addition, although it is assumed that the basic unit of MVL[0] and MVL[1] is 1 pixel, the basic unit may be 1 / 16 pixel or 1 / N pixel, where N may be any positive integer.

[0435] According to an embodiment, block partitioning of the luma component and the chroma component in the same CTU is performed independently (that is, the block partition structure of the luma component and the block partition structure of the chroma component are different), and the current block is a chroma component block and is encoded using an intra block copy prediction method, the block vector of the chroma component block may be derived as follows.

[0436] A luma component region corresponding to a current chroma component block may be determined as follows.

[0437] When the upper left sample point position of the current chroma component block is (xc, yc), the width is Wc, and the height is Hc, the upper left sample point position of the luminance component block corresponding to the current chroma component block may be (xc / K1, yc / K2), the width may be K1×Wc, and the height may be K2×Hc. At this time, K1 and K2 may vary according to the chroma component format, and when the chroma component format of the picture to be encoded is the 4:2:0 format, both K1 and K2 may be 2, and when the chroma component format of the picture to be encoded is the 4:4:4 format, both K1 and K2 may be 1. In addition, in the case of the 4:2:2 format, K1=2 and K2=1.

[0438] At this time, the region of the luminance component corresponding to the current chrominance component block may include only the partitioned portion of the luminance component block. In addition, the luminance component region corresponding to the chrominance component block may be partitioned into at least one luminance component block.

[0439] The current chrominance component block may be partitioned in units of N×M sub-blocks, and the sub-blocks of the luminance component area corresponding to the corresponding sub-block may be partitioned in units of (N×K1)×(M×K2) sub-blocks. At this time, N and M may be integers 1 or greater.

[0440] Fig.16 is a diagram illustrating a correspondence relationship between a chrominance component block and a luminance component region according to another embodiment of the present invention.

[0441] Reference Fig.16 , an example of a block partition structure in an arbitrary CTU with a 4:2:0 chroma format is shown. The current chroma component block can be partitioned in units of N×M sub-blocks, and the sub-blocks of the luminance component area corresponding to the corresponding sub-blocks can be obtained by partitioning the luminance component block in units of (N×K1)×(M×K2) sub-blocks. At this time, N and M can be integers 1 or greater. Optionally, when the width of the current chroma component block is Wc and the height is Hc, partitioning can be performed in units of N×M sub-blocks, where the width is partitioned into P1 and the height is partitioned into P2. In this case, N=Wc / P1 and M=Hc / P2, where P1 and P2 can be integers 1 or greater.

[0442] There may be a luminance component subblock corresponding to the subblock of the current chrominance component block. The block vector of the current chrominance component subblock may be derived from the block vector of the luminance component subblock corresponding thereto. For example, when the block vector of the luminance component subblock corresponding to the chrominance component subblock is (MVL[0], MVL[1]), the block vector of the chrominance component block may be (MVL[0] / K1, MVL[1] / K2). At this time, K1 and K2 may be the same as described above. In addition, although it is assumed in the description that the basic unit of MVL[0] and MVL[1] is one pixel, the basic unit may be 1 / 16 pixel or 1 / N pixel, where N may be any positive integer.

[0443] In addition, all samples located in the luminance component subblock corresponding to the subblock of the current chrominance component block may not be encoded / decoded using the same prediction method. For example, when the block partition structures of the luminance component and the chrominance component are independent, the luminance component subblock corresponding to the chrominance component subblock may not match the luminance component prediction block, or there may be two or more luminance component prediction blocks partitioned from the luminance component subblock. Here, the luminance component prediction block may represent a block to which the same prediction or transform coding is applied when the luminance component is encoded / decoded, and may be determined by the luminance component block partition. In addition, the luminance component area corresponding to the chrominance component block may not represent a block partitioned by, for example, Fig.16 The prediction block is not determined by partitioning the luminance component block in the example of , but may represent a luminance component area corresponding to the position and size of the chrominance component block.

[0444] Therefore, the block vector of the luma component subblock corresponding to the subblock of the current chroma component block may be one of the following items.

[0445] 1. Block vector of the luminance component prediction block when encoding / decoding the luminance component prediction block including the upper left sample of the luminance component sub-block corresponding to the sub-block of the current chrominance component block using the intra block copy prediction method 2. Block vector of the luminance component prediction block when encoding / decoding the luminance component prediction block including the center position sample of the luminance component subblock corresponding to the subblock of the current chrominance component block using the intra block copy prediction method 3. Fig.17 is a diagram showing a luminance component sub-block according to another embodiment of the present invention. Fig. 20 In the example of using the intra block copy prediction method to encode / decode the luminance component prediction block including one of the shaded sample positions in the luminance component sub-block corresponding to the sub-block of the current chrominance component block, the block vector of the luminance component prediction block is 4. Block vector of a luminance component prediction block when encoding / decoding a luminance component prediction block occupying the largest area in a luminance component subblock corresponding to a subblock of a current chrominance component block using an intra block copy prediction method In one of the following cases, there may not be a block vector of a luma component subblock corresponding to a subblock of a current chroma component block.

[0446] 1. The case where the luminance component prediction block including the upper left sample of the luminance component sub-block corresponding to the sub-block of the current chrominance component block is not encoded / decoded using the intra block copy prediction method or the luminance component prediction block including the upper left sample of the luminance component sub-block corresponding to the sub-block of the current chrominance component block is encoded / decoded using the intra prediction method 2. The case where the luminance component prediction block including the center position sample of the luminance component subblock corresponding to the subblock of the current chrominance component block is not encoded / decoded using the intra block copy prediction method or the luminance component prediction block including the center position sample of the luminance component subblock corresponding to the subblock of the current chrominance component block is encoded / decoded using the intra prediction method 3. As in Fig.17 In the example, the intra block copy prediction method is not used to encode / decode the luminance component prediction block including one of the shadow sample positions in the luminance component sub-block corresponding to the sub-block of the current chrominance component block, or the intra prediction method is used to encode / decode the luminance component prediction block including one of the shadow sample positions in the luminance component sub-block corresponding to the sub-block of the current chrominance component block.

[0447] 4. The case where the luminance component prediction block occupying the largest area in the luminance component sub-block corresponding to the sub-block of the current chrominance component block is not encoded / decoded using the intra-block copy prediction method or the luminance component prediction block occupying the largest area in the luminance component sub-block corresponding to the sub-block of the current chrominance component block is encoded / decoded using the intra-frame prediction method When there is no block vector of a luma component subblock corresponding to a subblock of a current chroma component block (hereinafter referred to as a 'current subblock'), a block vector corresponding to the current chroma component block may be derived using one of the following methods.

[0448] The block vector of the current sub-block may be set to (0, 0) or (D1, D2). In this case, D1 and D2 may be integers 0, ±1, ±2, ±3, ...

[0449] The block vector of the current subblock may be set to (Wc+D1, D2) or (D1, Hc+D2). In this case, Wc may be the width of the current chroma component block, Hc may be the height of the current chroma component block, and D1 and D2 may be integers 0, ±1, ±2, ±3, ...

[0450] The block vector of the current sub-block can be set to one of (-(Wc<<n)+a, -(Hc<<n)+b), (-(Wc<<n)+c, 0), or (0, -(Hc<<n)+d). At this time, n can be a positive integer greater than or equal to 0, and a, b, c, and d can have integer values.

[0451] The block vector of a neighboring sub-block of the current sub-block (e.g., at least one of the upper sub-block, lower sub-block, left sub-block, right sub-block, upper left sub-block, upper right sub-block, lower left sub-block, or lower right sub-block) can be used as the block vector of the current sub-block.

[0452] The block vector of the current sub-block can be derived using the statistical value of the block vector values of the sub-blocks in the current chrominance component block that have corresponding luma component sub-blocks.

[0453] For example, the block vector of the current sub-block can be one of the average value, median value, maximum value, or minimum value of the block vectors of the sub-blocks.

[0454] As another example, the block vector of the current sub-block can be the block vector with the highest occurrence frequency.

[0455] In addition, when the intra-block copy prediction method is not used to encode / decode the corresponding luma component sub-block, or when there is at least one chrominance component sub-block in which there is no block vector of the luma component sub-block, the intra-block copy prediction method may not be used to encode / decode the chrominance component block.

[0456] The prediction mode of the luma component sub-block corresponding to the sub-block of the current chrominance component block can be set as follows. Here, the prediction mode can be intra prediction, inter prediction, or intra-block copy prediction, and more specifically, can be one of the skip mode, merge mode, AMVP mode, or affine skip mode in the inter prediction mode, or can be the skip mode based on intra-block copy, merge mode based on intra-block copy, or AMVP mode based on intra-block copy in the intra-block copy prediction mode.

[0457] 1. The prediction mode of the luma component prediction block including the top-left sample of the luma component sub-block corresponding to the sub-block of the current chrominance component block 2. The prediction mode of the luma component prediction block including the center-position sample of the luma component sub-block corresponding to the sub-block of the current chrominance component block 3. As in the Fig.17 example, the prediction mode of the luma component prediction block including one of the shadow sample positions in the shadow sample positions of the luma component sub-block corresponding to the sub-block of the current chrominance component block 4. The prediction mode of the luma component prediction block that occupies the largest area in the luma component sub-block corresponding to the sub-block of the current chrominance component block In the following, the steps of deriving the prediction signal will be described.

[0458] The step of deriving a prediction signal for intra block copy prediction may include at least one of a step of deriving a prediction signal for a luma component block and a step of deriving a prediction signal for a chroma component block.

[0459] Hereinafter, the steps of deriving a prediction signal for a luminance component block will be described.

[0460] A block of a block vector of a luminance component block derived from a current luminance component block may be referred to as a prediction block.

[0461] For example, when the upper left sample position of the current luma component block is (x0, y0), the width is WL, the height is HL, and the derived block vector of the luma component is (xd, yd), the block with the sample position (x0+xd, y0+yd) separated by (xd, yd) from the upper left sample position of the current luma component block in the same picture as the upper left sample position, the width is WL, and the height is HL can be the prediction block. At this time, if xd is a negative integer, it can be moved to the left by xd in the horizontal direction from (x0, y0), if xd is a positive integer, it can be moved to the right by xd from (x0, y0), if yd is a negative integer, it can be moved upward by yd in the vertical direction from (x0, y0), and if yd is a positive integer, it can be moved downward by yd from (x0, y0).

[0462] Fig.18 is a diagram illustrating a relationship between a current block and a prediction block according to another embodiment of the present invention.

[0463] Reference Fig.18 , assuming xd and yd are negative integers.

[0464] The sample value of the prediction block may be set as the prediction sample value of the current luminance component block, and the set value may be referred to as a prediction signal of the current luminance component block.

[0465] In the following, the steps of deriving a prediction signal for a chroma component block will be described.

[0466] According to an embodiment, when block partitioning of the luma component and the chroma component in the same CTU is performed identically (i.e., the block partition structure of the luma component and the block partition structure of the chroma component are the same) and the current block is a chroma component block and is encoded using an intra block copy prediction method, a prediction signal of the chroma component block may be derived as follows.

[0467] A block of block vectors of a chroma component block derived from a current chroma component block may be referred to as a prediction block.

[0468] For example, when the upper left sample position of the current chroma component block is (x0, y0), the width is Wc, the height is Hc, and the derived block vector of the chroma component block is (xd, yd), the block whose sample position (x0+xd, y0+yd) is separated from the upper left sample position of the current chroma component block by (xd, yd) in the same picture and is the upper left sample position, the width is Wc, and the height is Hc can be a prediction block. At this time, if xd is a positive integer, it can be moved to the right by xd in the horizontal direction from x0, if xd is a negative integer, it can be moved to the left by xd from x0, if yd is a positive integer, it can be moved downward by yd in the vertical direction from y0, and if yd is a negative integer, it can be moved upward by yd from y0.

[0469] The sample value of the prediction block may be set as the prediction sample value of the current chroma component block, and the set value may be referred to as a prediction signal of the current chroma component block.

[0470] According to an embodiment, when block partitioning of the luma component and the chroma component in the same CTU is performed independently (i.e., the block partition structure of the luma component and the block partition structure of the chroma component are different) and the current block is a chroma component block and is encoded using an intra block copy prediction method, a prediction signal of the chroma component block may be derived as follows.

[0471] The subblock prediction signal may be derived in units of subblocks using a block vector derived in units of subblocks of the current chroma component block.

[0472] A block of block vectors of subblocks of chroma components derived from subblocks of the current chroma component block may be referred to as a predicted subblock.

[0473] For example, when the upper left sample position of the sub-block of the current chroma component block is (sx0, sy0), the width is SWc, the height is SHc and the derived block vector of the chroma component is (Sxd, Syd), (sx0+Sxd, sy0+Syd) obtained by moving (xd, yd) from the upper left sample position of the sub-block in the current chroma component block in the same picture can be the upper left sample position, and the block with a width of SWc and a height of SHc can be the predicted sub-block.

[0474] The sample value of the prediction sub-block may be set as the prediction sample value of the current chroma component sub-block, and the set value may be referred to as a prediction signal of the current chroma component sub-block.

[0475] The prediction signal of the current chroma component block may be constructed using subblock prediction signals of all subblocks included in the current chroma component block.

[0476] Hereinafter, the steps of deriving the residual signal will be described.

[0477] Generally, when a residual signal exists, the residual signal may be transformed and encoded in an encoding process and may be included in and transmitted in a bitstream, and an inverse process of the transform encoding process may be performed in a decoding process to derive the residual signal.

[0478] The identifier information indicating the presence / absence of a residual signal-related signal (eg, a quantized transform coefficient (or quantized transform coefficient), etc.) included in a bitstream and transmitted to a decoder may include at least one of the following items.

[0479] cu_cbf: When the luma component and the chroma component have the same block partition structure, this may indicate information about the presence / absence of the quantized transform coefficient of the residual signal of the luma component block and the quantized transform coefficient of the residual signal of the chroma component block in the coding block CU. When the luma component and the chroma component have independent block partition structures, this may indicate information about the presence / absence of the quantized transform coefficient of the residual signal of the luma component block (or the luma component block in the coding block CU) or the chroma component block (or the chroma component block in the coding block CU). The information about the presence / absence of the quantized transform coefficient of the residual signal having a first value of 1 may indicate the presence of the quantized transform coefficient of the residual signal of the block, and the information about the presence / absence of the quantized transform coefficient of the residual signal having a second value of 0 may indicate the absence of the quantized transform coefficient of the residual signal of the block. When the luminance component and the chrominance component have the same block partition structure, if any one of the luminance component block and the chrominance component (Cb, Cr) block has a quantized transform coefficient of a residual signal, the information about the presence / absence of the quantized transform coefficient of the residual signal may have a first value, and if the quantized transform coefficient of the residual signal does not exist for all components, the information about the presence / absence of the quantized transform coefficient of the residual signal may have a second value. Here, the luminance component block and the chrominance component block may refer to a luminance component block in a coding block CU and a chrominance component block in a coding block CU.

[0480] tu_cbf_luma: This may indicate the presence / absence of a quantized transform coefficient of a residual signal of a luma component block. Information on the presence / absence of a quantized transform coefficient of a residual signal of a luma component block having a first value of 1 may indicate the presence of a quantized transform coefficient of a residual signal of a luma block, and information on the presence / absence of a quantized transform coefficient of a residual signal of a luma component block having a second value of 0 may indicate the absence of a quantized transform coefficient of a residual signal of a luma block. Here, a luma component block may indicate a luma component block in a transform block TU.

[0481] tu_cbf_cr, tu_cbf_cb: These may represent quantization transform coefficients of residual signals of each of Cr and Cb of the chrominance component indicating presence / absence. Information on quantization transform coefficients of a residual signal of a block of a chrominance component (Cr or Cb) having a first value of 1 may represent quantization transform coefficients of a residual signal of a block of a present chrominance component (Cr or Cb), and information on quantization transform coefficients of a residual signal of a block of a chrominance component (Cr or Cb) having a second value of 0 may represent quantization transform coefficients of a residual signal of a block of an absent chrominance component (Cr or Cb). Here, a chrominance component block may represent a chrominance component block in a transform block TU.

[0482] In addition, in the following embodiments, a luminance component block and a chrominance component block related to cu_cbf may represent a luminance component block in an encoding block CU and a chrominance component block in the encoding block CU, respectively. Further, a luminance component block related to tu_cbf_luma may represent a luminance component block in a transform block TU. Further, chrominance component blocks related to tu_cbf_cr and tu_cbf_cb may represent chrominance component blocks in a transform block TU.

[0483] Generally, only when cu_cbf has a first value of 1, at least one of tu_cbf_luma, tu_cbf_cr, or tu_cbf_cb may be further transmitted to indicate presence / absence of quantization transform coefficients of residual signals of a luminance component, Cr of a chrominance component, and Cb of a chrominance component.

[0484] When a luminance component and a chrominance component have an independent block partitioning structure, cu_cbf may have the same information as tu_cbf_luma.

[0485] In a CTU to be currently encoded, when the block partitioning structures of a luminance component and a chrominance component are the same and the current luminance component block is in a skip mode based on intra block copy, residual signals of the current luminance component block and the chrominance component block may be derived as follows.

[0486] When the current luminance component block is in a skip mode based on intra block copy, there is no residual signal as in a skip mode of general intra prediction. In this case, all residual signals may be set to have a value of 0.

[0487] In the current chrominance component block, when the corresponding luminance component block is in a skip mode based on intra block copy, there is no residual signal similar to the luminance component block. In this case, all residual signals may be set to have a value of 0.

[0488] In the case of the skip mode based on intra block copy, information for identifying the presence of a residual signal (e.g., an identifier, a flag, an index, cu_cbf, tu_cbf_luma, tu_cbf_cr, tu_cbf_cb, etc.) may not be sent in the bitstream.

[0489] For example, the cu_cbf value indicating whether the quantized transform coefficients of the residual signals of the luminance component, Cr of the chrominance component, and Cb of the chrominance component all exist may not be sent in the bitstream and may be set to a second value indicating that the quantized transform coefficients of the residual signals of the luminance component, Cr of the chrominance component, and Cb of the chrominance component all do not exist during the decoding process. The tu_cbf_luma indicating the presence / absence of the quantized transform coefficients of the residual signal of the luminance component, the tu_cbf_cr indicating the presence / absence of the quantized transform coefficients of the residual signal of the Cr component of the chrominance component, and the tu_cbf_cb indicating the presence / absence of the quantized transform coefficients of the residual signal of the Cb component of the chrominance component are all not sent and are all set to the second value during the decoding process to indicate the absence of the quantized transform coefficients of the corresponding residual signals.

[0490] In the current CTU to be encoded, when the block partition structures of the luminance component and the chrominance component are the same and the current luminance component block is in the merge mode based on intra block copy, the residual signals of the current luminance component block and the chrominance component block may be derived as follows.

[0491] When the current luminance component block is in the merge mode based on intra block copy, the residual signal may always exist. In this case, the quantized transform coefficients of the residual signal that are transformed and encoded during the encoding process may be included and sent in the bitstream, and the residual signal may be derived by inverse transform coding during the decoding process.

[0492] In the current chrominance component block, when the corresponding luminance component block is in the merge mode based on intra block copy, a residual signal similar to that of the luminance component block may exist. In this case, the quantized transform coefficients of the residual signal that are transformed and encoded during the encoding process may be included and sent in the bitstream, and the residual signal may be derived by inverse transform coding during the decoding process.

[0493] In the case of the merge mode based on intra block copy, information (e.g., identifier, flag, index, cu_cbf, etc.) for identifying the presence of the residual signal may not be transmitted in the bitstream. In the merge mode, since the residual signal always exists, the cu_cbf value indicating whether any one of the quantized transform coefficients of the residual signal of the luminance component, the Cr of the chrominance component, and the Cb of the chrominance component exists may also be set to the first value in the decoding process. In this case, the information for identifying the presence of the residual signal may not be transmitted in the bitstream, and the quantized transform coefficient information of the residual signal may also be included and transmitted.

[0494] However, in the case of the intra block copy based merge mode, since there may be components of quantized transform coefficients having residuals in the luminance component, Cr of the chrominance component, and Cb of the chrominance component, an identifier of the quantized transform coefficient indicating the presence / absence of a residual signal of each component (for example, tu_cbf_luma in the case of the luminance component and tu_cbf_cr and tu_cbf_cb in the case of the chrominance components) may be included in the bitstream and transmitted.

[0495] In the current CTU to be encoded, the block partition structures of the luminance component and the chrominance component are the same and the current luminance component block is in the AMVP mode based on intra block copying, the residual signals of the current luminance component block and the chrominance component block can be derived as follows.

[0496] When the current luminance component block is in the AMVP mode based on intra-block copying, the residual signal may or may not exist. In this case, information for identifying the presence / absence of the residual signal may always be sent in the bitstream. When the residual signal exists, the quantized transform coefficients of the residual signal transformed and encoded in the encoding process may be included and sent in the bitstream, and the residual signal may be derived by inverse transform encoding in the decoding process. When the residual signal does not exist, all residual signals may be set to have a value of 0.

[0497] In the current chrominance component block, when the corresponding luminance component block is in the AMVP mode based on intra block copying, a residual signal similar to the luminance component block may or may not exist. In this case, a quantized transform coefficient of a residual signal transformed and encoded in an encoding process may be included and transmitted in a bitstream, and the residual signal may be derived by inverse transform encoding in a decoding process. When there is no residual signal, all residual signals may be set to have a value of 0.

[0498] In the case of the AMVP mode based on intra block copy, since the quantization transform coefficients of the residual signals of the luminance component, the Cr of the chrominance component, and the Cb of the chrominance component may or may not exist, information (e.g., an identifier, a flag, an index, cu_cbf, etc.) for identifying the presence / absence of the residual signal and indicating whether the quantization transform coefficients of the residual signals of the luminance component, the Cr of the chrominance component, and the Cb of the chrominance component exist may always be included in the bitstream and transmitted in the bitstream.

[0499] In addition, when information (e.g., an identifier, a flag, an index, cu_cbf, etc.) for identifying the presence / absence of a residual signal and indicating whether a quantized transform coefficient of a residual signal of a luminance component, Cr of a chrominance component, and Cb of a chrominance component exists has a first value indicating the presence of a residual signal, since there may be components of quantized transform coefficients without residuals in the luminance component, Cr of the chrominance component, and Cb of the chrominance component, an identifier indicating the presence / absence of a quantized transform coefficient of a residual signal of each component (e.g., tu_cbf_luma in the case of a luminance component and tu_cbf_cr and tu_cbf_cb in the case of chrominance components) may be included in the bitstream and transmitted in the bitstream.

[0500] In the CTU to be currently encoded, when the block partitions of the luma component and the chroma component are independent and the current luma component block is in a skip mode based on intra block copying, the residual signal of the current luma component block may not exist as in the skip mode of general intra prediction. In this case, all residual signals may be set to have a value of 0, and information (e.g., an identifier, a flag, an index, cu_cb, tu_cbf_luma, etc.) for identifying the presence of the residual signal may not be transmitted in the bitstream.

[0501] When the luma component block is in a skip mode based on intra block copying, cu_cbf transmitted for the luma component block in an independent partition structure may indicate whether there is a quantized transform coefficient of a residual signal of the luma component block. In this case, since the quantized transform coefficient of the residual signal of the luma component block is always absent, the information may not be transmitted in the bitstream and may be set to a second value of 0 in the decoding process.

[0502] Also, identification information (eg, tu_cbf_luma) indicating the presence of a residual signal of a luma component may not be transmitted in a bitstream and may be set to a second value of 0 in a decoding process.

[0503] In the CTU to be currently encoded, when the block partitions of the luminance component and the chrominance component are independent and the current luminance component block is in a merge mode based on intra block copying, the residual signal of the current luminance component block may always exist as in a merge mode of general intra prediction. In this case, the quantized transform coefficients of the residual signal transformed and encoded in the encoding process may be included and transmitted in the bitstream, and the residual signal may be derived by inverse transform encoding in the decoding process.

[0504] When the luma component block is in a merge mode based on intra block copying, in an independent partition structure, the cu_cbf sent for the luma component block may only indicate whether there is a quantized transform coefficient of the residual signal of the luma component block. In this case, since the quantized transform coefficient of the residual signal of the luma component block always exists, this information may not be sent in the bitstream and may be set to a first value 1 in the decoding process.

[0505] In addition, identification information (e.g., tu_cbf_luma) of a residual signal indicating the presence / absence of a luma component has the same value as cu_cbf transmitted for a luma component block in an independent partition structure and thus may not be transmitted in a bitstream and may be set to a first value 1 in a decoding process.

[0506] In the CTU to be currently encoded, when the block partitions of the luminance component and the chrominance component are independent and the current luminance component block is in the AMVP mode based on intra-frame block copying, the residual signal of the current luminance component block may exist or not exist as in the AMVP mode of general intra-frame prediction. When the residual signal of the current luminance component block exists, the quantized transform coefficients of the residual signal transformed and encoded in the encoding process may be included and transmitted in the bitstream, and the residual signal may be derived by inverse transform encoding in the decoding process. When there is no residual signal, all residual signals may be set to have a value of 0.

[0507] When the luma component block is in the AMVP mode based on intra block copying, the cu_cbf transmitted for the luma component block in the independent partition structure may only indicate whether there is a quantized transform coefficient of the residual signal of the luma component block. In this case, since the quantized transform coefficient of the residual signal of the luma component block may or may not exist, cu_cbf as information for identifying whether there is a residual signal may always be transmitted in the bitstream.

[0508] In addition, the identification information (e.g., tu_cbf_luma) of the residual signal indicating the presence / absence of the luminance signal in the transform unit TU has the same value as the cu_cbf sent for the luminance component block in the independent partition structure in the coding block CU, and therefore may not be sent in the bitstream, and may be set to the same value as cu_cbf in the decoding process. That is, the encoding / decoding efficiency can be improved by removing the redundancy of the signaling of both cu_cbf and tu_cbf_luma. For example, in an independent partition structure, when the prediction mode of the current luminance component block is the intra-block copy mode, tu_cbf_luma may not be sent with a signal. At this time, the tu_cbf_luma value that is not sent with a signal may be set to the cu_cbf value.

[0509] Whether a residual signal exists may be determined according to the value of cu_cbf or tu_cbf_luma. For example, when the value of cu_cbf or tu_cbf_luma has a first value, it may be determined that a residual signal exists.

[0510] When block partitioning of the luma component and the chroma component is performed independently in the same CTU (i.e., the block partition structure of the luma component is different from the block partition structure of the chroma component) and the current block is a chroma component block and is encoded using an intra block copy prediction method, the residual signal of the chroma component block can be derived as follows.

[0511] All subblocks included in a luma component block corresponding to a current chroma component block may have the same intra block copy prediction encoding mode.

[0512] At this time, the intra block copy prediction encoding mode may be an intra block copy-based skip mode, an intra block copy-based merge mode, or an intra block copy-based AMVP mode.

[0513] Fig.19 2 is a diagram showing the case where the prediction coding modes of the luminance component sub-blocks corresponding to the chrominance component blocks according to an embodiment of the present invention are the same. Fig.19 In the example of , all prediction coding modes of the luminance component sub-blocks can be a skip mode based on intra block copy, a merge mode based on intra block copy, or an AMVP mode based on intra block copy.

[0514] When all subblocks included in a luma component block corresponding to a current chroma component block are in the same intra block copy prediction mode, whether to encode / decode a residual signal of a corresponding chroma component block may be determined based on the intra block copy prediction mode of the corresponding luma component block.

[0515] For example, when all subblocks included in the luminance component block corresponding to the current chrominance component block are in the intra block copy-based skip mode, as in the case where the luminance component block is in the intra block copy-based skip mode, the residual signal of the chrominance component block may not be encoded / decoded, and the residual signal information may not be transmitted. In this case, all residual signals may be set to have a value of 0.

[0516] At this time, information (e.g., identifier, flag, cu_cbf, tu_cbf_cr / tu_cbf_cb, etc.) for identifying the presence / absence of a residual signal of a block may not be transmitted. Information for identifying the presence / absence of a residual signal having a first value may indicate that a residual signal exists, and the information having a second value may indicate that a residual signal does not exist. When a chroma component block is in a skip mode based on intra block copying, information for identifying the presence / absence of a residual signal of the block may be set.

[0517] As another example, when all subblocks included in the luminance component block corresponding to the current chrominance component block are in the intra block copy-based merge mode, as in the case where the luminance component block is in the intra block copy-based merge mode, the chrominance component block may always have a residual signal. In this case, a quantized transform coefficient of the residual signal transformed and encoded in the encoding process may be included and transmitted in the bitstream, and the residual signal may be derived by inverse transform encoding in the decoding process.

[0518] In the independent partition structure, information (eg, identifier, flag, cu_cbf, etc.) sent for the chroma component block to identify the presence of the residual signal may indicate whether the quantized transform coefficient of the residual signal exists in at least one of the Cb block and the Cr block of the chroma component.

[0519] In the case of the intra block copy-based merge mode, information (e.g., an identifier, a flag, an index, cu_cbf, etc.) for identifying the presence / absence of a residual signal may not be transmitted in a bitstream. In the merge mode, since the residual signal always exists, the cu_cbf value indicating whether any one of the quantized transform coefficients of the residual signal of the Cr of the chroma component and the Cb of the chroma component exists may always be set to the first value in the decoding process.

[0520] However, in the case of an intra block copy-based merge mode, since there may be components of quantized transform coefficients without residual signals among the Cr of the chroma component and the Cb of the chroma component, an identifier (e.g., tu_cbf_cr, tu_cbf_cb) indicating the presence / absence of the quantized transform coefficient of the residual signal of each chroma component may be included and transmitted in the bitstream.

[0521] As another example, when all sub-blocks included in a luminance component block corresponding to a current chrominance component block are in the AMVP mode based on intra-block copy, as in the case where the luminance component block is in the AMVP mode based on intra-block copy, the chrominance component block may or may not have a residual signal. In this case, information for identifying the presence / absence of the residual may always be sent in the bitstream. When there is a residual signal of the current luminance component block, the quantized transform coefficients of the residual signal that have been transformed and encoded in the encoding process may be included and sent in the bitstream, and the residual signal may be derived by inverse transform coding in the decoding process. When there is no residual signal, all residual signals may be set to have a value of 0.

[0522] In an independent partition structure, the information for identifying the presence of the residual signal sent for a chrominance component block (e.g., an identifier, a flag, cu_cbf, etc.) may indicate whether the quantized transform coefficients of the residual signal exist in at least one of the Cb block and the Cr block of the chrominance component.

[0523] In the case of the AMVP mode based on intra-block copy, since the quantized transform coefficients of the residual signals of the Cr of the chrominance component and the Cb of the chrominance component may or may not exist, the information (e.g., an identifier, a flag, an index, cu_cbf, etc.) for identifying the presence / absence of the residual signals of the Cr of the chrominance component and the Cb of the chrominance component may be sent in the bitstream.

[0524] Furthermore, when the information (e.g., an identifier, a flag, an index, cu_cbf, etc.) for identifying the presence / absence of the residual signals of the Cr of the chrominance component and the Cb of the chrominance component has a first value indicating the presence of the residual signal, since there may be a component among the Cr of the chrominance component and the Cb of the chrominance component that does not have quantized transform coefficients of the residual, the identifier (e.g., tu_cbf_cr or tu_cbf_cb in the case of the chrominance component) for indicating the presence / absence of the quantized transform coefficients of the residual signal of each component may be included and sent in the bitstream. When the identifier (e.g., tu_cbf_cr) for indicating the presence of the quantized transform coefficients of the residual signal of the Cr of the chrominance component has a first value, the quantized transform coefficient information for the residual signal of the Cr component may be included and sent in the bitstream. When the identifier (e.g., tu_cbf_cb) for indicating the presence of the quantized transform coefficients of the residual signal of the Cb of the chrominance component has a first value, the quantized transform coefficient information for the residual signal of the Cb component may be included and sent in the bitstream.

[0525] As another example, even if all sub-blocks included in the luma component block corresponding to the current chroma component block are in the same intra block copy prediction mode (e.g., intra block copy-based skip mode, intra block copy-based merge mode, intra block copy-based AMVP mode, etc.), since all samples included in the corresponding luma component block are not in the same intra block copy prediction mode, encoding the residual signal according to the mode of the luma component block corresponding to the chroma component block may not be efficient.

[0526] Therefore, when a chroma component block is in an intra block copy mode, regardless of the type of a mode of a sub-block included in a corresponding luminance component block, information (e.g., an identifier, a flag, an index, cu_cbf, etc.) of a quantized transform coefficient of a residual signal for identifying the presence / absence of Cr of the chroma component and Cb of the chroma component may always be included in a bitstream and transmitted in the bitstream.

[0527] In addition, when information (e.g., an identifier, a flag, an index, cu_cbf, etc.) for identifying the presence / absence of a quantized transform coefficient of a residual signal of Cr of a chroma component and Cb of a chroma component has a first value indicating the presence of a residual signal, since there may be a component of a quantized transform coefficient without a residual among Cr of a chroma component and Cb of a chroma component, an identifier (e.g., tu_cbf_cr or tu_cbf_cb in the case of a chroma component) indicating the presence / absence of a quantized transform coefficient of a residual signal of each component may be included in a bitstream and transmitted in the bitstream. When an identifier (e.g., tu_cbf_cr) indicating the presence of a quantized transform coefficient of a residual signal of Cr of a chroma component has a first value, the quantized transform coefficient information of the residual signal of the Cr component may be included in the bitstream and transmitted. When an identifier (e.g., tu_cbf_cb) indicating the presence of a quantized transform coefficient of a residual signal of Cb of a chroma component has a first value, quantized transform coefficient information of a residual signal of the Cb component may be included in a bitstream and transmitted, and the residual signal may be derived by inverse transform encoding in a decoding process. When it is identified that a residual signal of a chroma component block does not exist, quantized transform coefficient information of the residual signal of the chroma component block may not be transmitted, and all residual signals may be set to have a value of 0.

[0528] As another example, when the current chroma component block is in the intra block copy prediction mode or when all subblocks included in the luma component block corresponding to the current chroma component block are in the intra block copy prediction mode, the subblocks of the luma component corresponding to the chroma component block may be in different intra block copy prediction encoding modes (e.g., intra block copy-based skip mode, intra block copy-based merge mode, and intra block copy-based AMVP mode). Fig. 201 is a diagram showing different prediction coding modes of luminance component sub-blocks corresponding to chrominance component blocks according to an embodiment of the present invention. Fig. 20 In the example of , at least two modes of the intra block copy based skip mode, the intra block copy based merge mode, and the intra block copy based AMVP mode may exist in the corresponding luma component block.

[0529] At this time, regardless of the type of pattern of the sub-block included in the corresponding luminance component block, information (e.g., an identifier, a flag, an index, cu_cbf, etc.) of the quantized transform coefficient of the residual signal for identifying the presence / absence of the chrominance component Cr and the chrominance component Cb may always be included in the bitstream and transmitted in the bitstream.

[0530] In addition, when information (e.g., an identifier, a flag, an index, cu_cbf, etc.) for identifying the presence / absence of a quantized transform coefficient of a residual signal of Cr of a chroma component and Cb of a chroma component has a first value indicating the presence of a residual signal, since there may be a component of a quantized transform coefficient without a residual signal among Cr of a chroma component and Cb of a chroma component, an identifier (e.g., tu_cbf_cr, tu_cbf_cb in the case of a chroma component) indicating the presence / absence of a quantized transform coefficient of a residual signal of each component may be included in the bitstream and transmitted in the bitstream. When an identifier (e.g., tu_cbf_cr) indicating the presence of a quantized transform coefficient of a residual signal of Cr of a chroma component has a first value, the quantized transform coefficient information of the residual signal of the Cr component may be included in the bitstream and transmitted in the bitstream. When the identifier (e.g., tu_cbf_cb) indicating the presence of the quantized transform coefficient of the residual signal of the Cb chroma component has a first value, the quantized transform coefficient information of the residual signal of the Cb component may be included in the bitstream and transmitted in the bitstream, and the residual signal may be derived by inverse transform encoding in the decoding process. When it is identified that the residual signal of the chroma component block does not exist, the quantized transform coefficient information of the residual signal of the chroma component block may not be transmitted, and all residual signals may be set to have a value of 0.

[0531] In the following, the steps of constructing the reconstructed signal will be described.

[0532] In the current luminance component block, a reconstructed signal may be constructed by adding a residual signal of the luminance component block to a prediction signal of the luminance component block.

[0533] In the current chroma component block, a reconstructed signal may be constructed by adding a residual signal of the chroma component block to a prediction signal of the chroma component block.

[0534] In addition, when there is no residual signal, the prediction signal may be set as the reconstructed signal.

[0535] Hereinafter, the steps of entropy encoding / decoding information on intra block copy prediction will be described.

[0536] The information about the intra block copy prediction encoding may be entropy encoded in the bitstream, or may be obtained by entropy decoding from the bitstream. Here, the information about the intra block copy prediction encoding may include at least one of the following information.

[0537] cu_skip_flag indicating whether skip mode is used merge_flag indicating whether merge mode is used merge_idx (merge index) indicating the merge candidate, pred_mode_flag indicating whether the prediction mode is intra prediction pre_mode_ibc_flag indicating whether the prediction mode is inter prediction or intra block copy prediction Block vector candidate index (mvp_l0_flag) Motion Vector Difference cu_cbf, tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr indicating the presence / absence of the quantized transform coefficients of the residual signal Here, cu_skip_flag may indicate whether the skip mode is used, and may be entropy encoded in units of at least one of a coding block or a prediction block. For example, if the information indicating whether the skip mode is used has a first value of 1, this may indicate that the skip mode is used, and when the information indicating whether the skip mode is used has a second value of 0, this may indicate that the skip mode is not used.

[0538] merge_flag may indicate whether the merge mode is used, and the merge_flag may be entropy encoded in units of at least one of a coding block or a prediction block. For example, if the information indicating whether the merge mode is used has a first value of 1, this may indicate that the merge mode is used, and when the information indicating whether the merge mode is used has a second value of 0, this may indicate that the merge mode is not used.

[0539] merge_idx may represent information indicating a merge candidate in a merge candidate list, and may be entropy encoded in units of at least one of a coding block or a prediction block. In addition, merge_idx may represent merge index information. In addition, merge_idx may indicate a block of a derived merge candidate in a reconstructed block that is spatially adjacent to a current block. In addition, merge_idx may indicate at least one of the motion information of a merge candidate. For example, merge index information having a first value of 0 may indicate a first merge candidate in a merge candidate list, merge index information having a second value of 1 may indicate a second merge candidate in a merge candidate list, and merge index information having a third value of 2 may indicate a third merge candidate in a merge candidate list. In addition, merge index information having a fourth value to an Nth value may indicate a merge candidate corresponding to a corresponding value in the order of the candidates in the merge candidate list. Here, N may be a positive integer including 0.

[0540] pred_mode_flag may indicate whether the intra prediction mode is applied, and may be entropy encoded in units of at least one of a coding block or a prediction block. For example, information indicating whether the intra prediction mode is applied having a first value of 1 may indicate that the intra prediction mode is applied, and information indicating whether the intra prediction mode is applied having a second value of 0 may indicate that the intra prediction mode is not applied.

[0541] pred_mode_ibc_flag may indicate whether the intra block copy prediction mode is applied, and may be entropy encoded in units of at least one of a coding block, a prediction block, or a coding unit. For example, information indicating whether the intra block copy prediction mode is applied having a first value of 1 may indicate that the intra block copy prediction mode is applied, and information indicating whether the intra block copy prediction mode is applied having a second value of 0 may indicate that the intra block copy prediction mode is not applied.

[0542] The block vector candidate index mvp_l0_flag may indicate a block vector candidate used by the current block in the block vector candidate list of the intra block copy prediction mode, and the block vector candidate index may be entropy encoded / decoded. The block vector candidate index may be used to derive a prediction block of the current block.

[0543] The motion vector difference may represent a difference between a block vector and a prediction block vector, and the block vector difference may be used to derive a prediction block for the current block.

[0544] In cu_cbf, tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr indicating the presence / absence of the quantized transform coefficient of the residual signal, when the luma component and the chroma component have the same block partition structure, cu_cbf may indicate information about the presence / absence of the quantized transform coefficient of the luma component block and the quantized transform coefficient of the chroma component block, and when the luma component and the chroma component have independent block partition structures, cu_cbf may indicate information about the quantized transform coefficient of the luma component block or the chroma component block. Information indicating the presence / absence of the quantized transform coefficient having a first value of 1 may indicate that the quantized transform coefficient of the block exists, and information indicating the presence / absence of the quantized transform coefficient having a second value of 0 may indicate that the quantized transform coefficient of the block does not exist. tu_cbf_luma may indicate the presence / absence of the quantized transform coefficient of the luma component block, and tu_cbf_cr and tu_cbf_cb may indicate the presence / absence of the quantized transform coefficients of Cr and Cb of the chroma component, respectively. The information on the presence / absence of the quantized transform coefficient of the luma component block having a first value of 1 may indicate that the quantized transform coefficient of the luma block exists, and the information on the presence / absence of the quantized transform coefficient of the luma component block having a second value of 0 may indicate that the quantized transform coefficient of the luma block does not exist. The information on the presence / absence of the quantized transform coefficient of the chroma component Cb or Cr having a first value of 1 may indicate that the quantized transform coefficient of the chroma block exists, and the information on the presence / absence of the quantized transform coefficient of the chroma component Cb or Cr having a second value of 0 may indicate that the quantized transform coefficient of the chroma block does not exist.

[0545] In addition, at least one of the information about intra block copy prediction encoding may be entropy encoded / decoded from at least one of a video parameter set, a sequence parameter set, a picture parameter set, an adaptation parameter set, a tile header, a tile group header, a slice header, or a slice payload.

[0546] Figures 21a to 23 is a diagram illustrating encoding information transmitted in association with intra-block partitioning according to an exemplary embodiment of the present invention.

[0547] Fig.21a and Figure 21b An example of a method of transmitting encoding information for each block partition structure is shown.

[0548] Figure 22 to Figure 23 An example of a coding information transmission method of removing overlap when cu_cbf and tu_cbf_luma information transmitted at the time of intra block partition prediction overlap is shown.

[0549] Specifically, Figure 22 to Figure 23A method for redundant signaling of cu_cbf and tu_cbf_luma indicating the same information in an independent block partition structure and when the luma component block is intra block copy predicted is shown. Figure 22 to Figure 23 , in an independent block partition structure and when the luma component block is intra block copy predicted, tu_cbf_luma may not be sent and the cu_cbf value may be set to the tu_cbf_luma value.

[0550] Reference Fig. 22 In the case of a luminance component block of an independent block partition structure (i.e., treeType is DUAL_TREE_LUMA), by signaling tu_cbf_luma only when the prediction mode is an intra prediction mode (i.e., CurPredMode[x0][y0]==MODE_INTRA), tu_cbf_luma may not be sent when the luminance component block of the independent block partition structure is in an intra block copy prediction mode. In addition, the luminance component block of the independent block partition structure (i.e., treeType is DUAL_TREE_LUMA), tu_cbf_cb, and tu_cbf_cr may not be signaled, and when tu_cbf_cb and tu_cbf_cr are not signaled, they may be set to 0 in the decoding process. In addition, the tu_cbf_luma value that is not signaled may be set to the cu_cbf value.

[0551] Reference Fig.23 In the case of a luma component block of an independent block partition structure (i.e., treeType is DUAL_TREE_LUMA), by signaling tu_cbf_luma only when the prediction mode is not an intra block copy prediction mode (i.e., CurPredMode[x0][y0]==MODE_IBC), tu_cbf_luma may not be signaled when the luma component block of the independent block partition structure is in the intra block copy prediction mode. In addition, in the case of a luma component block of an independent block partition structure (i.e., treeType is DUAL_TREE_LUMA), tu_cbf_cb and tu_cbf_cr may not be signaled, and when tu_cbf_cb and tu_cbf_cr are not signaled, they may be set to 0 in the decoding process. In addition, the tu_cbf_luma value that is not signaled may be set to the cu_cbf value.

[0552] According to the present invention, a method for deriving a block vector of a chrominance component block from a luminance component block vector corresponding to a chrominance component block in an independent block partition structure, and a method and apparatus for minimizing residual signal encoding information of a chrominance component block and a luminance component block when encoding is performed based on intra-block copying can be provided.

[0553] When entropy encoding / decoding at least one of the information about motion compensation or the region information, at least one of the following binarization methods may be used.

[0554] Truncated Rice Binarization Method k-order Exp_Golomb binarization method Finite k-order Exp_Golomb binarization method Fixed-length binarization method Unary Binarization Method Truncated Unary Binarization Method When entropy encoding / decoding is performed on at least one of the information about motion compensation or the area information, the context model may be determined using at least one of the following information: information about motion compensation of a neighboring block or the area information of a neighboring block, previously encoded / decoded information about motion compensation, previously encoded / decoded area information, information about the depth of a current unit / block, or information about the size of a current unit / block.

[0555] When entropy encoding / decoding is performed on at least one of the information about motion compensation or the region information, at least one of the following information may be used as a prediction value for the information about motion compensation or the region information about the current block to perform entropy encoding / decoding: information about motion compensation of a neighboring block or the region information of a neighboring block, previously encoded / decoded information about motion compensation, previously encoded / decoded region information, information about the depth of the current unit / block, or information about the size of the current unit / block.

[0556] The above-described embodiments may be performed in the same manner in an encoder and a decoder.

[0557] At least one embodiment or a combination of the above embodiments may be used to encode / decode a video.

[0558] The order in which the above-described embodiments are applied may be different between an encoder and a decoder, or the order in which the above-described embodiments are applied may be the same in an encoder and a decoder.

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

[0560] The block form to which the above-described embodiment of the present invention is applied may have a square form or a non-square form.

[0561] At least one of the syntax elements (flags, indexes, etc.) entropy encoded in the encoder and entropy decoded in the decoder may use at least one of the following binarization, debinarization, entropy encoding / entropy decoding methods.

[0562] -Signed 0th order Exp_Golomb binarization / debinarization method (se(v)) - Signed k-order Exp_Golomb binarization / debinarization method (sek(v)) - Binarization / debinarization method of Exp_Golomb of order 0 for unsigned positive integers (ue(v)) - Unsigned positive integer k-order Exp_Golomb binarization / debinarization method (uek(v)) -Fixed length binarization / debinarization method (f(n)) - Truncated Rice binarization / debinarization method or truncated unary binarization / debinarization method (tu(v)) - Truncated binary binarization / debinarization method (tb(v)) -Context-adaptive arithmetic coding / decoding method (ae(v)) -Byte unit bit string (b(8)) - Binarization / debinarization methods for signed integers (i(n)) - Binarization / debinarization method for unsigned positive integers (u(n)) - Unary Binarization / Debinarization Method The above-mentioned embodiments of the present invention may be applied according to the size of at least one of a coding block, a prediction block, a transform block, a block, a current block, a coding 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 a minimum size and a maximum size so that the above-mentioned embodiments are applied, or the size may be defined as a fixed size to which the above-mentioned embodiments are applied. In addition, in the above-mentioned embodiments, the first embodiment may be applied to a first size, and the second embodiment may be applied to a second size. In other words, the above-mentioned embodiments may be applied in combination according to the size. In addition, the above-mentioned 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, the above-mentioned embodiments may be applied when the block size is included in a specific range.

[0563] For example, when the size of the current block is 8×8 or larger, the above embodiment may be applied. For example, when the size of the current block is only 4×4, the above embodiment may be applied. For example, when the size of the current block is 16×16 or smaller, the above embodiment may be applied. For example, when the size of the current block is equal to or larger than 16×16 and equal to or smaller than 64×64, the above embodiment may be applied.

[0564] The above-described embodiments of the present invention may be applied according to time layers. In order to identify the time layers to which the above-described embodiments may be applied, a corresponding identifier may be signaled, and the above-described embodiments may be applied to the specified time layers 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 may be applied, or may be defined as a specific layer to which the embodiments may be applied. In addition, a fixed time layer to which the embodiments may be applied may be defined.

[0565] For example, when the temporal layer of the current image is the lowest layer, the above embodiment may be applied. For example, when the temporal layer identifier of the current image is 1, the above embodiment may be applied. For example, when the temporal layer of the current image is the highest layer, the above embodiment may be applied.

[0566] A slice type or a tile 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 slice type or tile group type.

[0567] In the above embodiments, the method is described based on a flowchart having a series of steps or units, but the present invention is not limited to the order of the steps, but some steps may be performed simultaneously with other steps or in a different order. In addition, it should be understood by those skilled in the art that the steps in the flowchart are not mutually exclusive, and other steps may be added to the flowchart, or some steps may be deleted from the flowchart without affecting the scope of the present invention.

[0568] The embodiments include various aspects of the examples. All possible combinations for various aspects may not be described, but those skilled in the art will be able to recognize different combinations. Therefore, the present invention may include all substitutions, modifications and changes within the scope of the claims.

[0569] Embodiments of the present invention may 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 a separate program instruction, a data file, a data structure, etc., or a combination of program instructions, data files, data structures, etc. The program instructions recorded in the computer-readable recording medium may be specially designed and constructed for the present invention, or known to ordinary technicians in the field of computer software technology. Examples of computer-readable recording media include magnetic recording media (such as hard disks, floppy disks, and 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 memory (ROM), random access memory (RAM), flash memory, etc.) that are specifically constructed to store and implement program instructions. Examples of program instructions include not only machine language codes formatted by a compiler, but also high-level language codes that can 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 processing according to the present invention, or vice versa.

[0570] Although the present invention has been described according to specific items such as detailed elements and limited embodiments and drawings, they are provided only to help a greater understanding of the present invention, and the present invention is not limited to the above embodiments. It will be appreciated by those skilled in the art that various modifications and changes can be made from the above description.

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

[0572] Industrial Applicability The present invention can be used to encode or decode images.

Claims

1. A method for decoding an image, the method comprising: include: Decoding, from a sequence parameter set SPS, enabling information indicating whether an intra block copy IBC mode is enabled; decoding maximum number information indicating a maximum number of candidates that can be included in the block vector candidate list, wherein when the enabling information indicates that the IBC mode is enabled, the maximum number information is decoded; decoding an IBC flag indicating whether an IBC mode is applied to a current block; When the IBC flag indicates that the IBC mode is applied to the current block, deriving the block vector candidate list for the current block by inserting at least one block vector candidate; and deriving a block vector for the current block based on the block vector candidate list, wherein the block vector for the current block is derived from one of the block vector candidates included in the block vector candidate list, wherein, when a merge mode based on the IBC mode is applied to the current block, one of the block vector candidates is selected by a merge index, and wherein, when the advanced motion vector prediction mode based on the IBC mode is applied to the current block, one of the block vector candidates is selected by the L0 motion vector predictor flag, and When the maximum number of candidates is not greater than 1, decoding of the L0 motion vector predictor flag is omitted and the value of the L0 motion vector predictor flag is inferred to be 0.

2. The method according to claim 1, in, When the maximum number of candidates is set to 0, the IBC mode is not applied to all slices that reference the SPS.

3. The method according to claim 1, in, When the size of the current block is smaller than a predetermined size, spatial block vector candidates derived from upper and left neighboring blocks are not added to the block vector candidate list for the current block.

4. The method according to claim 1, in, The maximum number information indicates a difference between a predetermined positive integer and the maximum number of candidates.

5. The method according to claim 1, in, When the maximum number of candidates is not greater than 1, decoding of the merge index is omitted and the value of the merge index is inferred to be 0.

6. The method according to claim 1, in, The step of deriving the block vector candidate list for the current block comprises: When the number of candidate block vectors included in the block vector candidate list is less than the maximum number of candidates, one or more history-based block vector candidates are added to the block vector candidate list until the number of candidate block vectors in the block vector candidate list is equal to the maximum number of candidates.

7. The method according to claim 6, in, The step of adding one or more history-based block vector candidates to the block vector candidate list comprises: One or more history-based block vector candidates are added to the block vector candidate list based on whether a candidate block vector previously included in the block vector candidate list and the added history-based block vector candidate are the same.

8. The method according to claim 7, in, When the size of the current block is 4×4, the block vector for the current block is not updated as a history-based block vector candidate.

9. A method for encoding an image, the method comprising: include: Encoding the enabling information indicating whether the intra block copy IBC mode is enabled into the sequence parameter set SPS; encoding maximum number information indicating a maximum number of candidates that can be included in the block vector candidate list, wherein when the enabling information is encoded to have a value indicating that the IBC mode is enabled, the maximum number information is encoded; deriving the block vector candidate list for the current block by inserting at least one block vector candidate; deriving a block vector for the current block based on the block vector candidate list; and encoding an IBC flag for the current block indicating whether an IBC mode is applied to the current block, wherein the block vector for the current block is derived from one of the block vector candidates included in the block vector candidate list, wherein when a merge mode based on the IBC mode is applied to the current block, a merge index representing one of the block vector candidates is selectively encoded, and wherein when the advanced motion vector prediction mode based on the IBC mode is applied to the current block, an L0 motion vector predictor flag indicating one of the block vector candidates is selectively encoded, and Wherein, when the maximum number of candidates is not greater than 1, encoding of the L0 motion vector predictor flag is omitted and one of the block vector candidates has an index of 0.

10. A method for transmitting data, in, The data comprises a bitstream generated by an encoding method, wherein the encoding method comprises: Encoding the enabling information indicating whether the intra block copy IBC mode is enabled into the sequence parameter set SPS; encoding maximum number information indicating a maximum number of candidates that can be included in the block vector candidate list, wherein when the enabling information is encoded to have a value indicating that the IBC mode is enabled, the maximum number information is encoded; deriving the block vector candidate list for the current block by inserting at least one block vector candidate; deriving a block vector for the current block based on the block vector candidate list; and encoding an IBC flag for the current block indicating whether an IBC mode is applied to the current block, wherein the block vector for the current block is derived from one of the block vector candidates included in the block vector candidate list, wherein when a merge mode based on the IBC mode is applied to the current block, a merge index representing one of the block vector candidates is selectively encoded, and wherein when the advanced motion vector prediction mode based on the IBC mode is applied to the current block, an L0 motion vector predictor flag indicating one of the block vector candidates is selectively encoded, and Wherein, when the maximum number of candidates is not greater than 1, encoding of the L0 motion vector predictor flag is omitted and one of the block vector candidates has an index of 0.