Method for encoding / decoding image and method for transmitting bitstream
By deducing the block vector in image encoding/decoding and reconstructing the current block, the problem of limited encoding efficiency in the intra-block replication method in the prior art is solved, and higher compression efficiency and more efficient image data storage and transmission are achieved.
Patent Information
- Application Number
- CN202510275024.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-06-19
- Filing Date
- 2020-03-11
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, in the image encoding/decoding method using intra-block copying, the block partition structures of the luminance component and the chrominance component are different, resulting in a limited encoding efficiency.
By obtaining the prediction mode information of the current block from the bitstream, deducing the block vector, and reconstructing the current block based on this, efficient encoding and decoding of the image is achieved.
The compression efficiency of image encoding/decoding is improved, especially in scenarios where intra-block replication is used, high-resolution and high-quality image data can be stored and transmitted more efficiently.
Smart Images

Figure CN120075434A_ABST
Abstract
Description
[0001] This application is a divisional application of a patent application with an application date of March 11, 2020, an application number of 202080020366.9, and a title of "Method for Encoding / Decoding Images and Method for Transmitting Bitstreams". Technical Field
[0002] The present invention relates to an image encoding / decoding method and apparatus, and a recording medium for storing a bitstream. More specifically, the present invention relates to a method and apparatus for encoding / decoding an image based on intra-block copy, and a recording medium for storing a bitstream 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 correspondingly increases. This is one of the reasons for the increase in transmission cost and storage cost when transmitting image data through existing transmission media such as wired or wireless broadband channels or when storing image data. To solve these problems of high-resolution and high-quality image data, efficient image encoding / decoding techniques are required.
[0004] There are various video compression techniques, such as an inter prediction technique for predicting the value of a pixel in a current picture from the values of pixels in a previous picture or a subsequent picture, an intra prediction technique for predicting the value of a pixel in a region of a current picture from the values of pixels in another region of the current picture, a transform and quantization technique for compressing the energy of a residual signal, and an entropy encoding technique for assigning a shorter code to a frequently occurring pixel value and a longer code to a less frequently occurring pixel value.
[0005] In traditional image encoding / decoding methods and apparatuses, if the luminance component and the chrominance component have different block partition structures in the encoding process based on intra-block copy, the encoding information of the luminance component is restrictively used in the encoding process of the chrominance component. Therefore, there are limitations in improving the encoding efficiency. Summary of the Invention
[0006] Technical Problem An object of the present invention is to provide an image encoding / decoding method and apparatus having improved compression efficiency.
[0007] Another object of the present invention is to provide an image encoding / decoding method and apparatus using intra-block copy having improved compression efficiency.
[0008] Another object of the present invention is to provide a recording medium for storing a bitstream generated by the image encoding / decoding method or apparatus according to the present invention.
[0009] Technical solution A method for decoding an image includes: obtaining prediction mode information of a current block from a bitstream; using the prediction mode information of the current block to derive a prediction mode of the current block; obtaining information indicating whether there is a residual signal of a transform block for the current block based on at least one of information about a partition of the current block or the prediction mode of the current block; and reconstructing the current block based on the information indicating whether there is the residual signal of the transform block.
[0010] The information about the partition of the current block may indicate a partition structure between a luminance block and a chrominance block corresponding to the current block, and the partition structure between the luminance block and the chrominance block may be one of a same block partition structure and an independent block partition structure.
[0011] The prediction mode of the current block may be at least one of an intra prediction mode, an inter prediction mode, or an intra block copy prediction mode.
[0012] When the information about the partition of the current block has an independent block partition structure for the luminance block and the prediction mode of the current block is an intra block copy prediction mode, the information indicating whether there is a residual signal of the transform block for the current block may not be decoded.
[0013] When the prediction mode of the current block is an intra block copy prediction mode, the step of reconstructing the current block may include: deriving a block vector for the current block, and using the derived block vector to reconstruct the current block.
[0014] The block vector may be derived based on a reference region buffer that can be referenced by the block vector, and the size of the reference region buffer may be a predetermined integer multiple of the size of a coding tree block including the current block.
[0015] The reference region buffer may be initialized in units of at least one of a picture, a slice, a parallel block group, a parallel block, a coding tree unit (CTU), a CTU row, or a CTU column.
[0016] The initialization value may be -1.
[0017] The reference region buffer may store reconstructed image sample values of a prediction block corresponding to the current block obtained using the block vector.
[0018] When the size of the coding tree block is 128×128, the predetermined integer may be 2.
[0019] According to the present invention, a method for encoding an image includes: encoding information indicating whether there is a residual signal of a transform block for a current block based on at least one of information about a partition of the current block or a prediction mode of the current block; and encoding the current block based on the information indicating whether there is a residual signal of the transform block.
[0020] The information about the partition of the current block may indicate a partition structure between a luminance block and a chrominance block corresponding to the current block, and the partition structure between the luminance block and the chrominance block may be one of a same-block partition structure and an independent-block partition structure.
[0021] The prediction mode of the current block may be at least one of an intra prediction mode, an inter prediction mode, or an intra block copy prediction mode.
[0022] When the information about the partition of the current block has an independent-block partition structure for the luminance block and the prediction mode of the current block is an intra block copy prediction mode, the information indicating whether there is a residual signal of the transform block for the current block may not be encoded.
[0023] When the prediction mode of the current block is an intra block copy prediction mode, the step of encoding the current block may include: deriving a block vector for the current block, and encoding the current block using the derived block vector.
[0024] The block vector may be derived based on a reference region buffer that can be referenced by the block vector, and the size of the reference region buffer may be a predetermined integer multiple of the size of a coding tree block including the current block.
[0025] The reference region buffer may be initialized in units of at least one of a picture, a slice, a parallel block group, a parallel block, a coding tree unit (CTU), a CTU row, or a CTU column.
[0026] The initialization value may be -1.
[0027] The reference region buffer may store reconstructed image sample values of a prediction block corresponding to the current block obtained using the block vector.
[0028] A recording medium according to the present invention may store a bitstream generated by the image encoding method according to the present invention. Advantageous Effects According to the present invention, an image encoding / decoding method and apparatus having improved compression efficiency can be provided.
[0029] According to the present invention, an image encoding / decoding method and apparatus using intra block copy having improved compression efficiency can be provided.
[0030] According to the present invention, a recording medium for storing a bitstream generated by an image encoding / decoding method or apparatus according to the present invention can be provided. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is a block diagram showing the configuration of an encoding apparatus according to an embodiment to which the present invention is applied.
[0032] Figure 2 is a block diagram showing the configuration of a decoding apparatus according to an embodiment to which the present invention is applied.
[0033] Figure 3 is a diagram schematically showing a partitioning structure of an image when the image is encoded and decoded.
[0034] Figure 4 is a diagram showing an intra prediction process.
[0035] Figure 5 is a diagram showing an example of an inter prediction process.
[0036] Figure 6 is a diagram showing a transform and quantization process.
[0037] Figure 7 is a diagram showing reference sample points that can be used for intra prediction.
[0038] Figure 8a is a flowchart showing an image encoding method according to an embodiment of the present invention.
[0039] Figure 8b is a flowchart showing an image decoding method according to an embodiment of the present invention.
[0040] Figure 9 is a diagram showing a relationship between a current block and a prediction block according to an embodiment of the present invention.
[0041] Figure 10 is a diagram showing neighboring blocks adjacent to a current block according to an embodiment of the present invention.
[0042] Figure 11 is a diagram showing a current block partitioned when a predetermined threshold is 32 according to an embodiment of the present invention.
[0043] Figure 12 is a diagram showing a process of sharing and using a block vector candidate list constructed in a higher-level block according to an embodiment of the present invention.
[0044] Figure 13 is a diagram showing a relationship between a current block and a reference prediction block according to an embodiment of the present invention.
[0045] Figure 14 is a diagram showing a reference prediction block for a current block in an intra block copy mode according to an embodiment of the present invention.
[0046] Figure 15 is a diagram showing a reference region buffer in an intra block copy mode according to an embodiment of the present invention.
[0047] Figure 16 is a diagram showing a range of values of a block vector according to an embodiment of the present invention.
[0048] Figure 17 is a diagram showing a region that has been encoded / decoded before a current block according to an embodiment of the present invention.
[0049] Figure 18 is a diagram showing a reference region buffer in an intra block copy mode according to another embodiment of the present invention.
[0050] Figure 19 is a diagram showing a correspondence relationship between a chrominance component block and a luminance component region according to an embodiment of the present invention.
[0051] Figure 20 is a diagram showing a luminance sub-block according to an embodiment of the present invention.
[0052] Figure 21 is a diagram showing a relationship between a current block and a prediction block according to an embodiment of the present invention.
[0053] Figure 22 is a diagram showing a case where prediction coding modes of luminance sub-blocks corresponding to a chrominance component block are the same according to an embodiment of the present invention.
[0054] Figure 23 is a diagram showing a case where prediction coding modes of luminance sub-blocks corresponding to a chrominance component block are different according to an embodiment of the present invention.
[0055] Figures 24 to Figure 27 is a diagram showing encoded information transmitted in association with an intra block partition according to an embodiment of the present invention. Detailed Description
[0056] Various modifications can be made to the present invention, and there are various embodiments of the present invention. Herein, examples of various embodiments of the present invention will now be provided and described in detail with reference to the accompanying drawings. However, the present invention is not limited thereto, although the exemplary embodiments can be construed as including all modifications, equivalents, or alternatives within the technical concept and scope of the present invention. In all aspects, like reference numerals refer to the same or similar functions. In the 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 which illustrate, in a schematic manner, specific embodiments in which the present invention can be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, specific features, structures, and characteristics described herein in connection with one embodiment can be implemented in other embodiments without departing from the spirit and scope of the present disclosure. In addition, it should be understood that within each disclosed embodiment, the positions or arrangements of the individual elements can be modified without departing from the spirit and scope of the present disclosure. Accordingly, the following detailed description should not be construed in a limiting sense, and the scope of the present disclosure is defined only by the appended claims (when properly construed, together with the full scope of equivalents claimed).
[0057] The terms "first", "second", etc. used in the specification may be used to describe various components, but the components should not be construed 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, the "first" component may be named the "second" component, and the "second" component may be similarly named the "first" component. The term "and / or" includes combinations of multiple items or any one of the multiple items.
[0058] It will be understood that in this specification, when an element is simply referred to as "connected to" or "coupled to" another element rather than "directly connected to" or "directly coupled to" another element, the element may be "directly connected to" or "directly coupled to" another element, or be connected to or coupled to another element with other elements intervening between the element and the other element. Conversely, it should be understood that when an element is referred to as "directly coupled" or "directly connected" to another element, there is no intermediate element.
[0059] In addition, the components shown in the embodiments of the present invention are shown independently to represent different characteristic functions from each other. Therefore, this does not mean that each component is constituted by a separate hardware or software component unit. In other words, for convenience, each component includes each of the components listed. Therefore, at least two components of each component may be combined to form one component, or one component may be divided into multiple components to perform each function. Embodiments in which each component is combined and embodiments in which one component is divided are also included in the scope of the present invention without departing from the essence of the present invention.
[0060] The terms used in this specification are only for describing specific embodiments and are not intended to limit the present invention. Expressions used in the singular form include the plural form unless they have a clearly different meaning in the context. In this specification, it will be understood that terms such as "including" and "having" are intended to indicate the presence of features, numbers, steps, actions, elements, components, or combinations thereof disclosed in the specification, and are not intended to exclude the possibility of the existence or addition of one or more other features, numbers, steps, actions, elements, components, or combinations thereof. In other words, when a specific element is referred to as "being included", elements other than the corresponding element are not excluded, but additional elements may be included in the embodiments of the present invention or within the scope of the present invention.
[0061] In addition, some components may not be essential components for performing the basic functions of the present invention, but are only optional components for improving its performance. The present invention can be implemented by including only the essential components for realizing the essence of the present invention and not including the components for improving performance. Structures that include only the essential components and do not include the optional components for only improving performance are also included in the scope of the present invention.
[0062] 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 components in the drawings are denoted by the same reference numerals, and repeated descriptions of the same components will be omitted.
[0063] Hereinafter, an image may refer to a frame 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 or both encoding and decoding one image in the images of a moving picture".
[0064] Hereinafter, the terms "moving picture" and "video" may be used with the same meaning and may be interchangeable with each other.
[0065] Hereinafter, the target image may be an encoding target image as an encoding target and / or a decoding target image as a decoding target. In addition, the 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.
[0066] Hereinafter, the terms "image", "picture", "frame", and "screen" may be used with the same meaning and may be replaced with each other.
[0067] 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 that is a target of current encoding and / or decoding. For example, the terms "target block" and "current block" may be used with the same meaning and may be replaced with each other.
[0068] Hereinafter, the terms "block" and "unit" may be used with the same meaning and may be replaced with each other. Or "block" may represent a specific unit.
[0069] Hereinafter, the terms "region" and "segment" may be replaced with each other.
[0070] 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.
[0071] In an embodiment, each of specific information, data, flag, index, element, and attribute, etc. may have a value. A value of the information, data, flag, index, element, and attribute equal to "0" may represent logical false or a first predefined value. In other words, the values "0", false, logical false, and the first predefined value may be replaced with each other. A value of the information, data, flag, index, element, and attribute equal to "1" may represent logical true or a second predefined value. In other words, the values "1", true, logical true, and the second predefined value may be replaced with each other.
[0072] When variables i or j are used to represent a column, row, or index, the value of i may be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, the column, row, index, etc. may be counted starting from 0, or may be counted starting from 1.
[0073] Description of terms Encoder: Represents a device that performs encoding. That is, it represents an encoding device.
[0074] Decoder: Represents a device that performs decoding. That is, it represents a decoding device.
[0075] Block: A block is an M×N array of samples. Here, M and N can represent positive integers, and a block can represent an array of samples in two-dimensional form. A block can refer to a unit. The current block can represent an encoding target block that becomes the target during encoding, or a decoding target block that becomes the target during decoding. In addition, the current block can be at least one of an encoding block, a prediction block, a residual block, and a transform block.
[0076] Sample: A sample is a basic unit that constitutes a block. Depending on the bit depth (B d ), a sample can be represented as a value from 0 to −1. In the present invention, a sample can be used in the sense of a pixel. That is, a sample, a pel, and a pixel can have the same meaning as each other.
[0077] Unit: A unit can refer to an encoding and decoding unit. When encoding and decoding an image, a unit can be a region generated by partitioning a single image. In addition, when a single image is partitioned into sub-partition units during encoding or decoding, a unit can represent a sub-partition unit. That is, an image can be partitioned into multiple units. When encoding and decoding an image, predetermined processing can be performed for each unit. A single unit can be partitioned into sub-units having a size smaller than the size of the unit. Depending on the function, a unit can represent a block, a macroblock, a coding tree unit, a coding tree block, an encoding unit, an encoding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, etc. In addition, in order to distinguish a unit from a block, a unit can include a luminance component block, a chrominance component block associated with the luminance component block, and syntax elements of each color component block. A unit can have various sizes and shapes. Specifically, the shape of a unit can be a two-dimensional geometric figure, such as a square, a rectangle, a trapezoid, a triangle, a pentagon, etc. In addition, unit information can include at least one of a unit type indicating an encoding unit, a prediction unit, a transform unit, etc., and a unit size, a unit depth, an encoding and decoding order of the unit, etc.
[0078] Coding tree unit: A coding tree unit is configured with a single coding tree block of the luminance component Y and two coding tree blocks related to the chrominance components Cb and Cr. In addition, a coding tree unit can represent a block and syntax elements of each block. Each coding tree unit can 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 lower-level units such as an encoding unit, a prediction unit, a transform unit, etc. A coding tree unit can 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, a quadtree can represent a quaternary tree.
[0079] When the size of a coding block is within a predetermined range, it is possible to perform partitioning only using quadtree partitioning. Here, the predetermined range may be defined as at least one of the maximum size and the minimum size of coding blocks that can be partitioned only using quadtree partitioning. Information indicating the maximum / minimum size of coding blocks allowing quadtree partitioning can be signaled through a bitstream, and the information can be signaled in at least one unit among a sequence, picture parameters, parallel block groups, or slices (segments). Optionally, the maximum / minimum size of coding blocks can be a fixed size predetermined in an encoder / decoder. For example, when the size of a coding block corresponds to 256×256 to 64×64, it is possible to perform partitioning only using quadtree partitioning. Optionally, when the size of a coding block is larger than the size of the maximum transform block, it is possible to perform partitioning only using quadtree partitioning. Here, the block to be partitioned can be at least one of a coding block and a transform block. In this case, information indicating the partitioning of the coding block (e.g., split_flag) can be a flag indicating whether quadtree partitioning is performed. When the size of a coding block falls within a predetermined range, it is possible to perform partitioning only using binary tree or ternary tree partitioning. In this case, the above description of quadtree partitioning can be applied to binary tree partitioning or ternary tree partitioning in the same manner.
[0080] Coding tree block: A term that can be used to specify any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.
[0081] Neighboring block: Can represent a block adjacent to the current block. A block adjacent to the current block can represent a block that touches the boundary of the current block, or a block located within a predetermined distance from the current block. A neighboring block can represent a block adjacent to a vertex of the current block. Here, a block adjacent to a vertex of the current block can represent a block that is vertically adjacent to a horizontally neighboring block adjacent to the current block, or a block that is horizontally adjacent to a vertically neighboring block adjacent to the current block.
[0082] Reconstructed neighboring block: Can represent a neighboring block that is adjacent to the current block and has been encoded or decoded spatially / temporally. Here, a reconstructed neighboring block can represent a reconstructed neighboring unit. A reconstructed spatial neighboring block can be a block within the current picture that has been reconstructed through encoding or decoding or both encoding and decoding. A reconstructed temporal neighboring block is a block or a neighboring block of the block at the position corresponding to the current block of the current picture in a reference image.
[0083] Unit depth: It can represent the degree of partitioning of a unit. In a tree structure, the highest node (root node) can correspond to the first unit that is not partitioned. In addition, the highest node can have the minimum depth value. In this case, the depth of the highest node can be level 0. A node with a depth of level 1 can represent a unit generated by partitioning the first unit once. A node with a depth of level 2 can represent a unit generated by partitioning the first unit twice. A node with a depth of level n can represent a unit generated by partitioning the first unit n times. A leaf node can be the lowest node and a node that cannot be further partitioned. The depth of a leaf node can be the maximum level. For example, a predefined value of the maximum level can be 3. The depth of the root node can be the lowest, and the depth of the leaf node can be the deepest. In addition, when a unit is represented as a tree structure, the level in which the unit exists can represent the unit depth.
[0084] Bitstream: It can represent a bitstream including encoded image information.
[0085] Parameter set: It corresponds to the header information among the configurations within a bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptive parameter set can be included in the parameter set. In addition, the parameter set can include slice headers, tile group headers, and tile header information. The term "tile group" represents a group of tiles and has the same meaning as a slice.
[0086] An adaptive parameter set can represent a parameter set that can be shared by being referenced in different pictures, sub - pictures, slices, tile groups, tiles, or bricks. In addition, the information in the adaptive parameter set can be used by referring to different adaptive parameter sets for sub - pictures, slices, tile groups, tiles, or bricks within a picture.
[0087] In addition, regarding the adaptive parameter set, different adaptive parameter sets can be referenced by using the identifiers of different adaptive parameter sets for sub - pictures, slices, tile groups, tiles, or bricks within a picture.
[0088] In addition, regarding the adaptive parameter set, different adaptive parameter sets can be referenced by using the identifiers of different adaptive parameter sets for slices, tile groups, tiles, or bricks within a sub - picture.
[0089] In addition, regarding the adaptive parameter set, different adaptive parameter sets can be referenced by using the identifiers of different adaptive parameter sets for tiles or bricks within a slice.
[0090] In addition, regarding the adaptive parameter set, different adaptive parameter sets can be referenced by using the identifiers of different adaptive parameter sets for bricks within a tile.
[0091] Information about an adaptive parameter set identifier may be included in the parameter set or header of a sub - picture, and the adaptive parameter set corresponding to the adaptive parameter set identifier may be used for the sub - picture.
[0092] Information about an adaptive parameter set identifier may be included in the parameter set or header of a parallel block, and the adaptive parameter set corresponding to the adaptive parameter set identifier may be used for the parallel block.
[0093] Information about an adaptive parameter set identifier may be included in the header of a partitioned block, and the adaptive parameter set corresponding to the adaptive parameter set identifier may be used for the partitioned block.
[0094] A picture may be partitioned into one or more parallel block rows and one or more parallel block columns.
[0095] 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 a rectangular / square - shaped area within a picture and may include one or more CTUs. In addition, at least one or more parallel blocks / partitioned blocks / strips may be included within a sub - picture.
[0096] A parallel block may be a rectangular / square - shaped area within a picture and may include one or more CTUs. In addition, a parallel block may be partitioned into one or more partitioned blocks.
[0097] A partitioned block may represent one or more CTU rows within a parallel block. A parallel block may be partitioned into one or more partitioned blocks, and each partitioned block may have at least one or more CTU rows. A parallel block that is not partitioned into two or more may represent a partitioned block.
[0098] A strip may include one or more parallel blocks within a picture and may include one or more partitioned blocks within a parallel block.
[0099] Parsing: may represent determining the value of a syntax element by performing entropy decoding, or may represent entropy decoding itself.
[0100] Symbol: may represent at least one of a syntax element, an encoding parameter, and a transform coefficient value of an encoding / decoding target unit. In addition, a symbol may represent an entropy encoding target or an entropy decoding result.
[0101] Prediction mode: may be information indicating a mode encoded / decoded using intra - frame prediction or a mode encoded / decoded using inter - frame prediction.
[0102] Prediction Unit: It can represent the basic unit when performing predictions such as inter-frame prediction, intra-frame prediction, inter-frame compensation, intra-frame compensation, and motion compensation. A single prediction unit can be partitioned into multiple partitions with smaller sizes, or can be partitioned into multiple subordinate prediction units. Multiple partitions can be the basic units when performing prediction or compensation. The partitions generated by dividing the prediction unit can also be prediction units.
[0103] Prediction Unit Partition: It can represent the shape obtained by partitioning the prediction unit.
[0104] The reference picture list can refer to a list including one or more reference pictures for inter-frame 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).
[0105] The inter-frame prediction indicator can refer to the direction of inter-frame prediction of the current block (unidirectional prediction, bidirectional prediction, etc.). Optionally, the inter-frame prediction indicator can refer to the number of reference pictures used to generate the prediction block of the current block. Optionally, the inter-frame prediction indicator can refer to the number of prediction blocks used when performing inter-frame prediction or motion compensation on the current block.
[0106] The prediction list utilization flag indicates whether at least one reference picture in a specific reference picture list is used to generate the prediction block. The prediction list utilization flag can be used to derive the inter-frame prediction indicator, and conversely, the inter-frame prediction indicator can 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 pictures in the reference picture list are 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.
[0107] The reference picture index can refer to the index indicating a specific reference picture in the reference picture list.
[0108] The reference picture can represent the reference picture referred to by a specific block for the purpose of inter-frame prediction or motion compensation of the specific block. Optionally, the reference picture can be a picture including the reference blocks referred to by the current block for inter-frame prediction or motion compensation. Hereinafter, the terms "reference picture" and "reference image" have the same meaning and can be used interchangeably.
[0109] The motion vector can be a two-dimensional vector for inter-frame prediction or motion compensation. The motion vector can represent the offset between the encoded / decoded target block and the reference block. For example, (mvX, mvY) can represent the motion vector. Here, mvX can represent the horizontal component, and mvY can represent the vertical component.
[0110] The search range can be a two-dimensional area that is searched during inter-frame prediction to retrieve a motion vector. For example, the size of the search range can be M×N. Here, both M and N are integers.
[0111] A motion vector candidate can refer to a predicted candidate block or the motion vector of a predicted candidate block when predicting a motion vector. In addition, a motion vector candidate can be included in a motion vector candidate list.
[0112] A motion vector candidate list can represent a list composed of one or more motion vector candidates.
[0113] A motion vector candidate index can represent an indicator that indicates a motion vector candidate in a motion vector candidate list. Optionally, it can be an index of a motion vector prediction factor.
[0114] Motion information can represent information including at least one of items such as a motion vector, a reference picture index, an inter-frame prediction indicator, a prediction list utilization flag, reference picture list information, a reference picture, a motion vector candidate, a motion vector candidate index, a merge candidate, and a merge index.
[0115] A merge candidate list can represent a list composed of one or more merge candidates.
[0116] A merge candidate can represent a spatial merge candidate, a temporal merge candidate, a combined merge candidate, a combined bi-prediction merge candidate, or a zero merge candidate. A merge candidate can include motion information such as an inter-frame prediction indicator, a reference picture index for each list, a motion vector, a prediction list utilization flag, and an inter-frame prediction indicator.
[0117] A merge index can represent an indicator that indicates a merge candidate in a merge candidate list. Optionally, the merge index can indicate a block in a reconstructed block that is spatially / temporally adjacent to the current block, from which the merge candidate has been derived. Optionally, the merge index can indicate at least one motion information of a merge candidate.
[0118] A transform unit: can represent a basic unit when performing encoding / decoding on a residual signal (such as transform, inverse transform, quantization, dequantization, transform coefficient encoding / decoding). A single transform unit can be partitioned into multiple subordinate transform units with smaller sizes. Here, the transform / inverse transform can include at least one of a first transform / first inverse transform and a second transform / second inverse transform.
[0119] Scaling: can represent a process of multiplying a quantization level by a factor. Transform coefficients can be generated by scaling the quantization level. Scaling can also be referred to as dequantization.
[0120] Quantization parameter: A value that can represent a value used when generating quantized levels using transform coefficients during quantization. The quantization parameter can also represent a value used when generating transform coefficients by scaling the quantized levels during dequantization. The quantization parameter can be a value mapped to a quantization step size.
[0121] Delta quantization parameter: A value that can represent the difference between a predicted quantization parameter and the quantization parameter of an encoded / decoded target unit.
[0122] Scanning: A method that can represent sorting coefficients within a unit, block, or matrix. For example, changing a two-dimensional matrix of coefficients to a one-dimensional matrix can be referred to as scanning, and changing a one-dimensional matrix of coefficients to a two-dimensional matrix can be referred to as scanning or inverse scanning.
[0123] Transform coefficient: A coefficient value generated after performing a transform in an encoder. The transform coefficient can represent a coefficient value generated after performing at least one of entropy decoding and dequantization in a decoder. Quantized levels or quantized transform coefficient levels obtained by quantizing the transform coefficient or the residual signal can also fall within the meaning of the transform coefficient.
[0124] Quantized level: A value generated by quantizing a transform coefficient or a residual signal in an encoder. Optionally, the quantized level can represent a value to be dequantized in a decoder. Similarly, quantized transform coefficient levels resulting from transform and quantization can also fall within the meaning of the quantized level.
[0125] Non-zero transform coefficient: A transform coefficient having a value other than zero, or a transform coefficient level or quantized level having a value other than zero.
[0126] Quantization matrix: A matrix used in quantization processing or dequantization processing performed to improve subjective image quality or objective image quality. The quantization matrix can also be referred to as a scaling list.
[0127] Quantization matrix coefficient: Each element within the quantization matrix. The quantization matrix coefficient can also be referred to as a matrix coefficient.
[0128] Default matrix: A predefined quantization matrix defined in advance in an encoder or a decoder.
[0129] Non-default matrix: A quantization matrix that is not predefined in an encoder or a decoder but signaled by a user.
[0130] Statistical value: A statistical value for at least one of a variable, an encoding parameter, a constant value, etc. having a computable specific value can be one or more of an average value, a sum value, a weighted average value, a weighted sum value, a minimum value, a maximum value, a most frequently occurring value, a median value, an interpolation of the corresponding specific value.
[0131] Figure 1 It is a block diagram showing the configuration of an encoding device according to an embodiment to which the present invention is applied.
[0132] The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. The video may include at least one image. The encoding device 100 may sequentially encode at least one image.
[0133] Referring to Figure 1 , the encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180, and a reference picture buffer 190.
[0134] 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 bitstream including encoding information by encoding the input image, and output the generated bitstream. The generated bitstream may be stored in a computer-readable recording medium, or may be streamed through a wired / wireless transmission medium. When the intra mode is used as a prediction mode, the switch 115 may switch to intra. Optionally, 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 by using the residual between the input block and the prediction block after generating the prediction block. The input image may be referred to as a current image that is a current encoding target. The input block may be referred to as a current block that is a current encoding target, or may be referred to as an encoding target block.
[0135] When the prediction mode is an intra mode, the intra prediction unit 120 may use the 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, the intra prediction may represent a prediction within a frame.
[0136] When the prediction mode is an inter-frame mode, the motion prediction unit 111 may retrieve, during motion prediction, the region that best matches the input block from a reference image, and derive a motion vector by using the retrieved region. In this case, the search region may be used as the region. The reference image may be stored in the reference picture buffer 190. Here, when encoding / decoding of the reference image is performed, the reference image may be stored in the reference picture buffer 190.
[0137] The motion compensation unit 112 may perform motion compensation on the current block by using the motion vector to generate a prediction block. Here, inter-frame prediction may represent prediction or motion compensation between frames.
[0138] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a partial region of the reference picture. To perform inter-picture prediction or motion compensation on an encoding unit, it may be determined which one of a skip mode, a merge mode, an advanced motion vector prediction (AMVP) mode, and a current picture reference mode is used for motion prediction and motion compensation of a prediction unit included in the corresponding encoding unit. Then, inter-picture prediction or motion compensation may be performed differently according to the determined mode.
[0139] 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 or both transforming and quantizing the difference between the original signal and the prediction signal. The residual block may be the residual signal of a block unit.
[0140] The transform unit 130 may generate transform coefficients by performing a transform on the residual block, and output the generated transform coefficients. Here, the transform coefficients may be coefficient values generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 may skip the transform of the residual block.
[0141] Quantized levels may be generated by applying quantization to the transform coefficients or to the residual signal. Hereinafter, the quantized levels may also be referred to as transform coefficients in the embodiments.
[0142] The quantization unit 140 may generate quantized levels by quantizing the transform coefficients or the residual signal according to parameters, and output the generated quantized levels. Here, the quantization unit 140 may quantize the transform coefficients by using a quantization matrix.
[0143] The entropy coding unit 150 may generate a bitstream by performing entropy coding on the values calculated by the quantization unit 140 or on the coding parameter values calculated during encoding according to a probability distribution, and output the generated bitstream. The entropy coding unit 150 may perform entropy coding on the sample information of the image and the information for decoding the image. For example, the information for decoding the image may include syntax elements.
[0144] When entropy coding is applied, symbols are represented such that a smaller number of bits are assigned to symbols with a high generation probability, and a larger number of bits are assigned to symbols with a low generation probability. Therefore, the size of the bitstream of the symbols to be encoded can be reduced. The entropy coding unit 150 may use coding methods 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 for the target symbol and a probability model of the target symbol / bits, and perform arithmetic coding by using the derived binarization method and context model.
[0145] To encode the transform coefficient levels (quantization levels), the entropy coding unit 150 may change the coefficients in the two-dimensional block form into a one-dimensional vector form by using a transform coefficient scanning method.
[0146] Coding parameters may include information such as syntax elements (flags, indices, etc.) that are coded in the encoder and signaled to the decoder, as well as information derived during the execution of encoding or decoding. The coding parameters may represent the information required for encoding or decoding an image. For example, at least one value or combination among the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partitioning information, unit / block shape, unit / block partitioning structure, whether quadtree-based partitioning is performed, whether binary tree-based partitioning is performed, binary tree-based partitioning direction (horizontal direction or vertical direction), binary tree-based partitioning form (symmetric partitioning or asymmetric partitioning), whether the current coding unit is partitioned by ternary tree partitioning, ternary tree partitioning direction (horizontal direction or vertical direction), ternary tree partitioning type (symmetric type or asymmetric type), whether the current coding unit is partitioned by multi-type tree partitioning, multi-type tree partitioning direction (horizontal direction or vertical direction), multi-type tree partitioning type (symmetric type or asymmetric type), multi-type tree partitioning tree (binary tree or ternary tree) structure, prediction mode (intra prediction or inter prediction), luminance intra prediction mode / direction, chrominance intra prediction mode / direction, intra partitioning information, inter partitioning information, coding block partitioning flag, prediction block partitioning flag, transform block partitioning 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 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 the merge mode, merge index, merge candidate, merge candidate list, whether to use the skip mode, interpolation filter type, interpolation filter taps, interpolation filter coefficients, motion vector magnitude, representation precision of the 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 style, coding block flag (CBF), quantization parameter, quantization parameter for residual, quantization matrix, whether to apply intra-loop filter, intra-loop filter coefficients, intra-loop filter taps, intra-loop filter shape / form, whether to apply 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 adaptive loop filter, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form,Binarization / inverse binarization method, context model determination method, context model update method, whether to execute the normal mode, whether to execute the bypass mode, context binary bits, bypass binary bits, valid coefficient flag, last valid coefficient flag, coding flag for the unit of the coefficient group, position of the last valid coefficient, flag indicating whether the value of the coefficient is greater than 1, flag indicating whether the value of the coefficient is greater than 2, flag indicating whether the value of the coefficient is greater than 3, information about the values of the remaining coefficients, sign information, reconstructed luminance samples, reconstructed chrominance samples, residual luminance samples, residual chrominance samples, luminance transform coefficients, chrominance transform coefficients, quantized luminance levels, quantized chrominance levels, transform coefficient level scanning method, size of the motion vector search area on the decoder side, shape of the motion vector search area on the decoder side, number of times of motion vector search on the decoder side, information about the CTU size, information about the minimum block size, information about the maximum block size, information about the maximum block depth, information about the minimum block depth, image display / output order, slice identification information, slice type, slice partition information, parallel block identification information, parallel block type, parallel block partition information, parallel block group identification information, parallel block group type, parallel block group partition information, picture type, bit depth of the input samples, bit depth of the reconstructed samples, bit depth of the residual samples, bit depth of the transform coefficients, bit depth of the quantized levels, and information about the luminance signal or the chrominance signal.
[0147] Here, it can be indicated by a signaling flag or index that the encoder performs entropy coding on the corresponding flag or index and includes it in the bitstream, and it can be indicated that the decoder performs entropy decoding on the corresponding flag or index from the bitstream.
[0148] When the encoding device 100 performs encoding through inter prediction, the encoded current image can be used as a reference image for another image to be processed subsequently. Therefore, the encoding device 100 can reconstruct or decode the encoded current image, or store the reconstructed or decoded image as a reference image in the reference picture buffer 190.
[0149] The quantized levels can be dequantized in the dequantization unit 160, or can be inverse-transformed in the inverse transform unit 170. The coefficients that have been dequantized or inverse-transformed or both can be added to the prediction block by the adder 175. By adding the coefficients that have been dequantized or inverse-transformed or both to the prediction block, a reconstructed block can be generated. Here, the coefficients that have been dequantized or inverse-transformed or both can represent the coefficients on which at least one of dequantization and inverse transformation has been performed, and can represent the reconstructed residual block.
[0150] The reconstructed block can pass through the filter unit 180. The filter unit 180 can apply at least one of a deblocking filter, sample adaptive offset (SAO), and adaptive loop filter (ALF) to the reconstructed samples, reconstructed block, or reconstructed image. The filter unit 180 can be referred to as an in-loop filter.
[0151] The deblocking filter can remove block distortion generated at the boundary between blocks. To determine whether to apply the deblocking filter, it can be determined whether to apply the deblocking filter to the current block based on the samples included in several rows or columns included in the block. When applying the deblocking filter to a block, another filter can be applied according to the required deblocking filter strength.
[0152] To compensate for coding errors, an appropriate offset value can be added to the sample value by using sample adaptive offset. The sample adaptive offset can correct the offset between the deblocked image and the original image on a sample-by-sample basis. A method of applying an offset considering the edge information about each sample can be used, or the following method can be used: partitioning the samples of the image into a predetermined number of regions, determining the regions to which the offset is applied, and applying the offset to the determined regions.
[0153] The adaptive loop filter can perform filtering based on the comparison result between the filtered reconstructed image and the original image. The samples included in the image can be partitioned into predetermined groups, the filter to be applied to each group can be determined, and differential filtering can be performed on each group. Information on whether to apply the ALF can be signaled through the coding unit (CU), and the form and coefficients of the ALF to be applied to each block can vary.
[0154] The reconstructed block or reconstructed image that has passed through the filter unit 180 can be stored in the reference picture buffer 190. The reconstructed block processed by the filter unit 180 can be 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 can be used later in inter-frame prediction or motion compensation.
[0155] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment and applying the present invention.
[0156] The decoding device 200 can be a decoder, a video decoding device, or an image decoding device.
[0157] Referring to Figure 2 , the decoding device 200 can include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260, and a reference picture buffer 270.
[0158] The decoding device 200 may receive the bitstream output from the encoding device 100. The decoding device 200 may receive the bitstream stored in a computer-readable recording medium, or may receive the bitstream streamed through a wired / wireless transmission medium. The decoding device 200 may decode the bitstream 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.
[0159] When the prediction mode used during decoding is the intra mode, the switcher may be switched to intra. Optionally, when the prediction mode used during decoding is the inter mode, the switcher may be switched to the inter mode.
[0160] The decoding device 200 may obtain a reconstructed residual block by decoding the input bitstream, and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 may generate a reconstructed block to be decoded by adding the reconstructed residual block and the prediction block. The block to be decoded may be referred to as a current block.
[0161] The entropy decoding unit 210 may generate symbols by performing entropy decoding on the bitstream according to a probability distribution. The generated symbols may include symbols in a quantized level form. Here, the entropy decoding method may be an inverse process of the above entropy encoding method.
[0162] In order to decode the transform coefficient levels (quantized levels), the entropy decoding unit 210 may change the coefficients in a one-way vector form into a two-dimensional block form by using a transform coefficient scanning method.
[0163] The quantized levels may be dequantized in the dequantization unit 220, or may be inverse-transformed in the inverse transform unit 230. The quantized levels may be the result of performing dequantization or inverse transformation or both dequantization and inverse transformation, and may be generated as a reconstructed residual block. Here, the dequantization unit 220 may apply a quantization matrix to the quantized levels.
[0164] When using the intra mode, the intra prediction unit 240 may generate a prediction block by performing spatial prediction on the current block, where the spatial prediction uses the sample values of the blocks adjacent to the block to be decoded and that have already been decoded. When using the inter mode, the motion compensation unit 250 may generate a prediction block by performing motion compensation on the current block, where the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270.
[0165] The adder 255 may generate a reconstructed block by adding the reconstructed residual block and the prediction block. The filter unit 260 may apply at least one of a deblocking filter, sample adaptive offset, and adaptive loop filter to the reconstructed block or the reconstructed image. The filter unit 260 may output the reconstructed image. The reconstructed block or the reconstructed image may be stored in the reference picture buffer 270 and used when performing inter prediction. The reconstructed block processed by the filter unit 260 may be part of a 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 may be used later in inter prediction or motion compensation.
[0166] Figure 3 is a diagram schematically showing a partitioning structure of an image when encoding and decoding the image. Figure 3 Schematically shows an example of partitioning a single unit into a plurality of lower-level units.
[0167] To effectively partition an image, a coding unit (CU) may be used when encoding and decoding. The coding unit may be used as a basic unit when encoding / decoding an image. In addition, the coding unit may be used as a unit for distinguishing an intra prediction mode and an inter prediction mode when encoding / decoding an image. The coding unit may be a basic unit for prediction, transform, quantization, inverse transform, dequantization, or encoding / decoding processing of transform coefficients.
[0168] Refer to Figure 3 , the image 300 is sequentially partitioned according to the largest coding unit (LCU), and the LCU unit is determined as the partitioning structure. Here, the LCU may be used in the same meaning as the coding tree unit (CTU). Unit partitioning may represent partitioning of a block associated with the unit. In the block partitioning information, information on the unit depth may be included. The depth information may represent the number of times or the degree or both the number of times and the degree to which the unit is partitioned. A single unit may be partitioned into a plurality of lower-level units hierarchically associated with the depth information based on a tree structure. In other words, the unit and the lower-level units generated by partitioning the unit may correspond to a node and the children of the node, respectively. Each of the partitioned lower-level units may have depth information. The depth information may be information representing the size of the CU and may be stored in each CU. The unit depth represents the number and / or degree related to partitioning of the unit. Therefore, the partitioning information of the lower-level units may include information on the size of the lower-level units.
[0169] The partitioning structure can represent the distribution of coding units (CUs) within the LCU 310. Such a distribution can 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 partitioning can be half of the horizontal size and vertical size of the CU before partitioning, respectively, or can have sizes smaller than the horizontal size and vertical size before partitioning, respectively, according to the number of partitions. A CU can be recursively partitioned into multiple CUs. Through recursive partitioning, at least one of the height and width of the CU after partitioning can be reduced compared to at least one of the height and width of the CU before partitioning. The partitioning of the CU can be recursively executed until a predefined depth or a predefined size is reached. For example, the depth of the LCU can be 0, and the depth of the smallest coding unit (SCU) can be the predefined maximum depth. Here, as described above, the LCU can be a coding unit with the maximum coding unit size, and the SCU can 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 partitioning, the CU depth increases by 1. For example, for each depth, the size of the unpartitioned CU can be 2N×2N. Additionally, in the case of a partitioned CU, a CU with a size of 2N×2N can be partitioned into four CUs with a size of N×N. As the depth increases by 1, the size of N can be halved.
[0170] In addition, information indicating whether a CU is partitioned can be represented by using the partitioning information of the CU. The partitioning information can be 1-bit information. All CUs except the SCU can include the partitioning information. For example, when the value of the partitioning information is the first value, the CU may not be partitioned, and when the value of the partitioning information is the second value, the CU may be partitioned.
[0171] Referring to Figure 3 , the LCU with a depth of 0 can be a 64×64 block. 0 can be the minimum depth. The SCU with a depth of 3 can be an 8×8 block. 3 can be the maximum depth. The CUs of the 32×32 block and the 16×16 block can be represented as depth 1 and depth 2, respectively.
[0172] 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 can be half the size of the horizontal size and vertical size of the CU before partitioning. 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 can have a size of 16×16. When a single coding unit is partitioned into four coding units, it can be said that the coding unit can be partitioned into a quadtree form.
[0173] 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 can be half of the horizontal size or vertical size of the original coding unit. For example, when a coding unit with a size of 32×32 is vertically partitioned into two sub-coding units, each of the two sub-coding units can have a size of 16×32. For example, when a coding unit with a size of 8×32 is horizontally partitioned into two sub-coding units, each of the two sub-coding units can have a size of 8×16. When a coding unit is partitioned into two sub-coding units, it can be said that the coding unit is bipartitioned or partitioned according to a binary tree partitioning structure.
[0174] For example, when a coding unit is partitioned into three sub-coding units, the horizontal size or vertical size of the coding unit can be partitioned in a ratio of 1:2:1, thereby generating three sub-coding units with a horizontal size or vertical size ratio of 1:2:1. For example, when a coding unit with a size of 16×32 is horizontally partitioned into three sub-coding units, the three sub-coding units can have sizes of 16×8, 16×16, and 16×8 in order from the uppermost sub-coding unit to the lowermost sub-coding unit. For example, when a coding unit with a size of 32×32 is vertically divided into three sub-coding units, the three sub-coding units can have sizes of 8×32, 16×32, and 8×32 in order from the leftmost sub-coding unit to the rightmost sub-coding unit. When a coding unit is partitioned into three sub-coding units, it can be said that the coding unit is tripartitioned or partitioned according to a ternary tree partitioning structure.
[0175] In Figure 3 , the coding tree unit (CTU) 320 is an example of a CTU to which all of a quadtree partitioning structure, a binary tree partitioning structure, and a ternary tree partitioning structure are applied.
[0176] As described above, in order to partition a CTU, at least one of a quadtree partitioning structure, a binary tree partitioning structure, and a ternary tree partitioning structure can be applied. Various tree partitioning structures can be sequentially applied to the CTU according to a predetermined priority order. For example, the quadtree partitioning structure can be preferentially applied to the CTU. A coding unit for which the quadtree partitioning structure can no longer be used for partitioning can correspond to a leaf node of the quadtree. The coding unit corresponding to the leaf node of the quadtree can be used as the root node of a binary tree and / or ternary tree partitioning structure. That is, the coding unit corresponding to the leaf node of the quadtree can be further partitioned according to a binary tree partitioning structure or a ternary tree partitioning structure, or can not be further partitioned. Therefore, by preventing the coding units obtained from the binary tree partitioning or ternary tree partitioning of the coding unit corresponding to the leaf node of the quadtree from undergoing further quadtree partitioning, the block partitioning operation and / or the operation of signaling partitioning information can be effectively performed.
[0177] The fact that a coding unit corresponding to a node of a quadtree is partitioned can be signaled using quadtree partition information. Quadtree partition information having a first value (e.g., "1") can indicate that the current coding unit is partitioned according to a quadtree partition structure. Quadtree partition information having a second value (e.g., "0") can indicate that the current coding unit is not partitioned according to a quadtree partition structure. The quadtree partition information can be a flag having a predetermined length (e.g., one bit).
[0178] There may be no priority between binary tree partitioning and ternary tree partitioning. That is, a coding unit corresponding to a leaf node of a quadtree can further undergo either binary tree partitioning or ternary tree partitioning. In addition, a coding unit generated by binary tree partitioning or ternary tree partitioning can undergo further binary tree partitioning or further ternary tree partitioning, or may not be further partitioned.
[0179] A tree structure in which there is no priority between binary tree partitioning and ternary tree partitioning is called a multi-type tree structure. A coding unit corresponding to a leaf node of a quadtree can 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 can be used to signal whether to partition a coding unit corresponding to a node of a multi-type tree. To partition a coding unit corresponding to a node of a multi-type tree, the multi-type tree partition indication information, partition direction information, and partition tree information can be signaled sequentially.
[0180] Multi-type tree partition indication information having a first value (e.g., "1") can indicate that the current coding unit will undergo multi-type tree partitioning. Multi-type tree partition indication information having a second value (e.g., "0") can indicate that the current coding unit will not undergo multi-type tree partitioning.
[0181] 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 can include partition direction information. The partition direction information can indicate in which direction the current coding unit will be partitioned for multi-type tree partitioning. Partition direction information having a first value (e.g., "1") can indicate that the current coding unit will be vertically partitioned. Partition direction information having a second value (e.g., "0") can indicate that the current coding unit will be horizontally partitioned.
[0182] When a coding unit corresponding to a node of a multi-type tree is further partitioned according to a multi-type tree partitioning structure, the current coding unit may include partitioning tree information. The partitioning tree information may indicate a tree partitioning structure to be used for partitioning the node of the multi-type tree. Partitioning tree information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned according to a binary tree partitioning structure. Partitioning tree information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned according to a ternary tree partitioning structure.
[0183] The partitioning indication information, the partitioning tree information, and the partitioning direction information may all be flags having a predetermined length (e.g., one bit).
[0184] At least any one of the quadtree partitioning indication information, the multi-type tree partitioning indication information, the partitioning direction information, and the partitioning tree information may be entropy-coded / entropy-decoded. To entropy-code / entropy-decode those types of information, information about neighboring coding units adjacent to the current coding unit may be used. For example, it is very likely that the partitioning type (partitioned or not partitioned, partitioning tree and / or partitioning direction) of the left neighboring coding unit and / or the upper neighboring coding unit of the current coding unit is similar to that of the current coding unit. Therefore, context information for entropy-coding / entropy-decoding information about the current coding unit may be derived from information about neighboring coding units. Information about neighboring coding units may include at least any one of the quadtree partitioning information, the multi-type tree partitioning indication information, the partitioning direction information, and the partitioning tree information.
[0185] As another example, in 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 subsequently, the coding unit corresponding to the leaf node of the binary tree may be set as the root node for 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.
[0186] A coding unit that cannot be partitioned according to a quadtree partitioning structure, a binary tree partitioning structure, and / or a ternary tree partitioning structure becomes a basic unit for coding, prediction, and / or transformation. That is, the coding unit cannot be further partitioned for prediction and / or transformation. Therefore, there may be no partitioning structure information and partitioning information in the bitstream for partitioning the coding unit into a prediction unit and / or a transformation unit.
[0187] However, when the size of a coding unit (i.e., the basic unit for partitioning) is larger than the size of the maximum transform block, the coding unit can be recursively partitioned until the size of the coding unit is reduced to be equal to or less than the size of the maximum transform block. For example, when the size of the coding unit is 64×64 and when the size of the maximum transform block is 32×32, the coding unit can be partitioned into four 32×32 blocks for transformation. 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 can be partitioned into two 32×32 blocks for transformation. In this case, the partitioning of the coding unit for transformation is not signaled separately, and the partitioning of the coding unit for transformation can be determined by comparing the horizontal size or vertical size of the coding unit with 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 can be bisected vertically. 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 can be bisected horizontally.
[0188] The information on the maximum and / or minimum size of the coding unit and the information on the maximum and / or minimum size of the transform block can be signaled or determined at a higher level of the coding unit. The higher level can be, for example, sequence level, picture level, slice level, parallel block group level, parallel block level, etc. For example, the minimum size of the coding unit can be determined to be 4×4. For example, the maximum size of the transform block can be determined to be 64×64. For example, the minimum size of the transform block can be determined to be 4×4.
[0189] The information on the minimum size (quadtree minimum size) of the coding unit corresponding to the leaf node of the quadtree and / or the information on the maximum depth (maximum tree depth of the multi-type tree) from the root node to the leaf node of the multi-type tree can be signaled or determined at a higher level of the coding unit. For example, the higher level can be sequence level, picture level, slice level, parallel block group level, parallel block level, etc. The information on the minimum size of the quadtree and / or the information on the maximum depth of the multi-type tree can be signaled or determined for each of the in-picture slices and inter-picture slices.
[0190] The difference information between the size of the CTU and the maximum size of the transform block can be signaled or determined at a higher level of the coding unit. For example, the higher level can be the sequence level, picture level, slice level, parallel block group level, parallel block level, etc. The information on 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) can 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) can vary according to the type of slice. For example, for an intra-slice, the maximum size of the ternary tree can be 32×32. For example, for an inter-slice, the maximum size of the ternary tree can 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) can be set to the minimum size of the coding block.
[0191] As another example, the maximum size of the binary tree and / or the maximum size of the ternary tree can be signaled or determined at the slice level. Optionally, the minimum size of the binary tree and / or the minimum size of the ternary tree can be signaled or determined at the slice level.
[0192] According to the size and depth information of the above various blocks, the 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.
[0193] 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 can be inferred as a second value.
[0194] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to a 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 bipartitioned or tripartitioned. Therefore, the multi-type tree partition indication information may not be signaled, but the multi-type tree partition indication information can be inferred as a second value.
[0195] 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 twice the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be further bipartitioned or tripartitioned. 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. This is because when partitioning the coding unit according to the binary tree partition structure and / or the ternary tree partition structure, coding units smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree are generated.
[0196] Optionally, the binary tree partition or the ternary tree partition may be restricted based on the size of the virtual pipeline data unit (hereinafter, the pipeline buffer size). For example, when a coding unit is divided into sub-coding units that do not fit the pipeline buffer size by binary tree partition or ternary tree partition, the corresponding binary tree partition or ternary tree partition may be restricted. 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 divisions may be restricted.
[0197] - Ternary tree partition for an N×M (N and / or M is 128) coding unit - Binary tree partition for a 128×N (N<=64) coding unit in the horizontal direction - Binary tree partition for an N×128 (N<=64) coding unit in the vertical direction 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 bipartitioned and / or tripartitioned. 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.
[0198] Optionally, the multi-type tree partition indication information may be signaled only when at least one of the vertical binary tree partition, the horizontal binary tree partition, the vertical ternary tree partition, and the horizontal ternary tree partition is possible for the coding unit corresponding to the node of the multi-type tree. Otherwise, the coding unit may not be bipartitioned and / or tripartitioned. 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.
[0199] Optionally, the partition direction information may be signaled only when both the vertical binary tree partition and the horizontal binary tree partition or both the vertical ternary tree partition and the horizontal ternary tree partition are possible for the coding unit corresponding to the node of the multi-type tree. Otherwise, the partition direction information may not be signaled, but the partition direction information may be inferred as a value indicating the possible partition direction.
[0200] Optionally, partition tree information may be signaled 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. Otherwise, the partition tree information may not be signaled, but the partition tree information may be inferred as a value indicating a possible partition tree structure.
[0201] Figure 4 is a diagram showing intra prediction processing.
[0202] Figure 4 The arrows from the center to the outside in may represent the prediction direction of the intra prediction mode.
[0203] Intra coding and / or decoding may be performed by using reference samples of neighboring blocks of a current block. The neighboring blocks may be reconstructed neighboring blocks. For example, intra coding and / or decoding may be performed by using values or coding parameters included in the reconstructed neighboring blocks.
[0204] A 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 the size of one of a CU, a PU, and a TU. The prediction block may be a square block having a size of 2×2, 4×4, 16×16, 32×32, or 64×64, etc., or may be a rectangular block having a size of 2×8, 4×8, 2×16, 4×16, and 8×16, etc.
[0205] Intra prediction may be performed according to the intra prediction mode for a 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 the attributes of the prediction block. For example, the attributes of the prediction block may include the size of the prediction block and the shape of the prediction block, etc.
[0206] Regardless of the block size, the number of intra prediction modes may be fixed to N. Alternatively, the number of intra prediction modes may be 3, 5, 9, 17, 34, 35, 36, 65, or 67, etc. Optionally, the number of intra prediction modes may vary according to the block size or color component type or both the block size and the color component type. For example, the number of intra prediction modes may vary according to whether the color component is a luminance signal or a chrominance signal. For example, as the block size becomes larger, the number of intra prediction modes may increase. Optionally, the number of intra prediction modes for a luminance component block may be greater than the number of intra prediction modes for a chrominance component block.
[0207] The intra prediction mode can be a non - angular mode or an angular mode. The non - angular mode can be a DC mode or a planar mode, and the angular mode can be a prediction mode with a specific direction or angle. The intra prediction mode can be represented by at least one of a mode number, a mode value, a mode digit, a mode angle, and a mode direction. The number of intra prediction modes can be M which is greater than 1, including the non - angular mode and the angular mode. To perform intra prediction on a current block, a step of determining whether samples included in reconstructed neighboring blocks can be used as reference samples for the current block can be executed. When there are samples that cannot be used as reference samples for the current block, values obtained by copying or performing interpolation or both copying and interpolation on at least one sample value among the samples included in the reconstructed neighboring blocks can be used to replace the unavailable sample values of the samples, and thus the replaced sample values are used as reference samples for the current block.
[0208] Figure 7 is a diagram showing reference samples that can be used for intra prediction.
[0209] As Figure 7 shown, at least one of reference sample lines 0 to 3 can be used for intra prediction of the current block. In Figure 7 , the samples of segment A and segment F can be filled with the samples closest to segment B and segment E respectively, instead of being retrieved from the reconstructed neighboring blocks. Index information indicating the reference sample line to be used for intra prediction of the current block can be signaled. For example, in Figure 7 , reference sample line indicators 0, 1, and 2 can 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 a CTU, only reference sample line 0 can be available. Thus, in this case, the index information may not be signaled. When reference sample lines other than reference sample line 0 are used, filtering for the prediction block described later may not be performed.
[0210] When performing intra prediction, a filter can be applied to at least one of the reference samples and the prediction samples based on the intra prediction mode and the current block size.
[0211] In the case of planar mode, when generating a prediction block of a current block, according to the position of a predicted target sample within the prediction block, the sample value of the predicted target sample can be generated by using a 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 DC mode, when generating a prediction block of a current block, the average value of the upper reference sample and the left reference sample of the current block can be used. In addition, in the case of angular mode, a prediction block can 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. To generate a predicted sample value, interpolation of real-number units can be performed.
[0212] In the case of intra prediction between color components, a prediction block of the current block of the second color component can be generated based on the corresponding reconstructed block of the first color component. For example, the first color component can be a luminance component, and the second color component can be a chrominance component. For intra prediction between color components, the parameters of a linear model between the first color component and the second color component can be derived based on a template. The template can include the upper and / or left neighboring samples of the current block and the upper and / or left neighboring samples of the corresponding reconstructed block of the first color component. For example, the sample value of the first color component with the maximum value among the samples in the template and the corresponding sample value of the second color component, and the sample value of the first color component with the minimum value among the samples in the template and the corresponding sample value of the second color component can be used to derive the parameters of the linear model. When deriving the parameters of the linear model, the corresponding reconstructed block can be applied to the linear model to generate a prediction block of the current block. According to the video format, subsampling can be performed on the neighboring samples of the reconstructed block of the first color component and the corresponding reconstructed 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 can be subsampled to calculate one corresponding sample. In this case, the parameter derivation of the linear model and the intra prediction between color components can be performed based on the corresponding subsampled samples. Whether to perform intra prediction between color components and / or the range of the template can be signaled as an intra prediction mode.
[0213] The current block can be partitioned into two sub-blocks or four sub-blocks in the horizontal or vertical direction. The partitioned sub-blocks can be reconstructed sequentially. That is, intra prediction can be performed on the sub-blocks to generate sub-prediction blocks. In addition, inverse quantization and / or inverse transform can be performed on the sub-blocks to generate sub-residual blocks. The reconstructed sub-blocks can be generated by adding the sub-prediction blocks and the sub-residual blocks. The reconstructed sub-blocks can be used as reference sample points for intra prediction of subsequent sub-blocks. A sub-block can be a block including a predetermined number (e.g., 16) or more sample points. Thus, for example, when the current block is an 8×4 block or a 4×8 block, the current block can 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 dimensions, the current block can be partitioned into four sub-blocks. Information on whether to perform intra prediction based on sub-blocks and / or the partition direction (horizontal or vertical) can be signaled. Intra prediction based on sub-blocks can be limited to being performed only when using reference sample line 0. When performing intra prediction based on sub-blocks, filtering for the prediction block described later may not be performed.
[0214] The final prediction block can be generated by performing filtering on the prediction block that has been intra predicted. Filtering can be performed by applying a predetermined weight to the filtering target sample point, the left reference sample point, the upper reference sample point, and / or the upper left reference sample point. The weight and / or reference sample (range, position, etc.) for filtering can be determined based on at least one of the block size, the intra prediction mode, and the position of the filtering target sample point in the prediction block. Filtering can be performed only in the case of a predetermined intra prediction mode (e.g., DC, planar, vertical, horizontal, diagonal, and / or adjacent diagonal mode). The adjacent diagonal mode can be a mode obtained by adding k to the diagonal mode or subtracting k from the diagonal mode. For example, k can be a positive integer of 8 or less.
[0215] The intra prediction mode of the current block can be entropy encoded / entropy decoded by predicting the intra prediction mode of the block adjacent to the current block. When the intra prediction mode of the current block is the same as that of the neighboring block, information indicating that the intra prediction mode of the current block is the same as that of the neighboring block can be signaled by using predetermined flag information. In addition, indicator information of the intra prediction mode that is the same as the intra prediction mode of the current block among the intra prediction modes of multiple neighboring blocks can be signaled. When the intra prediction mode of the current block is different from that of the neighboring block, the intra prediction mode information of the current block can be entropy encoded / entropy decoded by performing entropy encoding / entropy decoding based on the intra prediction mode of the neighboring block.
[0216] Figure 5 is a diagram showing an embodiment of inter prediction processing.
[0217] In Figure 5 a rectangle can represent a picture. In Figure 5In this case, the arrow indicates the prediction direction. According to the coding type of the picture, the pictures can be classified into intra pictures (I pictures), predicted pictures (P pictures), and bi-predicted pictures (B pictures).
[0218] I pictures can be encoded by intra prediction without the need for inter-picture prediction. P pictures can be encoded by inter-picture prediction by using a reference picture existing in one direction (i.e., forward or backward) relative to the current block. B pictures can be encoded by inter-picture prediction by using reference pictures existing in two directions (i.e., forward and backward) relative to the current block. When using inter-picture prediction, the encoder can perform inter-picture prediction or motion compensation, and the decoder can perform corresponding motion compensation.
[0219] Hereinafter, embodiments of inter-picture prediction will be described in detail.
[0220] Reference pictures and motion information can be used to perform inter-picture prediction or motion compensation.
[0221] The motion information of the current block can be derived by each of the encoding device 100 and the decoding device 200 during inter-picture prediction. The motion information of the current block can be derived by using the motion information of the reconstructed neighboring block, the motion information of the co-located block (also referred to as the col block or co-located block), and / or the motion information of the block adjacent to the co-located block. The co-located block can represent a block that is spatially located at the same position as the current block within a previously reconstructed co-located picture (also referred to as the col picture or co-located picture). The co-located picture can be one of one or more reference pictures included in the reference picture list.
[0222] The method of deriving motion information can vary according to the prediction mode of the current block. For example, the prediction modes applied to inter-frame prediction include the AMVP mode, the merge mode, the skip mode, the merge mode with motion vector difference, the sub-block merge mode, the geometric partitioning mode, the combined inter-frame - intra-frame prediction mode, the affine mode, etc. Here, the merge mode can be referred to as the motion merge mode.
[0223] For example, when AMVP is used as the prediction mode, at least one of the motion vectors of the reconstructed neighboring block, the motion vector of the co-located block, the motion vector of the block adjacent to the co-located block, and the (0,0) motion vector can be determined as a motion vector candidate for the current block, and a motion vector candidate list is generated by using the motion vector candidates. The motion vector candidate of the current block can be derived by using the generated motion vector candidate list. The motion information of the current block can be determined based on the derived motion vector candidate. The motion vector of the co-located block or the motion vector of the block adjacent to the co-located block can be referred to as a temporal motion vector candidate, and the motion vector of the reconstructed neighboring block can be referred to as a spatial motion vector candidate.
[0224] 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 a 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.
[0225] In addition, the encoding device 100 may perform entropy encoding on resolution information of the calculated MVD. The decoding device 200 may use the MVD resolution information to adjust the resolution of the entropy-decoded MVD.
[0226] In addition, the encoding device 100 calculates a motion vector difference (MVD) between a motion vector in a 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 for each sub-block based on an affine-controlled motion vector of the decoding target block by deriving the sum of the entropy-decoded MVD and an affine-controlled motion vector candidate.
[0227] The bitstream may include a reference picture index indicating a reference picture. The reference picture index may be entropy-encoded by the encoding device 100 and then signaled as the bitstream to the decoding device 200. The decoding device 200 may generate a predicted block of the decoding target block based on the derived motion vector and the reference picture index information.
[0228] Another example of a method for 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, motion information of reconstructed neighboring blocks and / or motion information of co-located 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 uni-directional prediction (L0 prediction or L1 prediction) or bi-directional prediction (L0 prediction and L1 prediction).
[0229] 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 neighboring blocks adjacent to the current block (spatial merge candidates), motion information of co-located blocks of the current block in a reference picture (temporal merge candidates), new motion information generated by combining motion information existing in the merge candidate list, motion information of blocks encoded / decoded before the current block (history-based merge candidates), and zero merge candidates.
[0230] The encoding device 100 may generate a bitstream by performing entropy encoding on at least one of the merge flag and the merge index, and may signal the bitstream to the decoding device 200. The merge flag may be information indicating whether the merge mode is performed for each block, and the merge index may be information indicating which neighboring block among the neighboring blocks of the current block is the merge target block. For example, the neighboring blocks of the current block may include a left neighboring block located to the left of the current block, an upper neighboring block arranged above the current block, and a temporal neighboring block temporally adjacent to the current block.
[0231] In addition, the encoding device 100 performs entropy encoding on correction information for correcting a motion vector in the motion information of the merge candidate, and signals it to the decoding device 200. 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 correction is performed, correction direction information, and correction size information. As described above, the prediction mode of correcting the motion vector of the merge candidate based on the signaled correction information may be referred to as a merge mode with a motion vector difference.
[0232] The skip mode may be a mode of applying the motion information of a neighboring block to the current block as it is. When the skip mode is applied, the encoding device 100 may perform entropy encoding on information on the fact that the motion information of which block will be used as the motion information of the current block to generate a bitstream, and may signal the bitstream to the decoding device 200. The encoding device 100 may not signal syntax elements regarding at least any one of motion vector difference information, coded block flag, and transform coefficient level to the decoding device 200.
[0233] The sub-block merge mode may represent a mode of deriving motion information in units of sub-blocks of a coding unit (CU). When the sub-block merge mode is applied, motion information of a sub-block co-located with the current sub-block in a reference image (sub-block-based temporal merge candidates) and / or affine control point motion vector merge candidates may be used to generate a sub-block merge candidate list.
[0234] The geometric partitioning mode may represent a mode in which motion information is derived by partitioning a current block in a predetermined direction, each of the derived motion information is used to derive each predicted sample point, and the predicted sample point of the current block is derived by weighting each of the derived predicted sample points.
[0235] The inter-frame / intra-frame combined prediction mode may represent a mode in which the predicted sample point of the current block is derived by weighting the predicted sample points generated by inter-frame prediction and the predicted sample points generated by intra-frame prediction.
[0236] The decoding device 200 may correct the derived motion information by itself. The decoding device 200 may search a predetermined area based on the reference block indicated by the derived motion information, and derive the motion information with the minimum SAD as the corrected motion information.
[0237] The decoding device 200 may compensate the predicted sample points derived via inter-frame prediction using optical flow.
[0238] Figure 6 is a diagram showing transform and quantization processing.
[0239] As Figure 6 shown, transform processing and / or quantization processing is performed on the residual signal to generate a quantized level signal. The residual signal is the difference between the original block and the predicted block (i.e., the intra-frame predicted block or the inter-frame predicted block). The predicted block is a block generated by intra-frame prediction or inter-frame prediction. The transform may 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.
[0240] 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 for the primary transform and / or the secondary transform may be determined according to 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 signaled. The DCT-based transform may include, for example, DCT-2, DCT-8, etc. The DST-based transform may include, for example, DST-7.
[0241] A quantized level signal (quantization 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 an intra prediction mode or block size / shape of a block, the quantized level signal may be scanned according to at least one of a diagonal right-up scan, a vertical scan, and a horizontal scan. For example, when scanning coefficients according to a diagonal right-up scan, the coefficients in a block form are changed to a one-dimensional vector form. In addition to the diagonal right-up scan, depending on the intra prediction mode and / or the size of a transform block, a horizontal scan that horizontally scans the coefficients in a two-dimensional block form or a vertical scan that vertically scans the coefficients in a two-dimensional block form may be used. The scanned quantized level coefficients may be entropy encoded to be inserted into a bitstream.
[0242] A decoder performs entropy decoding on the bitstream to obtain the quantized level coefficients. The quantized level coefficients may be arranged in a two-dimensional block form by inverse scanning. For the inverse scanning, at least one of a diagonal right-up scan, a vertical scan, and a horizontal scan may be used.
[0243] The quantized level coefficients may then be dequantized, then optionally subjected to a secondary inverse transform, and finally optionally subjected to a primary inverse transform to generate a reconstructed residual signal.
[0244] Inverse mapping in a dynamic range may be performed on a luminance component reconstructed by intra prediction or inter prediction before in-loop filtering. The dynamic range may be divided into 16 equal segments, and a mapping function for each segment may be signaled. The mapping function may be signaled at a slice level or a parallel block group level. An inverse mapping function for performing inverse mapping may be derived based on the mapping function. In-loop filtering, reference picture storage, and motion compensation are performed in the mapped region, and a prediction block generated by inter prediction is transformed to the mapped region via mapping using the mapping function and then used to generate a reconstructed block. However, since intra prediction is performed in the mapped region, a prediction block generated by intra prediction may be used to generate a reconstructed block without mapping / inverse mapping.
[0245] 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 the 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.
[0246] The information indicating whether the mapping / inverse mapping of the luminance component and the chrominance component is available can be signaled through the sequence parameter set.
[0247] 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 called 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 the device complexity according to the IBC mode implementation can be reduced.
[0248] 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.
[0249] In the following, the encoding / decoding method of the present disclosure will be described.
[0250] For encoding a single picture, one of the intra prediction, inter prediction, or intra block copy prediction methods can be used.
[0251] When the luminance component and the chrominance component have an independent block partition structure (i.e., a dual-tree structure) or when the luminance component and the chrominance component have the same block partition structure (i.e., a single-tree structure), an encoding / decoding method based on intra block copy prediction can be used.
[0252] The intra block copy prediction method can be expressed as a method of deriving a prediction block from an encoded / decoded region in the same picture (i.e., intra) using a derived block vector.
[0253] When encoding / decoding a block that is currently to be encoded / decoded (i.e., the current block) using the intra block copy prediction method and the derived block vector is (x, y), a block that has the same size as the current block and is separated from the current block by x pixels 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 by y pixels 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) can be used as the prediction block of the current block. For example, Figure 9 is a diagram showing the relationship between the current block and the prediction block according to an embodiment of the present invention. Referring to Figure 9 , when x and y are negative integers and the upper left sample position of the current block is (x0, y0), the upper left sample position of the prediction block of the current block is (x0 + x, y0 + y).
[0254] If the current luminance component block uses intra block copy prediction, one of the following methods can be used to encode / decode the block.
[0255] The intra block copy skip mode that derives the block vector of the current block from the block vectors of the blocks encoded / decoded before the current block is similar to the skip mode in the inter prediction method, and there is no residual signal.
[0256] The intra block copy merge mode that derives the block vector of the current block from the block vectors of the blocks encoded / decoded before the current block is similar to the merge mode in the inter prediction method, and there is a residual signal.
[0257] The intra block copy AMVP mode that encodes the block vector is similar to the AMVP mode of the inter prediction method.
[0258] According to an embodiment, the encoding mode of the current luminance component block can be derived in the decoder as follows.
[0259] At least one of the coding information described below can be used to determine the coding mode of the current luminance component block, and at least one of the coding information can be included in the bitstream and sent in the bitstream.
[0260] The coding information may include information indicating that the luminance component block is in the skip mode (e.g., skip mode identifier, flag, index, skip_flag, cu_skip_flag, etc.).
[0261] When the information indicating the skip mode has a specific value, this indicates that the luminance component block is in the skip mode. For example, if the identifier, flag, or index has a first value of 1, this indicates that the luminance component block is in the skip mode, and if the identifier, flag, or index has a second value of 0, this indicates that the luminance component block is not in the skip mode.
[0262] The coding information may include prediction mode information of the luminance component block (e.g., index, identifier, flag, etc.). The prediction mode information may include an intra prediction mode, an inter prediction mode, an intra block copy prediction mode, etc.
[0263] For example, the syntax indicating 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.
[0264] As another example, first prediction mode information (e.g., index, flag, identifier, pred_mode_flag, etc.) can indicate whether the intra prediction mode is applied. 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, second prediction mode information (e.g., index, flag, identifier, pred_mode_ibc_flag, etc.) can be received to indicate whether the inter prediction mode or the intra block copy prediction mode is applied. The second prediction mode information having a first value of 1 can indicate that the intra block copy prediction mode is applied, and the second prediction mode information having a second value of 0 can indicate that the inter prediction mode is applied.
[0265] As another example, the first prediction mode information (e.g., index, flag, identifier, pred_mode_flag, etc.) may indicate whether the prediction mode of the luminance component block is an intra prediction mode or an inter prediction mode. The first prediction mode information having a first value of 1 may indicate the intra prediction mode, and the first prediction mode information having a second value of 0 may indicate the inter prediction mode. In addition, the second prediction mode information (e.g., index, flag, identifier, pred_mode_ibc_flag, etc.) may be sent or derived. The second prediction mode information having a first value of 1 may indicate that the intra 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 luminance component block is determined to be the intra prediction mode or the inter prediction mode determined in the first prediction mode information. In the above embodiments and / or the following embodiments, the first value and the second value may be different. For example, the first value may be 0, and the second value may be 1.
[0266] The coding information may include information indicating that the luminance component block is in the merge mode (e.g., merge mode identifier, flag, index, merge_flag, etc.).
[0267] When the current luminance component block is not in the skip mode but in the intra block copy mode, a merge mode having a specific value may indicate the merge mode. For example, an identifier, flag, or index having a first value of 1 may indicate that the merge mode is applied, and an identifier, flag, or index having a second value of 0 may indicate that the merge mode is not applied.
[0268] The coding information may be used as follows to determine the coding mode of the current luminance component block.
[0269] For example, when the luminance component block is in the skip mode and the parallel block group, strip, or parallel block belongs to type I, the prediction mode information may not be received and the block may be determined to be in the intra block copy skip mode because the prediction modes applicable to the case of type I include the intra prediction mode and the intra block copy prediction mode and the skip mode does not exist in the intra prediction mode.
[0270] As another example, when the luminance component block is in the skip mode and the parallel block group, strip, or parallel block does not belong to type I, the prediction mode information may be received. At this time, when it is determined based on the prediction mode information that the luminance component block is in the intra block copy prediction mode, it may be determined that the luminance block is in the intra block copy skip mode.
[0271] As another example, when the luminance component block is not in the skip mode and it is determined that the luminance component block is in the intra block copy prediction mode based on the prediction mode information, information indicating the merge mode may be received. Optionally, for example, when the luminance component block is not in the skip mode, information indicating the merge mode may be received. At this time, when the information indicating the merge mode indicates that the luminance component block is in the merge mode, it may be determined that the luminance component block is in the intra block copy merge mode.
[0272] As another example, when the luminance component block is not in the skip mode, not in the merge mode, and is in the intra block copy prediction mode, it may be determined that the luminance component block is in the intra block copy AMVP mode. For example, it may be determined whether the luminance component block is in the intra block copy merge mode or the intra block copy AMVP mode based on the information indicating the merge mode.
[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 luminance component and the chrominance component have the same block partitioning structure (i.e., a single tree structure), the coding mode may be determined as described below.
[0275] For example, the prediction mode of the chrominance component block (e.g., intra prediction, inter prediction, or intra block copy prediction) may be equal to the prediction mode of the luminance component block corresponding to the chrominance component block.
[0276] As another example, when the corresponding luminance component block is in the intra block copy skip mode, the residual signal may not be encoded / decoded in the chrominance component block and the residual signal information may not be sent. At this time, information indicating that the residual signal information is not sent (e.g., cu_cbf, tu_cbf, etc.) may not be sent in the bitstream.
[0277] As another example, when the luminance component and the chrominance component have the same block partitioning 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), the information required for encoding / decoding the current chrominance component block may 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 partitioning 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 and sent in the bitstream. The prediction mode of the chrominance component block may include an intra prediction mode, an inter prediction mode, an intra block copy prediction mode, etc. as in the prediction mode of the luminance component block.
[0279] For example, a syntax indicating prediction mode information with a first value of 0 may indicate an intra prediction mode, the syntax with a second value of 1 may indicate an inter prediction mode, and the syntax with a third value of 2 may indicate an intra block copy prediction mode.
[0280] As another example, first prediction mode information (e.g., an index, a flag, an identifier, pred_mode_flag, etc.) may indicate that the prediction mode of a chrominance component block is an intra prediction mode. The first prediction mode information with a first value of 1 may indicate that the intra prediction mode is applied, and the first prediction mode information with a second value of 0 may indicate that the intra prediction mode is not applied. When the intra prediction mode is not applied, second prediction mode information (e.g., an index, a flag, an identifier, pred_mode_ibc_flag, etc.) may be received to indicate whether the prediction mode of the chrominance component block is an inter prediction mode or an intra block copy prediction mode. The second prediction mode information with a first value of 1 may indicate that the intra block copy prediction mode is applied, and the second prediction mode information with a second value of 0 may indicate that the inter prediction mode is applied.
[0281] As another example, first prediction mode information (e.g., an index, a flag, an identifier, pred_mode_flag, etc.) may indicate whether the prediction mode of a chrominance component block is an intra prediction mode or an inter prediction mode. The first prediction mode information with a first value of 1 may indicate the intra prediction mode, and the first prediction mode information with a second value of 0 may indicate the inter prediction mode. In addition, second prediction mode information (e.g., an index, a flag, an identifier, pred_mode_ibc_flag, etc.) may be sent or derived. The second prediction mode information with a first value of 1 may indicate that the intra block copy mode is applied, and the second prediction mode information with a second value of 0 may indicate that the prediction mode of the chrominance component block is determined to be the intra prediction mode or the inter prediction mode determined in the first prediction mode information.
[0282] As another example, second prediction mode information (e.g., an index, a flag, an identifier, pred_mode_ibc_flag, etc.) may be sent or derived. The second prediction mode information with a first value of 1 may indicate the intra block copy mode, and the second prediction mode information with a second value of 0 may indicate the intra prediction mode.
[0283] When the luminance component and the chrominance component have an independent block partitioning structure and the current chrominance component block is in the intra block copy prediction mode, information (e.g., a block vector, etc.) required for encoding / decoding the current chrominance component block may be derived from the encoding / decoding information of the luminance component block corresponding to the current chrominance component block.
[0284] Hereinafter, steps for deriving a block vector for intra block copy prediction will be described.
[0285] The steps for deriving a block vector for intra block copy prediction may include at least one of the steps of deriving a block vector for a luminance component block and a block vector for a chrominance component block.
[0286] Hereinafter, the steps for deriving a block vector for a luminance component block will be described.
[0287] According to an embodiment, a method for deriving a block vector when a current block is a luminance component block and is encoded in an intra block copy skip mode or an intra block copy merge mode will be described below.
[0288] To derive a block vector for a luminance component block, a block vector candidate list may be constructed from block vector candidates of luminance component blocks encoded 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., an identifier, an index, a flag, merge_idx, etc.) for identifying a candidate in the block vector candidate list may be derived based on encoding parameters sent in the bitstream.
[0289] 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, one or more of the candidates described below may be included in the block vector candidate list.
[0290] Figure 10 is a diagram showing neighboring blocks adjacent to a current block according to an embodiment of the present invention. Referring to Figure 10 , a block vector may be derived from at least one of a block B1 adjacent to the upper side of the current block X, a block A1 adjacent to the left side of the current block, a block B0 located at the upper right corner of the current block, a block B2 located at the upper left corner of the current block, or a block A0 located at the lower left corner of the current block, and the derived block vector may be determined as a block vector candidate of the current block.
[0291] For example, if there are block vectors in all of the blocks A1, B1, B0, and A0, the block B2 located at the upper left corner of the current block may not be used as a block vector candidate.
[0292] As another example, it may be determined whether a block vector exists in at least one of the blocks A0, A1, B0, B1, and B2 in a predetermined priority order (i.e., whether the block is encoded / decoded using an intra block copy prediction method), and if there is a block vector, 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.
[0293] The block vector candidate list may be constructed in a predetermined priority order, and a redundancy check may be performed between the block vector candidates existing in the block vector candidate list and newly added block vector candidates.
[0294] For example, when constructing a block vector candidate list in the order of A1, B1, B0, A0, and B2, a redundancy check can be performed between block B1 and block A1, and a redundancy check can be performed between block B0 and block B1. In addition, a redundancy check can be performed between block A0 and block A1, and a redundancy check can be performed between block B2 and blocks A1 and B1. The redundancy check can be performed only when the block vector exists in the block.
[0295] As another example, a redundancy check can be performed between the block vector to be added and all block vectors existing in the block vector candidate list.
[0296] When the block vector exists in at least one of blocks A0, A1, B0, B1, and B2, it can be determined whether the block vector of the block is available in the current block, and only when it is available, the block vectors of adjacent blocks can be determined as block vector candidates. If it is not available, the block vectors of adjacent blocks may not be used as block vector candidates. At this time, it can be determined whether the block vector is available according to whether the reference sample point (block) at the position indicated by the block vector is available.
[0297] The block vectors of the blocks encoded / decoded before the current block can be stored in a buffer, and at least one of the block vectors stored in the buffer can be determined as a block vector candidate. At this time, the intra-frame block vectors can be stored in a buffer with a specific size in the order of encoding / decoding, and if the buffer is full, the first stored block vector can be deleted and a new (i.e., most recently encoded / decoded) block vector can be stored. When the block vector candidate list can be constructed based on 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 can be changed. For example, the block vectors can be included in the block vector candidate list from the most recently stored block vector to the first stored block vector or from the first stored block vector to the most recently stored block vector. The block vector candidate can be referred to as a history-based block vector candidate.
[0298] When using at least one history-based block vector candidate among the history-based block vector candidates to construct the block vector candidate list, it can be determined whether the history-based block vector candidate is available in the current block, and only when it is available, the candidate can be added to the block vector candidate list. At this time, it can be determined whether the history-based block vector is available according to whether the reference sample point (block) at the position indicated by the block vector is available.
[0299] When constructing a block vector candidate list using at least one history-based block vector candidate among the history-based block vector candidates, 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 there is no identical block vector as a result of the redundancy check, the candidate may be added to the block vector candidate list.
[0300] For example, when constructing a block vector candidate list using at least one history-based block vector candidate among the history-based block vector candidates, the candidate may be added to the block vector candidate list without performing redundancy check between a predetermined candidate among the history-based block vector candidates and 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 that is stored first or most recently in a history-based block vector list composed of history-based block vector candidates.
[0301] 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, redundancy check may be performed between a predetermined candidate among the history-based block vector candidates and the block vector candidates 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.
[0302] A buffer including history-based block vector candidates may be held 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 blocks that have been encoded / decoded before the current block in units of pictures, slices, parallel blocks, CTUs, CTU rows, or CTU columns.
[0303] 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, 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, and only if it is available, the combined block vector candidate may be used. 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.
[0304] If the width of the current luminance block is W and the height of the current luminance block is H, then (- (W << n) + a, - (H << n) + b), (- (W << n) + c, 0), or (0, - (H << n) + d) can be included in the block vector candidate list as block vector candidates. At this time, n can be a positive integer greater than 0, and a, b, c, and d can all have integer values. The block vector candidates can be referred to as fixed basic block vector candidates.
[0305] The block vector candidate list can 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, or fixed basic block vector candidates.
[0306] Here, referring to Figure 10 , the adjacent neighboring blocks can include at least one of A0 or A1 and at least one of B0, B1, or B2.
[0307] For example, the block vector candidate list can be constructed in the order of the block vectors of adjacent neighboring block candidates, history-based block vector candidates, combined block vector candidates, and fixed basic block vector candidates.
[0308] In addition, for example, the fixed basic block vectors can 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).
[0309] 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 can be the vector (0, 0), and a block vector candidate list with the maximum number of candidates can 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 can 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 can be the vector (0, 0).
[0310] When constructing the block vector candidate list, the maximum number of history-based block vector candidates that can be included in the block vector candidate list can be the maximum number N of block vector candidates or (N - m). m can be an integer greater than 0.
[0311] When partitioning a parent block and encoding / decoding each block in the intra block copy skip mode or intra block copy merge mode, if at least one of the blocks partitioned from the parent block is smaller than a predetermined threshold, the partitioned blocks can share and use the block vector candidate list constructed in the parent block.
[0312] When determining whether to share the block vector candidate list constructed in the parent block, when using the width and height of the parent block, the block vector candidate list constructed in the parent block can be used for the partitioned lower-level blocks when the following conditions are satisfied.
[0313] Quadtree partition: (width of the parent block × height of the parent block) / 4 < threshold Horizontal or vertical binary tree partition: (width of the parent block × height of the parent block) / 2 < threshold Trinary tree: (width of the parent block × height of the parent block) / 4 < threshold The threshold can be predetermined in the encoder / decoder or signaled from the encoder to the decoder.
[0314] Figure 11 is a diagram showing the current block partitioned when the predetermined threshold is 32 according to an embodiment of the present invention.
[0315] Refer to Figure 11, if a predetermined condition is satisfied, each sub-block is encoded / decoded in an intra block copy skip mode or an intra block copy merge mode. For example, a block vector candidate list can be used to encode / decode the sub-blocks, where the block vector candidate list includes block vectors of neighboring blocks (e.g., A1, B1, B0, A0, and B2) at the position of the upper block, as well as history-based block vector candidates that were encoded / decoded before the upper block and stored in a buffer, or fixed basic block vectors derived from the width and height of the upper block. Here, the condition may include whether at least one of the areas of the sub-blocks in the quadtree partition, vertical or horizontal bipartition, or ternary tree partition of the upper block is less than 32.
[0316] When sharing and using the block vector candidate list constructed in the upper block, the predicted block indicated by the block vector of the sub-block may not be located in the upper block.
[0317] For example, Figure 12 is a diagram showing the process of sharing and using the block vector candidate list constructed in the upper block according to an embodiment of the present invention. Referring to Figure 12 , when sharing and using the block vector candidate list at the position of the upper block, it can be determined that the block vector BV for encoding / decoding at least one of the sub-blocks in the intra prediction block copy mode is valid only when the predicted block exists in the area that was encoded / decoded before the upper block.
[0318] When sharing and using the block vector candidate list constructed in the upper block, at least one of the partitioned sub-blocks may have one of 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.
[0319] When sharing and using the block vector candidate list constructed in the upper block, the partitioned sub-blocks can be encoded / decoded only in a skip mode based on intra block copy, a merge mode based on intra block copy, an AMVP mode based on intra block copy, or an AMVP mode using a motion vector.
[0320] When sharing and using the merge candidate list constructed in the upper block, the partitioned sub-blocks are not encoded / decoded in the intra block copy skip mode and the intra block copy merge mode. Although the partitioned sub-blocks can be encoded / decoded in the intra block AMVP mode, it can be determined that the block vector of the block is valid only when the predicted block obtained from the block vector exists in the area that was encoded / decoded before the upper block.
[0321] The merge candidate list can represent a list that includes motion vectors and temporal motion vectors, history-based motion vectors, combined motion vectors, and zero vectors, but does not include the block vectors of adjacent neighboring blocks of the upper block.
[0322] When the width and / or height of the current block is equal to or less than a predetermined value, the intra-predicted block copy skip mode and the intra-predicted block merge mode may not be allowed.
[0323] For example, when the width and height of the current block are less than 8, the skip mode based on intra-block copy and the intra-predicted block merge mode may not be allowed.
[0324] Optionally, when the width and height of the current block are equal to or less than a predetermined value, a predetermined vector candidate may not be allowed as a block vector candidate. For example, when the width and height of the current block are equal to or less than 4×4 (or when the product of the width and height of the current block is equal to or less than 16), the block vectors of adjacent neighboring blocks may not be allowed as block vector candidates. At this time, at least one of the historical block vector, the combined block vector, or the fixed basic block vector may be used to construct a block vector candidate list. For example, only the historical block vector may be used or only the historical block vector and the fixed basic block vector may be used to construct the block vector candidate list. In addition, at this time, the update process of the historical block vector candidate list may not be performed.
[0325] If the value of the width W×height H of the current block is less than or equal to the threshold condition for using the merge candidate list constructed in the upper-level block in the lower-level block, the intra-block copy skip mode and the intra-block copy merge mode may not be allowed.
[0326] For example, if the threshold for using the merge candidate list constructed in the upper-level block in the lower-level block is 32, the intra-block copy skip mode and the intra-block copy merge mode may be allowed only when the width × height H of the current block is greater than 32.
[0327] When the value of the width W×height H of the current block is less than or equal to the threshold condition for using the block vector candidate list constructed in the upper-level block in the lower-level block, the skip mode and the merge mode may not be allowed. The skip mode and the merge mode may represent modes of encoding / decoding using a motion vector instead of the block vectors of the spatial / temporal neighboring blocks of the current block.
[0328] Optionally, when the width and height of the current block are equal to or less than a predetermined value, a predetermined vector candidate may not be allowed as a block vector candidate. For example, when the width and height of the current block are equal to or less than 4×4 (or when the product of the width and height of the current block is equal to or less than 16), the block vectors of adjacent neighboring blocks may not be allowed as block vector candidates. At this time, at least one of the historical block vector, the combined block vector, or the fixed basic block vector may be used to construct a block vector candidate list. For example, only the historical block vector may be used or only the historical block vector and the fixed basic block vector may be used to construct the block vector candidate list. In addition, at this time, the update process of the historical block vector candidate list may not be performed.
[0329] For example, if the threshold condition for using the block vector candidate list constructed in the upper-level block in the lower-level block is 32, the skip mode and merge mode based on the motion vector instead of the block vector are allowed only when the width × height H of the current block is greater than 32.
[0330] The combined merge candidate list may be composed of the motion vectors and block vectors of adjacent neighboring blocks of the upper-level block, and when the value derived based on the width and / or height of at least one block partitioned from the upper-level block is less than a predetermined threshold, the combined merge candidate list constructed in the upper-level block may be shared and used.
[0331] At least one of the neighboring block motion vector candidates of the upper-level block, the block vector candidates of the neighboring blocks, the temporal motion vector candidates, the history-based motion vector candidates, the history-based block vector candidates, the (0, 0) motion vector candidate, or the fixed basic block vector may be used to construct the combined merge candidate list, and the combined merge candidate list may be shared and used among the lower-level blocks.
[0332] For example, when encoding / decoding a block in the intra prediction block copy skip mode or the intra prediction block merge mode, the candidates corresponding to the block vectors in the combined merge candidate list may be encoded / decoded. At this time, when performing encoding / decoding in the intra prediction block copy skip mode or the intra prediction block merge mode, the information for identifying the corresponding candidate in the combined merge candidate list may only indicate the block vector candidates.
[0333] As another example, when encoding / decoding the corresponding block in the skip mode or the merge mode, only the candidates corresponding to the motion vectors rather than the block vectors in the combined merge candidate list may be encoded / decoded. At this time, when performing encoding / decoding in the skip mode or the merge mode, the information for identifying the corresponding candidate in the combined merge candidate list may only indicate the motion vector candidates.
[0334] According to an embodiment, when the current block is a luma component block and is encoded in the AMVP mode based on intra block copy, the block vector derivation method is as follows.
[0335] Similar to the intra block copy skip mode or the merge mode, up to N predicted block vector candidates may be used to construct a predicted block vector candidate list. One of the candidates included in the constructed predicted block vector candidate list may be used as the predicted block vector of the current block, and the information (e.g., identifier, index, flag, mvp_l0_flag, etc.) for identifying the predicted candidate in the predicted block vector candidate list may be derived based on the encoding parameters sent in the bitstream.
[0336] The vector difference between the block vector of the current block and the predicted block vector can be calculated, and the calculation result can be entropy-coded. The decoder can receive the block vector difference information in the bitstream, or derive the vector difference from the information sent in the bitstream, and add the block vector difference of the current block to the predicted block vector to derive the block vector of the current block.
[0337] One or more of the following candidates can be included in the predicted block vector candidate list.
[0338] In Figure 10 it can be determined whether to encode / decode the block in the order of A0 and A1 using the intra-block copy prediction method, and the block vector of the block encoded / decoded using the intra-block copy prediction method can be determined as the prediction candidate A. Optionally, it can be determined whether to encode / decode the block corresponding to A1 using the intra-block copy prediction method, and when the block is encoded / decoded using the intra-block copy prediction method, the block can be determined as the prediction candidate A.
[0339] In Figure 10 it can be determined whether to encode / decode the block in the order of B0, B1, and B2 using the intra-block copy prediction method, and the block vector of the block encoded / decoded using the intra-block copy prediction method can be determined as the prediction candidate B. Optionally, it can be determined whether to encode / decode the block corresponding to B1 using the intra-block copy prediction method, and when the block is encoded / decoded using the intra-block copy prediction method, the block can be determined as the prediction candidate B.
[0340] At this time, the predetermined priority order of the predicted block vector candidate list can be A and B.
[0341] The block vectors of the blocks encoded / decoded before the current block can be stored in a buffer, and one or more of the block vectors stored in the buffer can be determined as predicted block vector candidates. At this time, the block vectors can be stored in a buffer with a specific size in the order of encoding / decoding, and if the buffer is full, the first stored block vector can be deleted and a new (i.e., most recently encoded / decoded) block vector can be stored. When constructing the predicted block vector candidate list in the order of the block vectors stored in the buffer (e.g., from oldest to newest or from newest to oldest), the priority order can be changed. For example, the most recently stored block vector in the buffer can be included in the predicted block vector candidate list first, or the first stored block vector in the buffer can be included in the predicted block vector candidate list first. The block vectors can be referred to as history-based block vector candidates.
[0342] When constructing a block vector candidate list using at least one history-based block vector candidate among the history-based block vector candidates, it is possible to determine whether the history-based block vector candidate is available in the current block, and only if it is available, the candidate can be added to the block vector candidate list. At this time, it is possible to determine whether the history-based block vector is available based on whether the reference sample (block) at the position indicated by the block vector is available.
[0343] 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 can be performed between the history-based block vector candidate and the block vector candidates existing in the block vector candidate list, and when there is no identical block vector as a result of the redundancy check, the corresponding candidate can be added to the block vector candidate list.
[0344] For 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 not 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 can 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 the first stored or most recently stored block vector candidate in the history-based block vector list composed of the history-based block vector candidates.
[0345] 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 can 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 can 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.
[0346] A buffer including history-based block vector candidates can be maintained in units of picture, slice, parallel block, CTU, CTU row, CTU column during encoding / decoding, and can be used in units of picture, slice, parallel block, CTU, CTU row, CTU column. In addition, the buffer can include at least one piece of encoding information among the encoding information of the blocks encoded / decoded before the current block in units of picture, slice, parallel block, CTU, CTU row, CTU column.
[0347] At least two block vector candidates among the block vector candidates existing 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 candidate 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 can be determined whether the combined block vector candidate composed of block vector candidates is available in the current block, and only when it is available can this be determined as the combined block vector candidate. At this time, it can be determined whether the block vector is available according to whether the reference sample point (block) at the position indicated by the block vector is available.
[0348] 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) can be included in the block vector candidate list as block vector candidates. At this time, n can be a positive integer greater than 0, and a, b, c, and d can all have integer values. The block vector candidate can be referred to as a fixed basic block vector candidate.
[0349] At least one of the block vectors of adjacent neighboring blocks, the history-based block vectors, the combined block vectors, or the fixed basic block vector candidates can be used to construct the block vector candidate list in a predetermined order.
[0350] For example, the block vector candidate list can be constructed in the order of the block vectors of adjacent neighboring blocks, the history-based block vectors, the combined block vectors, and the fixed basic block vector candidates.
[0351] In addition, for example, the fixed basic block vectors can be constructed in the following order until the number of candidates in the block vector candidate list reaches the maximum number.
[0352] 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 can be the (0, 0) vector, and the fixed basic block vector can be added to build a candidate block vector candidate list with the maximum value until the number of candidates in the candidate block vector list reaches the maximum number. For example, when the number of candidate block vectors added to the candidate block vector list using the block vectors of adjacent neighboring blocks, history-based block vectors, combined block vectors, etc. is less than the maximum number N of candidate block vectors, the fixed basic block vector can be added to the candidate block vector list until the maximum number of candidate block vectors is reached. At this time, the fixed basic block vector can be the (0, 0) vector.
[0353] When constructing the candidate block vector list, the number of history-based candidate block vectors that can be included in the candidate block vector list can be the maximum number N of candidate block vectors or (N - m). m can be a natural number greater than 0.
[0354] In the intra-block copy mode, the range of values of the block vector or the position of the predicted block obtained using the block vector can be restricted. If the range of values of the block vector or the position of the predicted block obtained using the block vector is not restricted, it may be necessary to store the reconstructed images of all regions encoded / decoded before the current block in the same picture in order to generate a predicted block in the intra-block copy mode. In this case, when the encoder / decoder is implemented, a large-capacity memory may be required. Therefore, for ease of implementation, the range of values of the block vector in the intra-block copy mode or the position of the predicted block obtained using the block vector can be restricted.
[0355] Figure 13 is a diagram showing the relationship between the current block and the reference prediction block according to an embodiment of the present invention.
[0356] Referring to Figure 13 , when the coordinates of the current block in the picture in the intra-block copy mode are (xCb, yCb), the width of the current block is cbWidth, the height of the current block is cbHeight, and the block vector is (Vx, Vy), the upper left coordinates (xTL, yTL) of the reference prediction block obtained by applying the block vector can be (xCb + Vx, yCb + Vy), and the lower right coordinates (xBR, yBR) can be (xTL + cbWidth - 1, yTL + cbHeight - 1).
[0357] The method of restricting the range of values of the block vector or the position of the predicted block obtained using the block vector can be at least one of the following methods.
[0358] The block including the upper left coordinates (xTL, yTL) of the reference prediction block and the block including the lower right coordinates (xBR, yBR) should be available. Here, available can mean that the block exists or the reconstructed image of the block exists.
[0359] The lower right coordinates of the reference prediction block may be located to the left, above, or above the left of the upper left coordinates of the current block, and there may be no overlapping portion between the current block and the reference prediction block. To this end, at least one of the following conditions needs to be satisfied.
[0360] Vx + cbWidth ≤ 0 Vy + cbHeight ≤ 0 The reference prediction block may be included in the same CTB as the current block or the (N - 1) CTBs on the left. If the CTB size is 128×128, N may be 2, and if the CTB size is less than 128×128 or equal to or less than 64×64, the product of the height of the CTB and (N × the width of the CTB) may be equal to 128×128.
[0361] For example, if the CTB size is 128×128, the reference prediction block may be included in the same CTB as the current block and / or the left CTB. When the reference prediction block is included in the same CTB as the current block, it may be included in the area encoded / decoded before the current block. The current CTB and the left CTB of the current CTB are partitioned into four in units of 64×64, so that the reference prediction block may exist in three 64×64 blocks encoded / decoded before the 64×64 block to which the current block belongs. Figure 14 is a diagram showing a reference prediction block for a current block in an intra block copy mode according to an embodiment of the present invention. Refer to Figure 14 , according to the position of the current block Curr with a size of 64×64 in the CTB, the 64×64 blocks to which the reference prediction block may belong are shaded. The area indicated by "X" may represent an area that does not include the reference prediction block. In addition, the reference prediction block may exist in the area encoded / decoded before the current block in the CTB to which the current block belongs. The number of reconstructed samples that need to be stored to generate the reference prediction block may be limited to the number of samples included in at most four 64×64 blocks (i.e., 128×128 blocks).
[0362] As another example, when the CTB size is less than 128×128 or equal to or less than 64×64, the reference prediction block may be included in the (N - 1) CTBs on the left side of the CTB to which the current block belongs. The reference prediction block may be included in the same CTB as the current block and / or in the left CTB. At this time, N may be an integer such that the product of the height of the CTB and (N×the width of the CTB) satisfies 128×128. For example, when the CTB size is 64×64, N may be 4. In addition, the reference prediction block may exist in the region that has been encoded / decoded before the current block. The number of reconstructed samples required to be stored to generate the reference prediction block may be limited to the number of samples included in a 128×128 block.
[0363] The range of the reference prediction block may be limited by storing the reference prediction region available in the intra-block copy mode in a separate buffer.
[0364] In this case, the size of the intra-block copy reference region buffer may be M1×M2, and M3 bits may be stored per sample. At this time, M1 and M2 may be positive integers that are multiples of 2 (e.g., 8, 16, 32, 64, 128, etc.), and M3 may be any positive integer (e.g., 5, 6, 7, 8, 9, 10, 11, 12, etc.). The values stored in the buffer may be the reconstructed image samples that have not been applied with loop filtering, and when the samples are not represented as M3 bits per sample, the samples may be transformed into M3 bits per sample. A reference region buffer may be newly set for each sub-block, parallel block, stripe, CTB of the parallel block group or CTU row. The new setting may indicate that the buffer is reset or initialized. At least one of the following methods may be used to construct the buffer.
[0365] The size of the reference region buffer for the luminance component may be a predetermined multiple of the size of the CTB including the current block. Here, the predetermined multiple may be an integer greater than or equal to 1. For example, when the predetermined multiple is 1, the size of the reference region buffer for the luminance component may be equal to the size of the CTB including the current block. For example, when the CTB size is 128×128, the size of the reference region buffer may be 128×128. Optionally, when the predetermined multiple is 2, the size of the reference region buffer for the luminance component may be twice the size of the CTB including the current block. For example, when the CTB size is 128×128, the size of the reference region buffer may be 256×128.
[0366] Optionally, the size of the reference region buffer may be smaller than the CTB size.
[0367] Figure 15 is a diagram showing a reference region buffer in the intra-block copy mode according to an embodiment of the present invention. As shown inFigure 15 In the example of (a), the reference region buffer shown in the example of (b) can be constructed by including the region encoded / decoded before the current block in the region of the CTB including the current block (hereinafter referred to as the "current CTB") and the CTB located to the left of the current CTB. The reconstructed samples of the region encoded / decoded before the current block in the current CTB can be included at the same relative position in the CTB. In addition, the reconstructed samples included in the CTB located to the left of the current CTB can be included in the position of the current block and the positions corresponding to the regions other than the region encoded / decoded before the current block in the current CTB in the reference region buffer. At this time, the position of the reconstructed samples can be included at the same relative position as the reconstructed samples in the CTB. That is, when the coordinates of the sample are (x, y), the positions included in the buffer can be expressed as (x % CTB width or height, y % CTB width or height), (x % M1, y % M2), or (x % M1, y % CTB height). Here, the operation result of the modulo operation "%" can always be a positive value. That is, when x is a negative value, x%L can be -(-x%L). For example, when M1, CTB width, or CTB height is 128, -3%128 = 125. When the block vector is (Vx, Vy), the position of the predicted sample of the sample located at (x, y) can be ((x + Vx)%128, (y + Vy)%128). At this time, the sample value of the current block region in the reference region buffer can be the reconstructed sample value corresponding to the current block region in the left CTB. Figure 15 In the example of (b), the reference region buffer shown in the example of (b) can be constructed by including the region encoded / decoded before the current block in the region of the CTB including the current block (hereinafter referred to as the "current CTB") and the CTB located to the left of the current CTB. The reconstructed samples of the region encoded / decoded before the current block in the current CTB can be included at the same relative position in the CTB. In addition, the reconstructed samples included in the CTB located to the left of the current CTB can be included in the position of the current block and the positions corresponding to the regions other than the region encoded / decoded before the current block in the current CTB in the reference region buffer. At this time, the position of the reconstructed samples can be included at the same relative position as the reconstructed samples in the CTB. That is, when the coordinates of the sample are (x, y), the positions included in the buffer can be expressed as (x % CTB width or height, y % CTB width or height), (x % M1, y % M2), or (x % M1, y % CTB height). Here, the operation result of the modulo operation "%" can always be a positive value. That is, when x is a negative value, x%L can be -(-x%L). For example, when M1, CTB width, or CTB height is 128, -3%128 = 125. When the block vector is (Vx, Vy), the position of the predicted sample of the sample located at (x, y) can be ((x + Vx)%128, (y + Vy)%128). At this time, the sample value of the current block region in the reference region buffer can be the reconstructed sample value corresponding to the current block region in the left CTB.
[0368] The range of the block vector value can be restricted so that the transmitted or derived block vector indicates the region included in the reference region buffer.
[0369] The range of (Vx, Vy) can be restricted to MinVx ≤ Vx ≤ MaxVx, MinVy ≤ Vy ≤ MaxVy. (Vx, Vy) can be restricted with respect to the transmitted or derived block vector (Vx, Vy). At this time, MinVx, MaxVx, MinVy, and MaxVy can be set to one of the following items.
[0370] For example, when the upper left coordinates of the reference region buffer are set to (0, 0), MinVx = 0, MaxVx = (width of the reference region buffer - 1), MinVy = 0, and MaxVy = (height of the reference region buffer - 1) can be set.
[0371] As another example, Figure 16It is a diagram showing the range of values of block vectors according to an embodiment of the present invention. In the reference region buffer, when Figure 16 the shaded portion of (a) is set to (0, 0), MinVx = -(width of the reference region buffer / 2 - 1), MaxVx = (width of the reference region buffer / 2), MinVy = -(height of the reference region buffer / 2 - 1), and MaxVy = (height of the reference region buffer / 2) can be set.
[0372] As another example, in the reference region buffer, when Figure 16 the shaded portion of (b) is set to (0, 0), MinVx = -(width of the reference region buffer / 2), MaxVx = (width of the reference region buffer / 2 - 1), MinVy = -(height of the reference region buffer / 2), and MaxVy = (height of the reference region buffer / 2 - 1) can be set.
[0373] By restricting the range of values of block vectors in the reference region buffer, it is possible to easily determine whether an incorrect block vector is sent or used. When the sent or derived block vector is included in a range outside the restricted range, at least one of the following methods can be applied to include the block vector in the restricted range or generate a predicted block.
[0374] For example, the block vector can be replaced with the block vector closest to the block vector outside the restricted range within the range of values of the block vector. That is, when the sent or derived block vector is (V1x, V1y), if V1x < MinVx, then V1x = MinVx can be set, if V1x > MaxVx, then V1x = MaxVx can be set, if V1y < MinVy, then V1y = MinVy can be set, and if V1y > MaxVy, then V1y = MaxVy can be set.
[0375] As another example, the block vector outside the restricted range can be set to have an arbitrary fixed value. For example, (0,0), a vector value indicating the position of the current block, (0, P1), (P2, 0), or (P3, P4) can be set. At this time, P1, P2, P3, and P4 can be any integer values.
[0376] As another example, without replacing the block vectors outside the restricted range with any values, the sample values of the predicted blocks obtained using the block vectors can all be set to any fixed value. At this time, the arbitrary fixed value is a value from 0 to 2^(bitdepth)-1, and bitdepth can be any positive integer value greater than 5. For example, bitdepth can be 5, 6, 7, 8, 9, 10, 11, 12, etc. In addition, for example, the sample values of the predicted blocks can be 0, 2^(bitdepth-1), 2^(bitdepth)-1, etc.
[0377] The reference region buffer can store the reconstructed image samples of the current block at the current block position after the current block is encoded / decoded. This process can be referred to as the reference region buffer update process, and after this process is executed, the encoding / decoding of the next block can be performed. By gradually updating the sample values included in the reference region buffer, when the encoding / decoding of all blocks in the current CTB is completed, the buffer can consist only of the reconstructed image samples in the current CTB. Optionally, the buffer can consist of the reconstructed image samples in the current CTB and the reconstructed image samples in the left CTB that have been encoded / decoded before the current CTB.
[0378] The size of the reference region buffer can be M1 = (N × width of CTB), M2 = (height of CTB), or M1 = (height of CTB), M2 = (N × width of CTB). At this time, N can be any integer greater than 0 and satisfying M1 × M2 = 128 × 128. Optionally, N can be derived as a value that satisfies (N × width of CTB) × (height of CTB) = 2 × 128 × 128. The width M1 of the reference region buffer can be equal to or less than (N × width of CTB). The height M2 of the reference region buffer can be equal to the height of CTB. Optionally, M1 can be M1 = (128 / CTB width) × K, where K can be the width of the reference region buffer or a predetermined integer multiple of the CTB width when the CTB width is 128. For example, K can be 128, 256, etc. Here, the CTB width can represent the width of CTB.
[0379] For example, when the size of the CTB is 128 × 128, the size of the reference region buffer can be 256 × 128. Optionally, when the size of the CTB is 64 × 64, the size of the reference region buffer can be 512 × 64. Optionally, when the size of the CTB is 32 × 32, the size of the reference region buffer can be 1024 × 32.
[0380] Figure 17 is a diagram showing the region encoded / decoded before the current block according to an embodiment of the present invention.
[0381] Refer toFigure 17 , the reference region buffer may be composed of the (N - 1) CTBs on the left that have been encoded / decoded before the current CTB. In addition, the region in the current CTB that has been encoded / decoded before the current block may be included in the reference region buffer.
[0382] Figure 18 is a diagram showing the reference region buffer in the intra block copy mode according to another embodiment of the present invention.
[0383] Referring to Figure 18 , the reference region buffer may be constructed to include the (N - 1) CTBs on the left that have been encoded / decoded before the current CTB. When CTB #1 is the first CTB of the current CTU row or CTB row, the buffer before the start of encoding / decoding of CTB #1 may be empty or set to a predetermined initial value. At this time, the initial value may be any integer greater than or equal to -1 or less than or equal to "2^(bitdepth)-1". For example, the initial value may be -1, 0, 2^(bitdepth - 1), or 2^(bitdepth)-1.
[0384] Here, the buffer being empty may indicate that the block vector is restricted such that the block vector does not indicate an empty region or an initial region in the buffer. In addition, setting the initial value may indicate that the block vector is restricted such that the block vector does not indicate the region set to the initial value. In addition, the region being indicated may mean that the initial value may be set to the predicted sample value.
[0385] When the encoding / decoding of CTB #1 is completed, all the reconstructed samples of CTB #1 may be stored in the reference region buffer. When the encoding / decoding of CTB #2 is completed, the reconstructed samples of CTB #2 may be additionally stored in the reference region buffer. Figure 18 The state of the reference region buffer after the reconstructed samples are added to the reference region buffer when the encoding / decoding of a specific CTB is completed may be shown. Referring to Figure 18 in (a) of Figure 18In (b), without changing the storage position of the samples of CTB #1, the reconstructed samples of CTB #2 can be stored in the right region of CTB #1. At this time, when the encoding / decoding of CTB #4 is completed, the reference region buffer is filled, and when the encoding / decoding of CTB #5 is completed, the reconstructed samples of CTB #5 can be stored at the position where the reconstructed samples of CTB #1 were stored. Thereafter, the reconstructed samples of CTB #6 can be stored at the storage position of the reconstructed samples of CTB #2. Optionally, referring to Figure 18 In (c), the same process as that in Figure 18 In (b) can be performed until the encoding / decoding of CTB #4 is completed and the reference region buffer is filled, and when the encoding / decoding of CTB #5 is completed, the storage position of the reconstructed samples of CTB #4 can be shifted left by the size of one CTB and the reconstructed samples of CTB #5 can be stored at the position where the reconstructed samples of CTB #4 were stored. At this time, the reconstructed samples of CTB #2 and CTB #3 can also be shifted left by the size of one CTB. In this case, since the positions of the pictures between CTBs become equal to the positions in the reference region buffer, the received block vector can be used to derive the prediction block without performing a separate transformation process. Referring to Figure 18 In (d), when the encoding / decoding of CTB #2 is completed, the storage position of the samples of CTB #1 in the reference region buffer can be shifted left by the size of one CTB, and the reconstructed samples can be stored at the position where CTB #1 was stored. When the encoding / decoding of CTB #4 is completed, the reference region buffer is filled, and when the encoding / decoding of CTB#5 is completed, as in the process of Figure 18 In (c), the storage position of the reconstructed samples of CTB #4 can be shifted left by the size of one CTB, and the reconstructed samples of CTB#5 can be stored at the position where the reconstructed samples of CTB #4 were stored. At this time, the reconstructed samples of CTB #2 and CTB #3 can also be shifted left by the size of one CTB.
[0386] When starting to encode / decode the K5th CTB, that is, when starting to encode / decode the first block of the K5th CTB, the reconstructed samples of the (K5 - 1)th, (K5 - 2)th, …, and (K5 - N)th CTBs can be stored in the reference region buffer. For example, when the CTB size is 64×64, N is 4. In this case, the reconstructed samples of the (K5 - 1)th, (K5 - 2)th, (K5 - 3)th, and (K5 - 4)th CTBs can be stored in the reference region buffer. Here, K5 can represent any positive integer. The first block of the K5th CTB can be encoded / decoded by referring to the reference region buffer. Before the start of the encoding / decoding of the block or after the completion of the encoding / decoding of the block, the reference region buffer state and the range of the block vector can be one of the following items.
[0387] For example, the reconstructed samples of the (K5 - N)th CTB can be deleted from the reference region buffer, and the reconstructed samples of the first block of the K5th CTB can be stored in the reference region buffer. The reference region of the Ath block (A is any positive integer greater than 1) of the K5th CTB can be restricted to the (N - 1) CTBs on the left side of the current CTB. This restriction can mean that the positions indicated by the upper left coordinate (or position) and the lower right coordinate (or position) of the predicted block derived from the block vector are restricted to be included in the (N - 1) CTBs on the left side. Here, deleting from the reference region buffer can mean that the region is initialized.
[0388] As another example, the reconstructed samples of the (K5 - N)th CTB can be deleted from the reference region buffer, and the reconstructed samples of the first block of the K5th CTB can be stored in the reference region buffer. The reference region of the Ath block (A is any positive integer greater than 1) of the K5th CTB can be restricted to the region of the blocks encoded / decoded before the current block in the current CTB and / or the (N - 1) CTBs on the left side of the current CTB. This restriction can mean that the positions indicated by the upper left coordinate (or position) and the lower right coordinate (or position) of the predicted block derived from the block vector are restricted to be included in the (N - 1) CTBs on the left side and / or the blocks encoded / decoded before the Ath block of the current CTB. In this case, the block vector can be restricted to indicate a region not initialized in the reference region buffer.
[0389] As another example, only the sample points in the reconstructed sample points of the (K5-N)th CTB that correspond to the positions in the CTB that are the same as the positions of the first block of the K5th CTB can be deleted, and the reconstructed sample points of the first block of the K5th CTB can be stored at the corresponding positions. In this case, the reference region of the current block can be limited to the blocks that have been encoded / decoded before the current block in the current CTB and the (N-1) CTBs to the left of the current CTB. Considering the encoding efficiency, this limitation may be beneficial because all regions of the reference region buffer are composed of reconstructed sample points.
[0390] When starting to encode / decrypt the K5th CTB, that is, when starting to encode / decrypt the first block of the K5th CTB, the reconstructed sample points of the (K5-1)th CTB, the (K5-2)th CTB, ……, and the (K5-N)th CTB can be stored in the reference region buffer. For example, when the CTB size is 64×64, N is 4. In this case, the reconstructed sample points of the (K5-1)th CTB, the (K5-2)th CTB, and the (K5-3)th CTB can be stored in the reference region buffer. The blocks in the K5th CTB can be encoded / decoded by applying one of the following methods.
[0391] For example, the reference region of the Ath block (A is any positive integer greater than 0) of the K5th CTB can be limited to the (N-1) CTBs to the left of the current CTB. This limitation can mean that the positions indicated by the upper left coordinate (or position) and the lower right coordinate (or position) of the predicted block derived from the block vector are limited to be included in the (N-1) CTBs to the left.
[0392] As another example, the reference region of the Ath block (A is any positive integer greater than 0) of the K5th CTB can be limited to the region of the blocks that have been encoded / decoded before the current block in the current CTB and / or the (N-1) CTBs to the left of the current CTB. This limitation can mean that the positions indicated by the upper left coordinate (or position) and the lower right coordinate (or position) of the predicted block derived from the block vector are limited to be included in the (N-1) CTBs to the left and / or the blocks that have been encoded / decoded before the Ath block in the current CTB. In this case, the block vector can be limited to indicate a region that has not been initialized in the reference region buffer.
[0393] In addition, when starting to encode / decode the first block of the K5 CTB or before encoding / decoding, the CTB region that stores the reconstructed sample values of the encoded / decoded blocks of the K5 CTB can be initialized to any fixed value or can be empty. At this time, the initial value can be any integer greater than or equal to -1 or less than or equal to "2^(bitdepth)-1". For example, the initial value can be -1, 0, 2^(bitdepth-1), or 2^(bitdepth)-1.
[0394] Here, the buffer being empty can indicate that the block vector is restricted such that the block vector does not indicate an empty region or an initial region in the buffer. In addition, setting the initial value can indicate that the block vector is restricted such that the block vector does not indicate a region set to the initial value. In addition, the region being indicated can mean that the initial value can be set to the predicted sample value.
[0395] After a specific block in the CTB region is encoded / decoded, the reconstructed sample values can be stored at the block position set to the initial value or the empty region in the reference region buffer. Optionally, the unencoded / decoded regions of the CTB region in the reference region buffer can be empty or can be set to the initial value.
[0396] In addition, a reference region buffer can be newly set for each sub-block, parallel block, stripe, CTB, or parallel block group or CTU row. Here, newly setting can mean that the buffer is empty or is initialized.
[0397] When the CTB width is C1, the CTB height is C2, and the current CTB and the left (N-1) CTBs can be included in the reference region buffer, if the coordinates of the block included in the CTB in the picture are (x, y), the position of the block stored in the reference region buffer can be set as follows.
[0398] For example, as Figure 18As shown in (a) of , when the coordinates of the block included in the K5 CTB in the picture are (x, y), the block can be stored at the position (x%C1, y%C2). Optionally, the block can be stored at the positions (x % M1, y % M2), (x%M1, y%CTB height), or (x%M1, y). When the coordinates of the block included in the left CTB at the time point of storing the block included in the K5 CTB in the picture are (x1, y1), the position in the reference area buffer can be the following positions. The position of the block included in the (K5-1) CTB can be (x1%C1+C1, y1%C2), the position of the block included in the (K5-2) CTB can be (x1%C1+(C1x2), y1%C2), and the position of the block included in the (K5-3) CTB can be (x1%C1+(C1x3), y1%C2). In addition, the position of the block included in the (K5-A) CTB can be (x1%C1+(C1xA), y1%C2), where A can be 0 or a positive integer of 0≤A≤(N-1).
[0399] As another example, in Figure 18 As shown in (b) of , when the coordinates of the block included in the K5 CTB in the picture are (x, y), the block can be stored at the position (x%C1, y%C2). When the coordinates of the block included in the left CTB at the time point of storing the block included in the K5 CTB in the picture are (x1, y1), the position in the reference area buffer can be the following positions. The position of the block included in the (K5-1) CTB can be (x1%C1+(C1x3), y1%C2), the position of the block included in the (K5-2) CTB can be (x1%C1+(C1x2), y1%C2), and the position of the block included in the (K5-3) CTB can be (x1%C1+(C1x1), y1%C2). In addition, the position of the block included in the (K5-A) CTB can be (x1%C1+(C1x(N-A)), y1%C2), where A can be 0 or a positive integer of 0≤A≤(N-1).
[0400] As another example, in Figure 18In (c) or (d) above, when the coordinates of the block included in the K5 CTB in the picture are (x, y), the block can be stored at the position (x % C1+(C1 x (N - 1)), y % C2). When the coordinates of the block included in the left CTB at the time point of storing the block included in the K5 CTB in the picture are (x1, y1), the position in the reference region buffer can be the following position. The position of the block included in the (K5 - 1) CTB can be (x1 % C1+(C1 x (N - 2), y1 % C2), the position of the block included in the (K5 - 2) CTB can be (x1 % C1+(C1 x (N - 3)), y1 % C2), and the position of the block included in the (K5 - 3) CTB can be (x1 % C1+(C1 x (N - 4)), y1 % C2). In addition, the position of the block included in the (K5 - A) CTB can be (x1 % C1+(C1 x (N - (A + 1))), y1 % C2), where A can be 0 or a positive integer such that 0 ≤ A ≤ (N - 1).
[0401] In addition, one of the following methods can be used to represent the block vector. Further, the block vector can be signaled or derived to be represented by one of the following methods.
[0402] When the coordinates of the upper - left position of the current block in the picture are (x, y) and the coordinates of the upper - left position of the predicted block in the picture are (x + VPx, y + VPy), the block vector can be represented by (VPx, VPy) which is the difference between the two coordinates and can be sent, or information capable of deriving the block vector can be sent.
[0403] When the coordinates of the upper - left position of the current block in the reference region buffer are (x, y) and the coordinates of the upper - left position of the predicted block in the reference region buffer are (x + VBx, y + VBy), the block vector can be represented by (VBx, VBy) which is the difference between the two coordinates and can be sent, or information capable of deriving the block vector can be sent.
[0404] At this time, when there is an empty area in the reference area buffer, the range of the block vector can be restricted such that the predicted block is not included in the corresponding area. For example, the block vector (VBx, VBy) can be restricted such that neither the upper left coordinate (x + VBx, y + VBy) nor the lower right coordinate (x + VBx + cbWidth - 1, y + Vby + cbHeight - 1) of the predicted block is included in the empty area of the reference area buffer. The block vector can be restricted such that when the upper left coordinate of the predicted block is (x + VBx, y + VBy), 0 ≤ x + VBx and 0 ≤ y + VBy, and when the lower right coordinate is (x + VBx + cbWidth - 1, y + Vby + cbHeight - 1), x + VBx + cbWidth - 1 ≤ ((C1x(N - 1)) - 1) and y + VBy + cbHeight - 1 ≤ (C2 - 1). When up to the area in the current CTB that has been encoded / decoded before the current block can be referenced, the block vector can be restricted such that x + VBx + cbWidth - 1 < x or y + VBy + cbHeight - 1 < y.
[0405] Optionally, when the reference area is set to the initial value, the range of the block vector can be restricted to the range in which the predicted block is included in the reference buffer area. That is, the block vector can be restricted such that when the upper left coordinate of the predicted block is (x + VBx, y + VBy), 0 ≤ x + VBx and 0 ≤ y + VBy, and when the lower right coordinate is (x + VBx + cbWidth - 1, y + Vby + cbHeight - 1), x + VBx + cbWidth - 1 ≤ ((C1xN) - 1) and y + VBy + cbHeight - 1 ≤ (C2 - 1).
[0406] Although the size of the reference area buffer is 128×128 in the present disclosure, the present disclosure is not limited thereto, and the size of the reference area buffer can be changed differently. In addition, various embodiments implemented based on the size of the reference area buffer can be implemented regardless of the size of the reference area buffer. For example, modifications can be made to perform a predetermined method without comparing the sizes of the reference area buffers.
[0407] The steps for deriving the block vector of the chrominance component block will be described below.
[0408] According to an embodiment, when the block partitioning of the luminance component and the chrominance component is the same in the same CTU (i.e., the block partitioning structure of the luminance block and the chrominance block is the same), and the current block is a chrominance component block and is encoded using the intra block copy prediction method, the block vector of the chrominance component block can be derived as follows.
[0409] The luminance component block corresponding to the current chrominance component block can be determined as follows.
[0410] When the top - left sample position of the current chrominance component block is (xc, yc), the width is Wc, and the height is Hc, the top - left sample position of the corresponding luma component block can be (xc / K1, yc / K2), the width can be K1×Wc, and the height can be K2×Hc. At this time, K1 and K2 can vary according to the chrominance component format. When the chrominance component format to be encoded is the 4:2:0 format, both K1 and K2 can be 2, and when the chrominance component format to be encoded is the 4:4:4 format, both K1 and K2 can be 1. In addition, in the case of the 4:2:2 format, K1 = 2 and K2 = 1.
[0411] Since the block partition structures of the chrominance component block and the luma component block are the same, the luma component block corresponding to the current chrominance component block can be composed of one luma component block.
[0412] When the block vector of the luma component block corresponding to the chrominance component block is (MVL[0], MVL[1]), the block vector of the chrominance component block can 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 can be 2, and when the chrominance component format of the picture to be encoded is the 4:4:4 format, both K1 and K2 can be 1. In addition, in the case of the 4:2:2 format, K1 = 2 and K2 = 1. Additionally, although it is assumed that the basic unit of MVL[0] and MVL[1] is 1 pixel, the basic unit can be 1 / 16 pixel or 1 / N pixel, where N can be any positive integer.
[0413] According to the embodiment, the block partition of the luma component and the chrominance component in the same CTU is performed independently (i.e., the block partition structures of the luma component and the chrominance component are different). When the current block is a chrominance component block and is encoded using the intra - block copy prediction method, the block vector of the chrominance component block can be derived as follows.
[0414] The luma component region corresponding to the current chrominance component block can be determined as follows.
[0415] When the top - left sample position of the current chrominance component block is (xc, yc), the width is Wc, and the height is Hc, the top - left sample position of the corresponding luma component block can be (xc / K1, yc / K2), the width can be K1×Wc, and the height can be K2×Hc. At this time, K1 and K2 can vary according to the chrominance component format. When the chrominance component format of the picture to be encoded is the 4:2:0 format, both K1 and K2 can be 2, and when the chrominance component format of the picture to be encoded is the 4:4:4 format, both K1 and K2 can be 1. In addition, in the case of the 4:2:2 format, K1 = 2 and K2 = 1.
[0416] At this time, the region of the luma component corresponding to the current chrominance component block may include only the partitioned part of the luma component block. In addition, the luma component region corresponding to the chrominance component block may be partitioned into at least one luma component block.
[0417] The current chrominance component block can be partitioned in units of N×M sub - blocks, and the sub - blocks of the luma component region corresponding to the corresponding sub - blocks can be partitioned in units of (N×K1)×(M×K2) sub - blocks. At this time, N and M can be integers of 1 or greater.
[0418] Figure 19 is a diagram showing the correspondence relationship between the chrominance component block and the luma component region according to an embodiment of the present invention.
[0419] Referring to Figure 19 , an example of the block partition structure in any CTU with a chrominance format of 4:2:0 is shown. The current chrominance component block can be partitioned in units of N×M sub - blocks, and the sub - blocks of the luma component region corresponding to the corresponding sub - blocks can be obtained by partitioning the luma component block in units of (N×K1)×(M×K2) sub - blocks. At this time, N and M can be integers of 1 or greater. Optionally, when the width of the current chrominance component block is Wc and the height is Hc, the partition 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 of 1 or greater.
[0420] There may be a luminance sub-block corresponding to a sub-block of the current chrominance component block. The block vector of the current chrominance sub-block can be derived from the block vector of the corresponding luminance sub-block. For example, when the block vector of the luminance sub-block corresponding to the chrominance sub-block is (MVL[0], MVL[1]), the block vector of the chrominance component block can be (MVL[0] / K1, MVL[1] / K2). At this time, K1 and K2 can be the same as 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 can be 1 / 16 pixel or 1 / N pixel, where N can be any positive integer.
[0421] In addition, the same prediction method may not be used to encode / decode all samples located in the luminance sub-block corresponding to the sub-block of the current chrominance component block. For example, when the block partition structures of the luminance component and the chrominance component are independent, the luminance sub-block corresponding to the chrominance sub-block may not match the luminance component prediction block, or there may be two or more luminance component prediction blocks partitioned in the luminance sub-block. Here, the luminance component prediction block can represent a block to which the same prediction or transform coding is applied when the luminance component is encoded / decoded, and can be determined by the luminance component block partition. In addition, the luminance component region corresponding to the chrominance component block may not represent a prediction block determined by the luminance component block partition as in the example of Figure 19 but may represent a luminance component region corresponding to the position and size of the chrominance component block.
[0422] Therefore, the block vector of the luminance sub-block corresponding to the sub-block of the current chrominance component block can be one of the following items.
[0423] 1. The block vector of the luminance component prediction block when encoding / decoding the luminance component prediction block including the top-left sample of the luminance sub-block corresponding to the sub-block of the current chrominance component block using the intra-block copy prediction method 2. The block vector of the luminance component prediction block when encoding / decoding the luminance component prediction block including the sample at the center position of the luminance sub-block corresponding to the sub-block of the current chrominance component block using the intra-block copy prediction method 3. Figure 20 is a diagram showing the luminance sub-block according to an embodiment of the present invention. When encoding / decoding the luminance component prediction block including one of the shadow sample positions in the shadow sample positions of the luminance sub-block corresponding to the sub-block of the current chrominance component block using the intra-block copy prediction method as in the example of Figure 20 the block vector of the luminance component prediction block 4. The block vector of the luminance component prediction block when encoding / decoding the luminance component prediction block occupying the largest area in the luminance sub-block corresponding to the sub-block of the current chrominance component block In one of the following cases, there may be no block vector of the luminance sub-block corresponding to the sub-block of the current chrominance component block.
[0424] 1. The case where the intra-block copy prediction method is not used to encode / decode the luminance component prediction block including the top-left sample of the luminance 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 the top-left sample of the luminance sub-block corresponding to the sub-block of the current chrominance component block 2. The case where the intra-block copy prediction method is not used to encode / decode the luminance component prediction block including the center position sample of the luminance 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 the center position sample of the luminance sub-block corresponding to the sub-block of the current chrominance component block 3. As in the example of Figure 20 the case where the intra-block copy prediction method is not used to encode / decode the luminance component prediction block at one of the shadow sample positions in the luminance 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 at one of the shadow sample positions in the luminance sub-block corresponding to the sub-block of the current chrominance component block.
[0425] 4. The case where the intra-block copy prediction method is not used to encode / decode the luminance component prediction block that occupies the largest area in the luminance 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 that occupies the largest area in the luminance sub-block corresponding to the sub-block of the current chrominance component block When there is no block vector of the luminance sub-block corresponding to the sub-block of the current chrominance component block (hereinafter referred to as the "current sub-block"), one of the following methods can be used to derive the block vector corresponding to the current chrominance component block.
[0426] The block vector of the current sub-block can be set to (0, 0) or (D1, D2). At this time, D1 and D2 can be integers 0, ±1, ±2, ±3,....
[0427] The block vector of the current sub-block can be set to (Wc + D1, D2) or (D1, Hc + D2). At this time, Wc can be the width of the current chrominance component block, Hc can be the height of the current chrominance component block, and D1 and D2 can be integers 0, ±1, ±2, ±3,....
[0428] 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.
[0429] 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.
[0430] 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.
[0431] 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.
[0432] As another example, the block vector of the current sub-block can be the block vector with the highest occurrence frequency.
[0433] 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.
[0434] 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, it can be one mode of the skip mode, merge mode, AMVP mode, or affine skip mode in the inter prediction mode, or it can be the intra-block copy skip mode, intra-block copy merge mode, or intra-block copy AMVP mode in the intra-block copy prediction mode.
[0435] 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 sample at the center position of the luma component sub-block corresponding to the sub-block of the current chrominance component block 3. As in Figure 20 the example of 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 In the following, steps for deriving a prediction signal will be described.
[0436] The steps for deriving a prediction signal for intra block copy prediction may include at least one of steps for deriving a prediction signal for a luminance component block and steps for deriving a prediction signal for a chrominance component block.
[0437] In the following, steps for deriving a prediction signal for a luminance component block will be described.
[0438] A block having a block vector of a luminance component block derived at a distance from a current luminance component block may be referred to as a prediction block.
[0439] For example, when the top - left sample position of a current luminance component block is (x0, y0), the width is WL, the height is HL, and the derived block vector of the luminance component is (xd, yd), a block having a sample position (x0 + xd, y0 + yd) as the top - left sample position, a width of WL, and a height of HL in the same picture may be a prediction block. At this time, if xd is a negative integer, it may be moved left by xd in the horizontal direction from (x0, y0), if xd is a positive integer, it may be moved right by xd from (x0, y0), if yd is a negative integer, it may be moved up by yd in the vertical direction from (x0, y0), and if yd is a positive integer, it may be moved down by yd from (x0, y0).
[0440] Figure 21 is a diagram showing the relationship between a current block and a prediction block according to an embodiment of the present invention.
[0441] Referring to Figure 21 assuming that both xd and yd are negative integers.
[0442] The sample value of the prediction block may be set to the predicted sample value of the current luminance component block, and the set value may be referred to as the prediction signal of the current luminance component block.
[0443] Here, the sample value of the prediction block may be a reconstructed image sample value to which loop filtering is not applied.
[0444] When the block vector is (0, 0), a fixed value may be used to set the prediction block sample value. Here, the fixed value may be any integer value greater than or equal to 0 and less than or equal to "2^(bitdepth)-1", and may be a predetermined value within the range of reconstructed samples. For example, the fixed value may be 0, 2^(bitdepth - 1), or 2^(bitdepth)-1.
[0445] The value of the block vector can be restricted such that the predicted block is within the restricted region. When the block vector does not have a value within the restricted range, the fixed value can be used to set the predicted block sample value of the block with that block vector. The fixed value can be set to the same value as the fixed value set when the block vector is (0, 0).
[0446] In addition, when encoding / decoding is performed by applying a reference region buffer, a block separated from the current block position by the block vector in the reference region buffer can be referred to as a predicted block. The predicted block can be included in the reference region buffer.
[0447] When the coordinates of the samples in the current block in the picture are (x, y) and the block vector is (Vx, Vy), the position of the corresponding predicted sample in the predicted block in the reference region buffer can be ((x + Vx) % M1, (y + Vy) % M2) or ((x + Vx) % M1, (y + Vy)).
[0448] Hereinafter, the steps for deriving the prediction signal of the chrominance component block will be described.
[0449] According to an embodiment, when the block partitioning of the luminance component and the chrominance component in the same CTU is performed equivalently (i.e., the block partitioning structures of the luminance component and the chrominance component are the same) and the current block is a chrominance component block and is encoded using the intra-block copy prediction method, the prediction signal of the chrominance component block can be derived as follows.
[0450] A block separated from the current chrominance component block by the block vector of the derived chrominance component block can be referred to as a predicted block.
[0451] For example, when the top-left sample position of the current chrominance component block is (x0, y0), the width is Wc, the height is Hc, and the block vector of the derived chrominance component block is (xd, yd), the sample position (x0 + xd, y0 + yd) in the same picture separated from the top-left sample position of the current chrominance component block by (xd, yd), and having a width of Wc and a height of Hc can be a predicted block. At this time, if xd is a positive integer, it can be moved xd to the right from x0 in the horizontal direction, if xd is a negative integer, it can be moved xd to the left from x0, if yd is a positive integer, it can be moved yd downwards from y0 in the vertical direction, and if yd is a negative integer, it can be moved yd upwards from y0.
[0452] The sample value of the predicted block can be set to the predicted sample value of the current chrominance component block, and the set value can be referred to as the prediction signal of the current chrominance component block.
[0453] According to an embodiment, when the block partitioning of the luminance component and the chrominance component in the same CTU is performed independently (i.e., the block partitioning structure of the luminance component and the block partitioning structure of the chrominance component are different) and the current block is a chrominance component block and is encoded using the intra block copy prediction method, the prediction signal of the chrominance component block can be derived as follows.
[0454] The sub-block prediction signal can be derived in units of sub-blocks using the block vector derived in units of sub-blocks of the current chrominance component block.
[0455] The block of the sub-block of the chrominance component whose block vector is derived at a distance from the sub-block of the current chrominance component block can be referred to as a prediction sub-block.
[0456] For example, when the upper left sample position of the sub-block of the current chrominance component block is (sx0, sy0), the width is SWc, the height is SHc, and the derived block vector of the chrominance component is (Sxd, Syd), the sample position (sx0 + Sxd, sy0 + Syd) at a distance (xd, yd) from the upper left sample position of the sub-block in the current chrominance component block in the same picture, and the block with a width of SWc and a height of SHc can be a prediction sub-block.
[0457] The sample value of the prediction sub-block can be set as the predicted sample value of the current chrominance component sub-block, and the set value can be referred to as the prediction signal of the current chrominance component sub-block.
[0458] The prediction signal of the current chrominance component block can be constructed using the sub-block prediction signals of all sub-blocks included in the current chrominance component block.
[0459] Hereinafter, the steps for deriving the residual signal will be described.
[0460] Generally, when there is a residual signal, the residual signal can be transformed and encoded in the encoding process, can be included in the bitstream and sent in the bitstream, and the inverse process of the transform coding process can be performed in the decoding process to derive the residual signal.
[0461] The identifier information indicating the presence / absence of a residual signal-related signal (e.g., quantized transform coefficients (or quantized transform coefficients), etc.) included in the bitstream and sent to the decoder may include at least one of the following items.
[0462] cu_cbf: When the luminance component and the chrominance component have the same block partitioning structure, this can represent information on the quantized transform coefficients of the residual signal of the luminance component block and the quantized transform coefficients of the residual signal of the chrominance component block in the coding block CU. When the luminance component and the chrominance component have an independent block partitioning structure, this can represent information on the quantized transform coefficients of the residual signal of the luminance component block (or the luminance component block in the coding block CU) or the chrominance component block (or the chrominance component block in the coding block CU). Information on the presence / absence of the quantized transform coefficients of the residual signal with the first value 1 can represent the quantized transform coefficients of the residual signal of the present block, and information on the presence / absence of the quantized transform coefficients of the residual signal with the second value 0 can represent the quantized transform coefficients of the residual signal of the absent block. When the luminance component and the chrominance component have the same block partitioning structure, if either the luminance component block or the chrominance component (Cb, Cr) block has the quantized transform coefficients of the residual signal, the information on the presence / absence of the quantized transform coefficients of the residual signal can have the first value, and if there are no quantized transform coefficients of the residual signal for all components, the information on the presence / absence of the quantized transform coefficients of the residual signal can have the second value. Here, the luminance component block and the chrominance component block can represent the luminance component block in the coding block CU and the chrominance component block in the coding block CU.
[0463] tu_cbf_luma: This can represent the presence / absence of the quantized transform coefficients of the residual signal of the luminance component block. Information on the presence / absence of the quantized transform coefficients of the residual signal of the luminance component block with the first value 1 can represent the quantized transform coefficients of the residual signal of the present luminance block, and information on the presence / absence of the quantized transform coefficients of the residual signal of the luminance component block with the second value 0 can represent the quantized transform coefficients of the residual signal of the absent luminance block. Here, the luminance component block can represent the luminance component block in the transform block TU.
[0464] tu_cbf_cr, tu_cbf_cb: This can represent the presence / absence of the quantized transform coefficients of the residual signal of each of Cr and Cb of the chrominance component. Information on the presence / absence of the quantized transform coefficients of the residual signal of the chrominance component (Cr or Cb) block with the first value 1 can represent the quantized transform coefficients of the residual signal of the present chrominance component (Cr or Cb) block, and information on the presence / absence of the quantized transform coefficients of the residual signal of the chrominance component (Cr or Cb) block with the second value 0 can represent the quantized transform coefficients of the residual signal of the absent chrominance component (Cr or Cb) block. Here, the chrominance component block can represent the chrominance component block in the transform block TU.
[0465] In addition, in the following embodiments, the luminance component block and chrominance component block related to cu_cbf may respectively represent the luminance component block in the coding unit (CU) and the chrominance component block in the coding unit (CU). Further, the luminance component block related to tu_cbf_luma may represent the luminance component block in the transform unit (TU). Further, the chrominance component blocks related to tu_cbf_cr and tu_cbf_cb may represent the chrominance component blocks in the transform unit (TU).
[0466] Generally, only when cu_cbf has the first value 1, at least one of tu_cbf_luma, tu_cbf_cr, or tu_cbf_cb may be further transmitted to indicate the presence / absence of the quantized transform coefficients of the residual signals of the luminance component, Cr of the chrominance component, and Cb of the chrominance component.
[0467] When the luminance component and chrominance component have an independent block partitioning structure, cu_cbf may have the same information as tu_cbf_luma.
[0468] In the current coding tree unit (CTU) to be coded, when the block partitioning structures of the luminance component and chrominance component are the same and the current luminance component block is in the intra block copy skip mode, the residual signals of the current luminance component block and chrominance component block may be derived as follows.
[0469] When the current luminance component block is in the intra block copy skip mode, there is no residual signal as in the skip mode of general inter prediction. In this case, all residual signals may be set to have the value 0.
[0470] In the current chrominance component block, when the corresponding luminance component block is in the intra block copy skip mode, there is no residual signal as in the luminance component block. In this case, all residual signals may be set to have the value 0.
[0471] In the case of the intra block copy skip mode, the information for identifying the presence of the residual signal (e.g., identifier, flag, index, cu_cbf, tu_cbf_luma, tu_cbf_cr, tu_cbf_cb, etc.) may not be transmitted in the bitstream.
[0472] For example, the cu_cbf value indicating whether the quantization 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 quantization 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 existence / non-existence of the quantization transform coefficient of the residual signal of the luminance component, the tu_cbf_cr indicating the existence / non-existence of the quantization transform coefficient of the residual signal of the Cr component of the chrominance component, and the tu_cbf_cb indicating the existence / non-existence of the quantization transform coefficient 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 non-existence of the quantization transform coefficient of the corresponding residual signal.
[0473] 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 intra block copy merge mode, the residual signals of the current luminance component block and the chrominance component block can be derived as follows.
[0474] When the current luminance component block is in the intra block copy merge mode, the residual signal may always exist. In this case, the quantization transform coefficients of the residual signal that is transformed and encoded during the encoding process may be included and sent in the bitstream, and the residual signal can be derived by inverse transform coding during the decoding process.
[0475] In the current chrominance component block, when the corresponding luminance component block is in the intra block copy merge mode, the residual signal may exist as in the luminance component block. In this case, the quantization transform coefficients of the residual signal that is transformed and encoded during the encoding process may be included and sent in the bitstream, and the residual signal can be derived by inverse transform coding during the decoding process.
[0476] In the case of the merge mode based on intra block copy, the information for identifying the existence / non-existence of the residual signal (e.g., identifier, flag, index, cu_cbf, etc.) may not be sent in the bitstream. In the merge mode, since the residual signal always exists, the cu_cbf value indicating whether any one of the quantization transform coefficients of the residual signals of the luminance component, Cr of the chrominance component, and Cb of the chrominance component exists may also be set to the first value during the decoding process. In this case, the information for identifying the existence / non-existence of the residual signal may not be sent in the bitstream, and the quantization transform coefficient information of the residual signal may always be included and sent.
[0477] However, in the case of the intra block copy merge mode, since there may be components of the quantization transform coefficients without residual signals in the luminance component, Cr of the chrominance component, and Cb of the chrominance component, identifiers indicating the presence / absence of the quantization transform coefficients of the residual signals for each component (e.g., tu_cbf_luma in the case of the luminance component, and tu_cbf_cr and tu_cbf_cb in the case of the chrominance component) may be included and sent in the bitstream.
[0478] 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 intra block copy AMVP mode. The residual signals of the current luminance component block and the chrominance component block can be derived as follows.
[0479] When the current luminance component block is in the intra block copy AMVP mode, the residual signal may or may not exist. In this case, information for identifying the presence / absence of the residual signal can always be sent in the bitstream. When the residual signal exists, the quantization 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 can be derived by inverse transform coding in the decoding process. When the residual signal does not exist, all the residual signals can be set to have a value of 0.
[0480] In the current chrominance component block, when the corresponding luminance component block is in the intra block copy AMVP mode, the residual signal may or may not exist as in the luminance component block. When the residual signal exists, the quantization 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 can be derived by inverse transform coding in the decoding process. When the residual signal does not exist, all the residual signals can be set to have a value of 0.
[0481] In the case of the intra block copy AMVP mode, since the quantization transform coefficients of the residual signals of the luminance component, Cr of the chrominance component, and Cb of the chrominance component may or may not exist, information (e.g., identifiers, flags, indexes, cu_cbf, etc.) indicating whether the quantization transform coefficients of the residual signals of the luminance component, Cr of the chrominance component, and Cb of the chrominance component exist, for identifying the presence / absence of the residual signal, may always be included and sent in the bitstream.
[0482] In addition, when information (such as an identifier, a flag, an index, cu_cbf, etc.) indicating whether quantization transform coefficients of residual signals of a luminance component, Cr of a chrominance component, and Cb of a chrominance component, which is used to identify the presence / absence of a residual signal, has a first value indicating the presence of a residual signal, since there may be components without quantization transform coefficients of a residual signal in the luminance component, Cr of the chrominance component, and Cb of the chrominance component, an identifier (such as tu_cbf_luma in the case of the luminance component and tu_cbf_cr and tu_cbf_cb in the case of the chrominance component) indicating whether quantization transform coefficients of the residual signal of each component are present may be included in the bitstream and sent in the bitstream.
[0483] In the CTU to be currently encoded, when the block partitioning of the luminance component and the chrominance component is independent and the current luminance component block is in the intra block copy skip mode, the residual signal of the current luminance 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 (such as an identifier, a flag, an index, cu_cb, tu_cbf_luma, etc.) used to identify the presence / absence of a residual signal may not be sent in the bitstream.
[0484] When the luminance component block is in the intra block copy skip mode, cu_cbf sent for the luminance component block with an independent partitioning structure may indicate whether quantization transform coefficients of the residual signal of the luminance component block are present. In this case, since the quantization transform coefficients of the residual signal of the luminance component block are always absent, this information may not be sent in the bitstream and may be set to a second value of 0 in the decoding process.
[0485] In addition, identification information (such as tu_cbf_luma) indicating the presence / absence of the residual signal of the luminance component may not be sent in the bitstream and may be set to a second value of 0 in the decoding process.
[0486] In the CTU to be currently encoded, when the block partitioning of the luminance component and the chrominance component is independent and the current luminance component block is in the intra block copy merge mode, the residual signal of the current luminance component block may always exist as in the merge mode of general intra prediction. In this case, the quantization transform coefficients of the residual signal that is 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.
[0487] When the luminance component block is in the intra block copy merge mode, the cu_cbf sent for the luminance component block with an independent partition structure may only indicate whether there are quantized transform coefficients of the residual signal of the luminance component block. In this case, since the quantized transform coefficients of the residual signal of the luminance component block always exist, this information may not be sent in the bitstream and may be set to the first value 1 in the decoding process.
[0488] In addition, the identification information indicating the presence / absence of the residual signal of the luminance component (e.g., tu_cbf_luma) has the same value as the cu_cbf sent for the luminance component block with an independent partition structure, so it may not be sent in the bitstream and may be set to the first value 1 in the decoding process.
[0489] In the current CTU to be encoded, when the block partitions of the luminance component and the chrominance component are independent and the current luminance component block is in the intra block copy AMVP mode, the residual signal of the current luminance component block may or may not exist as in the general intra prediction AMVP mode. When there is a residual signal of the current luminance component block, the quantized transform coefficients of the residual signal that are 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 the value 0.
[0490] When the luminance component block is in the intra block copy AMVP mode, the cu_cbf sent for the luminance component block with an independent partition structure may only indicate whether there are quantized transform coefficients of the residual signal of the luminance component block. In this case, since the quantized transform coefficients of the residual signal of the luminance component block may or may not exist, the cu_cbf as the information for identifying whether there is a residual signal may always be sent in the bitstream.
[0491] In addition, the identification information indicating the presence / absence of the residual signal of the luminance signal in the transform unit TU (e.g., tu_cbf_luma) has the same value as the cu_cbf sent for the luminance component block with an independent partition structure in the coding block CU, so it may not be sent in the bitstream and may be set to the same value as the cu_cbf in the decoding process. That is, the coding / decoding efficiency can be improved by removing the redundancy of the signaling of both cu_cbf and tu_cbf_luma. For example, in the 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 signaled. At this time, the value of tu_cbf_luma that is not signaled may be set to the cu_cbf value.
[0492] Whether there is a residual signal can be determined according to the value of cu_cbf or tu_cbf_luma. For example, when cu_cbf or tu_cbf_luma has a first value, it can be determined that there is a residual signal.
[0493] When the block partitioning of the luminance component and the chrominance component is independently performed in the same CTU (i.e., the block partitioning structure of the luminance component is different from that of the chrominance component) and the current block is a chrominance component block and is encoded using the intra block copy prediction method, the residual signal of the chrominance component block can be derived as follows.
[0494] All sub - blocks included in the luminance component block corresponding to the current chrominance component block can have the same intra block copy prediction coding mode.
[0495] At this time, the intra block copy prediction coding mode can be an intra block copy skip mode, an intra block copy merge mode, or an intra block copy AMVP mode.
[0496] Figure 22 It is a view showing the case when the prediction coding modes of the luminance sub - blocks corresponding to the chrominance component block according to an embodiment of the present invention are the same. For example, as in the example of Figure 22 All prediction coding modes of the luminance sub - blocks can be an intra block copy skip mode, an intra block copy merge mode, or an intra block copy AMVP mode.
[0497] When all sub - blocks included in the luminance component block corresponding to the current chrominance component block are in the same intra block copy prediction mode, it can be determined whether to encode / decode the residual signal of the corresponding chrominance component block based on the intra block copy prediction mode of the corresponding luminance component block.
[0498] For example, when all sub - blocks included in the luminance component block corresponding to the current chrominance component block are in the intra block copy skip mode, as in the case where the luminance component block is in the intra block copy skip mode, the residual signal of the chrominance component block may not be encoded / decoded, and the residual signal information may not be sent. In this case, all residual signals can be set to have a value of 0.
[0499] At this time, the information for identifying the presence / absence of the residual signal of the block (such as an identifier, a flag, cu_cbf, tu_cbf_cr / tu_cbf_cb, etc.) may not be sent. The information for identifying the presence / absence of the residual signal having a first value can indicate the presence of the residual signal, and this information having a second value can indicate the absence of the residual signal. When the chrominance component block is in the intra block copy skip mode, the information for identifying the presence / absence of the residual signal of the corresponding block can always be set to the second value in the decoding process.
[0500] As another example, when all sub-blocks included in a luminance component block corresponding to a current chrominance component block are in the intra block copy merge mode, as in the case where the luminance component block is in the intra block copy merge mode, the chrominance component block may always have a residual signal. In this case, 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.
[0501] The information for identifying the presence / absence of a residual signal (e.g., identifier, flag, cu_cbf, etc.) sent for a chrominance component block in an independent partition structure may indicate whether the quantized transform coefficients of the residual signal are present in at least one of the Cb block and the Cr block of the chrominance component.
[0502] In the case of the intra block copy merge mode, the information for identifying the presence / absence of a residual signal (e.g., identifier, flag, index, cu_cbf, etc.) may not be sent 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 Cr of the chrominance component and the Cb of the chrominance component exists may always be set to a first value in the decoding process.
[0503] However, in the case of the intra block copy merge mode, since there may be a component among the Cr of the chrominance component and the Cb of the chrominance component that does not have the quantized transform coefficients of the residual signal, an identifier (e.g., tu_cbf_cr, tu_cbf_cb) indicating the presence / absence of the quantized transform coefficients of the residual signal of each chrominance component may be included and sent in the bitstream.
[0504] As another example, when all sub-blocks included in a luminance component block corresponding to a current chrominance component block are in the intra block copy AMVP mode, as in the case where the luminance component block is in the intra block copy AMVP mode, the chrominance component block may or may not have a residual signal. In this case, the information for identifying the presence / absence of a residual may always be sent in the bitstream. When there is a residual signal of a 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.
[0505] The information for identifying the presence / absence of a residual signal (e.g., identifier, flag, cu_cbf, etc.) sent for a chrominance component block in an independent partition structure may indicate whether the quantized transform coefficients of the residual signal are present in at least one of the Cb block and the Cr block of the chrominance component.
[0506] In the case of the intra block copy AMVP mode, since the quantized transform coefficients of the residual signals of Cr of the chrominance component and Cb of the chrominance component may or may not exist, the information (e.g., identifier, flag, index, cu_cbf, etc.) for identifying the existence or non-existence of the residual signals of Cr of the chrominance component and Cb of the chrominance component can always be included in the bitstream and sent in the bitstream.
[0507] In addition, when the information (e.g., identifier, flag, index, cu_cbf, etc.) for identifying the existence or non-existence of the residual signals of Cr of the chrominance component and Cb of the chrominance component has a first value indicating the existence of the residual signal, since there may be a component without quantized transform coefficients of the residual signal among Cr of the chrominance component and Cb of the chrominance component, the identifier (e.g., tu_cbf_cr or tu_cbf_cb in the case of the chrominance component) for indicating the quantized transform coefficients of the residual signal of each component can be included in the bitstream and sent in the bitstream. When the identifier (e.g., tu_cbf_cr) indicating the existence of the quantized transform coefficients of the residual signal of Cr of the chrominance component has the first value, the quantized transform coefficient information for the residual signal of the Cr component can be included and sent in the bitstream. When the identifier (e.g., tu_cbf_cb) indicating the existence of the quantized transform coefficients of the residual signal of Cb of the chrominance component has the first value, the quantized transform coefficient information for the residual signal of the Cb component can be included and sent in the bitstream.
[0508] As another example, even if all sub-blocks included in the luminance component block corresponding to the current chrominance component block are in the same intra block copy prediction mode (e.g., intra block copy skip mode, intra block copy merge mode, intra block copy AMVP mode, etc.), since all samples included in the corresponding luminance component block are not in the same intra block copy prediction mode, it may not be efficient to encode the residual signal according to the mode of the luminance component block corresponding to the chrominance component block.
[0509] Therefore, when the chrominance component block is in the intra block copy mode, regardless of the type of the mode of the sub-blocks included in the corresponding luminance component block, the information (e.g., identifier, flag, index, cu_cbf, etc.) for identifying the existence or non-existence of the quantized transform coefficients of the residual signals of Cr of the chrominance component and Cb of the chrominance component can always be included in the bitstream and sent in the bitstream.
[0510] In addition, when information (e.g., identifier, flag, index, cu_cbf, etc.) of quantization transform coefficients of residual signals of Cr for identifying presence / absence of a chrominance component and Cb of the chrominance component has a first value indicating the presence of a residual signal, since there may be a component without quantization transform coefficients of a residual signal among Cr of the chrominance component and Cb of the chrominance component, an identifier (e.g., tu_cbf_cr or tu_cbf_cb in the case of a chrominance component) indicating quantization transform coefficients of a residual signal of each component for presence / absence may be included in and transmitted in a bitstream. When an identifier (e.g., tu_cbf_cr) indicating quantization transform coefficients of a residual signal of Cr of the chrominance component has the first value, quantization transform coefficient information of the residual signal of the Cr component may be included in and transmitted in the bitstream. When an identifier (e.g., tu_cbf_cb) indicating the presence of quantization transform coefficients of a residual signal of Cb of the chrominance component has the first value, quantization transform coefficient information of the residual signal of the Cb component may be included in and transmitted in the bitstream, and the residual signal may be derived by inverse transform coding in a decoding process. When it is recognized that there is no residual signal of a chrominance component block, quantization transform coefficient information of the residual signal of the chrominance component block may not be transmitted, and all residual signals may be set to have a value of 0.
[0511] As another example, when a current chrominance component block is in an intra block copy prediction mode or when all sub-blocks included in a luminance component block corresponding to the current chrominance component block are in an intra block copy prediction mode, sub-blocks of the luminance component corresponding to the chrominance component block may be in different intra block copy prediction coding modes (e.g., intra block copy skip mode, intra block copy merge mode, and intra block copy AMVP mode). Figure 23 is a diagram showing a case where prediction coding modes of sub-blocks of a luminance component corresponding to a chrominance component block are different according to an embodiment of the present invention. For example, as in Figure 23 's example, at least two modes among an intra block copy skip mode, an intra block copy merge mode, and an intra block copy AMVP mode may exist in a corresponding luminance component block.
[0512] At this time, regardless of the type of mode of sub-blocks included in a corresponding luminance component block, information (e.g., identifier, flag, index, cu_cbf, etc.) of quantization transform coefficients of residual signals of Cr for identifying presence / absence of a chrominance component and Cb of the chrominance component may always be included in and transmitted in a bitstream.
[0513] In addition, when the information of the quantization transform coefficients of the residual signals of Cr for identifying the presence / absence of the chrominance component and Cb of the chrominance component (e.g., identifier, flag, index, cu_cbf, etc.) has a first value indicating the presence of the residual signal, since there may be a component of the quantization transform coefficients of the residual signal that does not exist among Cr of the chrominance component and Cb of the chrominance component, the identifiers (e.g., tu_cbf_cr, tu_cbf_cb in the case of the chrominance component) indicating the presence / absence of the quantization transform coefficients of the residual signal of each component may be included in the bitstream and sent in the bitstream. When the identifier (e.g., tu_cbf_cr) indicating the presence of the quantization transform coefficients of the residual signal of Cr of the chrominance component has a first value, the quantization transform coefficient information of the residual signal for the Cr component may be included in the bitstream and sent in the bitstream. When the identifier (e.g., tu_cbf_cb) indicating the presence of the quantization transform coefficients of the residual signal of Cb of the chrominance component has a first value, the quantization transform coefficient information of the residual signal of the Cb component may be included in the bitstream and sent in the bitstream, and the residual signal may be derived by inverse transform coding in the decoding process. When it is recognized that there is no residual signal in the chrominance component block, the quantization transform coefficient information of the residual signal of the chrominance component block may not be sent, and all residual signals may be set to have a value of 0.
[0514] Hereinafter, the steps of constructing the reconstructed signal will be described.
[0515] In the current luminance component block, the reconstructed signal can be constructed by adding the residual signal of the luminance component block to the predicted signal of the luminance component block.
[0516] In the current chrominance component block, the reconstructed signal can be constructed by adding the residual signal of the chrominance component block to the predicted signal of the chrominance component block.
[0517] In addition, when there is no residual signal, the predicted signal can be set as the reconstructed signal.
[0518] Hereinafter, the steps of entropy encoding / entropy decoding the information on intra block copy prediction coding will be described.
[0519] The information on intra block copy prediction coding can be entropy encoded in the bitstream or entropy decoded from the bitstream. Here, the information on intra block copy prediction coding may include at least one of the following information.
[0520] cu_skip_flag indicating whether the skip mode is used merge_flag indicating whether the merge mode is used merge_idx (merge index) indicating the merge candidate The pred_mode_flag indicating whether the prediction mode is intra prediction The 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 The cu_cbf, tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr indicating the presence / absence of quantized transform coefficients of the residual signal Here, the cu_skip_flag can indicate whether the skip mode is used and can be entropy-coded in units of at least one of the coded block or the prediction block. For example, if the information indicating whether the skip mode is used has a first value of 1, this can 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 can indicate that the skip mode is not used.
[0521] The merge_flag can indicate whether the merge mode is used and can be entropy-coded in units of at least one of the coded block or the prediction block. For example, if the information indicating whether the merge mode is used has a first value of 1, this can indicate that the merge mode is used, and when the information indicating whether the skip mode is used has a second value of 0, this can indicate that the merge mode is not used.
[0522] The merge_idx can indicate the information indicating the merge candidate in the merge candidate list and can be entropy-coded in units of at least one of the coded block or the prediction block. In addition, the merge_idx can indicate the merge index information. In addition, the merge_idx can indicate the block of the derived merge candidate in the reconstructed block spatially adjacent to the current block. In addition, the merge_idx can indicate at least one of the motion information of the merge candidate. For example, the merge index information with a first value of 0 can indicate the first merge candidate in the merge candidate list, the merge index information with a second value of 1 can indicate the second merge candidate in the merge candidate list, and the merge index information with a third value of 2 can indicate the third merge candidate in the merge candidate list. In addition, the merge index information with the fourth value to the Nth value can indicate the merge candidate corresponding to the corresponding value in the order of the candidates in the merge candidate list. Here, N can be a positive integer including 0.
[0523] The pred_mode_flag can indicate whether the intra prediction mode is applied and can be entropy-coded in units of at least one of the coded block or the prediction block. For example, the information indicating whether the intra prediction mode is applied with a first value of 1 can indicate that the intra prediction mode is applied, and the information indicating whether the intra prediction mode is applied with a second value of 0 can indicate that the intra prediction mode is not applied.
[0524] The pred_mode_ibc_flag can indicate whether the intra block copy prediction mode is applied, and can be entropy-coded in units of at least one of coded blocks, prediction blocks, or coding units. For example, the information indicating whether the intra block copy prediction mode is applied with a first value of 1 can indicate that the intra block copy prediction mode is applied, and the information indicating whether the intra block copy prediction mode is applied with a second value of 0 can indicate that the intra block copy prediction mode is not applied.
[0525] The block vector candidate index mvp_l0_flag can indicate the 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 can be entropy-coded / entropy-decoded. The block vector candidate index can be used to derive the prediction block of the current block.
[0526] The motion vector difference can represent the difference between the block vector and the prediction block vector, and the block vector difference can be used to derive the prediction block of the current block.
[0527] Among cu_cbf, tu_cbf_luma, tu_cbf_cb, and tu_cbf_cr indicating the presence / absence of quantized transform coefficients of the residual signal, when the luminance component and the chrominance component have the same block partitioning structure, cu_cbf can represent information about the presence / absence of quantized transform coefficients of the luminance component block and the chrominance component block, and when the luminance component and the chrominance component have an independent block partitioning structure, cu_cbf can represent information about the presence / absence of quantized transform coefficients of the luminance component block or the chrominance component block. The information indicating the presence / absence of quantized transform coefficients with a first value of 1 can represent the presence of the quantized transform coefficients of the block, and the information indicating the presence / absence of quantized transform coefficients with a second value of 0 can represent the absence of the quantized transform coefficients of the block. tu_cbf_luma can represent the presence / absence of quantized transform coefficients of the luminance component block, and tu_cbf_cr and tu_cbf_cb can respectively represent the presence / absence of quantized transform coefficients of the Cr and Cb of the chrominance component. The information about the presence / absence of quantized transform coefficients of the luminance component block with a first value of 1 can represent the presence of the quantized transform coefficients of the luminance block, and the information about the presence / absence of quantized transform coefficients of the luminance component block with a second value of 0 can represent the absence of the quantized transform coefficients of the luminance block. The information about the presence / absence of quantized transform coefficients of the chrominance component Cb or Cr with a first value of 1 can represent the presence of the quantized transform coefficients of the chrominance block, and the information about the presence / absence of quantized transform coefficients of the chrominance component Cb or Cr with a second value of 0 can represent the absence of the quantized transform coefficients of the chrominance block.
[0528] In addition, at least one piece of information among the information regarding intra-block copy prediction coding can be entropy-coded / entropy-decoded from at least one of a video parameter set, a sequence parameter set, a picture parameter set, an adaptive parameter set, a parallel block header, a parallel block group header, a slice header, or a slice payload.
[0529] FIG. 24 to Figure 27 is a diagram showing encoded information transmitted in association with intra-block partitioning according to an embodiment of the present invention.
[0530] Figure 24a and Figure 24b show examples of methods for transmitting encoded information for each block partitioning structure.
[0531] Figures 25 to 27 shows an example of a method for removing overlapping encoded information when cu_cbf and tu_cbf_luma information transmitted during intra-block partitioning prediction overlap.
[0532] Specifically, Figures 25 to 27 shows a method for removing redundant signaling of cu_cbf and tu_cbf_luma indicating the same information when there is an independent block partitioning structure and the luminance component block is in intra-block copy prediction. In addition, referring to Figures 25 to 27 , in an independent block partitioning structure and when the luminance component block is in intra-block copy prediction, tu_cbf_luma may not be transmitted, and the cu_cbf value may be set to the tu_cbf_luma value.
[0533] Referring to Figure 25 , in the case of a luminance component block of an independent block partitioning 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 transmitted when the luminance component block of the independent block partitioning structure is in intra-block copy prediction mode. In addition, tu_cbf_cb and tu_cbf_cr of the luminance component block of the independent block partitioning structure (i.e., treeType is DUAL_TREE_LUMA) may not be signaled, and when tu_cbf_cb and tu_cbf_cr are not signaled, they may be set to 0 during decoding processing. Additionally, the non-signaled tu_cbf_luma value may be set to the cu_cbf value.
[0534] Referring to Figure 26, in the case of a luminance component block in an independent block partitioning structure (i.e., treeType is DUAL_TREE_LUMA), tu_cbf_luma is signaled only when the prediction mode is not the intra block copy prediction mode (i.e., CurPredMode[x0][y0] == MODE_IBC). When the luminance component block in the independent block partitioning structure is in the intra block copy prediction mode, tu_cbf_luma may not be signaled. Further, in the case of a luminance component block in an independent block partitioning 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. Additionally, the non-signaled tu_cbf_luma value may be set to the cu_cbf value.
[0535] Refer to Figure 27 , in a structure where tu_cbf_luma is signaled based on tu_cbf_cb and tu_cbf_cr, tu_cbf_luma may not be signaled when the luminance component block in the independent block partitioning structure is in the intra block copy prediction mode. In the case of a luminance component block in an independent block partitioning 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 this case, when both tu_cbf_cb and tu_cbf_cr are 0, tu_cbf_luma may not be signaled. At this time, the non-signaled tu_cbf_luma value may be set to the cu_cbf value.
[0536] Additionally, refer to Figures 25 to 27 , IntraSubPartitionsSplitType may indicate whether the corresponding block is partitioned into sub-blocks and predicted when applying intra prediction. When the luminance component block is in the intra block copy prediction mode, the current block is not partitioned into sub-blocks and is encoded. At this time, IntraSubPartitionsSplitType may correspond to ISP_NO_SPLIT. Further, cu_sbt_flag indicates whether transformation is performed in units of sub-blocks in the case of inter prediction, and cu_sbt_flag is not applicable when intra block copy prediction is applied. In the case of the intra block copy prediction mode, cu_sbt_flag may always have the value 0.
[0537] When entropy encoding at least one of the information on motion compensation or region information, at least one of the following binarization methods can be used.
[0538] Truncated Rice binarization method k-th order Exp_Golomb binarization method Finite k-th order Exp_Golomb binarization method Fixed-length binarization method Unary binarization method Truncated unary binarization method When entropy encoding / decoding at least one of the information on motion compensation or region information, at least one of the information on motion compensation of neighboring blocks, region information of neighboring blocks, previously encoded / decoded information on motion compensation, previously encoded / decoded region information, information on the depth of the current unit / block, or information on the size of the current unit / block can be used to determine the context model.
[0539] When entropy encoding / decoding at least one of the information on motion compensation or region information, at least one of the information on motion compensation of neighboring blocks, region information of neighboring blocks, previously encoded / decoded information on motion compensation, previously encoded / decoded region information, information on the depth of the current unit / block, or information on the size of the current unit / block can be used as a predicted value for the information on motion compensation or region information of the current block to perform entropy encoding / decoding.
[0540] The above embodiments can be implemented in the same way in the encoder and the decoder.
[0541] At least one of the above embodiments or a combination thereof can be used for encoding / decoding video.
[0542] The order of applying the above embodiments can be different between the encoder and the decoder, or the order of applying the above embodiments can be the same in the encoder and the decoder.
[0543] The above embodiments can be performed for each luminance signal and each chrominance signal, or the above embodiments can be performed identically for the luminance signal and the chrominance signal.
[0544] The block form to which the above embodiments of the present invention are applied can have a square form or a non-square form.
[0545] The above embodiments of the present invention can 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 can be defined as the minimum size or the maximum size or both the minimum size and the maximum size such that the above embodiments are applied, or the size can be defined as a fixed size for applying the above embodiments. In addition, in the above embodiments, the first embodiment can be applied to a first size, and the second embodiment can be applied to a second size. In other words, the above embodiments can be applied combinatorially according to the size. Further, when the size is equal to or greater than the minimum size and equal to or less than the maximum size, the above embodiments can be applied. In other words, when the block size is included in a specific range, the above embodiments can be applied.
[0546] For example, when the size of the current block is 8×8 or larger, the above embodiments can be applied. For example, when the size of the current block is only 4×4, the above embodiments can be applied. For example, when the size of the current block is 16×16 or smaller, the above embodiments can be applied. For example, when the size of the current block is equal to or greater than 16×16 and equal to or less than 64×64, the above embodiments can be applied.
[0547] The above embodiments of the present invention can be applied according to a time layer. To identify the time layer to which the above embodiments can be applied, a corresponding identifier can be signaled, and the above embodiments can be applied to the specified time layer identified by the corresponding identifier. Here, the identifier can be defined as the lowest layer or the highest layer or both the lowest layer and the highest layer to which the above embodiments can be applied, or can be defined as a specific layer indicating the application of the embodiments. In addition, a fixed time layer for applying the embodiments can be defined.
[0548] For example, when the time layer of the current image is the lowest layer, the above embodiments can be applied. For example, when the time layer identifier of the current image is 1, the above embodiments can be applied. For example, when the time layer of the current image is the highest layer, the above embodiments can be applied.
[0549] A stripe type or a parallel block group type for applying the above embodiments of the present invention can be defined, and the above embodiments can be applied according to the corresponding stripe type or parallel block group type.
[0550] 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, and some steps can be executed simultaneously with other steps or in a different order. In addition, those of ordinary skill in the art should understand that the steps in the flowchart do not exclude each other, and other steps can be added to the flowchart or some steps can be deleted from the flowchart without affecting the scope of the present invention.
[0551] The embodiments include various aspects of the examples. All possible combinations for each aspect may not be described, but those skilled in the art will be able to recognize different combinations. Thus, the present invention may include all substitutions, modifications, and variations within the scope of the claims.
[0552] Embodiments of the present invention may be implemented in the form of program instructions executable by various computer components and recorded on a computer-readable recording medium. The computer-readable recording medium may include individual program instructions, data files, data structures, etc., or combinations thereof. The program instructions recorded on the computer-readable recording medium may be specifically designed and constructed for the present invention or well-known to those of ordinary skill in the art of computer software. Examples of the computer-readable recording medium include magnetic recording media (such as hard disks, floppy disks, and magnetic tapes) specifically constructed to store and implement program instructions, optical data storage media (such as CD-ROMs or DVD-ROMs), magneto-optical media (such as floppy optical disks), and hardware devices (such as read-only memories (ROMs), random access memories (RAMs), flash memories, etc.). Examples of program instructions include not only machine language codes formatted by compilers but also high-level language codes that can be implemented by computers using interpreters. The hardware devices may be configured to be operated by one or more software modules to perform processing according to the present invention, and vice versa.
[0553] Although the present invention has been described based on specific items such as detailed elements and limited embodiments and drawings, they are provided only to assist in a more general understanding of the present invention, and the present invention is not limited to the above embodiments. Those skilled in the art to which the present invention pertains will understand that various modifications and changes can be made from the above description.
[0554] Therefore, the spirit of the present invention should not be limited to the above embodiments, and the entire scope of the claims and their equivalents will fall within the scope and spirit of the present invention.
[0555] Industrial Applicability The present invention can be used for encoding or decoding images.
Claims
1. A method for decoding an image, the method comprises: determining whether an intra block copy mode is applied to a current block; in response to the intra block copy mode being applied to the current block, obtaining a list of block vector candidates for the current block; obtaining a block vector for the current block based on a selected block vector candidate from the list of block vector candidates; and obtaining predicted samples for the current block based on the block vector of the current block, wherein the list of block vector candidates is constructed by inserting history-based block vector candidates stored in a block vector buffer.
2. The method according to claim 1, wherein the list of block vector candidates is initialized for each coding tree unit row.
3. The method according to claim 1, wherein whether to update the block vector buffer using the block vector of the current block is determined based on the size of the current block.
4. The method according to claim 3, wherein when both the width and height of the current block are equal to or less than 4, the block vector buffer is not updated using the block vector of the current block.
5. The method according to claim 1, wherein the predicted samples are obtained from an intra block copy buffer storing reconstructed samples reconstructed before the current block, wherein the size of the intra block copy buffer is determined based on the size of the coding tree unit including the current block.
6. The method according to claim 5, wherein the intra block copy buffer is initialized for each coding tree unit row.
7. The method according to claim 1, wherein the method further comprises: determining whether to decode a coding block flag for the current block, the coding block flag indicating whether there is a residual signal for a transform block of the current block in a bitstream, wherein, in response to the current block being a dual-tree luma block and the intra block copy mode being applied to the current block, decoding the coding block flag from the bitstream is omitted, wherein, in response to decoding the coding block flag being omitted, the value of the coding block flag is inferred to indicate the presence of a residual signal for the transform block of the current block.
8. The method according to claim 1, wherein in response to the current block being a dual-tree luma block, whether the intra block copy mode is applied to the current block is determined based on prediction mode information explicitly signaled via the bitstream, wherein, in response to the current block being a dual-tree chroma block, the prediction mode information is not decoded from the bitstream, and the value of the prediction mode information is implicitly determined at the decoder side.
9. A method for encoding an image, the method comprises: in response to the intra block copy mode being applied to the current block, obtaining a list of block vector candidates for the current block; obtaining a block vector for the current block; obtaining predicted samples for the current block based on the block vector of the current block; and encoding index information indicating the block vector candidate in the list of block vector candidates that is the same as the block vector of the current block, wherein the list of block vector candidates is constructed by inserting history-based block vector candidates stored in a block vector buffer.
10. A method for transmitting a bitstream generated by a method for encoding an image, the method for transmitting the bitstream comprises: transmitting the bitstream, wherein the method for encoding the image comprises: in response to the intra block copy mode being applied to the current block, obtaining a list of block vector candidates for the current block; Obtain the block vector of the current block; Obtain the predicted sample points of the current block based on the block vector of the current block; and Encode the index information indicating the block vector candidate in the block vector candidate list that is the same as the block vector of the current block, wherein, the block vector candidate list is constructed by inserting the history-based block vector candidates stored in the block vector buffer.